Jump to content

Save game has station usage logs. Why?


Recommended Posts

On 9/11/2019 at 11:12 PM, Chthonicone said:

I would agree with you that this is why those logging entries were added, but this doesn't have to be the way it's implemented.

Instead they could keep track of only the last 10 days worth of entries, and generated it off of that. This would cap the file size at only so many entries.

[Serializable]
float uptime= 0f;
private void Update() { uptime += Time.deltaTime; }
public Uptime { get { return this.uptime / Game.timeplayed; } }

No need to store anything but a float, I don't even see much of a reason for this statistic either, not something I ever missed in ONI...
 

49 minutes ago, bobucles said:

My question is why is time expressed as a float when simulation ticks are very clearly discrete values?

They store the timestamps, which are in unity measured as seconds in a float.

Link to comment
Share on other sites

7 hours ago, Heister said:

[Serializable]
float uptime= 0f;
private void Update() { uptime += Time.deltaTime; }
public Uptime { get { return this.uptime / Game.timeplayed; } }

No need to store anything but a float, I don't even see much of a reason for this statistic either, not something I ever missed in ONI...

This would be uptime since game start.
They show uptime for last 600 seconds or 6000 seconds.

In such case knowing that something was used 10% during last 10 cycles is not enough information for future calculations.
It could have been used evenly 10% each cycle or also it could have been used fully during just one cycle 9 cycles ago or ...

 

Link to comment
Share on other sites

8 hours ago, Heister said:

[Serializable]
float uptime= 0f;
private void Update() { uptime += Time.deltaTime; }
public Uptime { get { return this.uptime / Game.timeplayed; } }

No need to store anything but a float, I don't even see much of a reason for this statistic either, not something I ever missed in ONI...
 

They store the timestamps, which are in unity measured as seconds in a float.

Something like this makes a lot more sense. Storing every single on and off event is not only expensive, it's also not useful information for a player. That kind of detail doesn't matter at all, at least not for normal play, and it's clear that piling up THOUSANDS of statistics for every single thing is not the brightest of ideas to begin with. (It might be fun for a limited replay option). There are three potential statistics that might really matter.

- Time used this cycle is just one number. Increment it when a machine is on(+1 every tick, or +n after it turns off), and reset it every cycle. Easy.

- Time used in last 10 cycles is a running average. It's only 10 numbers, and every new number discards the oldest one. 10 numbers x 1000 machines is quite manageable.

- Total time active life is one number. It's very much like "time used this cycle", except it never resets. Bonus points for time stamping when the machine was first built, to give an average of (time active / total time), taking up two entire numbers.

So there ya go. Each machine gets 13 numbers to track all the useful stuff. It can go even lower than that, if the running average isn't that important.

Link to comment
Share on other sites

3 hours ago, Oxygenbreather said:

Why do some people always and always move every discussion about anything to FPS / CPU?

Agree.  I can live with smooth 15 fps but hate the 15 second lockup which was made plain horrible with the added drag across the map on lock thing (which now has a mod fix)

Link to comment
Share on other sites

Serialization can easily become a CPU time hog in any application, so none of this exactly surprises me. I've gone to the trouble of building code generators that reflect over everything serializable and generate fast-path save and load code just to shave precious milliseconds off of periodic saves.

Link to comment
Share on other sites

Here are my results for my cycle 21298 base, attached. Time is measured until I can move the camera.

  • Original 10x speed zoomed in FPS: 23-24
  • Aggressive 10x speed zoomed in FPS: 35-37
  • Original Size: 49.4 MB
  • Aggressive Size: 25.1 MB
  • Original Load: 65 seconds
  • Aggressive Load: 48 seconds
  • Original Save: 15 seconds
  • Aggressive Save: 5 seconds

I was kind of expecting most of those results, but not the 50% FPS increase. Incredible. Thank you.

(FYI, it is likely representing more than a 50% speed increase, because once you go below 30 FPS I understand the game will begin to disable certain computations in an effort to maintain 30 FPS. This mod has allowed me to re-enable such computations AND exceed 30 FPS at 10x speed.)

@Ipsquiggle I suspect many people will use this mod, so please look into the crash it will cause after uninstalling it and viewing deleted reports. Hopefully the game can just show no data or prevent showing the cycle report at all instead of crashing.

Link to comment
Share on other sites

20 minutes ago, nakomaru said:

Here are my results for my cycle 21298 base, attached.Time is measured until I can move the camera.

  • Original 10x speed zoomed in FPS: 23-24
  • Aggressive 10x speed zoomed in FPS: 35-37
  • Original Size: 49.4 MB
  • Aggressive Size: 25.1 MB
  • Original Load: 65 seconds
  • Aggressive Load: 48 seconds
  • Original Save: 15 seconds
  • Aggressive Save: 5 seconds

I was kind of expecting most of those results, but not the 50% FPS increase. Incredible. Thank you.

@Ipsquiggle I suspect many people will use this mod, so please look into the crash it will cause after uninstalling it and viewing deleted reports. Hopefully the game can just show no data or prevent showing the cycle report at all instead of crashing.

wow   if there is a fps gain, they are wasting a ton of cpu all the time instead of the cycle save lock period that I would have thought was the only time

Link to comment
Share on other sites

Not sure if i'm doing something wrong here - but I seem to have had zero improvement from this mod, certainly nothing along the lines of what nako stated above.

I backed up the save, renamed a new save and did a save/load - the mods enabled and set to aggressive - no performance increase at all, nor any change to save/load times.

I was all hyped for this mod, so i'm hoping i've made a derp.

Link to comment
Share on other sites

My case likey represents the most extreme edge at 21 thousand cycles of reports at an abnormally high game speed.

It seems you have done the necessary steps: enabled→load→save→exit game (important, not sure if you did this)→load.

A quick check to confirm it has had some effect is that you cannot view old reports and your graphs will only show the last day, and your save file should be quite a bit smaller.

I would like to hear if anyone can reproduce my results when doing the process with the uploaded save.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...