more savegames

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.
KrazeeXXL
BORG Trouble Maker
BORG Trouble Maker
Posts: 2323
Joined: Sat Jan 03, 2009 3:00 am
Location: the 36th Chamber

more savegames

Post by KrazeeXXL »

just an idea of me. would be cool to have more savegame slots. but might be difficult to implement.

Another, perhaps easier option would be very interesting for epic games which can last for a few hundred turns: use the auto.sav function to create savegames per turn and simply save all of them instead of rewriting auto.sav and last.sav all the time.

Sure you would've a savegame for every turn and this would clutter up the directory a bit but who cares. The savegames aren't this big and we live in 2012 where that couple of KB don't matter anymore. It'd also be beneficial to have such a "savegame-history" when you somehow have to deal with corrupted savegames. And as all of you know it really can be a PITA to play an epic game with someone and then the last working savegame is like from 20++ turns ago.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: more savegames

Post by thunderchero »

I looked into this while working on the 1024 project, to increase the saved game slots it would require changes similar to the energy project. So I would say this would be one of the lowest priority on that list. more build slots and larger fleets would be first imho. And none of these type of changes are easy to do.

thunderchero
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3237
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: more savegames

Post by Flocke »

I already had this idea in mind a while back. As turn process, save and load game are already hooked in mpr++, it should be kinda straight forward to implement something like this. And I agree, I'd love to have a better implementation too. Doing it manually every second turn just is annoying. :x

Good point.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2403
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: more savegames

Post by Tethys »

Some info I found this evening regarding save game slots and how they are tied to the loadsave.wdf
(Warning, stack pointer information included in code)

sub 4F0AC0

Code: Select all

