Author Topic: This bot kills its babies  (Read 4097 times)

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
This bot kills its babies
« on: April 26, 2009, 03:34:10 PM »
Hi everybody,

I have checked the code over and over again and I cant see what's wrong with it, please help me some1, - the 'timerepro' was one of my attempts but it didnt work

Here's the code
Code: [Select]
def timerepro 13

cond
 *.nrg 3000 >
 *.body 1000 >
start
 10 .repro store
 .timer .timerepro store
 .timerepro 10 add store
stop

cond
 *.timerepro *.timer >
 *.eye5 0 >
 *.memval *67 !=
start
 *.refveldx .dx store
 *.refvelup 20 add .up store
stop

cond
 *.timerepro *.timer >
 *.eye4 0 >
 *.memval *67 !=
start
 10 .aimsx store
stop

cond
 *.timerepro *.timer >
 *.eye6 0 >
 *.memval *67 !=
start
 10 .aimdx store
stop

cond
 *.timerepro *.timer >
 *.eye3 50 >
 *.memval *67 !=
start
 1240 .aimshoot store
 -1 .shoot store
 *.refvelup .up store
stop

cond
 *.timerepro *.timer >
 *.eye4 50 >
 *.memval *67 !=
start
 1250 .aimshoot store
 -1 .shoot store
 *.refvelup .up store
stop

cond
 *.timerepro *.timer >
 *.eye5 50 >
 *.memval *67 !=
start
 *.timerepro *.timer >
 0 .aimshoot store
 -1 .shoot store
 *.refvelup .up store
stop

cond
 *.timerepro *.timer >
 *.eye6 50 >
 *.memval *67 !=
start
 10 .aimshoot store
 -1 .shoot store
 *.refvelup .up store
stop

cond
 *.timerepro *.timer >
 *.eye7 50 >
 *.memval *67 !=
start
 20 .aimshoot store
 -1 .shoot store
 *.refvelup .up store
stop

cond
 *.timerepro *.timer >
 *.waste 1000 >
 *.memval *67 !=
start
 -4 .shoot store
stop

cond
 *.timerepro *.timer >
 *.robage 300 > or
 *.nrg 500 >
 *.eye5 0 =
 *.memval *67 = or
start
 314 rnd .aimdx store
stop

cond
 *.timerepro *.timer >
 *.body 1000 <
start
 100 .strbody store
stop

cond
*.robage 0 >
*.robage 8 <
start
67 .memloc store
101 67 store
.deltie store
.dn 300
stop

end
« Last Edit: April 26, 2009, 03:34:58 PM by Panda »

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
This bot kills its babies
« Reply #1 on: April 26, 2009, 08:46:01 PM »
Oh, well, usually you do the .numeye != .eyes or whatever the correct code for that would be, to prevent shooting a friendly.
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
This bot kills its babies
« Reply #2 on: April 27, 2009, 03:10:44 AM »
Well I'd scrap the timerepro thing... (.timer works in strange and mysterious ways, I think it starts at 32000 and counts down)
And it looks like you already have a conspec using .memloc and it looks like it should work.
Just turn every time you reproduce, so you don't risk spawning the offspring in the midle of a burst of shots.

But you have other issues, you create offspring with only 10% of your mass, and then you grow to 1000 body, not considering if you have enough energy to actualy do that. My guess is you don't, so the offspring is killing itself. Growing body costs a lot of energy, always make sure you have enough energy when trying to perform a very high cost opperation. You should also consider eating body when dropping bellow a certain amount of energy.

Other than that the eye look realy wierd... eye5 is your default focus eye and all values you can read about an oponent (refvars) come from that eye, don't shoot at something before checking it out with eye5 first, or shifting your focus eye to see who it is.
You have genes like this one :

cond
*.timerepro *.timer >
*.eye3 50 >
*.memval *67 !=
start
1240 .aimshoot store
-1 .shoot store
*.refvelup .up store
stop

What this gene does is :
If eye3 sees something relatively close and eye5 is looking at an enemy, then make a 360 with the canon, fire a shot and adjust .up according to speed of oponent in eye5.
I suspect that wasn't exactly what you where going for...

I would recommend starting out with a simple eye settup, or steal a simple eye settup. I think excalibur has 4 relatively small genes that can handle the eyes.
Or you can just set eye5width to 300 or so, and only use that eye (It will loose some range, but it makes everything a lot easyer to deal with so you don't clutter your bot with all this eye code that does more harm than good. And the current nr3 F1 bot actualy handles eyes this way )

Also I'd leave the canon position straight ahead to begin with, just turn to face your oponents and shoot regularly.
To track an oponent with eye5 just use *.refxpos *.refypos angle .setaim store

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
This bot kills its babies
« Reply #3 on: April 27, 2009, 12:51:26 PM »
Thank you Moonfisher
I scrapped the eye code and I am using a much more simple eye setup
and I have 2 different bots, 1 that uses sexrepro and 1 that uses normal repro.

Sexual Repro
Code: [Select]
cond
 *.nrg 10000 >
 *.fertilized 0 >
 *.body 2000 >
start
 20 .sexrepro store
stop

Normal Repro
Code: [Select]
cond
 *.nrg 10000 >
 *.body 2000 >
start
 25 .repro store
stop

Thanks Everybody