Hi Chris,
I hope you're doing well.
My publisher is currently porting the game to PS4, and we've run into a serious issue with save-game loading times.
Loading a save from the main menu takes around 2 minutes in a release build. Even on a powerful development PC, it takes approximately 20–30 seconds. Interestingly, loading between scenes during gameplay is very quick, so the issue seems to be related specifically to loading save data.
After profiling the process, we found that a significant amount of time is being spent in FileFormatHandler_Xml.DeserializeObject(), specifically when deserialising FootstepSoundData.
The profiler shows that RememberFootstepSounds.LoadData() is being called approximately 68,121 times during the loading process. After investigating the character prefab, we noticed that it contains dozens of RememberFootstepSounds components, many of which appear to reference the same object ID (273766).
We also noticed that the character prefab contains around 261 instances of this component, despite there seemingly being only one character prefab in the project. We tested this using a freshly extracted version of the original source files, and the same setup exists there, so it doesn't appear to be caused by any changes we made.
We've also tried setting the audio files in the Resources folder to Streaming, as suggested in some forum discussions, but this didn't improve the loading times.
Our main questions are:
1) Why are there so many RememberFootstepSounds components on the character prefab?
2) Is it safe to remove the duplicates and leave only one component?
3) Is there a better way to optimise or prevent this data from being deserialised so many times during save-game loading?
4) Is there any way or trick to reduce the loading time?
Removing the duplicates appears to reduce the loading time to just a few seconds, so it could potentially solve the issue entirely. However, we don't want to remove anything that might be required by Adventure Creator.
Profiler screenshots:
https://prnt.sc/T8u9JwRxqzG0
https://prnt.sc/IVzuyBRU3nds
Any advice would be greatly appreciated.
Regards,
Bik
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Certainly the duplicates are unintended - for any given Remember component, only one instance is necessary and the others will be redundant.
I'm not sure what you mean by this. Are you able to share steps that cause a character to have so many copies of this component?
There may be avenues to further reduce load times, but remove these duplicates first and let's see what we're left with.
Hi Chris,
Thanks for clarifying. By “a freshly extracted version of the original source files”, I meant that we reused the original game source code from before the console SDK integration. We wanted to check whether the duplicates were already present in the original project or had been introduced during the console porting process.
After extracting the original source files, we checked the character prefab and found the same duplicated RememberFootstepSounds components there as well.
We'll remove the duplicates as you suggested and see how much of an improvement that makes to the loading times.