reduce lag in monitor bot for Maypole scenario #1244
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I was testing #1010, I observed that the
maypole.yaml
scenario (#1158) would reach the "won" condition if launched from the command line via--autoplay
, for which thesolution
content is the following code:but would not achieve a win if executed via
--run
with the solution file:Placing a
wait 16
at the beginning of the solution script was enough to fix the--run
invocation. Presumably, the overhead of therun
command for the player'ssolution
code had previously given the system robot enough of a head start in counting the player's loops to reach the goal count.Ultimately, instead of placing a delay in the solution, I sped up the system robot with an
instant
command (#1231). However, insertinginstant
requires some care; it can cause the game to freeze if it gets tangled with a recursion.Perhaps a better solution in the long term would be to have some way to make system robots (in particular, invisible "judge" robots) execute all commands in zero ticks. This should not be the default for all system robots, especially those that are not
invisible
; sometimes we prefer that their commands have finite duration to interact plausibly with the player.