changing controling race of a single player game save.

changing AI controling race of a savegame; support/discussion/questions

Moderator: thunderchero

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1928
Joined: Sun Apr 27, 2008 2:00 am

changing controling race of a single player game save

Post by Spocks-cuddly-tribble »

thunderchero wrote: Mon Jun 01, 2009 8:28 pmUE has been unable to switch races without AI controling new race :cry:

how it is done;

first you need 2 computers or use warzone.
edit save to multiplayer game.
host load as original controlling race and person joining as new saved race.
EDIT; host player must leave game before joining person saves
joining person saves game without turning.
close game and open joined persons save he just saved and edit back to single player game.

Here is my (fixed!) single player patch with instructions: (not easier than multiplayer conversion)
SwitchPlayerEmpire.patch
(1.68 KiB) Downloaded 36 times

- install patch to trek.exe
- load saved game slot
- unselect F-11 Mudd cheat if active (all sectors 65,000 scan + all races/relationships, events & system stats)
- in options menu set strategic timer to new player-empire ID (0-4)
- save game to any slot
- exit BotF and remove patch from trek.exe

If new player-empire ID is 1-4: (all except cardassians)

- load saved game
- in options menu set strategic timer to 0
- save again to update strategic timer in saved game
- exit and re-start BotF (to avoid timer deviation crashes - a BotF default bug)

Code: Select all

NAME: Switch Player Empire = Strategic Timer (Options) When Saving (IDs 0-4) - UPDATED
DESC: Switches player/AI empires when saving game & resets all new AI files.
DESC: Disable/unselect F-11 cheat before saving to keep AI empires unknown.
DESC: Reload game after saving and remove patch from trek.exe.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=57851#p57851

>> 0x00037d9e e8 fd 53 01 00
>> 0x0004d188 00 00 00 00 00
>> 0x0004d18e 00 00
>> 0x0004d193 00 00 00 00 00 00 00
>> 0x0004d19b 00 00 00 00 00 c3 00 00 00 00 00
>> 0x0004d1a7 00 00 00 00 00 00 00 00
>> 0x000ef43e ee 85 f4

<< 0x00037d9e 90 90 90 90 90
<< 0x0004d188 8a 0d 7c 2b 5a
<< 0x0004d18e b8 01
<< 0x0004d193 d3 e0 50 e8 05 2e 0c
<< 0x0004d19b 58 a2 28 2b 5a 00 88 0d 2a 2b 5a
<< 0x0004d1a7 8B C5 e8 82 a8 fe ff c3
<< 0x000ef43e 46 dd f5


#0043899E     9090909090       NOP  // remove call nullsub 44DDA0

#0044DD88     8A0D 7C2B5A00    MOV CL, [5A2B7C]  // read strategical timer (options) as new player empire ID 0-4
#0044DD8E     B8 01000000      MOV EAX,1
#0044DD93     D3E0             SHL EAX,CL
#0044DD95     50               PUSH EAX
#0044DD96     E8 052E0C00      CALL 510BA0  // update player & AI files
#0044DD9B     58               POP EAX
#0044DD9C     A2 282B5A00      MOV [5A2B28],AL  // set new player empires bitmask
#0044DDA1     880D 2A2B5A00    MOV [5A2B2A],CL  // set new new player empire
#0044DDA7     8BC5             MOV EAX, EBP   // selected slot number
#0044DDA9     E8 82A8FEFF      CALL 438630    // save game
#0044DDAE     C3               RETN

#004F003D     E8 46DDF5FF      CALL 44DD88   // new save game with player/AI switch

EDIT:
Flocke wrote: Sat Apr 09, 2022 4:02 amChanging the game to single-player the game repeatedly crashes with:

Code: Select all

File: ..\..\source\game\solarapi.c, Line: 5279, query != NULL
systInfo 0x314-0x317 updWrkr: update worker assignments marker (f.e. after pop loss) -> bugged!
unsetting that flag, I progressed another 50 turns without error. I updated UE to report and unset that flag by the integrity checks
Code is a query for system labor allocations (systIfo+54... and/or ordInfo). systInfo+314 for player UI.

This issue can occur due to system random events like earthquake (destruction of manned buildings and/or pop loss), editing systems/buildings, converting a MP to a single player game or switching player empire. :wink:

Just loading a save auto-fixes the issue for MP games. This patch extends the feature to single player:

Code: Select all

NAME: Auto-fix 'solarapi.c, Line: 5279, query != NULL' when loading single player saves.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=57851#p57851

>> 0x00037022 75
<< 0x00037022 EB

#00437C1B    cmp   ds:gameInfo_4C_single0_MP1, 0
#00437C22    jnz   short is_MP_set_systInfo_314_0    ; 0x37022 75 -> EB
The update laborer allocations marker is used to show changes via ordInfo in GUI preview mode.
So this fix can sometimes mess up the GUI wrt planned changes of laborer allocations when re-loading saved games.
But it's a small drawback since it auto corrects next turn, so better than the crash problem. :wink:
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 “changing AI controling race of a savegame”