kevork

Save game has station usage logs. Why?

Recommended Posts

Heister    58
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.

Share this post


Link to post
Share on other sites
Rebrait    39

Has anyone tried to take an old map, kill all dupes, clean the whole map with debug and compare the fps with a clean new map?

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
bzgzd    275
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 ...

 

Share this post


Link to post
Share on other sites
bobucles    335
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.

Edited by bobucles

Share this post


Link to post
Share on other sites
Xaekai    40
13 hours ago, Lifegrow said:

Any news on this mod being put on Steam Workshop ?

Peter says it should be up by the end of this week.

  • Like 4

Share this post


Link to post
Share on other sites
chemie    650
41 minutes ago, Xaekai said:

Peter says it should be up by the end of this week.

excellent news...50% reduction is the lockup time would be huge.  no reason klei could not fix but mods for the win.

Share this post


Link to post
Share on other sites
Lifegrow    1,524
1 hour ago, Xaekai said:

Peter says it should be up by the end of this week.

Excellent news, give me a nod when it's up please bud ;)

Thanks for your work in looking into this.

Modders : Heroes of the people :D 

Share this post


Link to post
Share on other sites
Tobruk    301

I think you're overhyping this mod. All it does it reduce save file and possibly the saving/loading time. The FPS during the game probably will remain the same.

Share this post


Link to post
Share on other sites
nakomaru    1,381

But nobody hyped an FPS change, and save time is a big deal. Looking forward to testing it.

Edited by nakomaru

Share this post


Link to post
Share on other sites
5 hours ago, Tobruk said:

I think you're overhyping this mod. All it does it reduce save file and possibly the saving/loading time. The FPS during the game probably will remain the same.

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

Share this post


Link to post
Share on other sites
chemie    650
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)

Share this post


Link to post
Share on other sites
Chintam    9
16 hours ago, bobucles said:

They're frame hunters. They'd sell their own mom to get a few more FPS.

What is life without that sweet sweet 144hz. 

Share this post


Link to post
Share on other sites
chemie    650
1 hour ago, Ipsquiggle said:

Thanks for finding this. We'll see about cleaning this up!

finding what? Station logs or having the umpteenth thread about how the game locks up for 15 seconds to save a relatively small file each cycle?

  • Haha 2

Share this post


Link to post
Share on other sites
Derringer    27

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.

Share this post


Link to post
Share on other sites
nakomaru    1,381

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.

Edited by nakomaru
  • Thanks 1

Share this post


Link to post
Share on other sites
chemie    650
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

Share this post


Link to post
Share on other sites
Lifegrow    1,524

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.

  • Confused 1
  • Sad 1

Share this post


Link to post
Share on other sites
nakomaru    1,381

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.

Edited by nakomaru

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now