Author Topic: SWARM  (Read 6363 times)

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
SWARM
« 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 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

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
SWARM
« Reply #1 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

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
SWARM
« Reply #2 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 )
« Last Edit: March 10, 2006, 06:30:55 PM by Elite »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
SWARM
« Reply #3 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 ;)

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
SWARM
« Reply #4 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.
« Last Edit: April 01, 2006, 06:16:00 AM by Elite »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
SWARM
« Reply #5 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.

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
SWARM
« Reply #6 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)
« Last Edit: April 14, 2006, 11:27:16 PM by Welwordion »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
SWARM
« Reply #7 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.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
SWARM
« Reply #8 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...)
Many beers....

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
SWARM
« Reply #9 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 :/
« Last Edit: April 15, 2006, 01:19:04 AM by Welwordion »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
SWARM
« Reply #10 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?

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
SWARM
« Reply #11 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)
« Last Edit: April 15, 2006, 03:26:07 AM by Welwordion »

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
SWARM
« Reply #12 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.
« Last Edit: April 15, 2006, 03:56:19 AM by Endy »

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
SWARM
« Reply #13 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
« Last Edit: April 15, 2006, 05:46:04 AM by Endy »

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
SWARM
« Reply #14 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.