Feat/407 multiplayer puzzle sessions - #429
Merged
Mkalbani merged 2 commits intoAug 25, 2026
Merged
Conversation
|
@mijinummi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[FEAT] Multiplayer Puzzle Solving Sessions
Summary
Implements real-time multiplayer puzzle-solving sessions for the quest service, allowing multiple players to collaborate on the same puzzle with synchronized state, player presence tracking, session persistence, timeout handling, and partial solution tracking.
The implementation introduces a WebSocket-driven session architecture designed to keep puzzle state consistent across connected players while gracefully handling joins, leaves, disconnects, and session expiration.
What Changed
🎮 Multiplayer Session Architecture
Introduced a dedicated multiplayer session lifecycle for collaborative puzzle solving:
Sessions provide an isolated environment where multiple players can work on the same puzzle simultaneously.
⚡ Real-Time WebSocket Synchronization
👥 Player Join & Leave Management
Implemented player presence management for:
Player membership is kept synchronized with the session lifecycle.
🧩 Collaborative Puzzle Solving
Players can contribute to the same puzzle simultaneously.
The backend tracks collaborative actions and synchronizes relevant changes across the session:
This allows participants to see progress made by other players without requiring manual refreshes.
💾 Session Persistence
Added persistent session state so multiplayer sessions are not dependent entirely on in-memory WebSocket state.
Persisted information includes the relevant session metadata, player participation, puzzle progress, and solution state required to recover or inspect a session.
⏱️ Timeout Handling
Added session timeout handling for inactive or abandoned sessions.
Expired sessions are detected and transitioned out of the active state rather than remaining indefinitely in the multiplayer session store.
This prevents stale sessions from consuming resources.
🧠 Partial Solution Tracking
The game engine now tracks partial progress toward a puzzle solution.
This allows collaborative sessions to maintain intermediate progress rather than treating the puzzle as only:
Instead, player contributions can progressively update the shared solution state until the puzzle is completed.
📊 Session Analytics
Added session-level analytics to provide visibility into multiplayer activity, including relevant participation and session lifecycle metrics.
This provides a foundation for measuring collaboration patterns, completion rates, player activity, and session performance.
Disconnect & Recovery Behaviour
The session handles unexpected player disconnections without terminating the entire puzzle session:
A single player's connection failure therefore does not cause the shared puzzle state to be lost.
Performance & Scalability
The WebSocket architecture is designed to support multiplayer sessions with 10+ concurrent players while limiting state updates to the relevant session participants.
Session-scoped broadcasting avoids unnecessarily sending puzzle updates to unrelated connections.
Testing
Added comprehensive coverage for:
Acceptance Criteria
Result
The quest service now supports real-time collaborative puzzle-solving sessions, allowing multiple players to work together with synchronized state, resilient connection handling, persistent progress, session timeouts, and multiplayer analytics.
The implementation provides the foundation for scalable cooperative gameplay while ensuring that player disconnects do not compromise the shared puzzle session.
Closes #410
Closes #409
Closes #407
Closes #411