R-Type
Networked shoot'em up built on Aegis2D
Loading...
Searching...
No Matches
rtype::tuning Namespace Reference

Values tuned for the game, in logical pixels, seconds and health points. More...

Variables

constexpr std::uint32_t tick_rate = 60
 Simulation rate of the server, in ticks per second.
 
constexpr std::uint32_t snapshot_rate = 20
 Snapshots the server sends each client per second (RFC section 4.3).
 
constexpr std::uint32_t position_history_ticks = tick_rate / 2
 Ticks of enemy positions the server keeps, for lag compensation: 500 ms.
 
constexpr std::chrono::milliseconds client_interpolation_delay {100}
 How far behind the server a client draws the world, as the server assumes it for lag compensation: the client's first interpolation delay, which clients do not report.
 
constexpr float area_width = 1280.0F
 Width of the play area (logical resolution).
 
constexpr float area_height = 720.0F
 Height of the play area (logical resolution).
 
constexpr std::size_t max_players = 4
 Players in one game, as the subject requires.
 
constexpr float player_speed = 300.0F
 Speed of a player ship, the same in every direction.
 
constexpr aegis2d::Vec2 player_size {33.0F, 17.0F}
 Size of a player ship on screen.
 
constexpr aegis2d::Vec2 player_hitbox {27.0F, 11.0F}
 Hit box of a player ship, a little smaller than its sprite.
 
constexpr std::int32_t player_health = 1
 Health points of a player ship: one hit loses a life.
 
constexpr std::uint32_t player_lives = 3
 Lives of a player at the start of a game.
 
constexpr float player_spawn_x = 100.0F
 Distance of the player spawns from the left edge.
 
constexpr float player_fire_cooldown = 0.25F
 Seconds between two shots of a player holding fire (four shots a second).
 
constexpr float player_missile_speed = 900.0F
 Speed of a player missile, to the right.
 
constexpr aegis2d::Vec2 player_missile_size {16.0F, 4.0F}
 Size of a player missile.
 
constexpr std::int32_t player_missile_damage = 1
 Damage of a player missile.
 
constexpr aegis2d::Vec2 bydos_size {32.0F, 32.0F}
 Size of a Bydos slave, as the clients draw it: width and height of assets/enemies/bydos_slave.lua, where its other values and its behavior are.
 
constexpr float bydos_lane_margin = 48.0F
 Room kept above and below the line of a random Bydos for its weave: the amplitude of assets/enemies/bydos_slave.lua.
 
constexpr std::string_view random_enemy = "bydos_slave"
 Enemy type the random spawns create, from assets/enemies.
 
constexpr float bydos_spawn_min_interval = 0.8F
 Shortest time between two random Bydos spawns, in seconds.
 
constexpr float bydos_spawn_max_interval = 2.0F
 Longest time between two random Bydos spawns, in seconds.
 
constexpr float bydos_spawn_x = area_width + (bydos_size.x / 2.0F)
 x of the random spawns: a Bydos appears just beyond the right edge.
 
constexpr float bydos_lane_top = bydos_lane_margin + (bydos_size.y / 2.0F)
 Highest line of a random Bydos, so that it weaves without leaving the screen.
 
constexpr float bydos_lane_bottom = area_height - bydos_lane_top
 Lowest line of a random Bydos.
 
constexpr std::int32_t easy_enemy_health_factor = 1
 Factor of the enemy health of an easy room: one missile still kills a Bydos.
 
constexpr float easy_spawn_interval_scale = 1.5F
 Random Bydos spawn intervals of an easy room, times the normal ones: fewer enemies.
 
constexpr std::int32_t hard_enemy_health_factor = 2
 Factor of the enemy health of a hard room: a Bydos takes two missiles.
 
constexpr float hard_spawn_interval_scale = 0.6F
 Random Bydos spawn intervals of a hard room, times the normal ones: more enemies.
 
constexpr float enemy_missile_speed = 300.0F
 Speed of an enemy missile, to the left.
 
constexpr aegis2d::Vec2 enemy_missile_size {8.0F, 8.0F}
 Size of an enemy missile.
 
constexpr std::int32_t enemy_missile_damage = 1
 Damage of an enemy missile.
 
constexpr std::int32_t ram_damage = 1
 Damage dealt by ramming: a player ship and a Bydos hurt each other on contact.
 
constexpr float despawn_margin = 64.0F
 Distance beyond the screen edges before a missile or an enemy is destroyed, so an enemy whose path dips off screen is kept (ecs::OffscreenDespawn::margin).
 
constexpr float collision_cell = 64.0F
 Side of a cell of the collision grid, about the size of a Bydos.
 

Detailed Description

Values tuned for the game, in logical pixels, seconds and health points.

Variable Documentation

◆ area_height

constexpr float rtype::tuning::area_height = 720.0F
inlineconstexpr

Height of the play area (logical resolution).

◆ area_width

constexpr float rtype::tuning::area_width = 1280.0F
inlineconstexpr

Width of the play area (logical resolution).

◆ bydos_lane_bottom

constexpr float rtype::tuning::bydos_lane_bottom = area_height - bydos_lane_top
inlineconstexpr

Lowest line of a random Bydos.

◆ bydos_lane_margin

constexpr float rtype::tuning::bydos_lane_margin = 48.0F
inlineconstexpr

Room kept above and below the line of a random Bydos for its weave: the amplitude of assets/enemies/bydos_slave.lua.

◆ bydos_lane_top

constexpr float rtype::tuning::bydos_lane_top = bydos_lane_margin + (bydos_size.y / 2.0F)
inlineconstexpr

Highest line of a random Bydos, so that it weaves without leaving the screen.

◆ bydos_size

