Overview
This is my first project were I implemented AI and PCG for a game, I also wanted to try to use scriptable objects from Unity. The pitch is simple; as a space dwarf, go down on planet, get resource, and get out of the planet before being drown under the space goblins.
Procedural generated content
I used PCG as much as possible thoughout the project:
- Generation of the level using cellular automaton
- Finding small area and removing them
- Linking region together
- Creating sub-region (for spawn)
- Spawning resources and enemies
- Random generation of weapon using a Markov Models approach
AI
The two core implementation I’ve made were the pathfinding and and decision making, it wasn’t applied to whole group but only to single agent. For the pathfinding I implemented the A* algorithm and completed it with a security to have a maximum of agent that could request a path at the same time. Working with the tilemap of unity helped to already have a grid system and to build a Waypoint Graph on top of it was an easy task.
For the decision making instead of using state machine I opted for a behavior tree using scriptable object. Using scriptable object allowed me recycle every behavior and to build complexe agent directly from the editor.
Infos
- Solo Project
- Time : 4 weeks at the end of my first year
- Github : link
Related articles
AI in an ECS environnement
This project show how an AI decision-making system and the patfinding algorithms has been optimized to go from a non playable with hundreds of agents to as game which can support 10'000 agents making decisions and moving inside a city.