all about editing savegames

editing Savegames files; support/discussion/questions

Moderator: thunderchero

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

Post by thunderchero »

enigma,

This problem has been fix in latest version of UE but ships still would need to be moved manully (hex edited)

UE0.7.0

Also Mentat's canon map is colse to being completed :wink:

thunderchero
User avatar
enigma
Cadet 4th Year
Cadet 4th Year
Posts: 17
Joined: Thu May 08, 2008 2:00 am

Post by enigma »

Thanks, thunderchero

I'll use the new version of UE. I thought the version I downloaded with the latest version of UDM was the newest, but... okay, my fault :wink:
User avatar
enigma
Cadet 4th Year
Cadet 4th Year
Posts: 17
Joined: Thu May 08, 2008 2:00 am

Post by enigma »

there's still an error...

The list of star systems (UE-Systems-Info) shows me all the systems line for line like on the map in the game. Thats okay.. but the galactic map in the editor is different.
For example, in a new game I found the Amargosa system in sector 14.10, but in UE I find Amargosa in sector 13.12.
I colonized Amargosa.. and now I have the original Amargosa still in 14.10, but in sector 13.12 there's now another amargosa. It's exactly the same like the original and colonized, but without any functions: I can't terraform in sektor 13.12.

And I changed nothing in the editor, the error also occured on starting a new game...
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

Looking for a morale problem I found some info about "empsInfo" file

starting at

0x0054 - 0x0097 is for info edited during turn?

0x0098 - 0x00DB? info at end of last turn?

0x0058 to 0x005B current intel different if changed during that turn AI shows 00 00 00 00

0x00BC to 0x00BF intel total at end of last turn

0x0074 to 0x0077 current morale?

0x00B8 to 0x00BB morale at end of last turn?

0x0068 to 0x006B current research point different if changed during that turn AI shows 00 00 00 00

0x00AC to 0x00AF research at end of last turn

this all looks the same for other values found in that area

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

Post by Spocks-cuddly-tribble »

I added -> byte ptr [systInfo+30h] system type: 0=home, 1=native, 2=non native, 3=subjugated, 4=affiliated, 5=independent minor, 6=conquered major home, 7&8=invalid?, 9=any, A=rebel, B=empty

DCER wrote:empsInfo: known empires and known minors are not seperate fields, but one field read as long (8 bytes)
There are similar fields in alienInfo Offset 0x0020 & 0x0024. From what I remember major/minor seem to be accessed separately, but my programming skills are limited. Is it the same case there?

thunderchero wrote:0x0058 to 0x005B current intel different if changed during that turn AI shows 00 00 00 00
Please doublecheck this (empsInfo+58h seems to be income). Also I have updated the wiki with your other infos. You might want to correct in case I misinterpreted something:

http://flocke.bplaced.net/botfwiki/inde ... &oldid=109
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

Spocks-cuddly-tribble wrote:
DCER wrote:empsInfo: known empires and known minors are not seperate fields, but one field read as long (8 bytes)
There are similar fields in alienInfo Offset 0x0020 & 0x0024. From what I remember major/minor seem to be accessed separately, but my programming skills are limited. Is it the same case there?
I don't know how these field(s) in alienInfo work. But my guess would be it's likely an 8 byte field as well. From a programming standpoint it's much easier to access such a field than having two fields and then checking by id which field needs to be accessed and then fixing the id to become the index in the field (5 becomes 0 and so on). There's also no advantage that I can see in having two fields here.

In empsInfo you can check if the race is known like this:

1. calculate mask for the race:

long mask = 2^race_id

2. Do a bitwise "and" operation on the field and see if it returns the mask

if ((known_races & mask) == mask)
race is known

It basicly tests whether the race_id-th bit is set to 1.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

Spocks-cuddly-tribble wrote:
thunderchero wrote:0x0058 to 0x005B current intel different if changed during that turn AI shows 00 00 00 00
Please doublecheck this (empsInfo+58h seems to be income). Also I have updated the wiki with your other infos. You might want to correct in case I misinterpreted something:

