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

Pause the game on objective completion #2073

Closed
xsebek opened this issue Jul 22, 2024 · 8 comments · Fixed by #2096
Closed

Pause the game on objective completion #2073

xsebek opened this issue Jul 22, 2024 · 8 comments · Fixed by #2096
Labels
G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. Z-Feature A new feature to be added to the game. Z-User Experience This issue seeks to make the game more enjoyable to play.

Comments

@xsebek
Copy link
Member

xsebek commented Jul 22, 2024

Is your feature request related to a problem? Please describe.

When an objective is completed, the game can keep running until the modal is shown.

In an extreme case, --scenario Tutorials/move --autoplay finishes the tutorial before the next modal pops up.

Describe the solution you'd like

Pause the game after objective completion and do not run further ticks.

@xsebek xsebek added Z-User Experience This issue seeks to make the game more enjoyable to play. Z-Feature A new feature to be added to the game. G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. labels Jul 22, 2024
@byorgey
Copy link
Member

byorgey commented Jul 22, 2024

Do objective modals pop up at all with --autoplay?

@xsebek
Copy link
Member Author

xsebek commented Jul 22, 2024

Yes, they do. I do not think that is wrong, since you might want to know how the solution is progressing.

@byorgey
Copy link
Member

byorgey commented Jul 22, 2024

Hmm, when I run --scenario Tutorials/farming --autoplay I do not get any goal modals popping up, and that one takes long enough that I do not think it is because of a race condition.

@xsebek
Copy link
Member Author

xsebek commented Jul 22, 2024

I do get the goal modal at start and after it farms 256 lambdas:
Screenshot 2024-07-22 at 17 12 17

@byorgey
Copy link
Member

byorgey commented Jul 22, 2024

Ah! I get goal modals only when --cheat is enabled. Without --cheat there are no goal modals.

@xsebek
Copy link
Member Author

xsebek commented Jul 22, 2024

Cheat does too many things. I can't even find the code that uses checks cheat for this option among the myriad cheat uses.

The only thing I found is:

suppressHidden =
if isCheating
then id
else filter $ not . view objectiveHidden

@xsebek
Copy link
Member Author

xsebek commented Jul 29, 2024

@byorgey I remembered a quick way to test if this is --autoplay specific:

cabal run swarm -- --scenario Tutorials/move --run <(yq '.solution' scenarios/Tutorials/move.yaml)

The game becomes unresponsive while it tries to catch up and then shows the goal modal after completion.

So, to answer your question in #2080 (comment):

For example, the game may run for several ticks during a single frame, but if an objective is completed during one of those ticks, the game needs to immediately auto-pause without waiting for the UI to tell it that it should do so, which could come several ticks late. (Actually I am unsure whether the game currently does this correctly or not.)

It does not. 😅

@xsebek
Copy link
Member Author

xsebek commented Aug 4, 2024

In #2094 I moved the --cheat behaviour to --debug=autoplay_goals.

That does not solve this Issue though - game should switch to AutoPause upon objective completion, unless the player does not want to interact with the game. Personally I would prefer a separate flag for no goal dialogs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. Z-Feature A new feature to be added to the game. Z-User Experience This issue seeks to make the game more enjoyable to play.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants