Are we likely to see the save feature improved

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

akari no ryu
Posts: 143
Joined: Sun, 11. Oct 09, 14:32
x4

Are we likely to see the save feature improved

Post by akari no ryu » Sun, 27. Jan 19, 18:16

It takes six to seven seconds or so. On a 9700 i5 with a 1070 GTX.

Edit: Removed exhaggeration as it doesn't help clarify the problem.

User avatar
Baconnaise
Posts: 619
Joined: Sat, 23. Nov 13, 15:50
x4

Re: Are we likely to see the save feature improved

Post by Baconnaise » Sun, 27. Jan 19, 19:47

I would think the drive it's saving to and installed on matters most since it's also the slowest component in a PC. Mine saves to a Sammy EVO SSD and it's always slow. Three to six seconds seems normal for the game in my experience. I don't particularly have an issue with how long it saves. My thoughts are that I would like to see more slots and possibly a backup feature within the game menu instead. The example I go to overwrite save file 001 and it makes a backup or moves the pre-existing 001 save to a backup folder while creating the newer 001 save.

User avatar
mr.WHO
Posts: 8617
Joined: Thu, 12. Oct 06, 17:19
x4

Re: Are we likely to see the save feature improved

Post by mr.WHO » Sun, 27. Jan 19, 20:10

Baconnaise wrote:
Sun, 27. Jan 19, 19:47
I would think the drive it's saving to and installed on matters most since it's also the slowest component in a PC. Mine saves to a Sammy EVO SSD and it's always slow. Three to six seconds seems normal for the game in my experience. I don't particularly have an issue with how long it saves. My thoughts are that I would like to see more slots and possibly a backup feature within the game menu instead. The example I go to overwrite save file 001 and it makes a backup or moves the pre-existing 001 save to a backup folder while creating the newer 001 save.

More than one quicksave slot in case the quicksave save is crashed/corrupted - that would be nice.

akari no ryu
Posts: 143
Joined: Sun, 11. Oct 09, 14:32
x4

Re: Are we likely to see the save feature improved

Post by akari no ryu » Sun, 27. Jan 19, 20:57

Baconnaise wrote:
Sun, 27. Jan 19, 19:47
I would think the drive it's saving to and installed on matters most since it's also the slowest component in a PC.
It is not the disk speed. I have checked. I am 99% positive it's the way the've programmed it, given the game literally stops running while it happens.

Falcrack
Posts: 5079
Joined: Wed, 29. Jul 09, 00:46
x4

Re: Are we likely to see the save feature improved

Post by Falcrack » Sun, 27. Jan 19, 21:03

I would like to be able to give custom names for my saved games. I would also like to be able to delete saved games to free up save game slots.

Shehriazad
Posts: 784
Joined: Wed, 5. Dec 18, 00:56
x4

Re: Are we likely to see the save feature improved

Post by Shehriazad » Sun, 27. Jan 19, 21:20

akari no ryu wrote:
Sun, 27. Jan 19, 20:57
Baconnaise wrote:
Sun, 27. Jan 19, 19:47
I would think the drive it's saving to and installed on matters most since it's also the slowest component in a PC.
It is not the disk speed. I have checked. I am 99% positive it's the way the've programmed it, given the game literally stops running while it happens.
Well the savegame has insane amounts of data inside.

Unpacked they can easily approach half a gigabyte....

Which at first doesn't seem to be a problem until you realize that it's half a gigabyte of text that is "written" when you hit save. The position of every trader, every command, be it NPC or player...all current actions and positions for NPCs are being "written down" when you hit save.


So I'd wager it would take that long because the ENTIRE UNIVERSE is being SCANNED and then everything written down. The only way to speed this up would be to be less accurate while saving. Letting us continue to play while saving would also be incredibly hard since everything will change during every millisecond you are allowed to continue.


I agree that the save-times can be a total nightmare (Got a modern PC and SSDs only and I have to wait like 10+ seconds before being allowed to continue) I don't quite see how they could make it much faster...unless they somehow manage to go for a "snapshot" approach where they'd just dump the current memory into a file the moment you press save...which would probably remove our ability to edit the files.

Damocles_
Posts: 128
Joined: Fri, 4. Apr 14, 17:40

Re: Are we likely to see the save feature improved

Post by Damocles_ » Sun, 27. Jan 19, 21:24

The whole gameworld is serialized to XML, and thats what takes most of the most performance.
It would be quicker to use a custom binary format, but Egosoft always likes their XMLs. (there are also advantages to it).

pref
Posts: 5615
Joined: Sat, 10. Nov 12, 17:55
x4

Re: Are we likely to see the save feature improved

Post by pref » Sun, 27. Jan 19, 21:34

Baconnaise wrote:
Sun, 27. Jan 19, 19:47
I would think the drive it's saving to and installed on matters most since it's also the slowest component in a PC.
Writing a few 100 mbs of data to an ssd takes a blink of an eye.
It's most likely the XML conversion. And can take much longer then 6 secs depending on asset count etc - i have an nvm 970 evo and game takes about half a min to save in later game.

Would be nice to have a switch for binary format not just compression. Only use for xml if someone wants to save edit and debugging - none of that should concern normal play.

User avatar
Axeface
Posts: 2973
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Are we likely to see the save feature improved

Post by Axeface » Sun, 27. Jan 19, 22:49

Ive long thought that this needs to be addressed. Its very disruptive to gameplay to have to wait so long to save, I really hope some clever solution can be found. Not having to wait for it, or even better, it being virtually undetectable has a lot more impact on gameplay/enjoyment than people seem to think.

I mean, does the game really need to be paused at all to save?

peteran
Posts: 269
Joined: Thu, 26. Jul 07, 13:01
x4

Re: Are we likely to see the save feature improved

Post by peteran » Mon, 28. Jan 19, 00:31

My saves take around 35 seconds!

That's really immersion breaking and had me disable autosave and really pay attention to when I want to save.
Luckily I don't experience any CTD so not saving very often really makes me want to stay alive.

I didn't mind it taking so long but now that I have people talking about single digit times, I will investigate my system further.

I'm running on
AMD Ryzen 7 1700 (overclocked to about 3.6 GHz)
16 GB of memory (don't remember speed)
Samsung 960 EVO 250 GB
GeForce GTX 1060 6GB

Game is pretty fluid most of the time except for map lagging a bit sometimes.

pref
Posts: 5615
Joined: Sat, 10. Nov 12, 17:55
x4

Re: Are we likely to see the save feature improved

Post by pref » Mon, 28. Jan 19, 00:39

peteran wrote:
Mon, 28. Jan 19, 00:31
I didn't mind it taking so long but now that I have people talking about single digit times, I will investigate my system further.
When you start the game it takes much less time.
It all depends on how many objects/properties etc the game needs to handle.

ApoxNM
Posts: 778
Joined: Wed, 5. Dec 18, 06:17
x4

Re: Are we likely to see the save feature improved

Post by ApoxNM » Mon, 28. Jan 19, 09:07

I agree,

save times are way too long and we need to be able to rename the Saves.

CBJ
EGOSOFT
EGOSOFT
Posts: 52128
Joined: Tue, 29. Apr 03, 00:56
x4

Re: Are we likely to see the save feature improved

Post by CBJ » Mon, 28. Jan 19, 09:58

The game universe is a complex thing and saving it does take time, regardless of format. As various people have noted, it's a lot quicker on a faster drive because of the size of the file, but there's still a lot of work to be done to extract everything that needs to be saved. And yes, the game does have to be paused, otherwise you'd have an inconsistent dataset as things changed from one frame to the next while the save progressed.

User avatar
Vandragorax
Posts: 1187
Joined: Fri, 13. Feb 04, 04:25
x4

Re: Are we likely to see the save feature improved

Post by Vandragorax » Mon, 28. Jan 19, 13:07

pref wrote:
Mon, 28. Jan 19, 00:39
peteran wrote:
Mon, 28. Jan 19, 00:31
I didn't mind it taking so long but now that I have people talking about single digit times, I will investigate my system further.
When you start the game it takes much less time.
It all depends on how many objects/properties etc the game needs to handle.
So what you are saying is that performance drops off after longer play-time and more assets in the galaxy. This is a VERY BAD thing and the devs should seriously consider performance implications as people are playing for longer and longer game saves, and mods are adding bigger battles, more ships/stations in the galaxy etc.

In other words, save time is exponentially worse as game time/universe activity increases.

I would be very surprised if there are absolutely zero optimisations to saving which Egosoft could make.
Admiral of the Fleet.

Shehriazad
Posts: 784
Joined: Wed, 5. Dec 18, 00:56
x4

Re: Are we likely to see the save feature improved

Post by Shehriazad » Mon, 28. Jan 19, 15:05

That is why I started compacting everything. I use a few L miners instead of many M Miners and my fleet is as condensed as possible. I have a boarding crew of 5 marines with about 300 power...they kill anything XD

I also regularly remove ships from the universe not only to keep the economy strong but also to incite devastating wars. I recently sold 20 destroyer ships I had stolen to HOP...while they were parked in Argon Prime. Disgusting fireworks.... But it keeps the game going and the factions small

pref
Posts: 5615
Joined: Sat, 10. Nov 12, 17:55
x4

Re: Are we likely to see the save feature improved

Post by pref » Mon, 28. Jan 19, 15:56

Vandragorax wrote:
Mon, 28. Jan 19, 13:07
So what you are saying is that performance drops off after longer play-time and more assets in the galaxy. This is a VERY BAD thing and the devs should seriously consider performance implications as people are playing for longer and longer game saves, and mods are adding bigger battles, more ships/stations in the galaxy etc.
It isn't that bad, just save takes longer.
Plus it's not just asset count, it contains a lot of other stuff like wrecks, projectiles, anything that is generated upon reaching high attention (IS status), and getting lost when you leave, extra details AI needs IS to not get confused after loading, animation states, turret orientations - and tons of other stuff we would never even think about.

Otherwise many people reported general significant performance drop with big empires (station modules and ships in the hundreds) - but that is a different topic and due to keeping my asset count low i have not seen that issue yet.
1.6 will contain some performance improvements - curious if that helps folks with a higher asset count.

BrasatoAlBarolo
Posts: 1404
Joined: Sat, 1. Dec 18, 14:26
x4

Re: Are we likely to see the save feature improved

Post by BrasatoAlBarolo » Mon, 28. Jan 19, 16:23

Six seconds. :lol:
My veteran system needs a minute or so to save a game. :lol:

Shehriazad
Posts: 784
Joined: Wed, 5. Dec 18, 00:56
x4

Re: Are we likely to see the save feature improved

Post by Shehriazad » Mon, 28. Jan 19, 17:16

BrasatoAlBarolo wrote:
Mon, 28. Jan 19, 16:23
Six seconds. :lol:
My veteran system needs a minute or so to save a game. :lol:

Yea it does seem a bit excessive... No matter how much data needs to be saved, there ought to be SOME room for improvement...because loading takes as long as saving and thus I use the feature less than I would like to.

I wonder if it would be possible to add a save feature for higher end machines (16Gigs of ram or so) that will make a snapshot of the current ram and then save in the background so we can continue to play....in theory this could even be done on lower ram machines if it is slapped on the pagefile...but not everyone has an SSD so it would still incur a short wait time.


Like I said I do my best to keep all the factions "down" as much as possible and have my fleet and factories be as condensed as possible to avoid increasing loadtimes...you know something is off when you have to change your way of playing a game to make saving less of a pain x)

akari no ryu
Posts: 143
Joined: Sun, 11. Oct 09, 14:32
x4

Re: Are we likely to see the save feature improved

Post by akari no ryu » Mon, 28. Jan 19, 18:56

Shehriazad wrote:
Sun, 27. Jan 19, 21:20
Well the savegame has insane amounts of data inside.
I am aware of this.
Shehriazad wrote:
Sun, 27. Jan 19, 21:20
Unpacked they can easily approach half a gigabyte....
I well believe it.
Shehriazad wrote:
Sun, 27. Jan 19, 21:20
Which at first doesn't seem to be a problem until you realize that it's half a gigabyte of text that is "written" when you hit save.
I expect the work flow is
  • game pauses execution
  • all Objects in the game execute their toXML method and an XML file is created
  • the xml is parsed into a coherent structure, whether it's individual documents per sector or a single massive file
  • the file is zipped
  • THEN AND ONLY THEN is it written to the disk
  • then the game is unpaused
And that this is done synchronously (which is largely the problem, there's no reason they couldn't just throw the save function into a thread).
Shehriazad wrote:
Sun, 27. Jan 19, 21:20
The position of every trader, every command, be it NPC or player...all current actions and positions for NPCs are being "written down" when you hit save.
No they're not.
Shehriazad wrote:
Sun, 27. Jan 19, 21:20
So I'd wager it would take that long because the ENTIRE UNIVERSE is being SCANNED and then everything written down.
I expect you'd lose that wager. Or that the save system is even more badly written than I thought.
Because ALL of that stuff already exists in RAM. It doesn't need to be scanned. It's all already there. And if it's not. If it's not in RAM. It's not part of the game. It's not having an effect on the game. And so it doesn't need to be saved.
Shehriazad wrote:
Sun, 27. Jan 19, 21:20
The only way to speed this up would be to be less accurate while saving.
That is factually incorrect.
Shehriazad wrote:
Sun, 27. Jan 19, 21:20
Letting us continue to play while saving would also be incredibly hard since everything will change during every millisecond you are allowed to continue.
The entire RAM usage of the game is on the order of 5 GB. Let's assume that that's 80% game state. Cloning that, there and then, inside a threaded execution environment and saving that addresses that problem. Momentarily doubling RAM use to well within acceptable limits.

Shehriazad wrote:
Sun, 27. Jan 19, 21:20
I don't quite see how they could make it much faster...unless they somehow manage to go for a "snapshot" approach where they'd just dump the current memory into a file the moment you press save...which would probably remove our ability to edit the files.
What reason would dumping a snapshot of the current state into the save algorithm leave the game save uneditable?

Admiral Sausage
Posts: 202
Joined: Mon, 28. Jan 19, 23:30

Re: Are we likely to see the save feature improved

Post by Admiral Sausage » Tue, 29. Jan 19, 00:14

Looking at the CPU use, you can see that saving (and loading) is single-threaded. If they wrote a multi-threaded XML serializer, that would make it potentially 4x faster (or more on a CPU with more cores). I'm sure it wouldn't be easy, but given that they have demonstrated the ability to write multithreaded code with their rendering engine, the devs would surely be capable of it if they had the time.
akari no ryu wrote:
Mon, 28. Jan 19, 18:56
The entire RAM usage of the game is on the order of 5 GB. Let's assume that that's 80% game state. Cloning that, there and then, inside a threaded execution environment and saving that addresses that problem. Momentarily doubling RAM use to well within acceptable limits.
Consider the game running on a minimum spec 4-core CPU. It will probably be using 100% CPU quite often. If you throw in another thread doing serialization in parallel with that, game performance will be reduced by 25%. That could leave the game running but unplayable for a minute, which is arguably worse than leaving the game paused. Worse than that, if the game became responsive before saving had completed, a player might assume that it had finished saving and quit the game, resulting in lost data.

Return to “X4: Foundations”