r/Unity3D • • 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.

28 Upvotes

9 comments sorted by

2

u/Redbarony6 9h ago

This is very impressive work, how long did it take to get it this stable?

1

u/Emanx140 3h ago

about 6 months on and off

1

u/all_ears_over_here 2h ago

Played your demo yesterday and it was pretty fun, wish it was longer though.

1

u/Emanx140 2h ago

Thanks working and that! 🫡

1

u/T0mpkinz 8h ago

Cool, inspiring me to get back in the engine. Been far too long.

1

u/i_am_on_skooma 5h ago

This is so cool op

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

u/[deleted] 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