mirror of
https://github.com/Xevion/smart-rgb.git
synced 2025-12-15 02:13:15 -06:00
Update source files
This commit is contained in:
49
crates/borders-core/src/game/constants.rs
Normal file
49
crates/borders-core/src/game/constants.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
/// Game constants organized by domain
|
||||
///
|
||||
/// This module centralizes all game balance constants that were previously
|
||||
/// scattered across multiple files. Constants are grouped by gameplay domain
|
||||
/// for easy discovery and tuning.
|
||||
pub mod combat {
|
||||
/// Empire size balancing - prevents snowballing by large empires
|
||||
/// Defense effectiveness decreases as empire grows beyond this threshold
|
||||
pub const DEFENSE_DEBUFF_MIDPOINT: f32 = 150_000.0;
|
||||
|
||||
/// Rate of defense effectiveness decay for large empires
|
||||
/// Uses natural log decay for smooth scaling
|
||||
pub const DEFENSE_DEBUFF_DECAY_RATE: f32 = std::f32::consts::LN_2 / 50_000.0;
|
||||
|
||||
/// Base terrain magnitude cost for plains (baseline terrain)
|
||||
/// Determines troop losses when conquering a tile
|
||||
pub const BASE_MAG_PLAINS: f32 = 80.0;
|
||||
|
||||
/// Base terrain speed for plains (baseline terrain)
|
||||
/// Affects how many tiles can be conquered per tick
|
||||
pub const BASE_SPEED_PLAINS: f32 = 16.5;
|
||||
|
||||
/// Maximum random adjustment to border size when calculating expansion speed
|
||||
/// Introduces natural variation in attack progression (0-4 range)
|
||||
pub const BORDER_RANDOM_ADJUSTMENT_MAX: u32 = 5;
|
||||
|
||||
/// Multiplier for tiles conquered per tick when attacking unclaimed territory
|
||||
pub const UNCLAIMED_TILES_PER_TICK_MULTIPLIER: f32 = 2.0;
|
||||
|
||||
/// Multiplier for tiles conquered per tick when attacking claimed territory
|
||||
pub const CLAIMED_TILES_PER_TICK_MULTIPLIER: f32 = 3.0;
|
||||
|
||||
/// Large empire threshold for attack penalties (>100k tiles)
|
||||
pub const LARGE_EMPIRE_THRESHOLD: usize = 100_000;
|
||||
|
||||
/// Random factor range for tile priority calculation (0-7)
|
||||
pub const TILE_PRIORITY_RANDOM_MAX: u32 = 8;
|
||||
|
||||
/// Defense post magnitude multiplier (when implemented)
|
||||
pub const DEFENSE_POST_MAG_MULTIPLIER: f32 = 5.0;
|
||||
|
||||
/// Defense post speed multiplier (when implemented)
|
||||
pub const DEFENSE_POST_SPEED_MULTIPLIER: f32 = 3.0;
|
||||
}
|
||||
|
||||
pub mod spawning {
|
||||
/// Radius of tiles claimed around spawn point (creates 5x5 square)
|
||||
pub const SPAWN_RADIUS: i32 = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user