Skip to content

reimplement OpenSHC::AI::AICState - #165

Draft
gynt wants to merge 25 commits into
mainfrom
reimpl/AICState
Draft

gynt wants to merge 25 commits into
mainfrom
reimpl/AICState

Conversation

@gynt

@gynt gynt commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Currently did only a first pass using Claude. Not all methods yet, I ran out of tokens. I used TRD's skill documents, ghidra-mcp, and the tools/mcp/decomphelper.py script succesfully.

I guess it is better if I use
git restore --source otherbranch path/to/myfile.txt
to pick the 100% files and push them separately, deleting those files from this PR

@gynt
gynt marked this pull request as draft July 19, 2026 16:13
@gynt gynt self-assigned this Jul 19, 2026
@gynt
gynt force-pushed the reimpl/AICState branch from 83934e7 to 560411d Compare July 19, 2026 23:10
@gynt

gynt commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

See 2d8606c

@gynt
gynt force-pushed the reimpl/AICState branch 2 times, most recently from eadf1c4 to b86fb18 Compare July 29, 2026 09:16
@gynt
gynt force-pushed the reimpl/AICState branch from 2a76afb to c647d52 Compare August 3, 2026 21:26
@gynt
gynt force-pushed the reimpl/AICState branch from e278f53 to a5fac8e Compare August 16, 2026 20:12
@Krarilotus

Copy link
Copy Markdown
Contributor

I am implementing an opt-in AIC behavior extension (recruitment/sorties, one next-wave reserve, opponent/retaliation policy, bounded split raids) under the UCP owner, with the native path retained for non-opted-in personalities. I found this existing reconstruction PR and will preserve its ownership rather than open a competing AICState reconstruction.

Reference inspected: your 970160c and SHC 1.41 SHA256 3bb0a8c1e72331b3a30a5aa93ed94beca0081b476b04c1960e26d5b45387ac5a. Read-only disassembly confirms the attack-role gate at 0x4D3C15–0x4D3C20 returns when the per-player state at playerStride+0x115E99C is nonzero. aiGiveRaidInstructions also actually iterates six existing tribe entries (0x4D2DE8), so eight AIC composition slots do not establish spare group capacity. Neither observation proves safe reserves or a new raid partition.

Please let me know the preferred way to contribute any bounded, assembly-verified prerequisites to your existing work. I am keeping policy changes out of OpenSHC and have not enabled or advertised the unverified reconstruction as a runtime replacement. Shared loader prerequisites are tracked in UnofficialCrusaderPatch/extension-aicloader#17; there is no claim of native, MP, save/replay, or performance acceptance yet.

@Krarilotus

Copy link
Copy Markdown
Contributor

A bounded discrepancy from the same SHC 1.41 audit: src/OpenSHC/AI/AICState/createTribeForUnitType.cpp annotates 0x004CC960, while the member resolver points to 0x004CC910 at head 970160c. Please reconcile this before enabling/comparing that source; I have left your branch unchanged.

For the acquisition prerequisite, the existing UnitsState euroRecruit / nonEuroRecruit fourth argument already implements check-only behavior. It still writes diagnostics; knights also call GameStateStructures::recountStablesAndHorses and update all eight cached horse counts. I am reusing those original owners in the UCP policy adapter, with isolated query side effects, rather than adding a competing eligibility reconstruction.

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.

2 participants