{"id":21015719,"url":"https://github.com/mrazza/gonav","last_synced_at":"2025-05-15T05:32:27.841Z","repository":{"id":57505347,"uuid":"63309811","full_name":"mrazza/gonav","owner":"mrazza","description":"A Source Engine navigation mesh file parser written in Go.","archived":false,"fork":false,"pushed_at":"2020-06-09T05:05:30.000Z","size":44,"stargazers_count":50,"open_issues_count":2,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T02:11:07.201Z","etag":null,"topics":["csgo","navigation","navmesh","source-engine"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrazza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-14T06:46:40.000Z","updated_at":"2024-01-21T08:13:41.000Z","dependencies_parsed_at":"2022-08-22T09:00:43.959Z","dependency_job_id":null,"html_url":"https://github.com/mrazza/gonav","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrazza%2Fgonav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrazza%2Fgonav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrazza%2Fgonav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrazza%2Fgonav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrazza","download_url":"https://codeload.github.com/mrazza/gonav/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225332381,"owners_count":17457710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csgo","navigation","navmesh","source-engine"],"created_at":"2024-11-19T10:11:02.151Z","updated_at":"2024-11-19T10:11:02.641Z","avatar_url":"https://github.com/mrazza.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gonav\nA [Source Engine](https://en.wikipedia.org/wiki/Source_(game_engine)) bot Nav file parser written in Go. This was written for CS:GO but will likely work with little or no modification for other Source titles. The specifics of the .nav format were reverse engineered using the information on [Valve's wiki](https://developer.valvesoftware.com/wiki/NAV) as a starting point. For more information on Source's Navigation Meshes see Valve's wiki: https://developer.valvesoftware.com/wiki/Navigation_Meshes\n\n# Usage\nSee the `_examples` folder for examples of how to use this library. The basics, however, are pretty straightforward. Create a parser and pass in any `Reader` that contains the binary .nav data, then call the `Parse()` method. This will output a parsed `NavMesh` object which you can perform operations on. Here's a terse example:\n\n```\nf, _ := os.Open(\"de_dust2.nav\") // Open the file\nparser := gonav.Parser{Reader: f}\nmesh, _ := parser.Parse() // Parse the file\narea := mesh.QuadTreeAreas.FindAreaByPoint(gonav.Vector3{10, 10, 10}, true) // Find the nav area that contains the world point {10, 10} with a Z-value closest to 10\nfmt.Println(area)\n```\n\n# Path Finding\nThis library also supports path finding across nav meshes via an A* implementation.\n\n```\nbombsiteA := mesh.GetPlaceByName(\"BombsiteA\")\naCenter, _ := bombsiteA.GetEstimatedCenter()\naArea := mesh.GetNearestArea(aCenter, false)\nbombsiteB := mesh.GetPlaceByName(\"BombsiteB\")\nbCenter, _ := bombsiteB.GetEstimatedCenter()\nbArea := mesh.GetNearestArea(bCenter, false)\npath, _ := gonav.SimpleBuildShortestPath(aArea, bArea)\n\nfor _, currNode := range path.Nodes {\n\tfmt.Println(currNode.Area)\n}\n```\n\nExample output of path finding from the center of A-site on de_nuke to the center of B-site:\n```\nPath length: 2381.591\nAreaID: 1419 [BombsiteA] @ {{675 -925 -414.96875}, {700 -900 -415.35532}}\nAreaID: 7 [BombsiteA] @ {{575 -1325 -415.96875}, {950 -925 -415.96875}}\nAreaID: 2285 [BombsiteA] @ {{550 -1300 -415.96875}, {575 -1225 -415.96875}}\nAreaID: 3107 [BombsiteA] @ {{500 -1400 -415.96875}, {550 -1225 -415.96875}}\nAreaID: 3368 [BombsiteA] @ {{475 -1375 -415.96875}, {500 -1225 -415.96875}}\nAreaID: 3076 [BombsiteA] @ {{425 -1375 -415.96875}, {475 -1325 -415.96875}}\nAreaID: 3075 [BombsiteA] @ {{425 -1400 -415.96875}, {475 -1375 -415.96875}}\nAreaID: 1673 [Vents] @ {{425 -1450 -607.96875}, {625 -1425 -607.96875}}\nAreaID: 700 [Vents] @ {{625 -1525 -607.96875}, {650 -1425 -607.96875}}\nAreaID: 2478 [Vents] @ {{650 -1450 -607.96875}, {700 -1425 -607.96875}}\nAreaID: 2479 [Vents] @ {{700 -1450 -607.96875}, {750 -1425 -607.96875}}\nAreaID: 2477 [Vents] @ {{750 -1450 -607.96875}, {825 -1425 -607.96875}}\nAreaID: 2300 [Vents] @ {{825 -1450 -607.96875}, {850 -1400 -607.96875}}\nAreaID: 2301 [Vents] @ {{825 -1400 -607.96875}, {850 -1350 -607.96875}}\nAreaID: 1690 [Vents] @ {{825 -1350 -607.96875}, {850 -1325 -639.96875}}\nAreaID: 2265 [BombsiteB] @ {{775 -1325 -639.96875}, {900 -1275 -639.96875}}\nAreaID: 3589 [BombsiteB] @ {{900 -1325 -639.96875}, {950 -1275 -639.96875}}\nAreaID: 3591 [BombsiteB] @ {{900 -1275 -639.96875}, {950 -1050 -639.96875}}\nAreaID: 3593 [BombsiteB] @ {{900 -1050 -639.96875}, {950 -900 -639.96875}}\nAreaID: 2490 [BombsiteB] @ {{878 -1050 -597.96875}, {888 -900 -597.96875}}\nAreaID: 2690 [BombsiteB] @ {{850 -1050 -767.96875}, {888 -900 -768.9288}}\nAreaID: 3500 [BombsiteB] @ {{550 -1075 -770.25446}, {850 -900 -767.96875}}\nAreaID: 3502 [BombsiteB] @ {{550 -900 -769.49255}, {850 -725 -767.96875}}\n```\n\n# License\nThis source is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE. If this license is not acceptable for your project, let me know. Additionally, more feature-rich versions of this library exist, written in C# and C++, and can be licensed upon request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrazza%2Fgonav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrazza%2Fgonav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrazza%2Fgonav/lists"}