Bots and Simulations > DNA - General
Tie question (2.4A)
EricL:
If I sucessfully shoot a tie during the execution of my DNA on cycle n, should *.numties and the *.tref sysvars be updated and able to figure into cond statements during the n+1 cycle?
I'm seeing behaviour in 2.4A where I shoot a tie, it suceeds, but *.numties, etc. don't get updated in time to be used in the following cycle. They update for the n+2 cycle. This makes my tie shooting gene which is conditional on numties fire twice.
Looking through the code, I see that FireTies() is called pretty late in the cycle, after readtie(), which updates the tref sysvars and Update_Ties(), which updartes .numties. So, at the end of a cycle, new ties may have been sucessfully created during that cycle, but that information is not yet reflected in the bot's memory arrays.
Then, on the next cycle, ExecRobs() (which executes the robot DNA and evaluates the gene cond statements) is called pretty early, before readtie and Update_Ties get a chance to update the bot's memory with the tie results of the previous cycle. This means that it takes 2 cycles before .numties, etc. read correctly.
Bug?
-E
Numsgil:
The order of operations for what robots update when is very particular. If it's out of orer that are a whole slew of possible problems that could develop.
So while it would be nice to have the tie available immediatly, moving the order around so that happens could seriously break something else. Or not. But the potential for problems exist.
EricL:
Understood, but did this change in 2.4 or has it always been this way? I.e. have people been coding their bots knowing that ties take a few cycles to form, knowing they can't rely on .numties, etc. the cycle after they fire a tie or is this delayed reaction a new thing?
Numsgil:
Check to see if it does the same thing in 2.37. I don't think I even touched ties in 2.4, but I could be wrong.
EricL:
What, you mean do some actual work? But asking random questions of the cloud is just so much easier...
2.37.6 exhibits the same behaviour I.e. fire a tie in cycle n and numties and all the tref sysvars arn't available to the bot until the n+2 cycle.
I won't try to do anything about this in 2.4.
Navigation
[0] Message Index
[#] Next page
Go to full version