Loading from a Save Slot Causes Game to Run Slow

Announcements, support questions, and discussion for Save System for Opsive Character Controllers.
Post Reply
dlees9191
Posts: 7
Joined: Mon Apr 22, 2024 6:05 pm

Loading from a Save Slot Causes Game to Run Slow

Post by dlees9191 »

Hi, I have a very strange issue and need help trying to debug it.

I have a SaveSystem working. I wanted to add save slots that I can Save and Load from, so I took the Load/Save panels from the Dialogue System Menu Framework (I didn't use the full menu system, I just took out the buttons panels and hooked it up to my own Pause menu, added a SaveHelper. Doesn't seem like there's any missing references or anything.).

The Saving and Loading works, but once the load is complete, everything runs slowly until I exit play mode. I noticed that after loading the Time.deltaTime in an Update is always .02 (the same as my fixedDeltaTime). Time.timeScale is still 1 (and the game does speed up if I increase it).

This only happens if I load from the save slots. If I use AutoLoad it doesn't cause this problem. If I go back to my main menu and auto-load the game again, it also doesn't cause it (or fix it if I already loaded from a save slot).

Any ideas on what could be happening or how I could go about debugging this?

Thanks!
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Loading from a Save Slot Causes Game to Run Slow

Post by Tony Li »

Hi,

Are there any errors or warnings in the Console window?

Another possibility: Maybe something is getting left over from the previous scene (the one you were in before loading the saved game) and causing a performance issue.
dlees9191
Posts: 7
Joined: Mon Apr 22, 2024 6:05 pm

Re: Loading from a Save Slot Causes Game to Run Slow

Post by dlees9191 »

There aren't any errors or extra warnings. And it's funny since the frame rate in the Stats window is still about the same and as variable as before the scene change (about 25-30 FPS in editor), yet the update deltaTime is a constant .02. There's no extra game objects left over.

I don't think it's a problem with the save system at this point. Just wanting to make sure you didn't have some easy fix. Currently investigating my popup code to see if it's doing something strange as the scene gets closed.

Thanks!
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Loading from a Save Slot Causes Game to Run Slow

Post by Tony Li »

If no culprits turn up in your popup code and you think it might be related to the save system, please feel free to send a reproduction project to tony (at) pixelcrushers.com
Post Reply