User flow
- Sign up / login / load the site
- Are you on desktop or mobile?
- Desktop - App downloaded - Move to matchmaking/profile page - Not downloaded - Prompt to download
- Mobile - Move to matchmaking/profile page
- Are you on desktop or mobile?
- Matchmaking/profile page
- Stats
- Random among stats
- Your ranking
- Etc.
- Join game
- Create a party
- Eligible player
- Joined to a voice channel in the Ranked Among Us discord
- A combobox to add users to a party
- Manually type a name
- Dropdown with all friends who are eligible to play
- Eligible player
- Enter matchmaking / "join game"
- Matchmaking algorithm
- Desktop player joins
- Is there a lobby with a free slot?
- Yes
- Join lobby
- No
- Create lobby
- Yes
- Is there a lobby with a free slot?
- Mobile player joins
- Is there a lobby with a free slot?
- Yes
- Join lobby
- No
- Wait for open lobby
- Yes
- Is there a lobby with a free slot?
- Desktop player joins
- Put the people into a game
- Get host into the game
- Show the host "great, you’re matched. Pls join this game code"
- Our bot disconnects
- Show game code to rest of lobby
- Confirm that every user joined
- Wait 2 minutes for everyone to join
- After 2 minutes if the game doesn’t start, we start it
- Get host into the game
- Game ends
- Stats are shown (how long you lasted, etc.)
- We force host to end game
- Stop the host from clicking play
- Everyone exits the game
- They get to sit in Discord for 5m
- There’s play again with same party
- Everyone gets thrown back into matchmaking
- Matchmaking algorithm
- Create a party
- Profile
- Change your among us name
- Switch profile into another Discord account
- Etc.
- Stats
Technical details
- Sign in / sign up
- Pick desktop / mobile
- isDesktop session cookie
- hasDownloadedApp permanent cookie
- Site socket
- Party events
- Client-bound "partyState" event
- Just contains a party document
- If you are solo, members will length 1
- Join party page
- Accept invite button which adds you and redirects to the homepage
- Link has the Part ID included
- Client-bound "partyState" event
- Matchmaking (the all-encompassing) events
- Server-bound "matchStart"
- Client-bound "matchMessage"
- From now "match" can be an abbreviation for matchmaking
- This message just contains messages to display to the user during matchmaking
- In the future we can add more options, for example for interactive things like buttons maybe?
- For now, just contains the message
- Likely messsages
- Please join the "Matchmaking" voice channel in our Discord server.
- Finding games...
- Looking for desktop players... (mobile only)
- Match found! Please join
ABCDEF
in Among Us. - Waiting for host...
- Client-bound "matchPrepHost"
- Countdown length
- Lobby code
- Server-bound "matchReady"
- Represents a game being found
- Contains the game id, client should redirect to the game page
- Game
- Client-bound "gameState" event
- Personal
- Player ID
- Is host
- Is dead
- Is impostor
- Shared
- Game ID
- Host player ID
- Among Us lobby code
- Status (status enum from the game schema)
- Player (array)
- Player ID
- Username
- Color
- Is in game
- Personal
- Client-bound "gameState" event
- Shared
- Client-bound "ready"
- Sent by the server when it's ready for a setup event
- Server-bound "setup"
- Authorizes the user
- The server should respond with one of "error"
- Client-bound "hostLeft"
- This message indicates that the host left, so stats cannot be tracked
- Sent to the host as well, different message should be shown they'll be penalized
- For normal players, it should have a button to remain in-game, and to find a new game
- Client-bound "ready"
- Party events
We'll have to figure out the best way to make this work across reloads, specifically the matchmaking messages.
Database schemas
- Player
- Player ID
- Username
- PP
- Host exits
- Stats
- Impostor wins
- Crewmate wins
- Impostor losses
- Crewmate losses
- Party id (nullable)
- Game id (nullable)
- Party
- Party ID
- Host player ID
- Members (array of player IDs)
- Game
- Game ID
- Among Us lobby code
- Host player ID
- Discord voice channel ID
- Status (enum)
- Lobby
- Playing
- Meeting
- Players (array)
- Player ID
- Is impostor
- Is dead
- Is in game
- Color
- Pending points
- Correct votes
- Incorrect votes
- Kills