Skip to content

Phase 2 Run Authority

Goal

Phase 2 separates Godot input collection from gameplay mutation. The current implementation remains local-first, but commands and authority processing no longer depend on a particular network transport.

The active flow is:

Godot input
  -> MoveCommand / WeaponCommand / InteractionCommand
  -> IRunAuthority queue
  -> ProcessTick
  -> registered gameplay target
  -> gameplay result events
  -> HUD, audio, VFX and replay presentation

Authority contract

IRunAuthority accepts player-input, weapon and interaction commands and processes them in monotonically increasing ticks. LocalRunAuthority preserves submission order, validates player targets and command sequences, bounds its pending queue, and emits a RunCommandResult for every processed command.

Supported modes are LocalSolo, ListenServer, DedicatedServer, and ReplayValidation. The bootstrap currently selects LocalSolo for a client and DedicatedServer for server mode. Listen-server transport and replay re-simulation are later adapters over the same contract.

Commands

  • MoveCommand
  • FireWeaponCommand
  • ReloadWeaponCommand
  • SwitchWeaponCommand
  • InteractCommand
  • UsePowerUpCommand
  • SelectPowerUpCommand
  • RevivePlayerCommand

RevivePlayerCommand is routable but currently rejected with revive_not_available, because the phase-1 slice has no revive mechanic yet.

Active integration

PlayerController is the local input adapter and an authority command target. It reads movement, aim and action state, creates commands, and advances the local authority once per physics frame. Its authority handlers own movement application, interaction validation, power-up application and delegation to the weapon gameplay system.

AdvancedWeaponController no longer reads Godot input. Fire, reload and switch mutations are only entered through ExecuteAuthorityCommand; its existing network sync remains downstream and can later be replaced by a listen- or dedicated-server authority transport.

Physical pickups submit CollectDropCommand; LocalSoloAuthority validates DropId, SourceEntityId, player state, distance, schedule state and effect eligibility before consumption. SelectPowerUpCommand and UsePowerUpCommand remain legacy-only.

Deferred work

Phase 2 does not implement snapshots, rollback, prediction, reconciliation, a dedicated-server process, or replay re-simulation. It establishes the boundary those systems will use without changing the current local gameplay result.