Repository navigation
feat(ai): give the skirmish AI a personality per match (D-114) - #144
Merged
Merged
Conversation
Every local match against the AI played out identically: the AI is stateless with no PRNG by design, and the menu always started the canonical seed. Stage A varies the opponent between matches without drawing randomness during play. AiPersonality.Derive(seed, slot) is a pure function (XxHash64) that picks an opening (Balanced, Rush, Economy, Turtle), a flanked staging cell, one of eight placement-scan orientations and banded profile deltas. It is fixed at construction like the profile, so the AI stays stateless and save/restore-identical, and a logged seed reproduces the opponent. The main menu turns on a fresh seed per local match; tests and harnesses keep the canonical seed, NOVA_MATCH_SEED pins one, network matches keep the relay seed. The neutral personality reproduces r8 tick for tick, so the canonical AI outcome pin is unchanged; AiBehaviorId moves to r9 with the same profile hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Review PR #144 – feat(ai): KI-Persönlichkeit je Partie (D-114)Reviewer: unabhängige Read-only-Session (Claude Opus 5.5), 2026-10-17 Eigene Nachweise
BefundeB1 · Hoch · Die Flanke schiebt den Sammelpunkt aus dem Wellenring, Wellen und Heimverteidigung laufen dann leer
B2 · Mittel · Der Igel-Heimradius 14 umfasst den Sammelpunkt (12)
B3 · Niedrig (latent) · Ansturm mit Allianz-KI: Verliert sie den Builder, bleibt sie dauerhaft ohne Einkommen
B4 · Niedrig · Der Flanken-Test prüft andere Zellen als der Produktionscode
B5 · Niedrig ·
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was & Warum
Jede lokale Partie gegen die KI lief bisher identisch. Drei Ursachen kamen zusammen:
MatchBootstrap.CanonicalSeed.Stufe A behebt die ersten beiden Ursachen, ohne dass die KI während der Partie würfelt:
NOVA_MATCH_SEED=<hex>pinnt einen Seed zum Nachstellen. Netzpartien sind unberührt, ihr Seed kommt vom Relay.AiPersonality.Derive(seed, slot)ist eine reine Funktion und legt fest:default) spielt exakt wie r8, der gepinnte Ausgang der kanonischen KI-Partie bleibt unverändert.AiBehaviorIdsteigt auf r9, der Profil-Hash bleibt gleich.Vorbild ist C&C Generals, dessen KI unter gleich priorisierten Teams per Spielzufall aus dem Simulations-Seed wählt (offener EA-Quellcode). Übernommen sind nur Konzepte, kein Code. Die Entscheidung steht als D-114 im DecisionLog. D-110 bis D-113 sind auf
feat/generals-look-and-feelbelegt.Spielabnahme: zurückgestellt — nicht gespielt
dotnet test tools/Nova.SimRunner.Tests: 778/778 grün, davon 10 neu inAiPersonalityTests:Deriveist rein und deckt über 512 Seeds alle Bänder ab;-quitgefahren.Dieser PR ist damit mergebar, aber nicht spielerisch abgenommen und kein Meilenstein-Nachweis.
Betroffene Bereiche
AI.Data/AiPersonality.cs(neu),AiBehaviorId.cs,AI/SkirmishAiSystem.cs,AiFactionProfile.csMatchRunner.cs,MatchBootstrap.cs,Nova.Gameplay.asmdef(+Nova.AI.Data)MainMenuController.cs,DebugHud.csAiPersonalityTests.cs(neu),SkirmishAiTests.cs(Host-Spiegel um Persönlichkeit und KI-Fraktion erweitert, ID-Pinr9),Nova.AI.Tests.asmdef(+Nova.AI.Data; nur der Unity-Lauf hat das gefunden)Changelog: „Die KI spielt nicht mehr jede Partie gleich (D-114, Stufe A)“ unter
[Unreleased]/ Hinzugefügt.Nächster Hebel (nicht in diesem PR): Stufe B mit Fahrzeugfabrik, Panzern, Konter-Bau und Tech. Lernen innerhalb der Partie (Stufe C) braucht KI-Gedächtnis im Spielstand und eine eigene Entscheidung.
Checkliste
dotnet test tools/Nova.SimRunner.Testslokal grün (778/778)[Unreleased]in CHANGELOG.mdInhaber-PR: Selbst-Merge erst nach grüner Pflicht-CI und dokumentiertem, unabhängigem Read-only-Review (AGENTS.md §3) — das Review steht noch aus.
🤖 Generated with Claude Code