Build Queue project with 4 new slots
Moderator: thunderchero
Forum rules
Please search before starting new topic.
There is a good chance it has already been asked.
Please search before starting new topic.
There is a good chance it has already been asked.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Build Queue project with 4 new slots
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
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.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
I have already made some changes in that sub-section here is an image from ida of my changes.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.
(best viewed in new window to allow zoom)
after changes I am still getting same crash
I thought about this also so I increased my changed memory locations +4 -> +20 (+4 per possible major race in multiplayer)Spocks-cuddly-tribble wrote: ↑Sat Jun 05, 2021 7:57 am Let's hope it's not a deep hidden global memory issue.
but this also had no effect
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Build Queue project with 4 new slots
Try using default sub_44D4B0 with only this:
Good luck!
EDIT:
Check if you have this on your list:
sub_44D620
0044D6DB mov ecx, 6Ch -> you have this
How about:
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
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
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
Be careful. This might cause issues with the memory deallocation if the specified sizes do not match (your example values are not MP related).
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.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
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.
so I changed
tomorrow I will add your changes, I will update this post when I test.
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.
same issueSpocks-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
yesSpocks-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
no, when I added this I got crash logSpocks-cuddly-tribble wrote: ↑Sat Jun 05, 2021 10:59 am How about:
Code: Select all
0044D6F7 lea esi, [edi+6Ch]
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
after that change then in debug I crashed atSpocks-cuddly-tribble wrote: ↑Sat Jun 05, 2021 10:59 amCode: Select all
0044D6E4 sub ebx, 6Eh -> set new size +2
Code: Select all
0044D6ED F2 A5 repne movsd
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?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
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Build Queue project with 4 new slots
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:
Player empire list size must be in ESI and EAX. And the next instruction copies ESI to EAX:
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:
-> should be "imul esi, eax, 6E" (i.e. new queue data size +2)Spocks-cuddly-tribble wrote: ↑Sat Jun 05, 2021 10:59 amRemove and replace with: imul eax, (new 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.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
progress report,
I am now able to process turn in multiplayer.
Thanks again to Spocks-cuddly-tribble again
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 )
I am now able to process turn in multiplayer.
Thanks again to Spocks-cuddly-tribble again
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 )
- Flocke
- BORG Trouble Maker
- Posts: 3246
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Build Queue project with 4 new slots
Cool and congratz!thunderchero wrote: ↑Sun Jun 06, 2021 4:27 pm progress report,
I am now able to process turn in multiplayer.
Thanks again to Spocks-cuddly-tribble again
Re: Build Queue project with 4 new slots
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).
After all 4K has enough space for them, and as planned with 50 X 50 icons (100 X 100 for energy screen).
Impress the Empress.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
here is some image from ida of my changes
44d5b6_before (vanilla) 44d5b6_after 44D6B1_before (vanilla) 44D6B1_after
44d5b6_before (vanilla) 44d5b6_after 44D6B1_before (vanilla) 44D6B1_after
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
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.
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.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
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
warning if you have already installed the first release "test version" you should uninstall test patch before installing MP patch version
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
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....
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....
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Build Queue project with 4 new slots
Can you elaborate. Is this a problem with the systInfo data 6Ch or GUI part (maybe intermediate data 34h)?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.
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.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7933
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Build Queue project with 4 new slots
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.Spocks-cuddly-tribble wrote: ↑Thu Jun 24, 2021 10:56 amCan you elaborate. Is this a problem with the systInfo data 6Ch or GUI part (maybe intermediate data 34h)?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.
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)?
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.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Build Queue project
Changing this looks like an error. Try resetting default code. Related to 'remove item'.thunderchero wrote: ↑Thu May 13, 2021 9:46 pmCode: Select all
4FD5E3 0xfc9e3 3B 41 04 cmp eax, [ecx+4]
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.