Skip to content

Latest commit

 

History

History
293 lines (198 loc) · 9.94 KB

File metadata and controls

293 lines (198 loc) · 9.94 KB

Model

WeaponProperties

Weapon properties

Fields:

  • name: string — Name
  • rounds_per_second: float64 — Shooting speed (number of shots per second)
  • spread: float64 — Accuracy (spread angle) of a shot (in degrees)
  • aim_time: float64 — Aiming time
  • aim_field_of_view: float64 — Field of view in full aim (in degrees)
  • aim_rotation_speed: float64 — Rotation speed in full aim (degrees per second)
  • aim_movement_speed_modifier: float64 — Movement speed modifier in full aim
  • projectile_speed: float64 — Speed of projectiles
  • projectile_damage: float64 — Damage of a projectile
  • projectile_life_time: float64 — Projectiles' life time
  • shot_sound_type_index: Option<int32> — Index of the sound when shooting (starting with 0), or None
  • projectile_hit_sound_type_index: Option<int32> — Index of the sound when hitting something (starting with 0), or None
  • max_inventory_ammo: int32 — Max amount of ammo unit can hold in their inventory

SoundProperties

Sound properties

Fields:

  • name: string — Name
  • distance: float64 — Distance from which the sound can be heard
  • offset: float64 — Offset modifier

Vec2

2 dimensional vector.

Fields:

  • x: float64x coordinate of the vector
  • y: float64y coordinate of the vector

Obstacle

An obstacle on the map

Fields:

  • id: int32 — Unique id
  • position: Vec2 — Center position
  • radius: float64 — Obstacle's radius
  • can_see_through: boolean — Whether units can see through this obstacle, or it blocks the view
  • can_shoot_through: boolean — Whether projectiles can go through this obstacle

Constants

Non changing game state

Fields:

  • ticks_per_second: float64 — Number of ticks per game second
  • team_size: int32 — Starting number of units in each team
  • initial_zone_radius: float64 — Initial zone radius
  • zone_speed: float64 — Speed of zone radius
  • zone_damage_per_second: float64 — Damage dealt to units outside of the zone per second
  • spawn_time: float64 — Unit spawning time
  • spawn_collision_damage_per_second: float64 — Damage dealt to units trying to spawn in incorrect position per second
  • looting_time: float64 — Time required to perform looting actions (in seconds)
  • bot_players: int32 — Number of bot players (teams)
  • unit_radius: float64 — Units' radius
  • unit_health: float64 — Max units' health
  • health_regeneration_per_second: float64 — Health automatically restored per second
  • health_regeneration_delay: float64 — Time until automatic health regeneration since last health damage (in seconds)
  • max_shield: float64 — Max value of unit's shield
  • spawn_shield: float64 — Initial value of unit's shield
  • extra_lives: int32 — Initial number of extra lives for units
  • last_respawn_zone_radius: float64 — Zone radius after which respawning is disabled
  • field_of_view: float64 — Units' field of view without aiming (in degrees)
  • view_distance: float64 — Units' view distance
  • view_blocking: boolean — Whether units' view is blocked by obstacles
  • rotation_speed: float64 — Unit rotation speed without aiming (degrees per second)
  • spawn_movement_speed: float64 — Units' movement speed while spawning
  • max_unit_forward_speed: float64 — Max unit speed when walking forward
  • max_unit_backward_speed: float64 — Max unit speed when walking backward
  • unit_acceleration: float64 — Max unit acceleration
  • friendly_fire: boolean — Whether a unit can damage units of the same team
  • kill_score: float64 — Score given for killing enemy unit
  • damage_score_multiplier: float64 — Score multiplier for damaging enemy units
  • score_per_place: float64 — Score given for every team killed before you
  • weapons: [WeaponProperties] — List of properties of every weapon type
  • starting_weapon: Option<int32> — Starting weapon with which units spawn, or None
  • starting_weapon_ammo: int32 — Ammo for starting weapon given when unit spawns
  • max_shield_potions_in_inventory: int32 — Max number of shield potions in unit's inventory
  • shield_per_potion: float64 — Amount of shield restored using one potion
  • shield_potion_use_time: float64 — Time required to perform action of using shield potion
  • sounds: [SoundProperties] — List of properties of every sound type
  • steps_sound_type_index: Option<int32> — Sound type index when moving (starting with 0), or None
  • steps_sound_travel_distance: float64 — Distance when steps sound will be 100% probability
  • obstacles: [Obstacle] — List of obstacles on the map

Player

