Darwinbots Forum

Bots and Simulations => Bot Tavern => Topic started by: Elite on March 10, 2006, 06:16:00 PM

Title: SWARM
Post by: Elite on March 10, 2006, 06:16:00 PM
I am so happy with my new project that I can't resist boasting about it  :D

Check out SWARM (http://forum.darwinbots.com/index.php?showtopic=1156) in the bestiary

I was playing about with swarming bots, thinking that bots that worked together would have a tactical advantage ofer other bots, who largely act as though their conspecs don't exist

SWARM is a very meritocratic bot, with the bots being led by the bot with the most kills. To form the swarms it aligns itself with the heading of it's conpecs, matches their speed and velocity, and constantly checks up on their heading and position. This allows it to fight in packs and surround and outnumber unfortunate enemies. Just watch him in action.

Neat huh  :D
Title: SWARM
Post by: Numsgil on March 10, 2006, 06:26:59 PM
Neat.

Have you looked at Fish School?  Your solution is so similar I was wondering if we came to it independantly or if my brilliant idea appealed to you :P
Title: SWARM
Post by: Elite on March 10, 2006, 06:30:20 PM
Well, I thought of it independantly, but I knew of Fish School beforehand. I saw how you made Fish School work but was trying to get rid of some of the problems with it's swarming behavior:
 - Most fish school bots face inward
 - Bots spend more time looking at consecs than feeding
etc.

SWARM is more efficient and deadly  :D

Inspired by Fish School but all the coding is 100% my own
Except the birth tie gene (that's yours  :P )
Title: SWARM
Post by: Numsgil on March 10, 2006, 06:40:03 PM
Yeah, I was a little dissapointed at how much of Fish School's life was spent checking vectors.

Nice work ;)
Title: SWARM
Post by: Elite on April 01, 2006, 06:15:47 AM
I've got a new prototype building on the swarming concept:

SocialSwarm communicates the location of food to conspecs and is fiercely territorial. It is also capable of limited 'memory' - remembering the locations of food.

Code: [Select]
' SocialSwarm
'
' An advancement on the SWARM concept

cond
start
.tie *.robage 1 add mult inc
.deltie inc
stop

cond
*.eye5 0 >
*.refeye *.myeye =
*.in1 0 !=
*.in2 0 !=
start
*.in1 .out1 store
*.in2 .out2 store
stop

cond
*.body 500 <
*.out1 0 !=
*.out2 0 !=
start
*.out1 *.out2 angle .setaim store
stop

cond
*.eye5 50 <
start
10 .up store
stop

cond
*.eye1 *.eye5 >
*.eye9 *.eye5 > or
start
*.eye9 *.eye1 sub 2 mult .aimdx store
stop

cond
*.eye5 35 >
*.refeye *.myeye !=
start
-6 .shoot store
8 .shootval store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refxpos .out1 store
*.refypos .out2 store
*.refveldx .dx *.eye5 sgn mult store
stop

cond
*.eye5 50 >
*.refeye *.myeye =
start
*.refaim .setaim store
stop

cond
*.body 1000 >
start
50 .repro store
stop

cond
*.nrg 5000 >
start
100 .strbody store
stop

cond
*.nrg 100 <
start
*.body .fdbody *.body sgn mult store
stop

end

Give it a try  :)

Social bots seem to perform much more efficiently, and come out better in melees, than 'lone hunter' bots.
Title: SWARM
Post by: Numsgil on April 01, 2006, 11:20:53 AM
Have you tried running a long evo sim with it?  Fish School always devolved the swarming behavior.  If Swarm doesn't, then it might seem to indicate it's really overall better than not swarming.
Title: SWARM
Post by: Welwordion on April 14, 2006, 11:26:27 PM
Swarm seems to have problems running in 2.4 right?
Cause I wanted it, to compete against my new evobot for swarm behaviour(uses some genes I am developing for the network concept) and it seemed to kill itself somehow.(seems it has something to do with body and nrg, cause it survived better when I changed the threshold for storing body, although it still killed itself of in a standalone simulation)
Title: SWARM
Post by: Numsgil on April 14, 2006, 11:57:24 PM
Try running it on 0 costs.  If it stil dies, we know its something rather real.  If it does't, it might be a tuning problem with 2.4 physics.
Title: SWARM
Post by: EricL on April 15, 2006, 12:26:54 AM
I've run swarm a lot in 2.4x though not in any long run sims.  That's how I built my first bot, by learnign how to build something that could beat it (once I discoverred how to fire a fixing memory shot it was all over...)
Title: SWARM
Post by: Welwordion on April 15, 2006, 12:57:49 AM
Changed my energy settings a little(2nrg per kilobody every bot is a veggie) ,now swarm kicks  the butt of my evobot X)
However whenever I use 0 cost and normal veggies they still seem to kill themselves :/
Title: SWARM
Post by: Numsgil on April 15, 2006, 02:00:00 AM
Can you try and figure out exactly where their nrg is going that they die?  Does it look like they're doing the same behavior or do they behave screwy too?
Title: SWARM
Post by: Welwordion on April 15, 2006, 03:21:47 AM
With 0 costs, mutation diasabled(used social swarm): Bots keep shrinking in size , some bots behave screwy but most are okay,
main cause of dead: bots firing at each other(mostly accidents,but they happen often) and bots trying to reproduce.
In the end only screwy shrinked bots remain(probably because they do not collect enough energy to reproduce)
Title: SWARM
Post by: Endy on April 15, 2006, 03:49:51 AM
The bots are only body feeding, it's also converting all it's body into nrg whenever nrg gets too low. You also need to convert it back into nrg before reproducing.

Code: [Select]
cond
*.nrg 5000 >
*.body 10 >
start
50 .repro store
*.nrg 5000 sub .strbody store
stop

cond
*.body 10 >
start
*.body 10 sub .fdbody store
stop

cond
*.nrg 100 <
*.body 100 *.nrg sub 10 div >
start
*.body 100 *.nrg sub 10 div sub .fdbody *.body sgn mult store
stop

As a good rule of thumb it's best to check body levels before reproducing. It's also good to beef up whenever fighting/feeding, for a free shot strength boost. For overall general surviving, it's a balancing act between the two.
Title: SWARM
Post by: Endy on April 15, 2006, 05:33:39 AM
Seems to have helped. I'm running an evosim to see how they hold up.

It's holding alright. Seems like it's helping them find food by playing a follow the leader game. It also appears to help the Canni's(perhaps more than normal bots) by helping them hunt the large groups of norms.

Neat little bot. I'll keeep going some more and see what happens.

Code: [Select]
' SocialSwarmX
'
' An advancement on the SWARM concept

cond
start
.tie *.robage 1 add mult inc
.deltie inc
stop

cond
*.eye5 0 >
*.refeye *.myeye =
*.in1 0 !=
*.in2 0 !=
start
*.in1 .out1 store
*.in2 .out2 store
stop

cond
*.body 500 <
*.out1 0 !=
*.out2 0 !=
start
*.out1 *.out2 angle .setaim store
stop

cond
*.eye5 50 <
start
10 .up store
stop

cond
*.eye1 *.eye5 >
*.eye9 *.eye5 > or
start
*.eye9 *.eye1 sub 2 mult .aimdx store
stop

cond
*.eye5 35 >
*.refeye *.myeye !=
start
-6 .shoot store
8 .shootval store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refxpos .out1 store
*.refypos .out2 store
*.refveldx .dx *.eye5 sgn mult store
stop

cond
*.eye5 50 >
*.refeye *.myeye =
start
*.refaim .setaim store
stop

cond
*.nrg 5000 >
*.body 10 >
start
50 .repro store
*.nrg 5000 sub .strbody store
stop

cond
*.body 10 >
start
*.body 10 sub .fdbody store
stop

cond
*.nrg 100 <
*.body 100 *.nrg sub 10 div >
start
*.body 100 *.nrg sub 10 div sub .fdbody *.body sgn mult store
stop

end
Title: SWARM
Post by: Endy on April 15, 2006, 06:06:53 AM
Good job on the bot design. Impressive features for a relativly small bot.

The improvised MB's it and FishSchool can form are very good at manuevering. Do you think one of you could try and deliberatly make a MB with the same coding?

Canni's seem to be taking the lead. Swarming traits have been adapted to hunting.

Population dipped then rose again.  Definitly a good Evosim.   I'll keep it going and see what happens.

 
Title: SWARM
Post by: Numsgil on April 15, 2006, 12:04:57 PM
I think SWARM follows the bot with the most kills.  Which would tend to make Cannis the leader if I understand right.  That would create all kinds of insanity in a sim  
Title: SWARM
Post by: Elite on April 15, 2006, 03:58:27 PM
Quote from: Numsgil
I think SWARM follows the bot with the most kills.  Which would tend to make Cannis the leader if I understand right.  That would create all kinds of insanity in a sim  

Yep, if one SWARM encounters another the one with the least kills orients itself to match the bot with the most kills

It's meritocratic