Build Queue project with 4 new slots

General Modding Information/Questions; support/discussion/questions

Moderator: thunderchero

Forum rules
:idea: Please search before starting new topic. :idea:
There is a good chance it has already been asked.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 950
Joined: Sun Apr 27, 2008 2:00 am

Re: Build Queue project with 4 new slots

Post by Spocks-cuddly-tribble »

We need the new asm code of your changed loc_44D517 with the new relocated section.

You already encountered code sequence issues wrt 'repne mov[x]'. This one is even a bit more complicated. It's part of a loop using ESP vs push, pop and so on.

Let's hope it's not a deep hidden global memory issue.

The (unused?) crash log line referes to 'numBytes':

0044D54D mov ebp, 1A2h
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 7:57 am We need the new asm code of your changed loc_44D517 with the new relocated section.
I have already made some changes in that sub-section here is an image from ida of my changes.
(best viewed in new window to allow zoom)
44D517.jpg
44D517.jpg (446.26 KiB) Viewed 531 times
after changes I am still getting same crash
Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 7:57 am Let's hope it's not a deep hidden global memory issue.
I thought about this also so I increased my changed memory locations +4 -> +20 (+4 per possible major race in multiplayer)

but this also had no effect
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 950
Joined: Sun Apr 27, 2008 2:00 am

Re: Build Queue project with 4 new slots

Post by Spocks-cuddly-tribble »

Try using default sub_44D4B0 with only this:

Code: Select all

0044D51F                 mov     ecx, 6Ch -> set new size value

0044D534   B9 6C000000    MOV ECX, 6C -> set new size value
0044D539   03E9           ADD EBP, ECX
0044D53B   290C24         SUB DWORD PTR SS:[ESP], ECX
0044D53E   833C24 00      CMP DWORD PTR SS:[ESP], 0
Good luck!


EDIT:

Check if you have this on your list:

sub_44D620

0044D6DB mov ecx, 6Ch -> you have this

How about:

Code: Select all

0044D6F7                 lea     esi, [edi+6Ch]

EDIT2:

There is also a list with entry size = systInfo queue data (default 6C) +2 (for system ID) = 6E

Remove and replace with: imul esi, eax, (new size+2) -> for create list

Code: Select all

AUTO:0044D5B6                 shl     eax, 2
AUTO:0044D5B9                 sub     eax, ecx
AUTO:0044D5BB                 shl     eax, 2
AUTO:0044D5BE                 sub     eax, ecx
AUTO:0044D5C0                 add     eax, eax
AUTO:0044D5C2                 lea     esi, ds:0[eax*4]
AUTO:0044D5C9                 add     esi, eax        ; provInfo entries *110 6E

Code: Select all

0044D6E4                 sub     ebx, 6Eh -> set new size +2



thunderchero wrote: Sat Jun 05, 2021 8:43 amI increased my changed memory locations +4 -> +20
Be careful. This might cause issues with the memory deallocation if the specified sizes do not match (your example values are not MP related). :wink:
Last edited by Spocks-cuddly-tribble on Sun Jun 06, 2021 11:31 am, edited 1 time in total.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

no progress today, I had to get my yearly eye exam and reading code was not easy. lol

tonight I wanted test my original changes to rule out issues with changing 1 byte to 4 byte. and with possible loc_44D517 (repne mov) issue.

what I did was changed all my values back to vanilla 4 slot and tested with no issues in multiplayer and single player, so I don't think those changes have issues.
Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 10:59 am Try using default sub_44D4B0 with only this:

Code: Select all

0044D51F                 mov     ecx, 6Ch -> set new size value

0044D534   B9 6C000000    MOV ECX, 6C -> set new size value
0044D539   03E9           ADD EBP, ECX
0044D53B   290C24         SUB DWORD PTR SS:[ESP], ECX
0044D53E   833C24 00      CMP DWORD PTR SS:[ESP], 0
same issue
Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 10:59 am Check if you have this on your list:

