You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Board size: Configurable, default 15x15 (up to 50x50 max)
Cell capacity: Each cell has maxval (default 20, max 50) troop limit
Terrain levels: Hills (+), Sea (-), Forest, with movement penalties
Wrapping: Optional board edge wrapping
Core Data Structures
Cell Properties:
typedefstruct {
s_charside; // Owner (0-10, or SIDE_NONE, SIDE_FIGHT)s_char*value; // Troop count per side [0-maxval]s_charlevel; // Terrain elevations_chargrowth; // Town production rate (0-255)s_charmove; // Number of active direction vectorss_char*dir; // Direction vector array [0-6 directions]s_charage; // How long owned by same side// ... plus march, visibility, etc.
} cell_type;
Movement & Combat System
Troop Movement:
// Movement calculation (from update_cell):nmove=surplus*move_hinder[dest_level] *// Terrain difficultymove_shunt[current_troops] *// Supply line attenuation move_speed*// Speed setting
(1.0-move_slope[level_diff]) // Hill penalty
Combat Resolution:
When enemy troops meet: cell->side = SIDE_FIGHT
Combat is probabilistic based on troop ratios
Loss calculation: loss = ((enemy_ratio^2) - 1.0 + random) * fight_intensity
Winner takes cell when only one side remains
Key Game Constants
#defineMAX_PLAYERS 11
#defineMAX_DIRECTIONS 6
#defineMAXVAL 50 // Max troops per cell
#defineTOWN_MIN 50 // Minimum town production
#defineTOWN_MAX 100 // Maximum town production
// Default values:#defineDEFAULT_BOARD 15 // Board size
#defineDEFAULT_MAXVAL 20 // Cell capacity
#defineDEFAULT_FIGHT 5 // Combat intensity
#defineDEFAULT_MOVE 3 // Movement speed
Town/Base System
Growth rate: Towns produce troops probabilistically each turn
Super towns: growth > 100 produce multiple troops per turn
Production formula: if (growth > random(100)) add_troop()