I've been making a simulation of ants.
Basically so far I have just a bunch of ants that randomly walk around the screen. I've done some quadtree magic and I'm able to get thousands of ants walking around at once, on their own little journeys.
The movement is very ant-like, so I'm happy with that.
My idea is to simulate some kind of collective thinking. They don't necessarily have to be ants (they could be little robots or whatever), but I want to try to simulate something whereby each ant works completely independently, but can learn from the other ants to achieve their tasks as a group.
I'm not entirely sure how to go about this. Any suggestions?
I was thinking about something like this:
- Each 'ant' can see a small distance around himself. Not very far at all (10 pixel circle around him).
- Each ant knows his own position. I'm not sure if I should just give each ant access to his own coordinates or make him work stuff out by how many footsteps he's done in each direction
- Ants can interact with each other if they're standing next to each other and share their information
- Each ant has a limited amount of energy. They can regenerate energy by standing still.
- The will be other insects roaming around (spiders??) that can eat the ants.
- When an ant dies it gives off a 'smell' around him to warn other ants
- There will be a couple of safe zones. The ants wont know where these safe zones are unless they discover them or until they're told about them
- Some of the terrain will have obstacles
I also need some kind of objective for the ants. For example, they have to work together to collect as much food from large food piles that they have to discover then make a train to bring back the food to a safe zone.
Or maybe they need to collectively discover as much of the terrain as possible and report it back to some source.
I dunno. Any ideas? It's completely completely completely pointless and I'm sure it's been done thousands of times before but it's quite interesting to do from scratch.
I need some kind of objective and something to time how long it takes them to perform the task, then try to tweak the code so they do it as fast as possible.
I'm also thinking about maybe the ants having a limited amount of brain power in which to store the information they know. Hmm. |