{"id":26615584,"url":"https://github.com/krc2000/astarpathfindernet","last_synced_at":"2025-06-14T11:05:05.683Z","repository":{"id":114301927,"uuid":"469920659","full_name":"KRC2000/AStarPathfinderNET","owner":"KRC2000","description":"Simple and fast A* pathfinder .NET c# implementation.","archived":false,"fork":false,"pushed_at":"2022-09-20T13:39:12.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T06:11:31.237Z","etag":null,"topics":["ai","algorithms","astar","astar-pathfinding","csharp","gamedev","net","pathfinding","zombies"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KRC2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-14T22:11:31.000Z","updated_at":"2025-02-09T05:06:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"84a8f126-0539-4b92-9a38-58e5d6f484ec","html_url":"https://github.com/KRC2000/AStarPathfinderNET","commit_stats":null,"previous_names":["krc2000/astarpathfindernet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KRC2000/AStarPathfinderNET","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRC2000%2FAStarPathfinderNET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRC2000%2FAStarPathfinderNET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRC2000%2FAStarPathfinderNET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRC2000%2FAStarPathfinderNET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KRC2000","download_url":"https://codeload.github.com/KRC2000/AStarPathfinderNET/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRC2000%2FAStarPathfinderNET/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259804839,"owners_count":22913901,"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":["ai","algorithms","astar","astar-pathfinding","csharp","gamedev","net","pathfinding","zombies"],"created_at":"2025-03-24T06:11:20.471Z","updated_at":"2025-06-14T11:05:05.672Z","avatar_url":"https://github.com/KRC2000.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A* algorithm pathfinder NET implementation\n## What is this?\nThis is a simple and fast little framework for finding shortest path from point A to point B on the 2d grid.\nIf you are building strategy game, you might want to give orders to your units where to go. Or maybe you want zoombies chase the player. \nWell, this framework got you covered.\n## Is it bloated?\nNo, there are 3 versions, all of them are using `dotnet framework3.1` and only one uses additional dependency - `MonoGame.Framework.DesktopGL`.\n## How to use it?\nCurrently there are 3 folders in the repository:\n* MadeClean (Just dotnet framework3.1, nothing else. Returns a path as a list of uint, where X and Y coordinates of solving nodes are packed in the row)\n* MadeForMonogame (dotnet framework3.1 and MonoGame, particulary Point class. Returns a path as a list of Point)\n* MadeCustom (dotnet framework3.1 and custom class Vector2i. Returns a path as a list of Vector2i)\n\n1. If you want to use pathfinder in your Monogame project - get `MadeForMonogame`. Else - get `MadeClean`. There is no reason getting `MadeCustom`.\n2. Copy all `.cs` files in your project's folder.\n3. Add `using Framework.Pathfinder;`\n4. Create an instance of Pathfinder: `Pathfinder finder = new Pathfinder();`\n5. Initialise pathfinder by feeding him with the map grid: \n```\n// Map grid where 0 - walkable, any other number - obstacle.\nuint[,] map = new uint[,]{\n  {0, 1, 0, 0, 0},\n  {0, 1, 0, 1, 0},\n  {0, 1, 0, 1, 0},\n  {0, 1, 0, 1, 0},\n  {0, 0, 0, 1, 0}\n};\n\n// Pathfinder initialisation\nfinder.Init(map); \n```\n6. And finally get the path from A to B by calling `GetPath`:\n```\n// If you using MadeClean:\nList\u003cuint\u003e path = new List\u003cuint\u003e(); // Create list to store final path coordinates\nfinder.GetPath(out path, 0, 0, 4, 4); // Fill just created list with path coordinates. First two numbers - X and Y position of the start cell(0, 0), next two - X and Y of the final target cell(4, 4)\n\n//if you using MadeForMonogame\nList\u003cPoint\u003e path = new List\u003cPoint\u003e(); // Create list to store final path coordinates\nfinder.GetPath(out path, new Point(0, 0), new Point(4, 4)); // Fill just created list with path coordinates. First Point - position of the start cell(0, 0), next one - X and Y of the final target cell(4, 4)\n```\nNow `path` will be filled with either `{ 0, 0, 0, 1, 0, 2, 0, 3, 1, 4, 2,  3, 2,  2, 2,  1, 3, 0, 4, 1, 4, 2, 4, 3, 4, 4 }` if you are using MadeClean, or it's gonna be Point objects that can be represented as so:\n```\n{0, 0}\n{0, 1}\n{0, 2}\n{0, 3}\n{1, 4}\n{2, 3}\n{2, 2}\n{2, 1}\n{3, 0}\n{4, 1}\n{4, 2}\n{4, 3}\n{4, 4}\n```\nAs you can see, it do be solving path:\n![pathfinfing_demo](https://user-images.githubusercontent.com/47914319/161387616-47344ad2-b089-451d-a51c-88c9a08c77f5.png)\nYou can also choose modes like so: `finder.Mode = PathMode.Aligned;`\nBy default the Mode is set to `PathMode.Free`, which means that path can be calculated using diagonal movement. If it is set to `PathMode.Aligned`, path would look like so:\n![pathfinfing_demo_short](https://user-images.githubusercontent.com/47914319/161387899-4a1deae5-682e-4fa2-9ef1-bd7d089fc12f.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrc2000%2Fastarpathfindernet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrc2000%2Fastarpathfindernet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrc2000%2Fastarpathfindernet/lists"}