AIV troop-spot loader skips 3 unit types (pikemen / swordsmen / Arabian swordsmen) — placed troops never walk to their AIV positions #192
Replies: 5 comments
|
Why is it not intent? I mean I find it hard to cause their intent as well, but it could have bene intent. Do you have more information I am not aware of? |
|
I can not speak about intent here, since someone clearly created the original code, even by mistake, but at the current stage, the projects aim is recreating the game, including all "mistakes". I personally do not think this is the right place for them, since it will be a huge while till something like this can be considered. As long as it is documented in the repo of the UCP module the same way, I also do not think this will be lost, since UCP modules are likely candidates of things people would want to integrate once the reimplementation is done. @gynt, what do you think? |
|
In the specific case, we can remember this issue for the In the general case however, it may not be that simple to convert such an issue into a code comment. I see several options:
Personally I am in favor of 4 or 5. 4 looks much more engaging on GitHub, because we can discuss quirks that are posted. |
|
I think 4 is good. Also checked if there is an API for the discussions (for the case that we really need to extract and move them) and there seems to be a GraphQL one LINK. There should be hints in the README and on the website. Using the discussion feature on Github is more niche then just opening an issue, so we need to point people there, something like
I do not know the capabilities of Github discussions, though. Sorry @DDanielDragon for using you issue for this btw., but we have to figure out what to do with findings like yours. |
|
I converted this issue to a discussion in the category "Code issues". Thanks again @DDanielDragon for raising this issue in a very clear way. |
Uh oh!
There was an error while loading. Please reload this page.
Hi — sharing a finding from reverse-engineering the AIV troop-spot behaviour, in case it's useful for the reimplementation. All base-
Stronghold Crusader.exeaddresses below are against the SHA256 your SARIF targets (3BB0A8C1…AC5A); I verified the same bug exists in Crusader Extreme and shipped a UCP3 fix for it.Symptom
Start troops placed at AIV unit positions (section 2012) never walk to their spots for three unit types, while ranged units / knights / assassins do. Most visibly the Arabic lords' swordsmen just idle at the keep. Firefly fixed this for the Definitive Edition; the original engine never was.
Mechanism
The loop that decodes AIV section 2012 into the per-AI spot arrays contains an explicit skip of three rows. In base SHC at
0x4EF4B0:The row index is the
AIVUnitType(your enum). Skipped: 9 = Pikeman, 11 (0xB) = Swordsman, 18 (0x12) = Arabian Swordsman — three melee infantry types. Their positions are discarded, so the downstream assignment (AICState::sendWallPatrolUnitTribesToAIVLocationsin your naming) finds no spot for them and they never get a move order.Why it looks like a bug, not intent
je(NOP) makes them march to their positions, matching DE behaviour. Verified live.Crusader Extreme
Same code, shifted addresses (Extreme has extra code; base and Extreme addresses do not coincide). In
Stronghold_Crusader_Extreme.exethe skip block is at0x4EF840. I can provide the Extreme↔base mapping for the surrounding AI functions if that helps your cross-version work — happy to contribute.Thanks for OpenSHC; the named symbols (
sendWallPatrolUnitTribesToAIVLocations,getDefensiveTribeForUnit,aiGiveOuterPatrolCommand, theAIVUnitTypeenum) made confirming all of this much faster.All reactions