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

Show the panels and goal dialog at game start #2081

Closed
xsebek opened this issue Jul 28, 2024 · 1 comment · Fixed by #2095
Closed

Show the panels and goal dialog at game start #2081

xsebek opened this issue Jul 28, 2024 · 1 comment · Fixed by #2095
Labels
Bug The observed behaviour is incorrect or unexpected.

Comments

@xsebek
Copy link
Member

xsebek commented Jul 28, 2024

Describe the bug

[Starting the game paused] gets to a really strange state where the side panels are empty, and the goal is not yet shown, but REPL works.

This is because the Inventory and Info panels update on Frame events, which causes this strange behavior.

I had to deal with this when I was integrating Swarm with Termite, because I forgot to spawn a thread which sends Frame events.

@noyahor in #2076 (comment)

To Reproduce

Run the game with --paused from #2080 and observe the game dialog showing up after one tick.

Alternatively, try running the move tutorial - this may require more retries.

Expected behavior

The UI should always be fully functional at the game start and not wait for events or robots to finish.

This is especially important with the goal dialog, as the player needs to know what to do in the scenario, and a long pause loading the robots would be confusing. This was noted by @byorgey in #2064 (comment).

Screenshots
351126876-fcbbff0e-d131-4dea-98f8-e3a4ff90ced2-2

@xsebek xsebek added the Bug The observed behaviour is incorrect or unexpected. label Jul 28, 2024
@byorgey
Copy link
Member

byorgey commented Jul 28, 2024

I think I understand why this happens. The updateUI function does a whole lot of stuff, including calling doGoalUpdates which is responsible for setting the proper modal. However, updateUI is not called when the game is paused. Perhaps the solution is to split updateUI into two functions, one that should always be called on every frame event and one that should only be called if we just ran the game for some ticks?

xsebek added a commit that referenced this issue Aug 4, 2024
* update UI even when paused
* send frame events earlier

* closes #2081
@mergify mergify bot closed this as completed in #2095 Aug 6, 2024
@mergify mergify bot closed this as completed in fe5fdf1 Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The observed behaviour is incorrect or unexpected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants