Skip to content

Skybox-Technologies/csgo-ai-competition

Repository files navigation

CSGO.ai competition

This repository contains documentation and some tools for the CSGO.ai challenge.

By participating in the CSGO.ai challenge you agree to the terms and conditions of the challenge, which can be found in terms.pdf.

Submission info can be found here.

Dataset

The initial data set consists of ~500 demos from high level tournament play in 2019 and 2020. Warmup rounds and restarts have been filtered, and for the remaining live rounds a round snapshot have been recorded every 20 seconds until the round is decided.

The second dataset has also been released, consisting of 200 recent demos.

The dataset can be downloaded here (version 3, last updated 01-07-2020).

Visualizer

We have added a small python program that can visualize the round snapshots, which might be useful for debugging and feature engineering. It can be found in the visualizer folder.

Data format

The data is in JSON, generated by serde with default settings. Below is the data structures in Rust, annotated with information that might be helpful to understand the data.

We have also provided a small jupyter notebook that shows how to load and perform simple analysis on the data. It needs tensorflow 2.1 to run, which can either be installed manually, or by installing Nix and running run_jupyter.sh.

If you find any errors or bugs in the dataset, data format or documentation, then please open an issue.

struct RoundSnapshot {
    map: String,                        // The map being played
    map_crc: u32                        // CRC value for the map being played,
                                        // which can be used to determine the
                                        // exact version (with a bit of work)
    patch_version: u32                  // Version of CS:GO the game was played on
    current_score: (u8, u8),            // Current round scores for (CT, T)
    round_status: RoundStatus,          // "FreezeTime", "Normal", "BombPlanted", "SlackTime"
    round_status_time_left: f32,        // How long to freezetime ends / round ends / bomb explodes
    alive_players: Vec<AlivePlayer>,
    active_smokes: Vec<Smoke>,          // Currently active smoke effects
    active_molotovs: Vec<Molotov>,      // Currently active molotov/incendiary inferno effects
    previous_kills: Vec<KillEvent>,     // All kills that have happened in the round so far
    round_winner: TeamSide,             // Target variable: who ends up winning the round
}

struct AlivePlayer {
    health: u16,
    armor: u16,
    has_helmet: bool,
    has_defuser: bool,
    money: u16,
    team: TeamSide,
    position_history: Vec<VecPos>,      // Previous positions for this player in the round, sampled every 5 seconds (but not in freezetime)
    inventory: Vec<Weapon>,             // Weapons / Grenades / C4 for this player (Knife not included)
}

struct Weapon {
    item_type: ItemType,
    clip_ammo: u8,                      // Ammo in the current magazine, or amount for grenades / C4
    reserve_ammo: u16,                  // Ammo outside of current magazine
}

struct Smoke {
    position: VecPos,
}

struct Molotov {
    position: VecPos,
}

enum TeamSide {
    CT,
    Terrorist,
}

enum RoundStatus {
    FreezeTime,
    Normal,
    BombPlanted,
    SlackTime,
}

// Position in CS:GO's global coordinate system. See https://developer.valvesoftware.com/wiki/Coordinates.
struct VecPos {
    x: f32,
    y: f32,
    z: f32,
}

struct KillEvent {
    weapon: HurtType,
    // NOTE: There isn't always an attacker (suicides), and kills might be teamkills
    attacker_position: Option<VecPos>, // Attacker position (if applicable)
    attacker_side: Option<TeamSide>,   // Attacker team (if applicable)
    victim_position: VecPos,
    victim_side: TeamSide,
}

// All items that can be carried
enum ItemType {
    Deagle, Elite, FiveSeven, Glock, Ak47, Aug, Awp, Famas, G3sg1, GalilAr, M249, M4a4, Mac10, P90, Mp5sd, Ump45, Xm1014, Bizon, Mag7, Negev, Sawedoff, Tec9, ZeusX27, P2000, Mp7, Mp9, Nova, P250, Scar20, Sg553, Ssg08, M4a1S, UspS, Cz75Auto, R8Revolver, Flashbang, HeGrenade, SmokeGrenade, MolotovGrenade, DecoyGrenade, IncendiaryGrenade, Knife, C4
}

// All sources that can deal damage. Inferno is molotov fire.
enum HurtType {
    Deagle, Elite, FiveSeven, Glock, Ak47, Aug, Awp, Famas, G3sg1, GalilAr, M249, M4a4, Mac10, P90, Mp5sd, Ump45, Xm1014, Bizon, Mag7, Negev, Sawedoff, Tec9, ZeusX27, P2000, Mp7, Mp9, Nova, P250, Scar20, Sg553, Ssg08, M4a1S, UspS, Cz75Auto, R8Revolver, Flashbang, HeGrenade, SmokeGrenade, MolotovGrenade, DecoyGrenade, IncendiaryGrenade, Knife, C4, World, Inferno
}