Author Topic: Optimizing a Swarm  (Read 2246 times)

Offline asterixx

  • Bot Neophyte
  • *
  • Posts: 48
    • View Profile
Optimizing a Swarm
« on: June 28, 2008, 06:12:30 PM »
I was wondering if anyone could help me improve the behaviour of this bot. I would particularly like them to be able to survive better, but also it would be neat if there was a way to make them stay in tighter clusters. Here's the DNA:

________________________________
 cond
 *.eye5 0 >
 *623 *.myeye !=
 start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 stop

 cond
 *.eye5 50 >
 *.refeye *.myeye !=
 start
 -1 .shoot store
 *.refvelup .up store
 stop


 cond
 *.eye5 0 =
 *.refeye *.myeye =
 or
 start
 314 rnd .aimright store
 stop

 cond
 *.nrg 5000 >
 start
 10 .repro store
 stop
________________________________

Thanks.
"Tell a man there are 300 billion stars in the universe and he'll believe you.  Tell him a bench has wet paint on it and he'll have to touch it to be sure."

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7740
    • View Profile
Optimizing a Swarm
« Reply #1 on: June 28, 2008, 06:48:55 PM »
The swarming behavior is caused by that first gene.  It's conspec broke, so the bots now accelerate towards kin.  The third gene will cause them to spin away from kin at the same time, so the net result is a poorman's swarming behavior.

There are a couple of swarming bots in the bestiary.  How true to the original bot do you want to stay?  The simplest tweaks would be to that 30 constant in the first gene.  Set it to different values and observe the differences in behavior.

Offline asterixx

  • Bot Neophyte
  • *
  • Posts: 48
    • View Profile
Optimizing a Swarm
« Reply #2 on: June 28, 2008, 07:47:28 PM »
Well, whatever advice you might have would be helpful. One of the most important things I want to fix is that when the swarm hits a wall, it gets a little broken up. So I'm going to start with that.
"Tell a man there are 300 billion stars in the universe and he'll believe you.  Tell him a bench has wet paint on it and he'll have to touch it to be sure."

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7740
    • View Profile
Optimizing a Swarm
« Reply #3 on: June 28, 2008, 10:29:09 PM »
Swarm and Fish School are the two swarming bots I'm aware of.  Fish School is based on animal minimalis, so it might be the better place to start.