Will onRobotDeath event miss due to skipped turns?
From Talk:Robocode
Jump to navigation
Jump to search
Revision as of 30 December 2017 at 04:07.
The highlighted comment was edited in this revision. [diff]
The highlighted comment was edited in this revision. [diff]
onRobotDeath is crucial when dealing with multiple enemies. If this event were able to lost, it will be hard to guess that information back.
- If I understood correctly skipped turns happen when the bots passes the time limit. I think, after this event no actions are made(setAhead( ), setFire( etc.) and no events are called after it. I am 99 percent sure that if you call onRobotDeath first no skipped turns will harm it.
- Even if it stopped everything you did by not updating the robot, static variables wouldn't change.
Dsekercioglu (talk)
I think all events (except the skip turn event) are lost when robocode punishes for long CPU use. I have no source confirmation for it. But I quite sure that event of enemy death can be lost. I recall adding a special check of enemy not being scanned for something like 10 tics to put it into the dead enemy category because, because I was occasionally missing the death event during the run. I also think you might even miss your own death event. I have a code which suppose to print some stats at such event, and I see that sometimes the output is not produced.