landmass
A Rust crate to provide a navigation system for video game characters to walk around levels.
What is a navigation system?
A navigation system is essentially the collection of tools needed for robust agent movement in video games. This generally involves 4 things:
- Path finding (e.g. A-star)
- Path simplification (e.g. SSFA)
- Steering (e.g. boids)
- Local collision avoidance
In addition, managing agents and the navigation meshes they walk on can be cumbersome, so a navigation system ideally will handle that for you.
Generally it is difficult to find a full, free system to handle all of these for
you, and the goal is for landmass to work relatively easily with other
languages so it can be used anywhere.
Overview
landmass has two major components: Archipelagos and Agents. An
Archipelago is essentially one
navigation mesh and the
Agents on that navigation mesh. Each game character (controlled by AI) should
correspond to one Agent. To start using landmass:
- Create an
Archipelagofrom aValidNavigationMesh. - Add
Agents to theArchipelago.
Each frame of the game:
- Set the position and velocity of each game character to its corresponding
Agent. - Call
updateon theArchipelago. - Use the desired move from each
Agentto inform the corresponding game character where it should move.
Note: landmass intentionally does not update the Agents position itself.
Generally, characters are moved using some other method (like a physics
simulation) rather than just moving the character, so moving the Agent would
be confusing.
License
Licensed under the MIT license.