Author Topic: trying to make a bot  (Read 5080 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
trying to make a bot
« on: March 29, 2006, 09:58:20 AM »
I can't get this bot to stop shooting at its conspecifics.

Could someone tell me what I'm doing wrong. I tried following the bot tutorial but it doesn't work.

Maybe I've put some things in the wrong order. Here is the code:

' Cyanobacterium nostoc

'Gene 1. Photosynthesis
cond
  *.nrg
  5000
  >
start
  50
  .repro
  store
  15
  .aimdx
  store
stop

'Gene 2. Form colonies
cond
 *.robage 0 =
start
 .tie inc
stop

'Gene 3. Simple search pattern 1
cond
 *.eye3 *.eye5 >
start
 -25 .aimdx store
stop

'Gene 4. Simple search pattern 2
cond
 *eye7 *eye5 >
start
 25 .aimdx store
stop

'Gene 5. Feeding
cond
 *.eye5 40 > *.nrg 5000 <
start -1 .shoot store
stop

'Gene 6. Avoid conspecifics
cond
 *eye5 0 >
 *.refeye 6=
start
 180 .aimdx store
stop

'gene 7. Spread out
cond
 *.nrg 1000 >
start
 .delti inc
stop

cond
 *robage 0 =
start .shoot .ploc store
stop

cond
 *.poison 500 <
start
 50 .strpoison store
stop

end
The internet is corrupt and controlled by criminally minded people.

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
trying to make a bot
« Reply #1 on: March 29, 2006, 11:19:14 AM »
Aaaaaargh - the formating!  :wacko:

I
hate
code
like
this
it's
so
hard
to
read

The reason you're bot is killing conspecs is gene 5

Code: [Select]
cond
*.eye5 40 > *.nrg 5000 <
start -1 .shoot store
stop

^  <_<

Code: [Select]
cond
*.eye5 40 >
*.nrg 5000 <
start
 -1 .shoot store
stop

^ Ah, Much better  :P

Add this condition to the gene:
*.refeye *.myeye !=

to get:

Code: [Select]
cond
*.eye5 40 >
*.nrg 5000 <
*.refeye *.myeye !=
start
 -1 .shoot store
stop

They should then stop killing conspecs  :D

Oh yeah, and it's .deltie, not .delti. Maybe why the bots are 'blobbing' into huge tied masses. There are a few more tiny errors too. To save you the bother, here's the corrected version:

Code: [Select]
'Gene 1. Reproduction
cond
*.nrg 5000 >
start
50 .repro store
15 .aimdx store
stop

'Gene 2. Attach to parent
cond
*.robage 0 =
start
.tie inc
.shoot .ploc store
stop

'Gene 3. Simple search pattern 1
cond
*.eye3 *.eye5 >
start
-25 .aimdx store
stop

'Gene 4. Simple search pattern 2
cond
*eye7 *eye5 >
start
25 .aimdx store
stop

'Gene 5. Feeding
cond
*.eye5 40 >
*.nrg 5000 <
*.refeye *.myeye !=
start
-1 .shoot store
stop

'Gene 6. Avoid conspecifics
cond
*eye5 0 >
*.refeye 6 =
start
180 .aimdx store
stop

'Gene 7. Spread out
cond
*.nrg 1000 >
start
.deltie inc
stop

'Gene 8. Store poison

cond
*.poison 500 <
start
50 .strpoison store
stop

end

 :D

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
trying to make a bot
« Reply #2 on: March 29, 2006, 12:19:04 PM »
Thanks for helping me with that. I was wondering about another thing. When I run a sim with this bot together with Animal Minimalis they don't shoot one another. They only shoot other bots. Could it be that something in the code make them think they are the same species?
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
trying to make a bot
« Reply #3 on: March 29, 2006, 01:06:28 PM »
They might have the same number of eye statements.  Since the conspec recognition is based on number of eye statements, it's not that hard for bots to get confused.  Hence why it's the more basic of conspec recognition types.

To fix the problem, add *.eye5 at the bottom of your code.  Doesn't need to be in a gene or anything (assuming you're running 2.4X).

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
trying to make a bot
« Reply #4 on: March 29, 2006, 02:07:10 PM »
Ok, I took the liberty of posting this bot in the Bestiary.
The internet is corrupt and controlled by criminally minded people.

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
trying to make a bot
« Reply #5 on: March 29, 2006, 02:11:19 PM »
Code: [Select]
'Gene 1. Reproduction
cond
*.nrg 5000 >
start
50 .repro store
15 .aimdx store
stop

