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

feat(web): handles 3d state while replaying #167

Merged
merged 10 commits into from
Sep 25, 2023
Merged

feat(web): handles 3d state while replaying #167

merged 10 commits into from
Sep 25, 2023

Conversation

feugy
Copy link
Owner

@feugy feugy commented Sep 25, 2023

📖 What's in there?

When replaying, especially in a multi-player game, the 3D engine is managing replayed state, and can not provide the latest states for save and new peers.
This PRs introduces simulation engine: a second 3D engine which has no rendering and can handles the latest state while the "real" 3D engine renders the replayed state.

And since the simulation engine applies animations with a duration of 0, it makes tests faster.
Are also included here:

  • fix(server): no redirection to home/lobby closure when owner deletes the current game/lobby.
  • fix(web): peer do not apply host game state on game sync.
  • fix(web): when receiving game or stream update, aside jumps to the player tab.
  • fix(web): peers muted/stopped states are reset when reconnecting to game.
  • feat(web): joins a simulation engine to the real engine, to maintain game state while replaying.
  • feat(server, web): records hand actions in history.
  • refactor(web): binds manager singletons to the 3d engine.

🧪 How to test?

Simulation:

  1. creates a playground game, flip, move and draw several cards, and invite a player

    player A is the host, its history reflects its actions, player B joins with latest state and history

  2. player B performs some actions

    they are displayed in both histories, and both states are equal

  3. player A (the host), enters replay mode

    its state is different from player B

  4. player B performs some actions

    they are displayed in both histories, but player A's state is still in replay

  5. player B leaves the game, and joins a gain

    they show the latest state, and latest history (previously, all actions since host entered replay would be lost).

Lobby deletion by host

  1. player A creates a lobby and invite another player
  2. player B joins the lobby

    they are both in the lobby

  3. player A leaves the lobby and deletes it

    player B's lobby is closed with a tooltip, and the lobby does not appear in game list (previously, player would stay in the deleted lobby).

Game deletion by host

  1. player A creates a game and invite another player
  2. player B joins the game

    they are both in the game

  3. player A leaves the game and deletes it

    player B's is redirected to home with a tooltip, and the game does not appear in game list (previously, player would stay in the deleted game).

Video state

  1. player A creates a game and invite another player, and switch tab to rules/discussion
  2. player B joins the game

    player A's players tab automatically pops, and they both have audio and video on

  3. player B switch tab to rules/discussion
  4. player A (host) mutes and stops video, performs some action

    player B is still on rules/discussion tab, hear no sound, and see latest actions

  5. player B switch to players tabe

    player B sees the "muted" icon and black video for player A

  6. player B reloads the page

    eventually they will see "muted" icon and black video. Streams are effectively stopped (previously state would be reset and streams would be live).

Hand action in history

  1. player A creates a playground and invite another player
  2. player A draws 3 cards, flip one, move them around in hand

    player A's history shows draws, flip and move actions, player B's history only show draws

  3. player B draws 3 cards, flip one, move them around in hand

    player B's history also shows draws, flip and move actions, player A's history only has the new draw

  4. player B replays history

    they will see hand actions replayed as well

@vercel
Copy link

vercel bot commented Sep 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tabulous ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2023 6:49am
tabulous-atelier ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2023 6:49am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant