Region definition and bloated Save files

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Realspace
Posts: 1371
Joined: Wed, 15. Nov 06, 10:21
x4

Region definition and bloated Save files

Post by Realspace » Mon, 11. Jul 22, 14:40

I start a new topic bc maybe this can be of general interest. In my last mod I faced a new issue, i.e. a bloated save file. My mod enlarges the map by a factor of 3/4 (sectors) so something was to be expected, but not so much. The first save file is even 3.5gb :o

In this mod I added a custom new region_definition.xml that replaces all. There are may regions that are huge (but low dense).

Fact is I tried a new game without my region_definition and the save is "only" 2 GB, loading time oc was much shorter.

I'd like to understand how the file works dynamically because it seems you can change it and restart the game and new regions are applied so I'd expect that regions are not stored in the save file, otherwise you'd see no change. But on contrary, changes appear so what the hell is stored in that save file? :gruebel:

p.s. this would explain why ego never used the "global_region.." even if it is in code's description, maybe they saw the same bloating of save files :?

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Region definition and bloated Save files

Post by DeadAirRT » Mon, 11. Jul 22, 15:04

While you can change regions in the file and it appears for the player, devs have said before that resource changes only take effect when a rebuild a triggered (new game or when ego triggers it). You will see the changes as the player but the AI is not aware of it.

Realspace
Posts: 1371
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Region definition and bloated Save files

Post by Realspace » Mon, 11. Jul 22, 15:08

DeadAirRT wrote:
Mon, 11. Jul 22, 15:04
While you can change regions in the file and it appears for the player, devs have said before that resource changes only take effect when a rebuild a triggered (new game or when ego triggers it). You will see the changes as the player but the AI is not aware of it.
Got it, the AI, that makes sense. That's why they are stored in save file too then.
Do you think that too large regions are the cause of a bloated file or is its number because in a larger map there are of course many more regions?

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Region definition and bloated Save files

Post by DeadAirRT » Mon, 11. Jul 22, 18:20

Realspace wrote:
Mon, 11. Jul 22, 15:08
DeadAirRT wrote:
Mon, 11. Jul 22, 15:04
While you can change regions in the file and it appears for the player, devs have said before that resource changes only take effect when a rebuild a triggered (new game or when ego triggers it). You will see the changes as the player but the AI is not aware of it.
Got it, the AI, that makes sense. That's why they are stored in save file too then.
Do you think that too large regions are the cause of a bloated file or is its number because in a larger map there are of course many more regions?
Hmmm it's hard to say, I've never even worried about save file size so I'm not sure what would cause it. I add tons of ships, equipment, 28 sectors with custom skyboxes and regions... And my save is only 91mb compressed

Realspace
Posts: 1371
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Region definition and bloated Save files

Post by Realspace » Mon, 11. Jul 22, 19:58

Good news, I tried removing the huge regions and leaving the common regions I edited and the save/load time and dimension is back to normal.

Question: say I want to add some huge regions only for cosmetic purposes like cluster-size nebula or sector-size asteroid belts...and I want them empty of resources (that I can spread as small pockets instead).
If I add asteroids in the <field> but without the following <resources>...</resources> tags, does it span empty asteroids?

I want to avoid these asteroids being stored in the save file as resources, so they act only as scenery

Post Reply

Return to “X4: Foundations - Scripts and Modding”