Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Game Options

Edward Smale edited this page Oct 24, 2020 · 3 revisions

A Game Options structure contains specific details about settings for a game being hosted. The structure has a constant length, although has changed over versions of the game.

Base game options

Name Type Description
Length packed int The length of the following structure, not including this.
Version byte The version of the game options, changes have been made over the last versions as detailed below.
Max players uint8 The maximum number of players allowed in this game. The server rejects any host game requests if this value is below 0 or over 10.
Language uint32 The language of the game, as described in the language enum.
Map ID byte The map to play, as described in the map enum.
Player speed float The speed of the players, can be negative.
Crewmate vision float The vision factor for the crewmates.
Imposter vision float The vision factor for the imposters.
Kill cooldown float The cooldown required to wait between each kill for each imposter.
Common tasks uint8 The number of common tasks required to complete for each crewmate.
Long tasks uint8 The number of long tasks required to complete for each crewmate.
Short tasks uint8 The number of short tasks required to complete for each crewmate.
Emergencies int32 The number of emergencies that each crewmate can call.
Imposter count uint8 The number of players to be made imposter each game.
Kill distance byte The max distance for killing a crewmate as an imposter, as described in the distance enum.
Discussion time int32 The number of seconds that crewmates have to discuss before voting.
Voting time int32 The number of seconds that crewmates have to vote to kick the imposters out.
Is Default? bool Whether or not the settings listed are the default recommended settings

Specific versions

Version 1+ game options

Name Type Description
Emergency cooldown uint8 The cooldown required to wait between each emergency meeting.

Version 2+ game options

Name Type Description
Confirm ejects bool Whether or not ejections from the ship are confirmed as crewmate or imposter.
Visual tasks bool Whether or not tasks that have them should show visual effects to other players.

Version 3+ game options.

Name Type Description
Anonymous voting bool Whether or not ejections from the ship are confirmed as crewmate or imposter.
Task bar updates uint8 When the task bar should update, as described in the Task bar updates enum.

Example parsing code

const options = {};
options.length = reader.packed();
options.version = reader.byte();
options.maxPlayers = reader.uint8();
options.language = reader.uint32LE();
options.mapID = reader.byte();
options.playerSpeed = reader.floatLE();
options.crewVision = reader.floatLE();
options.imposterVision = reader.floatLE();
options.killCooldown = reader.floatLE();
options.commonTasks = reader.uint8();
options.longTasks = reader.uint8();
options.shortTasks = reader.uint8();
options.emergencies = reader.int32LE();
options.imposterCount = reader.uint8();
options.killDistance = reader.byte();
options.discussionTime = reader.int32LE();
options.votingTime = reader.int32LE();
options.isDefault = reader.bool();

if (options.version === 1 || options.version === 2 || options.version === 3) {
    options.emergencyCooldown = reader.uint8();
}

if (options.version === 2 || options.version === 3) {
    options.confirmEjects = reader.bool();
    options.visualTasks = reader.bool();
}

if (options.version === 3) {
    options.anonymousVoting = reader.bool();
    options.taskBarUpdates = reader.uint8();
}
Clone this wiki locally