Game's participant (team of units)

Fields:

  • id: int32 — Unique id
  • kills: int32 — Number of kills
  • damage: float64 — Total damage dealt to enemies
  • place: int32 — Survival place (number of survivor teams currently/at the moment of death)
  • score: float64 — Team score

ActionType

Type of action a unit is currently performing

Variants:

  • Looting — Picking up or dropping loot
  • UseShieldPotion — Using a shield potion

Action

Action unit is currently performing

Fields:

  • finish_tick: int32 — Tick when the action will be finished
  • action_type: ActionType — Type of the action

Unit

A unit

Fields:

  • id: int32 — Unique id
  • player_id: int32 — Id of the player (team) controlling the unit
  • health: float64 — Current health
  • shield: float64 — Current shield value
  • extra_lives: int32 — Left extra lives of this unit
  • position: Vec2 — Current position of unit's center
  • remaining_spawn_time: Option<float64> — Remaining time until unit will be spawned, or None
  • velocity: Vec2 — Current velocity
  • direction: Vec2 — Current view direction (vector of length 1)
  • aim: float64 — Value describing process of aiming (0 - not aiming, 1 - ready to shoot)
  • action: Option<Action> — Current action unit is performing, or None
  • health_regeneration_start_tick: int32 — Tick when health regeneration will start (can be less than current game tick)
  • weapon: Option<int32> — Index of the weapon this unit is holding (starting with 0), or None
  • next_shot_tick: int32 — Next tick when unit can shoot again (can be less than current game tick)
  • ammo: [int32] — List of ammo in unit's inventory for every weapon type
  • shield_potions: int32 — Number of shield potions in inventory

Item

Lootable item

One of:

  • Weapon — Weapon

    Fields:

    • type_index: int32 — Weapon type index (starting with 0)
  • ShieldPotions — Shield potions

    Fields:

    • amount: int32 — Amount of potions
  • Ammo — Ammo

    Fields:

    • weapon_type_index: int32 — Weapon type index (starting with 0)
    • amount: int32 — Amount of ammo

Loot

Loot lying on the ground

Fields:

  • id: int32 — Unique id
  • position: Vec2 — Position
  • item: Item — Item

Projectile

Weapon projectile

Fields:

  • id: int32 — Unique id
  • weapon_type_index: int32 — Index of the weapon this projectile was shot from (starts with 0)
  • shooter_id: int32 — Id of unit who made the shot
  • shooter_player_id: int32 — Id of player (team), whose unit made the shot
  • position: Vec2 — Current position
  • velocity: Vec2 — Projectile's velocity
  • life_time: float64 — Left time of projectile's life

Zone

Current state of the game zone

Fields:

  • current_center: Vec2 — Current center
  • current_radius: float64 — Current radius
  • next_center: Vec2 — Next center
  • next_radius: float64 — Next radius

Sound

Sound heard by one of your units

Fields:

  • type_index: int32 — Sound type index (starting with 0)
  • unit_id: int32 — Id of unit that heard this sound
  • position: Vec2 — Position where sound was heard (different from sound source position)

Game

Current game's state

Fields:

  • my_id: int32 — Your player's id
  • players: [Player] — List of players (teams)
  • current_tick: int32 — Current tick
  • units: [Unit] — List of units visible by your team
  • loot: [Loot] — List of loot visible by your team
  • projectiles: [Projectile] — List of projectiles visible by your team
  • zone: Zone — Current state of game zone
  • sounds: [Sound] — List of sounds heard by your team during last tick

ActionOrder

Order to perform an action for unit

One of:

  • Pickup — Pick up loot

    Fields:

    • loot: int32 — Loot id
  • UseShieldPotion — Use shield potion

    No fields

  • DropShieldPotions — Drop shield potions on the ground

    Fields:

    • amount: int32 — Amount of potions
  • DropWeapon — Drop current weapon

    No fields

  • DropAmmo — Drop ammo

    Fields:

    • weapon_type_index: int32 — Weapon type index (starting with 0)
    • amount: int32 — Amount of ammo
  • Aim — Start/continue aiming

    Fields:

    • shoot: boolean — Shoot (only possible in full aim)

UnitOrder

Order for specific unit

Fields:

  • target_velocity: Vec2 — Target moving velocity
  • target_direction: Vec2 — Target view direction (vector length doesn't matter)
  • action: Option<ActionOrder> — Order to perform an action, or None

Order

Player's (team's) orders

Fields:

  • unit_orders: Map<int32 -> UnitOrder> — Orders for each of your units