Saturday, January 14, 2017

Getting Bit by Bytecode

Bytecode Bites Back

If you go over your limit for any given bot you freeze, and continue the next round where you left off. So it's not as bad for you as last year when you blew up, but the lag could get them killed or effect your overall team logic.

Hitting Limits Strategically

The key this year is to make sure you are aware of hitting bytecode limits and using it to your advantage.

You may want to purposely allow a bot to take several rounds to process something. If it is important and you need the results of the processing and aren't too worried about the bot dying while it crunches it out. In that case, why not. If you are doing it intentionally then go for it, but use it sparingly of course.

On the other hand, when it is happening by mistake you need to try and recover gracefully. If you can manage to detect that you have gone over bytecode limits then you need to consider if it is better to continue the code from where you left off (which is what will happen if you don't do anything) or more than likely the case, you need to scrap that and start back over as if it was a new round... because dude, it is a new round.

Something to think about is catching that you hit the limit and kicking your logic back to the start of the bot's round loop.