gameplay-guardrails

Guardrails for Senior Gameplay Engineer (Mission CORE-DIFFERENTIATION)

Gameplay Engineering Guardrails

1. Tick Rate Integrity (0.4s Standard)

Rule: The global game tick is 0.4 seconds (400ms). This is a hard deviation from the 0.6s OSRS standard.
  • Constants: Use a centralized TICK_DURATION constant (e.g., in shared-logic).
  • Time Conversion:
    • 1 Tick = 0.4s
    • 10 Ticks = 4.0s (not 6.0s)
    • 100 Ticks = 40.0s (Legacy minute is 100 ticks = 60s @ 0.6s. We are faster).
  • Animation Sync: Ensure animation clips match the 0.4s multiple. (e.g. Attack animation should be 0.8s, 1.2s, not 0.6s).
  • Regeneration: Adjust Health/Dharma regeneration rates to match the faster pace (or keep absolute time equivalent by reducing per-tick amount).

2. Combat Formulas & Determinism

Rule: Combat logic must be deterministic.
  • Integer Math: Use integer math for all damage calculation steps. Drop remainders (floor) only where specified in the design.
  • RNG Isolation: Use a seeded or controllable RNG for combat rolls to allow unit testing of specific hit scenarios.
  • Stance Modifiers:
    • Offensive: +3 Visible Strength/Attack
    • Defensive: +3 Visible Defense
    • Balanced: +1 to all
  • Testing: All formulas must have unit tests covering Min/Max/Average cases.

3. Leveling & Experience

  • Level Cap: 100 (approx 18M XP).
  • Data Types:
    • Experience: u32 (assuming 1 XP = 1 unit) or u64 (if 1 XP = 10 units). Verify existing schema.
    • Max XP: 200,000,000 (200M).
  • Overflow Protection: Ensure current_xp + gain does not overflow. Cap at 200M.

4. Inventory System

  • Grid Size: Base 30 slots (6x5).
  • Expansion: Logic must support dynamic sizing up to 50 slots.
  • Serialization: Ensure save formats handle variable inventory sizes gracefully.

5. Vedic Theme Enforcement (Asset & Data)

  • Strict Ban: No "Mithril", "Adamant", "Rune".
  • Replacements:
    • Mithril -> Soma
    • Adamant -> Meteoric
    • Rune -> Divya
  • Gods: No Saradomin/Zamorak/Guthix. Use Agni/Yama/Indra/Varuna capabilities.

6. Performance

  • Entity Counts: Combat loop must support 2000+ active entities. Use ParallelSystemDescriptor in Bevy or appropriate ECS batching.
  • Broadphase: Use spatial hashing for entity targeting queries.