Oh I absolutely love it!
I am not quite with you on terminology here. What precisely do you mean by
Program executes then returns memory block to robot
?
There is no return to memory after execution. A lot of values (all commands at least) are wiped as soon as they are executed and no values are ever added to memory locations either during or after execution. (one or two exceptions but not as a rule)
This is how it all works.....
(try it this way instead of with ASCII)
- ALL memory manipulation takes place right at the start when the DNA code is parsed in a sequential order through the genome.
- eyecells and other senses are updated. (actually happens from the start of the main loop but it makes more sense to show it here)
- memory values are stored into the console output (stored as a seperate block representing all memory locations at the start of the main cycle) as they are assigned. Nothing has been acted on yet.
- Now that the memory block has been modified for all actions specifically defined in the DNA (stuff like loading -1 into .shoot), the entire memory block for all robots is handed over to the main loop.
- Main loop consists of several steps which are each carried out for all robots before moving on to the next step.
- These steps consist of. (not necessarily in exactly this order
- updating tie comunications
- updating other tie stuff
- updating shot positions
- shot collisions
- updating robot positions
- collisions
- console displayed here!
- Drawing robots
- drawing shots
- several others
[/b]
That is it in a nutshell.
Just remember that nothing happens to the memory block after initial DNA parsing except for updating eye positions, and this still happens
before displaying the data in the console.
Basically, if you look at a robot in the console and check its eyes, you get a readback of everything it can see
in its present screen position ie. it hasn't moved yet in response to the impulses from the DNA.
Let's say you have a gene that will turn your robot 150 points left (150 .aimsx store) if eye 7 is greater than 15.
You can actually see from the console that eye7 = 28
when you press the button to move it forward one cycle, the robot will be seen to rotate left by a value of 150.
Actually I may have been a little misleading here. It isn't so much that the memory block hasn't been processed yet as that nothing on the screen has actually been updated so it just
looks like it hasn't been.