Author Topic: Help with something else  (Read 5319 times)

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Help with something else
« on: December 12, 2009, 09:19:33 PM »
Code: [Select]
'Treebot v0.1 - Not working perfectly yet.

def available 101
def parentbot 102
def canfix 103
def recordtime 104
def timerepro 105
def typelook 106
def type 971
def first 972
def parentx 973
def parenty 974
def mytree 975
def bot 956

'(type)- 5 = trunk
'        4 = major branch
'        3 = minor branch
'        2 = branch
'        1 = leaf
'        0 = seed

cond
  *.robage 0 =
start
  1000 rnd .mytree store
  *.thisgene .delgene store
  6 .type store
stop

'2
cond
  *.robage 35 =
start
  1000 rnd .bot store
  *.type 1 add .typelook store
stop

'3
cond
  *.robage 31 =
start
  *.bot .parentbot store
stop

'4
cond
  *.robage 1 =
start
  *.type 1 sub .type store
'  -436 .eye9dir store
'  -327 .eye8dir store
'  -218 .eye7dir store
'  -109 .eye6dir store
'  109 .eye4dir store
'  218 .eye3dir store
'  327 .eye2dir store
'  436 .eye1dir store
'  109 .eye1width store
'  109 .eye2width store
'  109 .eye3width store
'  109 .eye4width store
'  109 .eye5width store
'  109 .eye6width store
'  109 .eye7width store
'  109 .eye8width store
' 109 .eye9width store
  *.type 4 sub .fixpos store
stop

'5
cond
  *.multi 0 =
  *.robage 20 >
  *.in1 *.typelook =
  *.in2 0 =
  *.eye5 50 >
  *.in3 *.mytree =
  *.in4 *.parentbot =
start
  1 .tie store
stop

'6
cond
  *.numties 0 =
  *.type 5 !=
start
  0 .fixpos store
stop

'7
start
  *.type .out1 store
  *.mytree .out3 store
  *.bot .out4 store
stop

'8
cond
  *.numties 0 =
start
  0 .recordtime store
  0 .canrepro store
stop
  
'9
cond
  *.multi 1 =
start
  *.tiepres .tienum store
  *.type 20 mult 10 sub .sharenrg store
  *.type 150 mult .fixlen store
'  628 .fixang store
  100 .stifftie store
  314 .setaim store
  100 .up store
stop

'10
cond
  *.multi 1 =
  *.recordtime 0 =
start
  *.robage .canrepro store
  1 .recordtime store
stop

'11
cond
  *.multi 1 =
  *.canfix 300 add *.robage <=
start
  1 .fixpos store
stop

'12
cond
  *.numties 5 >=
start
  1 .out2 store
stop

'13
cond
  *.type 5 =
  *.multi 1 = or
  *.canfix 300 add *.robage <=
  *.timerepro 2 <
  *.type 1000 mult *.nrg <
  *.type 100 mult *.body <
start
  *.xpos .parentx store
  *.ypos .parenty store
  314 .aimsx store
  *.type 10 mult 20 sub .repro store
  .timerepro inc
stop

'14
comd
  *.multi 0 =
  *.type 5 !=
start
  *.parentx *.parenty angle .setaim store
  15 .up store
stop

'15
cond
  *.type 1000 mult *.nrg >
  *.type 100 mult *.body <
start
  100 .fdbody store
stop

'16
cond
  *.type 1000 mult *.nrg <
  *.type 100 mult *.body >
start
  100 .strbody store
stop
end
The problem is with copying what is in .bot to .parentbot(the line where it says that it isnt working):
Code: [Select]
'3
cond
  *.robage 31 =
start
  *.bot .parentbot store
stop
. I have tried loads of things to fix it but they are not working.

I have added the sim options I am using to run the bot.
« Last Edit: December 13, 2009, 06:02:46 AM by Panda »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Help with something else
« Reply #1 on: December 13, 2009, 06:13:35 AM »
Doesn't seem like that line would be the problem...
Are you aware that racial mem starts at 971 and the bot var is defined to 956 ?
Since you give it a value at age 35, but transfer the value at age 31... I'm asuming it was suposed to be inherited...
Also you should be aware that loc 976 isn't transfered immediatly, and not at all if you break the birth tie right away.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Help with something else
« Reply #2 on: December 13, 2009, 06:47:02 AM »
How long will it take for it to copy then

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Help with something else
« Reply #3 on: December 13, 2009, 07:02:11 AM »
I'm not sure, but I think the last 15 values are copyed one cycle at the time over 15 cycles. Probably starting with 976...
You can also pack more information into one var if you like.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Help with something else
« Reply #4 on: December 13, 2009, 08:13:52 AM »
I realised one of my defined values wasnt being used so I swapped it with that one

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Help with something else
« Reply #5 on: December 13, 2009, 08:47:33 AM »
If you want to avoid the issue of birth ties breaking before all data is transfered, you can just cram more information into each of the first 5 that are transfered immediatly.
Vars go up to 32000 as far as I know, leaving 15 bits of space. So if you have values that take up half that space you can pack the values into the same var using the | and & operators.
Ofcourse values up to 1000 will use op 10 bits I think, so you may have to break up data into smaller fragments to fit them... gets harder to keep track of.
But, looks like the "first" var (972) is never used... so...

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Help with something else
« Reply #6 on: December 13, 2009, 11:27:03 AM »
That is the one I moved it for but the bot still isnt working, I am away from my pc so when I get bac home I will show the code again just in case something isnt right for it, I will alos wexpain what each of the genes have to do

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Help with something else
« Reply #7 on: December 13, 2009, 01:17:02 PM »
Well, the value from bot should get transfered to parentbot at age 31, so that may not be whats causing the problem.
Maybe if you explain what the overall problem is with the bots behavior...
One thing I noticed is that "type" is set to 6 at age 0, then to 5 at age 1... and never changed since...
So basicaly instead of checking the type you could just check robage. But I'm thinking maybe this wasn't how it was suposed to work...
« Last Edit: December 13, 2009, 01:18:12 PM by Moonfisher »

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Help with something else
« Reply #8 on: December 13, 2009, 03:18:36 PM »
.type is passed down the generations, it is so the bot knows how much energy to share at, ect, ect...
I dont think that is a problem in the code. I have also just realised I can use "dec" instead of "*.type 1 sub .type store" The idea is that it gets decreased by 1 when the bot has just been born  . I find going throught he code with somebody helps me debug the code but I dont have anybody to do it with at the mo
« Last Edit: December 13, 2009, 03:45:16 PM by Panda »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Help with something else
« Reply #9 on: December 14, 2009, 11:47:12 AM »
Yeah, forgot you deleted the first gene, so type should work. And yes dec is another way of decrementing, and with F1 settings it costs the same as a condition rather than a store (So it's cheaper).
But the other line should work too... bot should get moved to parentbot as the line says. I can't see any reason why that line wouldn't work once you fixed the mem location...
What exactly is the problem with the behavior of the bot ?
You could try to cycle through it while observing memmory or using the console to check the values being handeled. It's hard to come up with any other advice without knowing what the issue is since the gene you're mentioning looks like it should work as intended.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Help with something else
« Reply #10 on: December 14, 2009, 12:23:28 PM »
It now works alright, it was just a few minor hiccups in the code that I had to iron out.
There is another problem though. The seeds dont de-attach and start new tree's in the latest code and the bots attach backwards down the branches twice a lot.