'Gene 2. Attach to parent
cond
*.robage 0 =
start
.tie inc
.shoot .ploc store
stop

'Gene 3. Simple search pattern 1
cond
*.eye3 *.eye5 >
start
-25 .aimdx store
stop

'Gene 4. Simple search pattern 2
cond
*.eye7 *.eye5 >
start
25 .aimdx store
stop

'Gene 5. Feeding
cond
*.eye5 40 >
*.refeye *.myeye !=
start
-1 .shoot store
stop

'Gene 6. Swarm with conspecs
cond
*.eye5 0 >
*.refeye *.myeye =
start
*.refaim .setaim store
stop

'Gene 7. Sever tie to parent
cond
start
.deltie inc
stop

'Gene 8. Store poison
cond
*.poison 500 <
start
50 .strpoison store
stop

'Gene 8. Actually move
cond
*.eye5 40 <
*.nrg 5000 <
start
10 .up store
stop

end

I've corrected a bunch of errors and added some new stuff too. Your bot has also recieved a routine from SWARM that allows it to form very natural-looking swarms. This solves the problem of him bashing in to conspecs.

It works incredibly well now  :D

Look at him go ...

EDIT: BTW Testlund, you can't have an *.eye5 on its own outside a gene
« Last Edit: March 29, 2006, 02:23:07 PM by Elite »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
trying to make a bot
« Reply #6 on: March 29, 2006, 03:15:22 PM »
Actually you can in 2.4.  It won't do anything, but it will change what the program thinks your myeye value is, so it's useful for conspec manipulation.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
trying to make a bot
« Reply #7 on: March 29, 2006, 04:27:20 PM »
Well, you've made the bot better, Elite, but I don't think it's a Cyanobacterium Nostoc anylonger after that change.  :P It seems a little TOO efficient now. Maybe that one should go into the Bestiary as another species.

Based on what I managed to find on internet the Nostoc species form colonies but I don't think it moves around much. I've had blue-green algea in my aquarium and it was growing on a few spots. Didn't spread much.
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
trying to make a bot
« Reply #8 on: March 30, 2006, 03:12:01 AM »
I found out that the program seem to think this bot is a veggie, so it keeps adding them when they die out, but it doesn't add any Alga Minimalis anylonger. I was wondering why that is. Is there a way to make the program think they are bots instead?
The internet is corrupt and controlled by criminally minded people.

Offline Old Henk

  • Bot Destroyer
  • ***
  • Posts: 229
    • View Profile
trying to make a bot
« Reply #9 on: March 30, 2006, 04:15:59 AM »
Uncheck 'Vegetable, autotroph' in the species tab. ;)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
trying to make a bot
« Reply #10 on: March 30, 2006, 04:55:43 AM »
Is that the only way? Then they wont have any photosynthesis.  :(
The internet is corrupt and controlled by criminally minded people.

Offline Old Henk

  • Bot Destroyer
  • ***
  • Posts: 229
    • View Profile
trying to make a bot
« Reply #11 on: March 30, 2006, 04:58:28 AM »
At the moment it is, unfortunately...

However with the advent of the enzym/specialication system the line between autotrophs and heterotrophs ought to blur.

But, this is still far away, I think...
« Last Edit: March 30, 2006, 04:58:48 AM by Henk »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
trying to make a bot
« Reply #12 on: March 30, 2006, 01:46:05 PM »
I'm working out the theoretical kinks at the moment for that.