The next possibility is that the player's cycle is atomic. This way of managing players' CPU usage is vulnerable to abuse by infinite loops, and I'm almost certain that this is not the behaviour of Screeps. Main body of loop goes here, and possibly uses skippedTicks to try to do SkippedTicks = Game.time - Memory.time - 1 This can easily be achieved using code like this: = function() CPU limit robust code isn't strictly necessary in this case, but it would still be useful to detect when the player's cycle is skipped and possibly start doing things more efficiently. The player's cycle is never interrupted.Īt one extreme, the player's memory deserialize, main script execution, and memory re-serialize are never interrupted, and exceeding the CPU limit simply means that the player's cycle will be skipped on subsequent ticks until the CPU debt is repaid. I've considered the following four possibilities: 1. In Screeps, each player's usage of CPU is limited, but the documentation for this feature doesn't make the way this is enforced sufficiently clear for writing CPU limit robust code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |