Surfacer: 2D-platformer AI and pathfinding's icon

Surfacer: 2D-platformer AI and pathfinding 0.7.0 2D Tools 3.4 Community

Submitted by user levi; MIT; 2022-05-11

**NOTE:** This framework depends the separate Scaffolder library. You'll need to add both of these libraries to your `addons/` folder. (https://godotengine.org/asset-library/asset/969)

**NOTE**: Consider this a pre-alpha release. This framework still has many rough edges, is still changing a lot, and is possibly a lot more inflexible than you would want (it makes a lot of assumptions about how you've structured your app).

**tl;dr**: Surfacer works by pre-parsing a level into a "platform graph". The nodes are represented by points along the different surfaces in the level (floors, walls, and ceilings). The edges are represented by possible movement trajectories between points along surfaces. There are different types of edges for different types of movement (e.g., jumping from a floor to a floor, falling from a wall, walking along a floor). At run time, A* search is used to calculate a path to a given destination.

Some features include:
- Surfacer includes a powerful character-behavior system for easily creating a character AI with high-level behaviors like "wander", "follow", "run-away", "return".
- Easy-to-use point-and-click navigation for player-controlled characters.
- Configurable movement parameters on a per-character basis.
- Level creation using Godot's standard pattern with a TileMap in the 2D scene editor.
- Pre-parsing the level into a platform graph, and using A* search for efficient path-finding at runtime.
- A powerful inspector for analyzing the platform graph, in order to debug and better understand how edges were calculated.
- Walking on floors, climbing on walls, climbing on ceilings, jumping and falling from anywhere.
- Variable-height jump and fast-fall.
- Adjusting movement trajectories to move around intermediate surfaces (such as jumping over a wall or around a floor).

Probably the easiest way to get set up is to copy the Squirrel Away example app, and then adjust it to fit your needs (https://github.com/SnoringCatGames/squirrel-away).

See more details in the README:
https://github.com/SnoringCatGames/surfacer.

You can also read more about how the AI works in this series of posts:
https://devlog.levi.dev/2021/09/building-platformer-ai-from-low-level.html


View files Download Submit an issue Recent Edits