AI Food Gathering code

Community Forums/Showcase/AI Food Gathering code

Rob Farley(Posted 2006) [#1]
Sunday afternoon coding...

A sort of ant type food gathering AI thing going on...

There's a bunch of food and a bunch of workers.

Workers go find food.

If a worker sees another worker with food and they are closer to the base they will take it off the other one to form a sort of chain.

Anyway... more curious than useful!




Grey Alien(Posted 2006) [#2]
hey that's neat. Reminds me of the ants that invaded our dining room last autumn!


Red Ocktober(Posted 2006) [#3]
cool... could be used in a Comand & Conquer sort of game...

--Mike


Regular K(Posted 2006) [#4]
Wheres the stomp button? I want to squish the ones in the corner.

Pretty cool, do they depend on food? That would be cool to see them eventually die off due to lack of food.


Rob Farley(Posted 2006) [#5]
Just made it more interesting... Added a caller mode. When one finds food if there's no-one else calling it will become a caller to attract the others.




Filax(Posted 2006) [#6]
Very good rob ! :) like always :)


Regular K(Posted 2006) [#7]
Even better :D

I made something comparable to this.

Everyone had a job: Baker, Guard or Thief.

Bakers would make food. Thiefs would steal food (if they cant afford it from the baker) or they would buy it. Guards would buy food, or persue thiefs (if seen when stealing). Everyone had to sleep and eat.

I dont know why I deleted it...


boomboom(Posted 2006) [#8]
Well why not now add preditors! that try to eat the workers. And guards. who have to guard the workers?


BlackJumper(Posted 2006) [#9]
Nice... especially the 'caller' mode.

I did something similar a long way back where the ants could emerge from a 'hive' North, South, East or West. A neural network then evolved the best strategy for sending out workers based on which direction provided the best harvest.

There was also a huge magnifying glass that let you slow down the ants or frazzle them out of existence...

Unfortunately, I didn't understand Blitz collisions very well at the time, and ants kept 'popping' out of the world as they got forced beneath the ground or escaped from the arena. I eventually abandoned it for this reason.


boomboom(Posted 2006) [#10]
I had a little program myself. This is what I came up with (Blitz3D)



The only borrowed code is the FPS Limiting Function. I am still working on it. Going to add scent trailers when I get the chance (like the Robs Caller Mode but more based on ants scent trails)