{"id":26058863,"url":"https://github.com/themusaigen/pathfinding","last_synced_at":"2026-04-21T02:03:08.717Z","repository":{"id":272733804,"uuid":"917144906","full_name":"themusaigen/pathfinding","owner":"themusaigen","description":"Library for implementing pathfinding algorithms in GTA:SA.","archived":false,"fork":false,"pushed_at":"2025-06-14T13:02:25.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T14:19:14.989Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/themusaigen.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-15T12:48:35.000Z","updated_at":"2025-06-14T13:02:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"55243143-4082-476f-91db-847144555ba2","html_url":"https://github.com/themusaigen/pathfinding","commit_stats":null,"previous_names":["themusaigen/pathfinding"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/themusaigen/pathfinding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themusaigen%2Fpathfinding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themusaigen%2Fpathfinding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themusaigen%2Fpathfinding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themusaigen%2Fpathfinding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/themusaigen","download_url":"https://codeload.github.com/themusaigen/pathfinding/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themusaigen%2Fpathfinding/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27586450,"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","status":"online","status_checked_at":"2025-12-08T02:00:07.111Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-03-08T12:40:42.613Z","updated_at":"2025-12-08T02:04:33.982Z","avatar_url":"https://github.com/themusaigen.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pathfinding\n\nLibrary for implementing pathfinding algorithms in GTA:SA.\nThis means that this library does not seek to implement only one pathfinding algorithm, but several, trying to bring them to a \"usable\" state. At the moment, work is underway on the most well-known and easy-to-implement algorithm A*.\n\n## Installation\n\nClone the repository and extract `src` directory content to the `moonloader/lib` directory.\n\n## Usage / Demo\n\nSee basic example of usage in `demo/init.lua` file. You also can extract `demo/init.lua` to your `moonloader` directory and test library right in the game.\n\n## Overview\n\n* `[...]` - required parameter.\n* `(...)` - optional parameter.\n\n`pathfinding` exports one main function:\n\n```lua\nlocal path = pathfinding:process([algorithm-name: string], [start: Vector], [goal: Vector], (configuration: Configuration|nil))\n```\n\n1. As you can see, the first argument is the name of the algorithm, it can be either `a*` or `astar` (case is not important). Required.\n2. The second argument is the vector of the starting point and the vector of the ending point. They have a special Vector class. In order to get it, you need the Point class, which is included with the Pathfinding table. Required. Examples:\n```lua\n-- Case 1:\nlocal Point = pathfinding.INTERFACE.Point\n\n-- Case 2:\nlocal Point = require(\"pathfinding.point\")\n\n-- Case 3: (Yea, Point and core Vector3d classes are same, but Point provides some utility in consturcting)\nlocal Vector3D = require(\"vector3d\") -- moonloader/lib/vector3d\n\n-- Use case:\nlocal pointA = Point.new(1, 2) -- It is not necessary to specify all the coordinates, but the order is important.\n\nlocal pointB = Vector3D(3, 4, 5)\n```\n3. The third argument is the configuration for the algorithm, which affects its outcome. In fact, it's just a table with some parameters. Optional.\n```lua\n-- To get the configuration class without `require`, use the INTERFACE field.\n-- To choose the right configuration class for your algorithm, you need to know which \"family\" it belongs to.\n-- A* and its derivatives (like Theta*) belong to the family of \"searching\" algorithms. That's why they use AstarConfiguration.\nlocal AstarConfiguration = pathfinding.INTERFACE.AstarConfiguration\n\n-- Create config.\n-- All fields are already filled in by default. \n-- This means that this configuration can be used immediately as it is.\nlocal config = AstarConfiguration.new()\n\n-- The larger the step, the lower the RAM costs, and the algorithm will run faster, but it will be less accurate.\nconfig:set_step(1.5)\n-- A heuristic function, by default it is the distance from one node to another.\nconfig:set_heuristics(...)\n-- The coordinate vector validation function. In this function, you can check for height differences and generally check whether this point is achievable. Used when creating a list of neighbors.\nconfig:set_validate(...)\n-- A function for checking for obstacles between two points. Returns true if there are no obstacles and false if there are. Used when creating a list of neighbors.\nconfig:set_collision(...)\n-- A function that returns a list of points for potential neighbors. The more points, the more accurate the path, but the higher the cost of RAM and speed. Used when creating a list of neighbors. By default there is 20+ points.\nconfig:set_neighbors(...)\n-- A function that checks whether this point has reached the end of the path. By default, this is the Euclidean distance, which is less than `Step` or equal.\nconfig:set_end_reached(...)\n\n-- These functions have annotations, so Visual Studio Code will tell you what arguments this function has.\n-- In other configuration classes, there may be other functions. Keep this in mind.\n```\n4. The algorithm \"spits out\" a list of points of the Vector class. If the path is unreachable, the list will be empty.\n\n## References\n* [A* (RU)](https://ru.wikipedia.org/wiki/A*)\n* [A* (EN)](https://en.wikipedia.org/wiki/A*_search_algorithm)\n* [Theta* (EN)](https://en.wikipedia.org/wiki/Theta*)\n* [FiveTuning](https://www.blast.hk/threads/182733/)\n* [GTA NavMesh](https://www.blast.hk/threads/228996/) a.k.a [this](https://www.blast.hk/threads/198094/)\n\n## See also\n\n* `pathfinding` written using [moonly](github.com/themusaigen/moonly)\n\n## License\n\n`pathfinding` licensed under `MIT License`. See `LICENSE` for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemusaigen%2Fpathfinding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemusaigen%2Fpathfinding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemusaigen%2Fpathfinding/lists"}