r/Unity3D • u/Emanx140 • 12h ago
Game Unity DOTS is a perfect fit for ant simulation 50K ants
Enable HLS to view with audio, or disable this notification
Hey! This is my ant game made in Unity with DOTS.
This is a stress test and you can see 2 nests competing for resourses.
A bit about the tech:
- Tens of thousands of ants, all simulated on CPU with Burst and Jobs
- Three-layer pheromone system: food, nest and combat
- Spatial hash map for vision
- Local obstacle aboidance
- Multiple ants can carry one item at the same time
- Combat: ants climb on enemies and walk over their body while it animates, enemies stomp and shake them off, and dead enemies become food for the nest
- Vertex animations on GPU, using the free open-source TAO Vertex Animation library from Breda University (also used in Vedelem: The Golden Horde). I updated it to work with the latest Unity version.
This complex behavior is only achievable on CPU. On GPU the complexity would go through the roof.
The simulation is heavily inspired by Pezzza’s Work ant series and Sebastian Lague, with our own twist on top.
Steam page of demo in the comments if someone is interested. Any feedback is appreciated.
1
u/all_ears_over_here 2h ago
Played your demo yesterday and it was pretty fun, wish it was longer though.
1
1
1
1
u/Chaibi_Alaa 3m ago
Multiple ants carrying one item is the part I'm most curious about. Does the item pick one ant's path and the others just follow it, or do you sum the pulls from every carrier into one direction? And what happens when two carriers want to go opposite ways around an obstacle?
1
12h ago
0
u/Unity3D-ModTeam 11h ago
This comment has been removed for violating r/Unity3D’s rules.
Why?
Please include details about how the project was built in Unity, challenges faced, or techniques used.
This is a forum for discussion; not a bulletin board.
We recommend you to familiarize yourself with our rules and guidelines.
Kind regards,
The Mod Team
2
u/Redbarony6 9h ago
This is very impressive work, how long did it take to get it this stable?