BSD Empire 1.1 combat source audit — v0.9.16
The original empire-1.1.tar.gz supplied by the player was read and inspected; it is not redistributed in this game ZIP. SHA-256: d705b9c8e77e6001f01c5f9feb39ce8d722964fbb99271e810d806ec4e4546ee. This source distribution contains original C implementations with RCS history dating to 1989–1990; the archive itself carries a later gzip modification timestamp.
Directly verified source formulas
| Behavior | Historical source | Implemented in C# |
|---|---|---|
| Round-by-round land casualties: odds = attacker strength/(attacker + defender strength); one casualty per random round | EMP/player/commands/atta.c, lines 215–247, 349–378 | LandCombatRules.Resolve, BsdCombatMath.Odds |
| Strength factor = 1 + (designation rating / 2 − 1) × sector efficiency / 100 | EMP/player/commands/atta.c, 354–371; EMP/lib/global/sect.c, 15–47 | BsdCombatMath.OffensiveFactor/DefensiveFactor |
| At 100% efficiency, fortress defense rating 8 = 4×; capital rating 4 = 2×; bank rating 3 = 1.5× | EMP/lib/global/sect.c, 21, 36, 45 | Defense reporting and ground odds |
| Successful attack with surviving MIL places about half in the captured sector; empty defenders may be captured without occupation | EMP/player/commands/atta.c, 219–220, 249–310 | Return-and-occupation split; no forced-survivor capture veto |
| Attack mobility cost: (source movement rating + 2 × target rating) × committed troops / 24, truncated to integer | EMP/player/commands/atta.c, 112–145 | BsdCombatMath.AttackMobilityCostMilli |
| Land gun effectiveness = 20 + (random%10) × 0.01 × efficiency | EMP/player/subs/landgun.c, 18–23 | BsdCombatMath.LandGun |
| Land shell armor = 320 for banks; 160 for other sectors; shell damage = int(guneff × 100 / (armor + guneff + 1)) | EMP/player/subs/landgun.c, 41–61 | BsdCombatMath.LandArmor/ShellDamage |
| Fortress defensive shot consumes one shell; seven guns cap range; technology factor = (50 + tech)/(200 + tech) | EMP/player/subs/fortdef.c, 107–160; EMP/player/subs/tfact.c, 18–39 | FortArtilleryRules |
| Direct FIRE has wind deflection and no +1 range bonus at 60% efficiency | EMP/player/commands/fire.c, 187–259 | LandArtilleryRules uses C-based damage/deflection |
v0.9.33 — land-combat contagion and event persistence
The original EMP/player/commands/atta.c, lines 97–98,
150–151, 293–295, 322 and 340–342, accumulates infectious participants and
transmits plague when an attack captures the destination. A healthy attacked
sector becomes exposed, and healthy source sectors can become exposed when
surviving troops return. Defeat clears the C infection accumulator. The
original returning-source write references V_PTIME rather than
V_PSTAGE; the C# implementation deliberately tests the actual
plague stage rather than copying that apparent bug. Attack and artillery
notices use the existing nation-private EVENTS infrastructure
and are recorded atomically with the battle or strike. This is not a full
recreation of the BSD wu telegram and nreport news
subsystems.
Original ship contact rules were also reviewed: player/commands/buil.c
exposes newly built ships in infected sectors; load.c transfers
plague on load and unload; tend.c and boar.c propagate
ship-to-ship exposure; and update/ship.c advances ship epidemics
and mortality without spontaneous ship outbreaks. No ships or naval commands
exist in this game yet, so those source-verified interactions remain future work.
Remaining known differences
The current ATTACK API supports up to six neighboring source sectors, matching atta.c; the original can optionally leave captured sectors unoccupied. Defensive artillery damages one randomly selected attacking source sector as a whole, including its noncommitted military, population, efficiency, and stockpiles. Combat uses seeded injectable randomness in tests; original C uses its global random generator. Some damage-rounding and inventory edge cases differ, although direct fire now reduces commodity inventories and mobility as well as population and efficiency.
At the time of the v0.9.16 audit, original ownership, loyalty, guerrillas and plague had not yet been reproduced. v0.9.24 adds persistent initial takeover state; v0.9.27 adds source-derived hourly guerrilla, rebellion and loyalty effects with a deterministic elapsed-time clock. v0.9.31 adds source-derived sector plague stages, direct-delivery exposure, and private milestone event history. Ship epidemics, historical mailboxes/public news and configurable ETUs remain unfinished; v0.9.33 adds captured-sector and returning-source land combat contagion plus nation-private combat/fire notices. BTU costs still follow our prototype's 1-BTU-per-command rule rather than the casualty-sensitive original attack charge. Because these differences can change outcomes, v0.9.14 is a source-verified core combat implementation, not a claim of total gameplay equivalence.
Migration snapshot verification
As of v0.9.16 the persistence regression suite compares the battle and direct-fire snapshot property names and CLR types to the live EF Core model. Coordinated attacks added SourceContributions and CollateralMilitaryLosses, increasing the battle entity property count from 17 to 19. Fixed property-count assertions are no longer used, while the foreign-key relationship to the named GameEntity is still checked. This is a test-only correction, not a migration or gameplay adjustment.
Regression evidence
Smoke tests assert the original odds, sector efficiencies, 1.5× bank defense, technology-factor range, one-shell fort shots, original mobility arithmetic, seeded reproducibility, occupation split, and capture without surviving occupiers. Optional PostgreSQL integration tests check transactional capture, military conservation, artillery spending and BTU rollback.
Reference command: COMBATRULES or COMB. Local archive inspection tools remain in scripts/, but the historical archive is never bundled in this release.