Skip to content

Clarify attack recruitment selection and improve assembly match - #239

Closed
Krarilotus wants to merge 26 commits into
sourcehold:reimpl/AICStatefrom
Krarilotus:reimpl/aic-attack-recruitment-style
Closed

Krarilotus wants to merge 26 commits into
sourcehold:reimpl/AICStatefrom
Krarilotus:reimpl/aic-attack-recruitment-style

Conversation

@Krarilotus

Copy link
Copy Markdown
Contributor

The draft selector in #165 still carries decompiler temporaries, a numeric end pointer and do loops. This change uses the declared eleven-entry role array, reads the named AIC/player fields at their use sites, and keeps the same eligibility, RNG and fallback behavior.

The RelWithDebInfo MSVC 2005 SP1 compile and link produced the DLL/PDB. reccmp against the specified SHC 1.41 reference improved from 76.9% to 97.1% for AICState::randomlySelectAttackUnitTypeToRecruit at 0x004CC070. The remaining difference is one independent add eax,eax scheduled on the other side of an AIC maximum load; original function calls and global resolver addresses are excluded from the structural conclusion. The old mt.exe faults while embedding the manifest on this Windows host, so the normal build command returns failure despite compiler/linker output; this local tool failure remains to be resolved before treating the full build as green.

The wiki note explains what this selector reads and makes clear that engineer role totals are written elsewhere. This is an original-game reconstruction contribution related to UCP AIC issues #18/#20, not a UCP behavior patch or a runtime binding.

@Krarilotus

Copy link
Copy Markdown
Contributor Author

I fetched the current reimpl/AICState head after opening this PR. It was force-updated from the older local snapshot, and it already contains this selector's style cleanup. Compiling that current source against the same SHC 1.41 fixture and comparing the resulting DLL/PDB gives 98.55% for 0x004CC070, better than this branch's 97.10%. I am closing this duplicate rather than replacing gynt's stronger implementation. The test build on this host reaches compilation/linking, then its old mt.exe faults at manifest embedding; reccmp reads the linked output. No UCP behavior change is claimed here.

@Krarilotus Krarilotus closed this Sep 27, 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.

2 participants