Skip to main content

GameSave

The Game Save is the data type written to the database at the end of the game. It contains all the information needed to trace the events of a game, and also includes statistics about the game and its players.

Data Type

The data type for GameSave is defined here, and is reproduced below for convenience:

export type GameSave = {
/** the id of the game */
id: string
/** the message history of the game */
messages: Message[]
/** the winning faction of the game */
winningFaction: Faction
/** the winning player numbers of the game */
winningPlayers: number[]
/** the game stats */
stats: GameStats
/** event log of actions taken in the game */
events: GameEventLog
/** the players in the game */
players: {
[playerNumber: string]: {
/** the player's number */
num: number
/** the player's alias */
alias: string
/** the role of the player */
role: Role
/** the faction of the player */
faction: Faction
/** the player's stats */
stats: PlayerStats
}
}
}

Sample Data

{
"events": {
"1": {
"nightActions": {
"2": {
"feedback": {
"message": "You stayed home last night.",
"success": true
}
},
"3": {
"feedback": {
"message": "You successfully hacked 1 of Sheri [1]'s visitors last night.",
"success": true
},
"target": 1
},
"4": {
"feedback": {
"message": "You attacked Sheri [1] last night.",
"success": true
},
"target": 1
},
"5": {
"feedback": {
"message": "You were hacked and could not perform your ability last night.",
"success": false
},
"target": 1
},
"6": {
"feedback": {
"message": "You protected Eadie [4] last night, but they were not attacked.",
"success": false
},
"target": 4
}
}
},
"2": {
"accusedPlayers": {
"6": {
"accusedPlayerNum": 6,
"judgementVotes": {
"2": "pardon",
"3": "execute",
"5": "execute"
},
"result": "execute"
}
},
"deathReveals": {
"0": 1
},
"nightActions": {
"3": {
"feedback": {
"message": "You successfully hacked 1 of Jaquenette [2]'s visitors last night.",
"success": true
},
"target": 2
},
"4": {
"feedback": {
"message": "You attacked Jaquenette [2] last night.",
"success": true
},
"target": 2
},
"5": {
"feedback": {
"message": "You were hacked and could not perform your ability last night.",
"success": false
},
"target": 2
}
}
},
"3": {
"accusedPlayers": {
"5": {
"accusedPlayerNum": 5,
"judgementVotes": {
"3": "execute",
"4": "execute"
},
"result": "execute"
}
},
"deathReveals": {
"0": 2
}
}
},
"id": "AQ37",
"messages": {
"0": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "The game has begun!",
"type": "event",
"visibility": "all"
},
"1": {
"author": {
"alias": "Sheri",
"playerNum": 1
},
"message": "yooooo",
"type": "chat",
"visibility": "all"
},
"2": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "The sun sets...",
"type": "event",
"visibility": "all"
},
"3": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Sheri [1] tonight",
"type": "event",
"visibility": {
"0": 4
}
},
"4": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Sheri [1] tonight",
"type": "event",
"visibility": {
"0": 3
}
},
"5": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Lucie [5] tonight",
"type": "event",
"visibility": {
"0": 1
}
},
"6": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Sheri [1] tonight",
"type": "event",
"visibility": {
"0": 5
}
},
"7": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Eadie [4] tonight",
"type": "event",
"visibility": {
"0": 6
}
},
"8": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You stayed home last night.",
"type": "event",
"visibility": {
"0": 2
}
},
"9": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You successfully hacked 1 of Sheri [1]'s visitors last night.",
"type": "event",
"visibility": {
"0": 3
}
},
"10": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You attacked Sheri [1] last night.",
"type": "event",
"visibility": {
"0": 4
}
},
"11": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You were hacked and could not perform your ability last night.",
"type": "event",
"visibility": {
"0": 5
}
},
"12": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You protected Eadie [4] last night, but they were not attacked.",
"type": "event",
"visibility": {
"0": 6
}
},
"13": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "A new day has begun...",
"type": "event",
"visibility": "all"
},
"14": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Sheri [1] was killed last night.",
"type": "event",
"visibility": "all"
},
"15": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Sheri [1] was a Investigator.",
"type": "event",
"visibility": "all"
},
"16": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Discussion has begun.",
"type": "event",
"visibility": "all"
},
"17": {
"author": {
"alias": "Eadie",
"playerNum": 4
},
"message": "vote 6",
"type": "chat",
"visibility": "all"
},
"18": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Voting has commenced.",
"type": "event",
"visibility": "all"
},
"19": {
"author": {
"alias": "Oralla",
"playerNum": 3
},
"message": "Oralla [3] has voted to accuse Fidela [6]",
"type": "action",
"visibility": "all"
},
"20": {
"author": {
"alias": "Eadie",
"playerNum": 4
},
"message": "Eadie [4] has voted to accuse Fidela [6]",
"type": "action",
"visibility": "all"
},
"21": {
"author": {
"alias": "Jaquenette",
"playerNum": 2
},
"message": "Jaquenette [2] has voted to accuse Fidela [6]",
"type": "action",
"visibility": "all"
},
"22": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Fidela [6] was accused of treason!",
"type": "event",
"visibility": "all"
},
"23": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "The accused may now defend themselves.",
"type": "event",
"visibility": "all"
},
"24": {
"author": {
"alias": "Fidela",
"playerNum": 6
},
"message": "its not me!",
"type": "chat",
"visibility": "all"
},
"25": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "The fate of the accused will now be decided.",
"type": "event",
"visibility": "all"
},
"26": {
"author": {
"alias": "Jaquenette",
"playerNum": 2
},
"message": "Jaquenette [2] has voted to pardon",
"type": "action",
"visibility": "all"
},
"27": {
"author": {
"alias": "Oralla",
"playerNum": 3
},
"message": "Oralla [3] has voted to execute",
"type": "action",
"visibility": "all"
},
"28": {
"author": {
"alias": "Lucie",
"playerNum": 5
},
"message": "Lucie [5] has voted to execute",
"type": "action",
"visibility": "all"
},
"29": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Fidela [6] was executed!",
"type": "event",
"visibility": "all"
},
"30": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Fidela [6] was a Bodyguard.",
"type": "event",
"visibility": "all"
},
"31": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "The sun sets...",
"type": "event",
"visibility": "all"
},
"32": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Jaquenette [2] tonight",
"type": "event",
"visibility": {
"0": 4
}
},
"33": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Jaquenette [2] tonight",
"type": "event",
"visibility": {
"0": 3
}
},
"34": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Oralla [3] tonight",
"type": "event",
"visibility": {
"0": 2
}
},
"35": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You will visit Jaquenette [2] tonight",
"type": "event",
"visibility": {
"0": 5
}
},
"36": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You successfully hacked 1 of Jaquenette [2]'s visitors last night.",
"type": "event",
"visibility": {
"0": 3
}
},
"37": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You attacked Jaquenette [2] last night.",
"type": "event",
"visibility": {
"0": 4
}
},
"38": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "You were hacked and could not perform your ability last night.",
"type": "event",
"visibility": {
"0": 5
}
},
"39": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "A new day has begun...",
"type": "event",
"visibility": "all"
},
"40": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Jaquenette [2] was killed last night.",
"type": "event",
"visibility": "all"
},
"41": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Jaquenette [2] was a Hacker.",
"type": "event",
"visibility": "all"
},
"42": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Discussion has begun.",
"type": "event",
"visibility": "all"
},
"43": {
"author": {
"alias": "Eadie",
"playerNum": 4
},
"message": "gg",
"type": "chat",
"visibility": "all"
},
"44": {
"author": {
"alias": "Oralla",
"playerNum": 3
},
"message": "ez game",
"type": "chat",
"visibility": "all"
},
"45": {
"author": {
"alias": "Lucie",
"playerNum": 5
},
"message": "bruh",
"type": "chat",
"visibility": "all"
},
"46": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Voting has commenced.",
"type": "event",
"visibility": "all"
},
"47": {
"author": {
"alias": "Oralla",
"playerNum": 3
},
"message": "Oralla [3] has voted to accuse Lucie [5]",
"type": "action",
"visibility": "all"
},
"48": {
"author": {
"alias": "Eadie",
"playerNum": 4
},
"message": "Eadie [4] has voted to accuse Lucie [5]",
"type": "action",
"visibility": "all"
},
"49": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Lucie [5] was accused of treason!",
"type": "event",
"visibility": "all"
},
"50": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "The accused may now defend themselves.",
"type": "event",
"visibility": "all"
},
"51": {
"author": {
"alias": "Lucie",
"playerNum": 5
},
"message": "welp",
"type": "chat",
"visibility": "all"
},
"52": {
"author": {
"alias": "Lucie",
"playerNum": 5
},
"message": "i am dead",
"type": "chat",
"visibility": "all"
},
"53": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "The fate of the accused will now be decided.",
"type": "event",
"visibility": "all"
},
"54": {
"author": {
"alias": "Eadie",
"playerNum": 4
},
"message": "correct",
"type": "chat",
"visibility": "all"
},
"55": {
"author": {
"alias": "Eadie",
"playerNum": 4
},
"message": "Eadie [4] has voted to execute",
"type": "action",
"visibility": "all"
},
"56": {
"author": {
"alias": "Oralla",
"playerNum": 3
},
"message": "Oralla [3] has voted to execute",
"type": "action",
"visibility": "all"
},
"57": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Lucie [5] was executed!",
"type": "event",
"visibility": "all"
},
"58": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Lucie [5] was a Physician.",
"type": "event",
"visibility": "all"
},
"59": {
"author": {
"alias": "Game",
"playerNum": 0
},
"message": "Discord has won the game!\nThe winners are: Oralla [3] (Nullifier), Eadie [4] (Assassin)",
"type": "event",
"visibility": "all"
}
},
"players": {
"1": {
"alias": "Sheri",
"faction": "harmony",
"num": 1,
"role": "investigator",
"stats": {
"death": {
"day": 1,
"time": "night"
},
"nightActions": {
"0": {
"day": 1,
"target": 5
}
},
"numKills": 0,
"numTrials": 0
}
},
"2": {
"alias": "Jaquenette",
"faction": "harmony",
"num": 2,
"role": "hacker",
"stats": {
"accusationVotes": {
"0": {
"day": 2,
"playerNum": 6
}
},
"death": {
"day": 2,
"time": "night"
},
"judgementVotes": {
"0": {
"day": 2,
"playerNum": 6,
"vote": "pardon"
}
},
"nightActions": {
"0": {
"day": 1
},
"1": {
"day": 2,
"target": 3
}
},
"numKills": 0,
"numTrials": 0
}
},
"3": {
"alias": "Oralla",
"faction": "discord",
"num": 3,
"role": "nullifier",
"stats": {
"accusationVotes": {
"0": {
"day": 2,
"playerNum": 6
},
"1": {
"day": 3,
"playerNum": 5
}
},
"judgementVotes": {
"0": {
"day": 2,
"playerNum": 6,
"vote": "execute"
},
"1": {
"day": 3,
"playerNum": 5,
"vote": "execute"
}
},
"nightActions": {
"0": {
"day": 1,
"target": 1
},
"1": {
"day": 2,
"target": 2
}
},
"numKills": 0,
"numTrials": 0
}
},
"4": {
"alias": "Eadie",
"faction": "discord",
"num": 4,
"role": "assassin",
"stats": {
"accusationVotes": {
"0": {
"day": 2,
"playerNum": 6
},
"1": {
"day": 3,
"playerNum": 5
}
},
"judgementVotes": {
"0": {
"day": 2,
"playerNum": 6
},
"1": {
"day": 3,
"playerNum": 5,
"vote": "execute"
}
},
"nightActions": {
"0": {
"day": 1,
"target": 1
},
"1": {
"day": 2,
"target": 2
}
},
"numKills": 2,
"numTrials": 0
}
},
"5": {
"alias": "Lucie",
"faction": "harmony",
"num": 5,
"role": "physician",
"stats": {
"death": {
"day": 3,
"time": "day"
},
"judgementVotes": {
"0": {
"day": 2,
"playerNum": 6,
"vote": "execute"
},
"1": {
"day": 3,
"playerNum": 5
}
},
"nightActions": {
"0": {
"day": 1,
"target": 1
},
"1": {
"day": 2,
"target": 2
}
},
"numKills": 0,
"numTrials": 1
}
},
"6": {
"alias": "Fidela",
"faction": "harmony",
"num": 6,
"role": "bodyguard",
"stats": {
"death": {
"day": 2,
"time": "day"
},
"judgementVotes": {
"0": {
"day": 2,
"playerNum": 6
}
},
"nightActions": {
"0": {
"day": 1,
"target": 4
}
},
"numKills": 0,
"numTrials": 1
}
}
},
"stats": {
"numAlive": {
"discord": 2,
"harmony": 0,
"neutral": 0
},
"numDayDeaths": {
"discord": 0,
"harmony": 2,
"neutral": 0
},
"numDays": 3,
"numDead": {
"discord": 0,
"harmony": 4,
"neutral": 0
},
"numNightDeaths": {
"discord": 0,
"harmony": 2,
"neutral": 0
},
"numPlayers": {
"discord": 2,
"harmony": 4,
"neutral": 0
}
},
"transcript": "[Game] The game has begun!\nSheri [1]: yooooo\n[Game] The sun sets...\n[Game] Sheri [1] visited Lucie [5] last night\n[Game] Jaquenette [2] stayed home last night\n[Game] Oralla [3] visited Sheri [1] last night\n[Game] Eadie [4] visited Sheri [1] last night\n[Game] Lucie [5] visited Sheri [1] last night\n[Game] Fidela [6] visited Eadie [4] last night\n[Game] A new day has begun...\n[Game] Sheri [1] was killed last night.\n[Game] Sheri [1] was a Investigator.\n[Game] Discussion has begun.\nEadie [4]: vote 6\n[Game] Voting has commenced.\n[Game] Oralla [3] has voted to accuse Fidela [6]\n[Game] Eadie [4] has voted to accuse Fidela [6]\n[Game] Jaquenette [2] has voted to accuse Fidela [6]\n[Game] Fidela [6] was accused of treason!\n[Game] The accused may now defend themselves.\nFidela [6]: its not me!\n[Game] The fate of the accused will now be decided.\n[Game] Jaquenette [2] has voted to pardon\n[Game] Oralla [3] has voted to execute\n[Game] Lucie [5] has voted to execute\n[Game] Fidela [6] was executed!\n[Game] Fidela [6] was a Bodyguard.\n[Game] The sun sets...\n[Game] Jaquenette [2] visited Oralla [3] last night\n[Game] Oralla [3] visited Jaquenette [2] last night\n[Game] Eadie [4] visited Jaquenette [2] last night\n[Game] Lucie [5] visited Jaquenette [2] last night\n[Game] A new day has begun...\n[Game] Jaquenette [2] was killed last night.\n[Game] Jaquenette [2] was a Hacker.\n[Game] Discussion has begun.\nEadie [4]: gg\nOralla [3]: ez game\nLucie [5]: bruh\n[Game] Voting has commenced.\n[Game] Oralla [3] has voted to accuse Lucie [5]\n[Game] Eadie [4] has voted to accuse Lucie [5]\n[Game] Lucie [5] was accused of treason!\n[Game] The accused may now defend themselves.\nLucie [5]: welp\nLucie [5]: i am dead\n[Game] The fate of the accused will now be decided.\nEadie [4]: correct\n[Game] Eadie [4] has voted to execute\n[Game] Oralla [3] has voted to execute\n[Game] Lucie [5] was executed!\n[Game] Lucie [5] was a Physician.\n[Game] Discord has won the game!\nThe winners are: Oralla [3] (Nullifier), Eadie [4] (Assassin)\n",
"winningFaction": "discord",
"winningPlayers": {
"0": 3,
"1": 4
}
}