Skip to content

✅ Add multi-NPC Background Life combat and loot - #690

Draft
RANGROO wants to merge 3 commits into
unstablefrom
codex/background-life-combat
Draft

✅ Add multi-NPC Background Life combat and loot#690
RANGROO wants to merge 3 commits into
unstablefrom
codex/background-life-combat

Conversation

@RANGROO

@RANGROO RANGROO commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add dedicated LLM-resolved Background Life combat for 2-6 opted-in nearby NPCs on exactly two sides
  • persist encounter participants, individual outcomes, corpse placement state, deterministic locks, acknowledgements, retries, rollback, and future Background Life context
  • add separate winner-driven loot resolution using current inventory, shared reservations, and equipped/quest-item exclusions
  • record combat, death, and loot in eventlog and each participant's Background Life history
  • expose combat participation, initiation, lethal, and loot controls through the shared PHP/Prisma API and PHP NPC editor
  • stop scheduling dead NPCs for Background Life
  • use the real game-time conversion when the encounter library is loaded outside the normal bootstrap

Companion game-side implementation: Dwemer-Dynamics/CHIM #127

Background Life event chain

eligible opted-in NPCs
→ deterministic participant locks
→ one LLM combat resolution
→ per-NPC CombatOutcome commands
→ game-side outcome acknowledgements
→ retry any unacknowledged command
→ fresh death, health, inventory, and position snapshots
→ verify dead actor and corpse placement
→ open and close the real corpse loot UI
→ verify the actor remains dead
→ inventory-safe loot resolution
→ BackgroundLoot transfer and applied-count acknowledgement
→ suppress an identical replay
→ verify final inventories
→ write eventlog and each participant's Background Life history
→ release locks and restore temporary settings

Live Skyrim AE validation

Local Systems Harness run #11 completed the deterministic three-NPC round trip through the real server/game bridge:

  • 1 encounter with all 3 participant outcomes acknowledged
  • initiator survived; target was confirmed dead; ally was seriously wounded at 26.25 / 75 health
  • one deliberately dropped ally command was delivered by the production retry path
  • corpse was placed beside the player
  • Skyrim opened and closed the real corpse loot interface, then confirmed the actor remained dead
  • 3 gold transferred from the defeated actor to the winner: target 10 → 7, winner 0 → 3
  • replaying the identical loot command returned the original applied count without transferring twice
  • final inventories, post-combat state, pending-response cleanup, and temporary-setting restoration verified
  • 1 encounter, 3 acknowledgements, 1 retry, 1 loot transfer, 0 combat failures, 0 failed actors

The live run also exercised the server-to-plugin command bridge directly, including runtime RefID targeting and fresh game telemetry.

Automated validation

  • PHP lint: all 9 changed PHP files pass
  • git diff --check: pass
  • focused resolver and PostgreSQL schema/transaction probes: pass
  • local Systems Harness tests: 14 tests, 54 assertions pass
  • scenario JSON parse: pass
  • exact PR branch was merge-tested with origin/unstable before publication

Deployment

  • live test used the local WSL HerikaServer deployment
  • the reusable Systems Harness and corpse-UI instrumentation remain local and are not included in this PR

Known limits

  • corpse interaction was automated through Skyrim's actual loot menu rather than manually clicked
  • live in-game validation was Skyrim AE only; Skyrim VR was deployed but not run in-game

@RANGROO RANGROO changed the title Add multi-NPC Background Life combat and loot ✅ Add multi-NPC Background Life combat and loot Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant