Skip to content

AI: recover after losing part of its base #42

Description

@CubeB

From the ROADMAP (requested 2026-08-30). Today the computer player carries on down its build list after an attack, as if nothing had happened. It should:

  1. Rebuild what was destroyed: remember each lost structure and its site, and requeue it ahead of new expansion.
  2. Reclaim its own wreckage for the metal, especially when it is metal-starved.
  3. Remember which direction attacks came from, and put defences on that side.
  4. Hold ground sensibly: place units for defence and for the next push rather than leaving them where they stopped.
  5. Scale with difficulty: all of this on Easy, Standard and Hard, with the thoroughness increasing with difficulty.

Where. src/rwe/ai/: BuildManager, EconomyManager, ArmyManager, StrategicManager, ThreatMap, PerceptionManager. See docs/ai-architecture-proposal.md. The AI runs inside GameSimulation::tick and emits ordinary PlayerCommands, so the determinism rules in CLAUDE.md apply: no uniform_int_distribution, use SimRandom.h's randomBelow, and any new state follows the save / hash / dump rule.

No original to copy. §103 could not establish that TA's computer player does any of this, so the design is RWE's own. Keep it in the AI's existing style, and write sim tests that build a base, destroy part of it, tick, and check what gets requeued, reclaimed and defended.

Suggest one PR per numbered point.

🤖 Generated with Claude Code

https://claude.ai/code/session_018moxVoyHDBoHqkw8uqS3HX

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiThe skirmish computer playerenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions