ants simulation
Hugh Lomas1 HN recommender · recommended in 1 month, 2014–2022
demo · general · evergreen · 2014–2022 on HN
A one-minute visualization of a simulated ant colony in which ants follow pheromone trails, with the source code on GitHub. It shows emergent behavior arising from simple rules.
Linked in ant-simulation threads as a compact, open-source example of emergent behavior.
Up next
3 mo on HNBirth of The Transistor: A video history of Japan's electronic industry. (Part 1)
RC286
3 HN recommender · 2018–2022
17 mo on HN8 Bit & '8 Bitish' Graphics-Outside the Box
GDC Festival of Gaming
13 HN recommender · 2018–2026
10 mo on HNelevated by Rgba & TBC | 4k intro (FullHD 1080p demoscene demo)
Demoscene High-Quality Videos (Annikras)
7 HN recommender · 2013–2025
10 mo on HNPainting a Character with Maths
Inigo Quilez
13 HN recommender · 2021–2025
6 mo on HNThe Art of Code - Dylan Beattie
NDC Conferences
6 HN recommender · 2020–2024
6 mo on HNFunctional Composition - Chris Ford
ClojureTV
6 HN recommender · 2013–2023
7 mo on HNI painted a Landscape with Mathematics
Inigo Quilez
7 HN recommender · 2022–2025
7 mo on HNElevated by RGBA and TBC
BUTTONTANG
7 HN recommender · 2009–2025
6 mo on HNDarius Kazemi, Tiny Subversions - XOXO Festival (2014)
XOXO Festival
7 HN recommender · 2015–2024
6 mo on HNRiftSketch: Live coding in VR with the Oculus Rift, Firefox WebVR, JavaScript and Three.js
Brian Peiris
5 HN recommender · 2014–2020
6 mo on HNMoleman 2 - Demoscene - The Art of the Algorithms (2012)
Vakondok (Moleman)
6 HN recommender · 2015–2023
5 mo on HNCoding Adventure: Ant and Slime Simulations
Sebastian Lague
6 HN recommender · 2021–2024
3 comments from Hacker News
Take a look at this visualization ▶ this video There's a repo in the description. Might not be specifically relevant to your project though
This is great to see. Years ago I created a basic simulation using the same principles of pheromone gradients, one for the nest and one for food. ▶ this video It a fascinating example of emergent behavior from simple rules. I've been wanting to find time to revisit the concept and produce an updated version, your simulation seems to include everything I wanted to do and more.
I loved reading this because I made something exceedingly similar a few years ago, and I'm similarly fascinated with how complex behavior can emerge from such simple rules. ▶ this video My ants also had no conception of where their home was located, their behavior is entirely pheromone driven. They can "read" pheromones from any adjacent cell. They leave a pheromone every movement depending on which state they are in, either "find food" or "return food". In my system, the pheromones have a strength. Whenever an ant touches the nest, his "nest pheromone" is at full strength (255). Each movement decreases the strength by 1. This sets up a natural gradient of nest strength for ants to follow. They also "deteriorate" each round as yours do. A similar setup is used with food, such that a high food scent is created when they pick up food, and decreases in strength as they return to the nest. So to find food, they try to move up a food gradient or down the nest gradient (away from the nest), while to return food they move up the nest gradient (towards the nest). Their searching consists of a random walking into cells that have no nest scent, or following a food trail. They have an energy cost for moving, and if it's too low they have to eat a piece of food. Returning a piece of food to the hill spawns a new ant. The lines on the right side show the population of each colony and the total food on the board. From these extremely basic rules, they are very efficient at clearing the "world"