constexpr aegis2d::Vec2 rtype::tuning::bydos_size {32.0F, 32.0F}
inlineconstexpr

Size of a Bydos slave, as the clients draw it: width and height of assets/enemies/bydos_slave.lua, where its other values and its behavior are.

◆ bydos_spawn_max_interval

constexpr float rtype::tuning::bydos_spawn_max_interval = 2.0F
inlineconstexpr

Longest time between two random Bydos spawns, in seconds.

◆ bydos_spawn_min_interval

constexpr float rtype::tuning::bydos_spawn_min_interval = 0.8F
inlineconstexpr

Shortest time between two random Bydos spawns, in seconds.

◆ bydos_spawn_x

constexpr float rtype::tuning::bydos_spawn_x = area_width + (bydos_size.x / 2.0F)
inlineconstexpr

x of the random spawns: a Bydos appears just beyond the right edge.

◆ client_interpolation_delay

constexpr std::chrono::milliseconds rtype::tuning::client_interpolation_delay {100}
inlineconstexpr

How far behind the server a client draws the world, as the server assumes it for lag compensation: the client's first interpolation delay, which clients do not report.

◆ collision_cell

constexpr float rtype::tuning::collision_cell = 64.0F
inlineconstexpr

Side of a cell of the collision grid, about the size of a Bydos.

◆ despawn_margin

constexpr float rtype::tuning::despawn_margin = 64.0F
inlineconstexpr

Distance beyond the screen edges before a missile or an enemy is destroyed, so an enemy whose path dips off screen is kept (ecs::OffscreenDespawn::margin).

◆ easy_enemy_health_factor

constexpr std::int32_t rtype::tuning::easy_enemy_health_factor = 1
inlineconstexpr

Factor of the enemy health of an easy room: one missile still kills a Bydos.

◆ easy_spawn_interval_scale

constexpr float rtype::tuning::easy_spawn_interval_scale = 1.5F
inlineconstexpr

Random Bydos spawn intervals of an easy room, times the normal ones: fewer enemies.

◆ enemy_missile_damage

constexpr std::int32_t rtype::tuning::enemy_missile_damage = 1
inlineconstexpr

Damage of an enemy missile.

◆ enemy_missile_size

constexpr aegis2d::Vec2 rtype::tuning::enemy_missile_size {8.0F, 8.0F}
inlineconstexpr

Size of an enemy missile.

◆ enemy_missile_speed

constexpr float rtype::tuning::enemy_missile_speed = 300.0F
inlineconstexpr

Speed of an enemy missile, to the left.

◆ hard_enemy_health_factor

constexpr std::int32_t rtype::tuning::hard_enemy_health_factor = 2
inlineconstexpr

Factor of the enemy health of a hard room: a Bydos takes two missiles.

◆ hard_spawn_interval_scale

constexpr float rtype::tuning::hard_spawn_interval_scale = 0.6F
inlineconstexpr

Random Bydos spawn intervals of a hard room, times the normal ones: more enemies.

◆ max_players

constexpr std::size_t rtype::tuning::max_players = 4
inlineconstexpr

Players in one game, as the subject requires.

◆ player_fire_cooldown

constexpr float rtype::tuning::player_fire_cooldown = 0.25F
inlineconstexpr

Seconds between two shots of a player holding fire (four shots a second).

◆ player_health

constexpr std::int32_t rtype::tuning::player_health = 1
inlineconstexpr

Health points of a player ship: one hit loses a life.

◆ player_hitbox

constexpr aegis2d::Vec2 rtype::tuning::player_hitbox {27.0F, 11.0F}
inlineconstexpr

Hit box of a player ship, a little smaller than its sprite.

◆ player_lives

constexpr std::uint32_t rtype::tuning::player_lives = 3
inlineconstexpr

Lives of a player at the start of a game.

◆ player_missile_damage

constexpr std::int32_t rtype::tuning::player_missile_damage = 1
inlineconstexpr

Damage of a player missile.

◆ player_missile_size

constexpr aegis2d::Vec2 rtype::tuning::player_missile_size {16.0F, 4.0F}
inlineconstexpr

Size of a player missile.

◆ player_missile_speed

constexpr float rtype::tuning::player_missile_speed = 900.0F
inlineconstexpr

Speed of a player missile, to the right.

◆ player_size

constexpr aegis2d::Vec2 rtype::tuning::player_size {33.0F, 17.0F}
inlineconstexpr

Size of a player ship on screen.

◆ player_spawn_x

constexpr float rtype::tuning::player_spawn_x = 100.0F
inlineconstexpr

Distance of the player spawns from the left edge.

◆ player_speed

constexpr float rtype::tuning::player_speed = 300.0F
inlineconstexpr

Speed of a player ship, the same in every direction.

◆ position_history_ticks

constexpr std::uint32_t rtype::tuning::position_history_ticks = tick_rate / 2
inlineconstexpr

Ticks of enemy positions the server keeps, for lag compensation: 500 ms.

◆ ram_damage

constexpr std::int32_t rtype::tuning::ram_damage = 1
inlineconstexpr

Damage dealt by ramming: a player ship and a Bydos hurt each other on contact.

◆ random_enemy

constexpr std::string_view rtype::tuning::random_enemy = "bydos_slave"
inlineconstexpr

Enemy type the random spawns create, from assets/enemies.

◆ snapshot_rate

constexpr std::uint32_t rtype::tuning::snapshot_rate = 20
inlineconstexpr

Snapshots the server sends each client per second (RFC section 4.3).

◆ tick_rate

constexpr std::uint32_t rtype::tuning::tick_rate = 60
inlineconstexpr

Simulation rate of the server, in ticks per second.