AUTO:004F0AD4                                                     loc_4F0AD4:
AUTO:004F0AD4 008 8B 42 24                                        mov     eax, [edx+24h]
AUTO:004F0AD7 008 83 C2 18                                        add     edx, 24         ; number of textbox entries?
AUTO:004F0ADA 008 E8 91 5E 05 00                                  call    sub_546970      ; Call Procedure
AUTO:004F0ADF 008 39 CA                                           cmp     edx, ecx        ; Compare Two Operands
AUTO:004F0AE1 008 75 F1                                           jnz     short loc_4F0AD4 ; Jump if Not Zero (Z


AUTO:004F0AE4 00C BA 27 00 00 00                                  mov     edx, 27h        ; total wdf entries
AUTO:004F0AE9 00C B8 D4 5B 59 00                                  mov     eax, offset unk_595BD4 ; begin at first wdf entry
AUTO:004F0AEE 00C 8B 1D CC 5B 59 00                               mov     ebx, ds:dword_595BCC ; 4 bytes before FF FF FF FF (flag?)
AUTO:004F0AF4 00C E8 27 D4 04 00                                  call    read_ObjectFileMemory_2_WDF? ; Call Procedure
AUTO:004F0AF9 00C A1 CC 5B 59 00                                  mov     eax, ds:dword_595BCC ; 4 bytes before
AUTO:004F0AFE 00C 8B 10                                           mov     edx, [eax]
AUTO:004F0B00 00C 85 D2                                           test    edx, edx        ; Logical Compare
AUTO:004F0B02 00C 74 12                                           jz      short loc_4F0B16 ; Jump if Zero (ZF=1)

AUTO:004F0B04 00C 89 D0                                           mov     eax, edx
AUTO:004F0B06 00C E8 75 D2 04 00                                  call    sub_53DD80      ; Call Procedure
AUTO:004F0B0B 00C A1 CC 5B 59 00                                  mov     eax, ds:dword_595BCC ; 4 bytes before FF
AUTO:004F0B10 00C C7 00 00 00 00 00                               mov     dword ptr [eax], 0

AUTO:004F0B16                                                     loc_4F0B16:             ;
AUTO:004F0B16 00C A1 CC 5B 59 00                                  mov     eax, ds:dword_595BCC ; 4 bytes before FF
AUTO:004F0B1B 00C B9 FF FF FF FF                                  mov     ecx, 0FFFFFFFFh ; ID for trek.exe wdf block? FF FF FF FF
AUTO:004F0B20 00C E8 3B 23 FA FF                                  call    system_memory_clear_adr_eax ; Call Procedure
AUTO:004F0B25 00C 89 0D D0 5B 59 00                               mov     ds:loadsave_wdf_info, ecx ; 595BD0
AUTO:004F0B2B 00C 5B                                              pop     ebx
sub 4F04F0

Code: Select all

AUTO:004F052D                                                     loc_4F052D:             ;
AUTO:004F052D 00C 83 C0 18                                        add     eax, 24         ; total number textbox entry?
AUTO:004F0530 00C 42                                              inc     edx             ; Increment by 1
AUTO:004F0531 00C 3D 20 01 00 00                                  cmp     eax, 120h       ; Compare Two Operands
AUTO:004F0536 00C 7C C7                                           jl      short loc_4F04FF ; Jump if Less (SF!=OF

AUTO:004F0538 00C BA FF FF FF FF                                  mov     edx, 0FFFFFFFFh
AUTO:004F053D 00C EB C6                                           jmp     short loc_4F0505 ;

AUTO:004F0505                                                     loc_4F0505:
AUTO:004F0505 00C 89 15 D0 5B 59 00                               mov     ds:loadsave_wdf_info, edx
AUTO:004F050B 00C 89 D0                                           mov     eax, edx
AUTO:004F050D 00C C1 E2 02                                        shl     edx, 2          ; Shift Logical Left
AUTO:004F0510 00C 8B 1D CC 5B 59 00                               mov     ebx, ds:dword_595BCC ; 4 byte before FF FF FF FF
AUTO:004F0516 00C 29 C2                                           sub     edx, eax        ; Integer Subtraction
AUTO:004F0518 00C 8B 5C D3 20                                     mov     ebx, [ebx+edx*8+20h]
AUTO:004F051C 00C 89 D8                                           mov     eax, ebx
AUTO:004F051E 00C E8 ED 0B 05 00                                  call    sub_541110      ; Call Procedure ; textbox
AUTO:004F0523 00C 89 C5                                           mov     ebp, eax
AUTO:004F0525 00C 85 C0                                           test    eax, eax        ; Logical Compare
AUTO:004F0527 00C 75 16                                           jnz     short loc_4F053F ; Jump if Not Zero (ZF=0)

AUTO:004F053F                                                     loc_4F053F:             ; 3x wdf_info
AUTO:004F053F 00C 57                                              push    edi
AUTO:004F0540 010 56                                              push    esi
AUTO:004F0541 014 8B 15 D0 5B 59 00                               mov     edx, ds:loadsave_wdf_info
AUTO:004F0547 014 8D 04 95 00 00 00 00                            lea     eax, ds:0[edx*4] ; Load Effective Address
AUTO:004F054E 014 29 D0                                           sub     eax, edx        ; Integer Subtraction
AUTO:004F0550 014 B9 32 00 00 00                                  mov     ecx, 32h
AUTO:004F0555 014 C1 E0 03                                        shl     eax, 3          ; Shift Logical Left
AUTO:004F0558 014 8B 3D CC 5B 59 00                               mov     edi, ds:dword_595BCC ; 4 bytes before
AUTO:004F055E 014 01 D0                                           add     eax, edx        ; Add
AUTO:004F0560 014 81 C7 38 01 00 00                               add     edi, 138h       ; Add
AUTO:004F0566 014 01 C0                                           add     eax, eax        ; Add
AUTO:004F0568 014 89 EE                                           mov     esi, ebp
AUTO:004F056A 014 01 C7                                           add     edi, eax        ; Add
AUTO:004F056C 014 57                                              push    edi
AUTO:004F056D 018 89 C8                                           mov     eax, ecx
AUTO:004F056F 018 C1 E9 02                                        shr     ecx, 2          ; Shift Logical Right
AUTO:004F0572 018 F2 A5                                           repne movsd             ; Move Byte(s) from String to String
AUTO:004F0574 018 8A C8                                           mov     cl, al
AUTO:004F0576 018 80 E1 03                                        and     cl, 3           ; Logical AND
AUTO:004F0579 018 F2 A4                                           repne movsb             ; Move Byte(s) from String to String
AUTO:004F057B 018 5F                                              pop     edi
AUTO:004F057C 014 8B 15 D0 5B 59 00                               mov     edx, ds:loadsave_wdf_info
AUTO:004F0582 014 8D 04 95 00 00 00 00                            lea     eax, ds:0[edx*4] ; Load Effective Address
AUTO:004F0589 014 8B 0D CC 5B 59 00                               mov     ecx, ds:dword_595BCC ; 4 bytes before
AUTO:004F058F 014 29 D0                                           sub     eax, edx        ; Integer Subtraction
AUTO:004F0591 014 8A 44 C1 28                                     mov     al, [ecx+eax*8+28h]
AUTO:004F0595 014 25 FF 00 00 00                                  and     eax, 0FFh       ; Logical AND
AUTO:004F059A 014 E8 E1 A8 F4 FF                                  call    emps_colors_7   ; Call Procedure
AUTO:004F059F 014 89 C2                                           mov     edx, eax
AUTO:004F05A1 014 89 D8                                           mov     eax, ebx
AUTO:004F05A3 014 E8 A8 04 05 00                                  call    textbox___fnt_colour? ; Call Procedure
AUTO:004F05A8 014 89 EA                                           mov     edx, ebp
AUTO:004F05AA 014 89 D8                                           mov     eax, ebx
AUTO:004F05AC 014 E8 AF 15 05 00                                  call    textbox_unknown_file_? ; Call Procedure
AUTO:004F05B1 014 89 E8                                           mov     eax, ebp
AUTO:004F05B3 014 E8 7C D2 02 00                                  call    call_2x_clear_free_memory ; Call Procedure
AUTO:004F05B8 014 8B 15 D0 5B 59 00                               mov     edx, ds:loadsave_wdf_info
AUTO:004F05BE 014 8D 04 95 00 00 00 00                            lea     eax, ds:0[edx*4] ; Load Effective Address
AUTO:004F05C5 014 8B 0D CC 5B 59 00                               mov     ecx, ds:dword_595BCC ; 4 bytes before
AUTO:004F05CB 014 29 D0                                           sub     eax, edx        ; Integer Subtraction
AUTO:004F05CD 014 8B 5C C1 1C                                     mov     ebx, [ecx+eax*8+1Ch]
AUTO:004F05D1 014 8A 44 C1 28                                     mov     al, [ecx+eax*8+28h]
AUTO:004F05D5 014 25 FF 00 00 00                                  and     eax, 0FFh       ; Logical AND
AUTO:004F05DA 014 E8 A1 A8 F4 FF                                  call    emps_colors_7   ; Call Procedure
AUTO:004F05DF 014 89 C2                                           mov     edx, eax
AUTO:004F05E1 014 89 D8                                           mov     eax, ebx
AUTO:004F05E3 014 E8 68 04 05 00                                  call    textbox___fnt_colour? ; Call Procedure
AUTO:004F05E8 014 5E                                              pop     esi
AUTO:004F05E9 010 5F                                              pop     edi
AUTO:004F05EA 00C 5D                                              pop     ebp
AUTO:004F05EB 008 59                                              pop     ecx
AUTO:004F05EC 004 5B                                              pop     ebx
AUTO:004F05ED 000 C3                                              retn                    ; Return Near from Procedure
AUTO:004F05ED                                                     sub_4F04F0 endp

dgroup 595BD0

FF FF FF FF = some ID to locate loadsave wdf info in trek.exe -1 cmp/mov flag?
each entry = 12 byte length (0C)
first 4 bytes = wdf object type
second 4 bytes = wdf id number
third 4 bytes = unknown at this time

example: 02 00 00 00 1F 25 00 00 10 00 00 00
02 00 00 00 = wdf object type: button
1F 25 00 00 = converts to 9503, an ID, "Accept" button ID 9503 in loadsave.wdf
10 00 00 00 = unknown

Code: Select all

DGROUP:00595BD0  FF FF FF FF 02 00 00 00  1F 25 00 00 10 00 00 00      ...%.....
DGROUP:00595BE0  02 00 00 00 20 25 00 00  14 00 00 00 0D 00 00 00  ... %..¶......
DGROUP:00595BF0  21 25 00 00 04 00 00 00  0E 00 00 00 22 25 00 00  !%........"%..
DGROUP:00595C00  1C 00 00 00 02 00 00 00  23 25 00 00 18 00 00 00  ......#%.....
DGROUP:00595C10  0E 00 00 00 3A 25 00 00  20 00 00 00 0E 00 00 00  ...:%.. ......
DGROUP:00595C20  24 25 00 00 34 00 00 00  02 00 00 00 25 25 00 00  $%..4......%%..
DGROUP:00595C30  30 00 00 00 0E 00 00 00  3C 25 00 00 38 00 00 00  0......<%..8...
DGROUP:00595C40  0E 00 00 00 26 25 00 00  4C 00 00 00 02 00 00 00  ...&%..L......
DGROUP:00595C50  27 25 00 00 48 00 00 00  0E 00 00 00 3E 25 00 00  '%..H......>%..
DGROUP:00595C60  50 00 00 00 0E 00 00 00  28 25 00 00 64 00 00 00  P......(%..d...
DGROUP:00595C70  02 00 00 00 29 25 00 00  60 00 00 00 0E 00 00 00  ...)%..`......
DGROUP:00595C80  40 25 00 00 68 00 00 00  0E 00 00 00 2A 25 00 00  @%..h......*%..
DGROUP:00595C90  7C 00 00 00 02 00 00 00  2B 25 00 00 78 00 00 00  |......+%..x...
DGROUP:00595CA0  0E 00 00 00 42 25 00 00  80 00 00 00 0E 00 00 00  ...B%..Ç......
DGROUP:00595CB0  2C 25 00 00 94 00 00 00  02 00 00 00 2D 25 00 00  ,%..ö......-%..
DGROUP:00595CC0  90 00 00 00 0E 00 00 00  44 25 00 00 98 00 00 00  É......D%..ÿ...
DGROUP:00595CD0  0E 00 00 00 2E 25 00 00  AC 00 00 00 02 00 00 00  ....%..¼......
DGROUP:00595CE0  2F 25 00 00 A8 00 00 00  0E 00 00 00 46 25 00 00  /%..¿......F%..
DGROUP:00595CF0  B0 00 00 00 0E 00 00 00  30 25 00 00 C4 00 00 00  ¦......0%..-...
DGROUP:00595D00  02 00 00 00 31 25 00 00  C0 00 00 00 0E 00 00 00  ...1%..+......
DGROUP:00595D10  48 25 00 00 C8 00 00 00  0E 00 00 00 32 25 00 00  H%..+......2%..
DGROUP:00595D20  DC 00 00 00 02 00 00 00  33 25 00 00 D8 00 00 00  _......3%..+...
DGROUP:00595D30  0E 00 00 00 4A 25 00 00  E0 00 00 00 0E 00 00 00  ...J%..a......
DGROUP:00595D40  34 25 00 00 F4 00 00 00  02 00 00 00 35 25 00 00  4%..(......5%..
DGROUP:00595D50  F0 00 00 00 0E 00 00 00  4C 25 00 00 F8 00 00 00  =......L%..°...
DGROUP:00595D60  0E 00 00 00 36 25 00 00  0C 01 00 00 02 00 00 00  ...6%.......
DGROUP:00595D70  37 25 00 00 08 01 00 00  0E 00 00 00 4E 25 00 00  7%.......N%..
DGROUP:00595D80  10 01 00 00 0E 00 00 00  38 25 00 00 24 01 00 00  .....8%..$..
DGROUP:00595D90  02 00 00 00 39 25 00 00  20 01 00 00 0E 00 00 00  ...9%.. .....
DGROUP:00595DA0  50 25 00 00 28 01 00 00
More info had been found by SCT which is also relevant, which omits use of FF FF FF FF wdf info locator for trek.exe, but instead uses dword 4 bytes preceding locator

sub 4EFF90

Code: Select all

AUTO:004EFFB9                                                     loc_4EFFB9:             ;
AUTO:004EFFB9 DDC 3B 0D D0 5B 59 00                               cmp     ecx, ds:loadsave_wdf_info ; 595BD0
AUTO:004EFFBF DDC 0F 8F 85 01 00 00                               jg      loc_4F014A      ; Jump if Greater (ZF=0 & S

AUTO:004EFFC5 DDC 57                                              push    edi
AUTO:004EFFC6 DE0 8D 04 AD 00 00 00 00                            lea     eax, ds:0[ebp*4] ; Load Effective Address
AUTO:004EFFCD DE0 8B 0D CC 5B 59 00                               mov     ecx, ds:dword_595BCC ; 4 bytes before FF FF FF FF
AUTO:004EFFD3 DE0 29 E8                                           sub     eax, ebp        ; Integer Subtraction
AUTO:004EFFD5 DE0 8B 44 C1 20                                     mov     eax, [ecx+eax*8+20h]
AUTO:004EFFD9 DE0 BF E5 28 5A 00                                  mov     edi, offset unk_5A28E5
AUTO:004EFFDE DE0 E8 2D 11 05 00                                  call    sub_541110      ; Call Procedure
AUTO:004EFFE3 DE0 B9 32 00 00 00                                  mov     ecx, 32h
AUTO:004EFFE8 DE0 89 C6                                           mov     esi, eax
AUTO:004EFFEA DE0 89 84 24 C4 0D 00 00                            mov     [esp+0DC4h], eax
AUTO:004EFFF1 DE0 57                                              push    edi
AUTO:004EFFF2 DE4 89 C8                                           mov     eax, ecx
AUTO:004EFFF4 DE4 C1 E9 02                                        shr     ecx, 2          ; Shift Logical Right
AUTO:004EFFF7 DE4 F2 A5                                           repne movsd             ; Move Byte(s) from String to String
AUTO:004EFFF9 DE4 8A C8                                           mov     cl, al
AUTO:004EFFFB DE4 80 E1 03                                        and     cl, 3           ; Logical AND
AUTO:004EFFFE DE4 F2 A4                                           repne movsb             ; Move Byte(s) from String to String
AUTO:004F0000 DE4 5F                                              pop     edi
AUTO:004F0001 DE0 A0 2A 2B 5A 00                                  mov     al, ds:player_empire
AUTO:004F0006 DE0 88 84 24 C8 0D 00 00                            mov     [esp+0DC8h], al
AUTO:004F000D DE0 3C 05                                           cmp     al, 5           ; Compare Two Operands
AUTO:004F000F DE0 72 08                                           jb      short manual_save ; Jump if Below (CF=1)

Last edited by Tethys on Fri Sep 29, 2023 7:16 am, edited 1 time in total.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2403
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: more savegames

Post by Tethys »

I have successfully relocated the widget ID table located at asm 595BD4 to within the relocation table, adjusted the 4 offset pointers to the new relocated data, and nop'd the old ID table just to be sure I wasn't reading the wrong table. Loaded a save no problemo. Saved a game no problemo. So, now I will add the 3 widget IDs for the new save slot and see what happens when I click on it... fun times coming
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: more savegames

Post by thunderchero »

I think at one point I was real close, but decided it was not worth it. And don't forget to make extra saved game files (game12.sav) in install path or I think it will crash.

but did find this little gem
Making last.sav accessible in load screen
viewtopic.php?p=53857#p53857
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2403
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: more savegames

Post by Tethys »

thunderchero wrote: Fri Sep 29, 2023 10:28 pm I think at one point I was real close, but decided it was not worth it. And don't forget to make extra saved game files (game12.sav) in install path or I think it will crash.

but did find this little gem
Making last.sav accessible in load screen
viewtopic.php?p=53857#p53857
Yes, I have been following. Right now, as it sits I am having trouble extending the wdf entry ID table. I have game12.sav in place, a copy of game10.sav renamed. It should populate the string if one exists and the code works. But, as it sits I am getting crashes trying to access the loadsave screen. It might be far more intricate than I thought; I did potentially identify several unlabeled code locations related to loadsave. It does seem like I am missing information though. Specifically coming to mind the number 120h (20 01 = 288 = last button entry in loadscreen wdf) and 138h (total size of all entries in loadscreen wdf +4). It also appears that each wdf slot is tied to a specific sav file. Supporting code will be needed for the others provided I can find it.

If you want to work the project together you know where to reach me :)
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1925
Joined: Sun Apr 27, 2008 2:00 am

Re: more savegames

Post by Spocks-cuddly-tribble »

It's kinda hard to follow your projects due to confusing/missing notes, have you edited this:
004F0531         cmp     eax, 120h                         ; slots * 0x18

004F0560         add     edi, 138h                         ; (slots+1) * 0x18


004F0ACE         add     ecx, 120h                         ; slots * 0x18
I will come back to your other projects ASAP. :wink:

EDIT: There is even more of them:
004F0BB0         add     edx, 120h

004F0C5D         lea     esi, [edi+138h]

004F0C7F         lea     ebp, [edi+120h]

004F0D7E         add     edx, 120h

004F018B         add     esi, 120h

004F02A1         cmp     ebx, 120h

004F02E2         add     edi, 138h   ???
004F034C         lea     edx, [eax+138h]   ???

004F0375         add     eax, 138h  ???

004F01FB         cmp     ecx, 120h

00438B34         cmp     cx, 0Ch   // slots

maybe?
004F065E         add     ecx, 138h
004F06BE         lea     esi, [ebp+138h]
004F0766         lea     edx, [ebp+138h]
Last edited by Spocks-cuddly-tribble on Sat Sep 30, 2023 3:20 pm, edited 7 times 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
Tethys
Past Administrator
Past Administrator
Posts: 2403
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: more savegames

Post by Tethys »

I am just mowing over stuff to refamiliarize myself with BotF code. I am trying to get myself back to the point where everything "clicks" and becomes routine.

I can post my IDA (based on yours) which has lots of new labels for "LoadSave" and "LdSv" that would probably be easier than typing them all out. I'll start re-editing this post in a little while to start rattling off locations with possible loadsave data:
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: more savegames

Post by thunderchero »

Damn dword_595BD0 is called 26 time, that is a lot of offset to edit lol
plus code that goes along with each offset no wonder I said it was not worth it.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3237
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: more savegames

Post by Flocke »

Since the load routine has already been figured, all we need is interface the WDF GUI to detect when the view becomes visible, fill text boxes and handle the button click. Any analysis in this direction is welcome. ;)
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1925
Joined: Sun Apr 27, 2008 2:00 am

Re: more savegames

Post by Spocks-cuddly-tribble »

I know not much about wdf handling in trek.exe, but if the wdf part of the project works then my above values should do the rest (unless I missed some or a nasty esp stack). Just list and sort them in code order and try with the wdf patch. :wink:

EDIT: There is other special code for PM games... :mad:

EDIT2: It's even worse. There is a fixed size data stack and all following locations might need relocation (138h+):
004F0B3B         mov     eax, 3C8h  // size

595BCC save_slots_data_3C8
I'm out...
Last edited by Spocks-cuddly-tribble on Sat Sep 30, 2023 3:28 pm, edited 5 times 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: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: more savegames

Post by thunderchero »

here is the 26 location
004EFFB9 3B 0D D0 5B 59 00                  cmp     ecx, [ds:dword_595BD0]
004F0505 89 15 D0 5B 59 00                  mov     [ds:dword_595BD0], edx
004F0541 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F057C 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F05B8 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F0616 89 15 D0 5B 59 00                  mov     [ds:dword_595BD0], edx
004F06A7 A1 D0 5B 59 00                     mov     eax, [ds:dword_595BD0]
004F06D2 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F070E A1 D0 5B 59 00                     mov     eax, [ds:dword_595BD0]
004F0723 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F0752 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F0779 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F07A1 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F0835 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F084B 8B 0D D0 5B 59 00                  mov     ecx, [ds:dword_595BD0]
004F08D4 8B 15 D0 5B 59 00                  mov     edx, [ds:dword_595BD0]
004F08FC 83 3D D0 5B 59 00 00               cmp     [ds:dword_595BD0], 0
004F0920 A1 D0 5B 59 00                     mov     eax, [ds:dword_595BD0]
004F094C C7 05 D0 5B 59 00 FF FF FF FF      mov     [ds:dword_595BD0], 0FFFFFFFFh
004F096B C7 05 D0 5B 59 00 FF FF FF FF      mov     [ds:dword_595BD0], 0FFFFFFFFh
004F097B A1 D0 5B 59 00                     mov     eax, [ds:dword_595BD0]
004F0993 89 1D D0 5B 59 00                  mov     [ds:dword_595BD0], ebx
004F09FA C7 05 D0 5B 59 00 FF FF FF FF      mov     [ds:dword_595BD0], 0FFFFFFFFh
004F0B25 89 0D D0 5B 59 00                  mov     [ds:dword_595BD0], ecx
004F0C06 89 0D D0 5B 59 00                  mov     [ds:dword_595BD0], ecx
004F0DD4 89 35 D0 5B 59 00                  mov     [ds:dword_595BD0], esi
EDIT
wdf id's are at max now (so wdf id's will not follow same pattern but that is not an issue)
button 1 row text 2 would conflict with button 13 id's
But those ID's don't have to be in order
but the trek.exe id's do have to be in order

trek.exe id's in () in hex, the value prior is wdf id's as viewed in UE example (9507 = 23 25 00 00 in trek)
button 1 9507 (18 00 00 00) textbox 1 9506 (1C 00 00 00) text 2 9530 (20 00 00 00)
button 2 9509 (30 00 00 00) textbox 1 9508 (34 00 00 00) text 2 9532 (38 00 00 00)
button 3 9511 (48 00 00 00) textbox 1 9510 (4C 00 00 00) text 2 9534 (50 00 00 00)
button 4 9513 (60 00 00 00) textbox 1 9512 (64 00 00 00) text 2 9536 (68 00 00 00)
button 5 9515 (78 00 00 00) textbox 1 9514 (7C 00 00 00) text 2 9538 (80 00 00 00)
button 6 9517 (90 00 00 00) textbox 1 9516 (94 00 00 00) text 2 9540 (98 00 00 00)
button 7 9519 (A8 00 00 00) textbox 1 9518 (AC 00 00 00) text 2 9542 (B0 00 00 00)
button 8 9521 (C0 00 00 00) textbox 1 9520 (C4 00 00 00) text 2 9544 (C8 00 00 00)
button 9 9523 (D8 00 00 00) textbox 1 9522 (DC 00 00 00) text 2 9546 (E0 00 00 00)
button 10 9525 (F0 00 00 00) textbox 1 9524 (F4 00 00 00) text 2 9548 (F8 00 00 00)
button 11 9527 (08 01 00 00) textbox 1 9526 (0C 01 00 00) text 2 9550 (10 01 00 00)
button 12 9529 (20 01 00 00) textbox 1 9528 (24 01 00 00) text 2 9552 (28 01 00 00)

new 13+ buttons (new buttons should contiue pattern below)
button 13 9553 (38 01 00 00) textbox 1 9554 (3C 01 00 00) text 2 9555 (40 01 00 00)
button 14 9556 (50 01 00 00) textbox 1 9557 (54 01 00 00) text 2 9558 (58 01 00 00)
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2403
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: more savegames

Post by Tethys »

@ TC question: Did you ever have the text reading from a 13th save?

@ SCT the 138h seems to be the total size in bytes +4 of the wdf widget ID's data block. Shifting those bytes should work? What worries me is the unknown 914h 918h because those might perhaps encompass more than just the saveload process/widget stuff we're after.

cmp 0D and mov 0C (if any exist that are not string lengths) need to be adjusted, I didn't look for many mov 0C because its typically a string length value. And I just finished a fair bit of work on GALM, added a few graphics, adjusted some building stats, reduced some of the ship ranges for better gameplay, rebalanced the Romulans (they were sooo OP), updated all Federation ship descriptions to new format, fleshed out the major race opening descriptions, and I am considering replacing one of the minors with Coridan.. not sure who gets the boot yet.. yeah I am a bit tired at the moment. Oh, and I guess something broke on the extended techs its only displaying 10 of 15 in the tech screen. Not sure how the value reverted or what patch reverted it, but I will find and fix it (graphical error only, no crashing)
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7929
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: more savegames

Post by thunderchero »

Tethys wrote: Sun Oct 01, 2023 5:36 am @ TC question: Did you ever have the text reading from a 13th save?
I don't think so, that was 12 years ago when I was working on 1024 project with QD.

personally I would rather see a different approach, I always like the way MPR++ saved game to a new folder with saved game name ("playing race" "turn".sav) on start of each turn automatically.

we should be able to do this if we call to a new sub right before auto sav sub returns.
new sub would create a copy of auto.sav and rename to example federation 0.sav to the "save" folder.

we have examples of code calling folder (english/german) folder
we have examples of coping and renaming sav file (auto -> last.sav)
I have not found location but we should have example of code reading race and turn of sav file when it adds text to a blank sav.
what else would we need?
Post Reply

Return to “General Modding Information/Questions”