sub_44D620

0044D6DB mov ecx, 6Ch -> you have this
yes
Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 10:59 am How about:

Code: Select all

0044D6F7                 lea     esi, [edi+6Ch]
no, when I added this I got crash log

Code: Select all

Version Under Test: 72
File: ..\..\source\game\pdqueue.c, Line: 363, systemId!=NULL
Initialize State: 31
Player Empire: 3	Starting Seed: 1622944295
Galaxy shape: 0	Galaxy Size: 2
so I changed
Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 10:59 am

Code: Select all

0044D6E4                 sub     ebx, 6Eh -> set new size +2
after that change then in debug I crashed at

Code: Select all

0044D6ED F2 A5                   repne movsd
tomorrow I will add your changes, I will update this post when I test.
Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 10:59 am EDIT2:

There is also a list with entry size = systInfo queue data (default 6C) +2 (for system ID) = 6E

Remove and replace with: imul eax, (new size+2) -> for create list

Code: Select all

AUTO:0044D5B6                 shl     eax, 2
AUTO:0044D5B9                 sub     eax, ecx
AUTO:0044D5BB                 shl     eax, 2
AUTO:0044D5BE                 sub     eax, ecx
AUTO:0044D5C0                 add     eax, eax
AUTO:0044D5C2                 lea     esi, ds:0[eax*4]
AUTO:0044D5C9                 add     esi, eax        ; provInfo entries *110 6E

Code: Select all

0044D6E4                 sub     ebx, 6Eh -> set new size +2
If the "6E" is needed I seem to recall several other locations that this is used, but need to check later.... but strange it is only used in multiplayer?
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 950
Joined: Sun Apr 27, 2008 2:00 am

Re: Build Queue project with 4 new slots

Post by Spocks-cuddly-tribble »

All these codes work together for MP. They list every human player system's build queue data and copy it into the (saved)game files of the host.


44D5B6... -> prepare list size memory allocation = (number of player_empire systems) * 6E (queue data size 6C +2 for system Id)

sub_44D620 -> copy player queue data to list

sub_44D4B0 -> copy other players queue data from list to host files?


The size value 6E should only matter for codes handling those MP queue data lists. In sub_44D4B0 the 6E is calculated like this:

0044D4EE sub edx, 2 // for system ID
0044D537 sub ecx, 6Ch // for queue data


Feel free to post your other suspects and/or to try your code of sub_44D4B0 again with all the other values I listed above.

EDIT: Note you need all at the same time:

44D5B6...
44D6E4
44D6F7
And your or my changes of sub_44D4B0.


:!: EDIT2: Warning -> mistake on my side: :!:
Spocks-cuddly-tribble wrote: Sat Jun 05, 2021 10:59 amRemove and replace with: imul eax, (new size+2)
-> should be "imul esi, eax, 6E" (i.e. new queue data size +2)

Player empire list size must be in ESI and EAX. And the next instruction copies ESI to EAX:

Code: Select all

0044D5CB                 mov     eax, esi
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

progress report,

I am now able to process turn in multiplayer. :grin:
Thanks again to Spocks-cuddly-tribble again :up:

I did all of these changes on the fly so will need to go back and document them later after some more testing.

I have tested so far 20 turns and emptied full build queues on 6 systems. also had combat (this scared me when it crashed, but then I realized I was still in debug. Combat does not work in debug. but I wish I could get it to work :grin: )
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2711
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Build Queue project with 4 new slots

Post by Flocke »

thunderchero wrote: Sun Jun 06, 2021 4:27 pm progress report,

I am now able to process turn in multiplayer. :grin:
Thanks again to Spocks-cuddly-tribble again :up:
Cool and congratz! :up: :D
User avatar
Axis
Commander
Commander
Posts: 329
Joined: Sun Aug 16, 2015 8:28 am
Location: Finland, EU

Re: Build Queue project with 4 new slots

Post by Axis »

