User reconnection possible (3 times, the game is paused, if >3 reconnects, the other player wins)
Error handling and checking
Two different sockets
Matchmaking Socket (Handles all matchmaking and tournament related messages.
Should always be open.
Match Socket (Handles only match related messages, like sending positions from the backend
or sending player input from the frontend.
Gameplay features
Ball speed increases over time
Paddle ball collision determines bounce direction
Ball resets after a goal
It's Pong ...
Local match
Two players on one keyboard
Player one keys: W + S
Player two keys: O + L
Will not be tracked in database
Frontend gets an information (is_local_match), so it can handle the names and what not
Will also be calculated in backend
Matchmaking queue
A user can join the matchmaking queue and will be matched with the next user in the
in the queue.
Tournaments
Round Robin
Size is currently limited to 12. (Could be changed to any size)
Is kind of lame because player 1 will play every match against every other user first.
After that the other players play. (So it's not nice for big tournaments, because the waiting time sucks)
Only one match is played at a time and only the playing users can see anything (also lame)
Message API
The documented socket API can be found in backend/static/websocket_messages.yaml.
Every API call is written there and is automatically checked with pydantic in the backend.
For testing, I used Firefox with the Firefox Multi-Account Containers, so I could easily log in multiple users in one browser.
Open localhost/pong to test local and matchmaking queue matches
open localhost/pong/tournament to test tournaments
Important notes
A user can only be registered for one thing at a time.
A user cannot register if he is playing or registered somewhere else.
The backend will send a message to the frontend if something is wrong.
Always check the console or websocket log to see if everything is working.
The test frontend is just for testing the bare minimum and will not display any information it receives.
that it receives (this should be implemented by Wayne).
There are several monitors and timers that decide what happens when
one or both players fail to connect, disconnect or reconnect. So the game should
should always end and save something to the database (except for local matches)
Tons of error handling and async magic ...
What to test
Try to brick the server.
In the past, some bugs have bricked the server or the games, so that a user couldn't play anymore because he was
in a running game. (Just look at the server console output if something hangs or is weird)
I hope I fixed everything (as always)
Overview
Key Features
Gameplay features
Local match
Matchmaking queue
Tournaments
Message API
How to test
For testing, I used Firefox with the Firefox Multi-Account Containers, so I could easily log in multiple users in one browser.
Important notes
What to test