Revolutionary but Probably Impossible Mod Idea
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.
Revolutionary but Probably Impossible Mod Idea
Simple in theory, but probably impossible to execute as a mod: changing the player's empire mid-game.
Example: You're playing as the Feds and you're kicking the AI empire's butts. Okay. Now suddenly, at, say, turn 200, you are in control of the Romulans instead and the AI takes over for you as the Feds. The AI gets all of your precisely managed colonies, your incredible research accomplishments and your devastating fleets, and you have to deal with whatever mess the AI left the Romulans in.
Can something like this be done? Because I've always wanted to be dropped into the middle of a game where I am a severe underdog. I know selecting a lower starting level for myself could sort of do this, but I like the idea of having to find a way to rescue an underdog empire mid-game.
Example: You're playing as the Feds and you're kicking the AI empire's butts. Okay. Now suddenly, at, say, turn 200, you are in control of the Romulans instead and the AI takes over for you as the Feds. The AI gets all of your precisely managed colonies, your incredible research accomplishments and your devastating fleets, and you have to deal with whatever mess the AI left the Romulans in.
Can something like this be done? Because I've always wanted to be dropped into the middle of a game where I am a severe underdog. I know selecting a lower starting level for myself could sort of do this, but I like the idea of having to find a way to rescue an underdog empire mid-game.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Revolutionary but Probably Impossible Mod Idea
I don't see any way to create an interface to accomplish your idea.
but you can do it manually;
1. open saved game with UE
2. change to multi player game (edit\game\game info)
3. save changes to saved game with UE
4. start a multiplayer game
5. host loads save and selects underdog race you want to play
6. joining player select original race
7. once both player are in game the joining player needs to exit game.
8. after joining player exits host player can save game in new/open slot.
9. open the saved game you just saved in open slot with UE
10. change to single player game (edit\game\game info)
11. save changes to saved game with UE
12 load saved game as underdog single player game
The reason you have to do all this is for AI to take proper control of original race and to allow you to get proper human control of underdog.
but you can do it manually;
1. open saved game with UE
2. change to multi player game (edit\game\game info)
3. save changes to saved game with UE
4. start a multiplayer game
5. host loads save and selects underdog race you want to play
6. joining player select original race
7. once both player are in game the joining player needs to exit game.
8. after joining player exits host player can save game in new/open slot.
9. open the saved game you just saved in open slot with UE
10. change to single player game (edit\game\game info)
11. save changes to saved game with UE
12 load saved game as underdog single player game
The reason you have to do all this is for AI to take proper control of original race and to allow you to get proper human control of underdog.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Revolutionary but Probably Impossible Mod Idea
In theory you can make it easier with a patch using sub_510BA0.thunderchero wrote: ↑Sat Jan 15, 2022 2:14 pmThe reason you have to do all this is for AI to take proper control of original race and to allow you to get proper human control of underdog.
First update savegame file -> gameInfo
Code: Select all
Offset 0x0250 player empires bitmask
Offset 0x0252 player empire
Best would be to insert the call in the beginning of sub_4387F0 (Load Game) and test if that works.
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: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Revolutionary but Probably Impossible Mod Idea
I tried to create a patch as suggested but would crash on game loadSpocks-cuddly-tribble wrote: ↑Sat Jan 15, 2022 3:43 pmIn theory you can make it easier with a patch using sub_510BA0.thunderchero wrote: ↑Sat Jan 15, 2022 2:14 pmThe reason you have to do all this is for AI to take proper control of original race and to allow you to get proper human control of underdog.
First update savegame file -> gameInfo
then use call sub_510BA0 to update player/AI control of the empires.Code: Select all
Offset 0x0250 player empires bitmask Offset 0x0252 player empire
Best would be to insert the call in the beginning of sub_4387F0 (Load Game) and test if that works.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Revolutionary but Probably Impossible Mod Idea
Sorry for the trouble.thunderchero wrote: ↑Sun Jan 16, 2022 12:00 amI tried to create a patch as suggested but would crash on game load
I see it's more complex. sub_510BA0 does not seem to auto check and update player/AI controll of all empires.
It needs ds:5A2998 resp ds:597504 loaded into 'al', so more research is needed.
This could be the updated player empires bitmask or some other marker.
And there might be even more issues.
EDIT: I think I got it now.
Do NOT update/edit the savegame file / gameInfo!
Instead the updated player empires bitmask must be loaded into al and afterwards into DS: 5A2B28.
Question is if this works in the beginning of sub_4387F0 (Load Game).
Code example:
mov byte [5A2B2A], (new player empire ID) e.g. 4 romulan
mov al, (new player empires bitmask) e.g. 10h when changing player empire to romulan
call sub_510BA0
mov byte [5A2B28] (player_empires_bitmask), (new player empires bitmask) same as above e.g. 10h.
EDIT2: To be on the safe side also add:
call 4569E0
call 438740
Patch should be removed before loading the next game!
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: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Revolutionary but Probably Impossible Mod Idea
I think you might be right
I think I followed your instructions correctly, but crash on attempt to load saved game with patch applied to change controlling race.
here is my changes using relocation table here is botf crash log
Version Under Test: 72
File: gdllist.c, Line: 667, gdlList != NULL
Initialize State: 31
Player Empire: 4 Starting Seed: 0
Galaxy shape: 0 Galaxy Size: 0
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Re: Revolutionary but Probably Impossible Mod Idea
Looks as if the files to alter aren't loaded yet.
The structure of sub_4387F0 (Load Game) is not well suited for multiplayer empire control update codes like sub_510BA0.
Adding the patch to end of 'load game' might cause issues with the saved game player data for this turn's incidents and other logs (calls at 438980 & 4389A3)?
Plus this little bugger needs to be adapted for GUI:
Code: Select all
00438864 mov al, ds:player_empire -> mov al, new empire ID
The benfit of a patch solution would be avoiding the need of a MP settup i.e. force code to do this for you:
thunderchero wrote: ↑Sat Jan 15, 2022 2:14 pm5. host loads save and selects underdog race you want to play -> sub_510BA0
7. once both player are in game the joining player needs to exit game. -> sub_510BA0
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: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Revolutionary but Probably Impossible Mod Idea
I don't
I did try suggestions above still crashed. new log
File: hash.c, Line: 74, hash != NULL
Initialize State: 31
Player Empire: 4 Starting Seed: 1642348299
Galaxy shape: 0 Galaxy Size: 2
Re: Revolutionary but Probably Impossible Mod Idea
Thanks all for looking into this.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Revolutionary but Probably Impossible Mod Idea
it is still possible you just need to do "race switch" manually. with UE and load as multiplayer game.