Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce lag in monitor bot for Maypole scenario #1244

Merged
merged 1 commit into from
May 5, 2023
Merged

Conversation

kostmo
Copy link
Member

@kostmo kostmo commented May 5, 2023

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 the solution content is the following code:

run "scenarios/Challenges/_maypole/solution.sw"

but would not achieve a win if executed via --run with the solution file:

scripts/play.sh --scenario data/scenarios/Challenges/maypole.yaml --run data/scenarios/Challenges/_maypole/solution.sw

Placing a wait 16 at the beginning of the solution script was enough to fix the --run invocation. Presumably, the overhead of the run command for the player's solution 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, inserting instant 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.

@kostmo kostmo marked this pull request as ready for review May 5, 2023 05:49
@kostmo kostmo requested a review from byorgey May 5, 2023 05:49
@kostmo kostmo added the merge me Trigger the merge process of the Pull request. label May 5, 2023
@kostmo
Copy link
Member Author

kostmo commented May 5, 2023

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented May 5, 2023

refresh

✅ Pull request refreshed

@kostmo kostmo merged commit f4776e2 into main May 5, 2023
6 checks passed
@mergify mergify bot deleted the maypole-monitor-speedup branch May 5, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants