https://github.com/matthewhilton/map-pathfinder
Godot extension for skeletonising images
https://github.com/matthewhilton/map-pathfinder
gdextension godot godot-4
Last synced: 7 months ago
JSON representation
Godot extension for skeletonising images
- Host: GitHub
- URL: https://github.com/matthewhilton/map-pathfinder
- Owner: matthewhilton
- License: unlicense
- Created: 2024-04-02T10:10:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-06T08:28:01.000Z (over 1 year ago)
- Last Synced: 2025-03-10T22:14:52.799Z (7 months ago)
- Topics: gdextension, godot, godot-4
- Language: C++
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MapUtils
A very tiny GDExtension addon for Godot that allows you to [skeletonise](https://en.wikipedia.org/wiki/Morphological_skeleton) bitmaps. I.e. given an image, find the 'centers' of the paths.
This can be used, for example, to find the centers of player-built paths.
This uses a skeletonisation script by LingDong, available here: https://github.com/LingDong-/skeleton-tracing
## Using in Godot
1. Go to the `actions` tab in github
2. Click the latest passing workflow run
3. Scroll down to `artifacts` and download `map-pathfinder`
4. In the zip there is an addons folder. Copy the file `map-pathfinder` into your Godot projects `addons` directory## Useful functions
### `process_map`
Given a bitmap, converts it into polylines (Array of Vector2is that connect to each other)
### `convert_to_astar`
Converts polylines (usually generated from above function) into an [AStar2D](https://en.wikipedia.org/wiki/A*_search_algorithm) graph
## Support
I provide this repository in the hopes it is useful to you. However, please not I do not intend to support it outside of any modifications needed for my projects.