Code center > Darwinbots Program Source Code

Eyes in DB!?

<< < (2/6) > >>

Ulciscor:
Just out of interest what value is returned the first time it reads an .eye address? 0?

PurpleYouko:
The first time it reads it (at age 1) it is pretty much always facing its parent so the number in eye5 is quite high. In versions prior to 2.35 this was extremely predictable and read exactly 77 every time.
In the newer versions the eyes have been somewhat overhauled so I am not sure what is returned now. Try running a sim frame by frame till a robot gives birth then switch to the baby and check its eyes at age 0 and 1. I haven't done this with the new version yet.
In the upcoming 2.4 it is going to be almost impossible to predict since the robot sizes will vary much more dramatically.

Greven:
I have tested what PY suggested serveral times, and I got 150 and/or 155 at age 0, with the simplebot2. Then it rotates and then nothing in eye5.

Ulciscor:
I think I meant what value is returned when the bot tries to get the value when the address hasn't been "activated" yet. Like when it tries to access an .eye address for the first time, a flag is set, but is a value still returned?

PurpleYouko:
At age zero it will (or should) return zero since the eyes array has yet to be populated.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version