http://flocke.bplaced.net/botfwiki/inde ... &oldid=109
Sorry my mistake

it should have been
0x0078 to 0x007B current intel different if changed during that turn AI shows 00 00 00 00

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

Post by Spocks-cuddly-tribble »

DCER wrote:From a programming standpoint it's much easier to access such a field than having two fields and then checking by id which field needs to be accessed and then fixing the id to become the index in the field (5 becomes 0 and so on). There's also no advantage that I can see in having two fields here.
Thanks DCER, this means the second sub-field is for the race IDs 32+.

The typical code access is:


IF race-ID < 20h

THEN

"and" 2^race_id, [EmpsInfo+158h] resp. [alienInfo+20h] resp. ds: 5A2B50

ELSE

"and" 2^(race_id -20h), [EmpsInfo+15Ch] resp. [alienInfo+24h] resp. ds: 5A2B54


So storing in alienInfo should be same as in EmpsInfo. But the meaning of the data could still differ.
ds: 5A2B50 / 5A2B54 should contain info if a race is still alive.
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: 7849
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

Here is one more I found messing with mentat's saved game.

gameInfo
0x0DBC victory condition (00 = single or Muilt player dominance 01 = Muilt player team dominance , 02 = vendetta)

thunderchero
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron »

Some variables that crossed my way:

[empsInfo]
0x010E to 0x010F
empire-wide ground combat bonus in percent
(from buildings like the Hall of Warriors)

[systInfo]
0x006E
resource level (0, 1, 2, 3, 4, 5, or 10)
A value that is set by subroutine 4B7A50 using a random value and comparing it to several constants.
This variable is used to set the Dilithium flag, and whenever it is read, it only matters if it is zero or if it is positive.
Most likely an abandoned feature.

[systInfo]
0x0071 (&0x08)
This is the actual Dilithium flag. No idea why they chose the 08 byte ^^

[GShipList]
0x0070 to 0x0073
base ground combat strength
(equal to the production value if the ship is a troop transport)
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke »

Gowron wrote:Some variables that crossed my way
have updated the wiki :)
the dilithium flag already has been known, but the resource level seems to be interesting, only figured it's used for showing the dilithium icon :roll:

btw. welcome back to active research :D
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke »

On request of Tachyonfang I've added some info on adding/removing buildings: http://flocke.bplaced.net/botfwiki/inde ... _Buildings

hope this helps Tachyonfang :)
User avatar
DarthXavius
Cadet 2nd Year
Cadet 2nd Year
Posts: 5
Joined: Thu Feb 12, 2015 4:55 pm

Re: all about editing savegames

Post by DarthXavius »

Hi All,

So I had the minor race subjugation -> rebellion can no longer propose treaties bug playing as romulans. I downloaded UE and couldn't figure out how to edit the extracted AlienInfo file with a hex editor, so I ran a verify integrity check and it detected the error (andorians status subjugated, but not assigned a race) and UE stated "Fixed", so I clicked save, nothing happened when I started up vanilla BOTF, so then I clicked save as and overwrote the save game file. Now, when I started up BOTF, I have all my former treaties, but all my trade routes are gone, all races (major and minor) are undiscovered, and my funds and income were reset both to 0. Everything else is as it should be, but even after (re)discovering the federation, I can't form trade routes even though under the diplomatic menu it still lists my friendship treaty with the fed. Any ideas?
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: all about editing savegames

Post by Flocke »

Hey DarthXavius, like thunderchero mentioned in the other thread, UE tends to corrupt savegames. So always do backups before editing them.
To manually edit treaties / known races, check empsInfo and alienInfo described over here: http://flocke.bplaced.net/botfwiki/inde ... g#empsInfo
Use UE to extract these files from your savegame, edit it with a hexeditor, add it back to your savegame with UE and that should do it.
good luck
Post Reply

Return to “editing Savegames files”