rts
The deterministic real-time strategy game: its simulation, content, computer opponent, networked matches and screens.
In the namespace octomy.
Detailed description
Classes
| Class | What it is |
|---|---|
| AiProfile | An authored AI profile (rts-extension m6-plan §M6P-0). The AI runs inside the simulation, so every field is sim-affecting: the content bundle hashes the profiles, and every peer plays the same AI. The defaults are a middle profile |
| AiSeat | A seat that the in-sim AI plays (rts-extension m6-plan §M6P-2.1): the player, its profile, and the unit types of its faction, which are the only types it trains or builds. Set at match start; checksummed and in the snapshot |
| AttackBonus | A +damage bonus dealt when the target carries attribute (§M8P-2.1 / §FID-2.4). A weapon, or a type's implicit weapon, stores its bonuses sorted by attribute bit, so they fold stably into simHash |
| AuraSpec | A buff or debuff a unit projects all the time over radius (§FID-13): Guardian Shield (armor to allies), a speed field. It reaches a unit while the unit stands in range, and nothing is stored on that unit. Sim-affecting (hashed) |
| CastEffect | A buff or debuff an ability lays on every unit it reaches (§FID-13): the units in the ability's radius on the chosen side, or the caster alone. A timed effect lasts turns; a drain lands at once. Sim-affecting (hashed) |
| FactionTraits | Faction-wide passive modifiers (§FEA-S8 / §FAC-1.1) — distinct mechanics, not just per-unit stats, so a whole side behaves differently. Content-authored (hashed into simHash()) and injected per player at match setup; sim-affecting, so folded into checksum(). Never crosses the wire (§SEAM-3.1): both peers derive it from the content bundle + faction id |
| MorphOption | A unit→unit morph option (§M8P-2.10 / §FID-11): the unit becomes a targetType over morphTurns, consuming the original, at cost. Distinct from a reversible mode (§FID-4). Sim-affecting (hashed) |
| ResourceType | A data-driven resource type (§M5P-2.1 / §FEA-S12). Content authors as many as it wants; the ordered registry index is the identity used by cost/amount vectors and per-player wallets. `id` is the sim identity (folded into simHash at session-init, §SEAM-3.3); a display name/colour is appearance and lives render-side, never here. `startAmount` seeds every player's wallet of this type at match start — data-driven, not a fixed `startResources` constant |
| RtsAi | In-sim computer opponent (rts-extension m6-plan §M6P) |
| RtsCardUnitState | — |
| RtsCommandAction | — |
| RtsPing | A map ping: a transient marker a player drops for communication (§HUD-1.2). Rides the deterministic command stream so every peer holds the same set, but is presentation-only — deliberately excluded from checksum() (§SEAM-4.1): a ping cannot affect any simulation outcome, and replays re-derive it from the recorded Ping command |
| RtsProducible | — |
| RtsProjectile | An ability projectile in flight (§S6-1.2). Deterministic fixed-point sim state, owner-namespaced id (§RTS-2.2), folded into checksum(): a projectile one sub-tile off on either peer is a desync. On reaching its target it detonates — owner-agnostic AoE — and expires |
| RtsResourceNode | A harvestable resource node on the map (§M5P-2.2 / §FEA-S12): a finite deposit of one resource type that gatherers deplete. Deterministic sim state — id, type, remaining and tile all fold into checksum(); a node one unit off on either peer is a desync. Placed by content/setup, not the command stream |
| RtsSkirmishActivity | Single-player setup: your faction, the AI's faction, the AI profile and the map, then Start (rts-extension m6-plan §M6P-2.4) |
| RtsUnit | One unit (or structure) in the world |
| RtsWatchBridge | DONOR side of mid-match Watch (§RES-3.3) — the observer analog of RtsRejoinBridge, but deferred |
| RtsWatchFacility | OBSERVER side of mid-match Watch (§RES-3.3) — the observer analog of RtsRejoinFacility ("rts.watch") |
| TerritoryYield | Occupation/territory gathering mechanism (§M5P-2.3 / §FEA-S12): a rectangular region [min,max] (inclusive tiles) that yields `ratePerTurn` of `resourceType` each turn to whichever player holds it — the one with the strict-most units inside (ties / empty = no yield). Modular: the same resource type may be won here AND by harvesting nodes. Authored content set at session-init; the region is folded into checksum() for totality, and the accrual lands in the (already-checksummed) wallets |
| UnitMode | An alternate unit mode (§M8P-2.3 / §FID-4): a named set of stat overrides a unit can switch into — siege (range/damage/immobile), burrow, lift-off, transform-fighter, all from one system. overrideMask selects which base stats this mode replaces. The active mode index lives on RtsUnit (checksummed); the override values are sim-affecting (hashed). name is appearance (never hashed). Immobility falls out of a speed override of 0 |
| UnitTypeStats | Static per-unit-type stats. MVP roster is data-driven via a small table (§RTS-6); the sim never hard-codes per-type behaviour |
| Weapon | One weapon of a unit type (§M8P-2.1 / §FID-2.3). A type with an empty UnitTypeStats::weapons list fires one implicit weapon built from its scalar damage / range / weaponTargets / bonusVsAttribute, with no cooldown and no splash — the behaviour from before the list (back-compat). All fields except name are sim-affecting (hashed) |