Why the fps drop when using the Save system?

Discussion and feedback on Construct 2

Post » Sun Oct 12, 2014 12:12 am

Hi all
I'm using the Save / Load system on my platform game, And every time the player collide with the save sprite ( To save the game for that position ) The Fps drop for 1-2 seconds.
Is this normal, and can i avoid this?

Thank's alot for any help.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Sun Oct 12, 2014 12:44 am

Naturally it takes time to write to disc. Do you have static objects that don't need to be saved (scenery etc.) with the 'don't save' behaviour? Search the official tutorials about saving games. If it continues to take a few seconds you could pop up a 'saving' message.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Oct 12, 2014 1:18 am

Thank's for the replay.
I'm already using the "No Save" for some sprites, I will add it to some more and test, I hope this will fix the problem.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Sun Oct 12, 2014 1:28 am

I'm struggling with loading and saving at the moment too. Haven't quite got it 100%. In fact I removed the Don't save behaviour because I thought it was causing issues but it should work.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Oct 12, 2014 6:00 am

You are using the savestate system to save the game. While you can use the savestate system and Ashley even shows an example. It really isn't the best way to do it.

Using the savestate system saves every object and every bit of data on those objects. This means all the static terrains that never changes. all the background art everything saves. This results in a save file where 99.5+% of useless data. This actually uses up a lot of save space. I suggest just printing out a few objects just to see what get's written. You will be surprised.

So of course there is a behavior to stop saving certain objects. Every tree position doesn't need to be saved. So you used the behavior to stop saving data on certain objects. And this is better approach. As this will reduce the amount of data you save. This will result in a much smaller file. But probably still 90% of information you won't need.

Keep in mind that the save system is a savestate which is meant to mimic the state of the game in memory. Including all the global values that carry over between layouts. Think of this is needing to reload a game on a mobile device when switching apps. Players except to precisly resume their game.

A save game only needs to save pertinent data that has meaning and doesn't need to reduplicate the memory state of the game. Mario, Assasins Creed, bioshock, GTA..... don't do save states. They record meaning information on progress and positional information.

So your jerk pause for 1-2 seconds is likely due to writing far more information you need. I wrote a savegame for The Blue Code and the save is unnoticeable because the data is less 300byes. In relation 1object in savestate is about 200+bytes. So you could be writing possible 100's kb of datam heck maybe even in the mb.

I suggest ideally to use proper save information for save games. And use save state for resuming games if your on mobile. It's more work though as you need to store the data and interpret the data. Where the save state is certainly far more convenient.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Sun Oct 12, 2014 11:32 am

hi,
it depend on your event
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Sun Oct 12, 2014 10:42 pm

@jayderyu
Thank's alot for this information,s, I didn't know that top games don't use save system.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Sun Oct 12, 2014 10:52 pm

@matrixreal
I'm using this:
Player on collision with checkpoint - Save to save slot
Player on Die - Load from save slot
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Mon Oct 13, 2014 3:23 am

No. They don't do "save state". They do "save games". I may have slipped on the keyboard when typing the difference on save game and save state. I will claim error if that's the case. C2 save system is a form of "SaveState"
http://en.wikipedia.org/wiki/Saved_game
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests