Spocks-cuddly-tribble wrote: ↑Tue Jan 11, 2022 8:19 pm
thunderchero wrote: ↑Tue Jan 11, 2022 3:47 pmdoes UE Extending the shiplist code need to be updated?
You should include: At 0xD49C, 0x2A736 and 0x34DE6 change: 52 73 to: 28 24.
0x4E698 (loc_44F295) -> Cube ID (block cube check)
Added, including another integrity check for when the BORG cube ID got changed.
Spocks-cuddly-tribble wrote: ↑Fri Apr 02, 2010 7:08 am
and set controlling race in shiplist.sst for monsters accordingly i.e. 0x24 +0-9.
This however is not checked and not supported by UE yet, and it is not set in shiplist.sst for any of the mods.
The race ID of the ship types is always 0x24 = BORG.
Therefore I fear the event checks will also work for other monsters now.
And by my expectation, changing it will break the monster race agent.
Edit:
Spocks-cuddly-tribble wrote: ↑Fri Apr 02, 2010 7:08 am
We can use instead: cmp word [eax+28h], 24h // (works with any shiplist)
At 0xD49C, 0x2A736 and 0x34DE6 change: 52 73 to: 28 24.
Explanation:
Ds: 5B2344 [GShipList]
Offset 0x0028 to 0x0029 = race-ID (even for monster unique, but not in shiplist.sst order !)
Offset 0x0052 to 0x0053 = shiplist.sst-ID
This makes more sense. I checked my sample game7.sav from
viewtopic.php?p=54002#p54002
It has one Chodak and that one indeed has race id 0x26 = 38 and not 36 = BORG.
So patch should be fine.
Spocks-cuddly-tribble wrote: ↑Fri Apr 02, 2010 7:08 am
Number of ships:
0x
6EC0A (sub_46F7D0) -> redundant
replace at 0x6EC08 -> 83 F8 7D 7D 5E with 90 90 90 90 90
0x
6EC68 (loc_46F85D) -> also redundant (at least in my tests, due to shiprace check)
replace at 0x6EC66 -> 83 FA 7D 7C with 90 90 90 EB
0x6EC0A indeed is just a redundant safeguard check, 0x6EC68 however makes sure to not read beyond the ship list end.
When you read beyond the data end, by luck of course the data happens to fail one of the other checks, but it's undefined behaviour.
Although it is just one of many locations that need to be fixed, I overworked the previous patch to now set and compare some integer value limit.
Code: Select all
NAME: UE ship build loop patch
DESC: replaces signed byte by integer comparison
AUTHOR: Flocke
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=61650#p61650
>> 0x0006EC04 89 44 24 10 83 F8 7D 7D 5E 31 C0 89 E2 8A 44 24 10
>> 0x0006EC5D 8B 54 24 10 42 89 54 24 10 83 FA 7D 7C A2
<< 0x0006EC04 90 90 3D 7D 00 00 00 7D 5E 90 90 89 E2 89 44 24 10
<< 0x0006EC5D 8B 44 24 10 40 3D 7D 00 00 00 7C A6 90 90
First check jumps to 2nd check, which reuses the "mov [esp+10h], eax" instruction from first check.
To activate without exceeding the limit, both segments need to be manually patched in segments view.
Spocks-cuddly-tribble wrote: ↑Fri Apr 02, 2010 7:08 am
0x
6EF89 (loc_46FB6A) -> redundant
replace at 0x6EF87 -> 66 3D 7D 00 74 with 90 90 90 90 EB
0x
6F02F (loc_46FC0A) -> redundant
replace at 0x6F02D -> 66 3D 7D 00 74 with 90 90 90 90 EB
These are two safeguard checks for the ship count in shiptech.sst and shiplist.sst.
You may call them redundant, but they provide proper error notification for when trek.exe is not properly patched to match stbof.res modded ship counts.
They are both already set by UE, plus they are short type values, so not limiting the moddable ship number.
Spocks-cuddly-tribble wrote: ↑Wed Jan 12, 2022 7:56 am
Maybe including values in sub_48B470 helps with this? There is a max ship ID +1 check, so max number of ships should be FEh.
...
thunderchero wrote: ↑Tue Jan 11, 2022 11:59 pmand is there any other location that UE does not edit currently?
I can't tell for sure, as I said sub_48B470 is unclear.
Cancel that, for all references to sub_48B470 (Monster__ship_race_IDs), you find that first the lexicon term 320h is looked up.
That string reads "%s{{, %s} and %s}", and guess what:
0x7B = '{'
0x7D = '}'
0x25 = '%'
0x73 = 's'
No BORG (0x73), no Crystal Entity (0x25), no orbital battery (0x7B) and no max ship ID limit (0x7D).
It is a plain text parsing routine!
In my lexicon lookup you can find that it's both used in combat screen and event summary:
viewtopic.php?p=55644#p55644