Sounds promising, might add this to my mod if it is stable enough.
After all 4K has enough space for them, and as planned with 50 X 50 icons (100 X 100 for energy screen).
No men est omen ;).
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

here is some image from ida of my changes

44d5b6_before (vanilla)
44d5b6_before.jpg
44d5b6_before.jpg (160.27 KiB) Viewed 397 times
44d5b6_after
44d5b6_after.jpg
44d5b6_after.jpg (143.67 KiB) Viewed 397 times
44D6B1_before (vanilla)
44D6B1_before.jpg
44D6B1_before.jpg (167.89 KiB) Viewed 397 times
44D6B1_after
44D6B1_after.jpg
44D6B1_after.jpg (233.54 KiB) Viewed 397 times
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

Testing update,

I have been testing with Xdx on UDML t5 many med irregular.

turn 0 - 33 was done with MPR++ installed.
I had zero crashes while Xdx had 3 crashes, first crash was while editing population, other 2 was while hovering over build list.

turns 33 - 75 was done without MPR++
we had a sync error at turn 44, reloaded last save and no crash after.
Xdx said he was trying to duplicate issues he had with MPR++ but never had any issues.

so with these limited tests, MPR++ might have a small issue when player uses nvidia driver (not related to build queue patch others have reported editing pop issue)? We did not have time to investigate this any further.

Note; I have AMD video driver

The issue might be able to be corrected by editing settings, or at least this is my hope.

testing will continue.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

I have update first post with new files with MP fix
warning if you have already installed the first release "test version" you should uninstall test patch before installing MP patch version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

Hi Everyone,

I was hoping for better results, but I found an issue when removing item in first build slot (top slot).

open game, either start new game or load game and everything is fine,

but if from that loaded saved game, if you load same or different saved game or even start new game. I am unable to remove item in first build slot.

if you close game and reopen game everything is normal again.

note; this happen both in single and MP

I have no idea what is causing this issue and a very strange issue....
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 950
Joined: Sun Apr 27, 2008 2:00 am

Re: Build Queue project with 4 new slots

Post by Spocks-cuddly-tribble »

thunderchero wrote: Thu Jun 24, 2021 9:34 ambut if from that loaded saved game, if you load same or different saved game or even start new game. I am unable to remove item in first build slot.
Can you elaborate. Is this a problem with the systInfo data 6Ch or GUI part (maybe intermediate data 34h)?

Also it's hard to keep track of project since forum search can't find code locations (e.g. 4FDF1B mov eax, 34h // 0xFD31C +4 per new slot)?
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6732
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Build Queue project with 4 new slots

Post by thunderchero »

Spocks-cuddly-tribble wrote: Thu Jun 24, 2021 10:56 am
thunderchero wrote: Thu Jun 24, 2021 9:34 ambut if from that loaded saved game, if you load same or different saved game or even start new game. I am unable to remove item in first build slot.
Can you elaborate. Is this a problem with the systInfo data 6Ch or GUI part (maybe intermediate data 34h)?

Also it's hard to keep track of project since forum search can't find code locations (e.g. 4FDF1B mov eax, 34h // 0xFD31C +4 per new slot)?
I don't think it is systinfo or GUI, when I hover over image I get the tool tip window, but when I click on image no sound and item is not removed.

this only happens on first slot, all other slots will remove item as they should.

I am looking at memory, not clearing?

I am also looking at the 4 new widgets, I do not have new code to destroy them. but my first attempt caused ctd on game reload.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 950
Joined: Sun Apr 27, 2008 2:00 am

Re: Build Queue project

Post by Spocks-cuddly-tribble »

thunderchero wrote: Thu May 13, 2021 9:46 pm

Code: Select all

4FD5E3 0xfc9e3 3B 41 04                cmp     eax, [ecx+4]
Changing this looks like an error. Try resetting default code. Related to 'remove item'.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
Post Reply

Return to “General Modding Information/Questions”