all about editing savegames
Moderator: thunderchero
- thunderchero
- 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.
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...
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...
- thunderchero
- 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.
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
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
- Spocks-cuddly-tribble
- Code Master
- Posts: 1884
- Joined: Sun Apr 27, 2008 2:00 am
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
http://flocke.bplaced.net/botfwiki/inde ... &oldid=109
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?DCER wrote:empsInfo: known empires and known minors are not seperate fields, but one field read as long (8 bytes)
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:thunderchero wrote:0x0058 to 0x005B current intel different if changed during that turn AI shows 00 00 00 00
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.
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.Spocks-cuddly-tribble wrote: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?DCER wrote:empsInfo: known empires and known minors are not seperate fields, but one field read as long (8 bytes)
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.
- thunderchero
- 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.
Sorry my mistakeSpocks-cuddly-tribble wrote: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:thunderchero wrote:0x0058 to 0x005B current intel different if changed during that turn AI shows 00 00 00 00
http://flocke.bplaced.net/botfwiki/inde ... &oldid=109
it should have been
0x0078 to 0x007B current intel different if changed during that turn AI shows 00 00 00 00
thunderchero
- Spocks-cuddly-tribble
- Code Master
- Posts: 1884
- Joined: Sun Apr 27, 2008 2:00 am
Thanks DCER, this means the second sub-field is for the race IDs 32+.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.
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.
- thunderchero
- 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.
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)
[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.
- Flocke
- BORG Trouble Maker
- Posts: 3197
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
On request of Tachyonfang I've added some info on adding/removing buildings: http://flocke.bplaced.net/botfwiki/inde ... _Buildings
hope this helps Tachyonfang
hope this helps Tachyonfang
- DarthXavius
- Cadet 2nd Year
- Posts: 5
- Joined: Thu Feb 12, 2015 4:55 pm
Re: all about editing savegames
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?
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?
- Flocke
- BORG Trouble Maker
- Posts: 3197
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: all about editing savegames
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
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