I use autosave at the start when changing levels. I use start delay 0.8
in my cutscene, because the new level fades in. If I use just zero the
autosave snaps a picture of the previous level but loads the correct one (the new one)
There is a slight lag, sort of screen freez when doing autosaving with delay.
Without autosaving or setting delay to zero the level's transition is very smooth with no hinges. But as I mentioned then autosave snaps the picture of the previous level.
Is there any way to improve this?
I tried to check load levels asynchronously, but I think the proble is
when the engine either takes a snap picture of the screen or saves the
data.
Or it could be that the game runs smoothly but that picture snap shows for a brief second what it captured. And thus making us think it lags. Can this picture snap be doen with out showing what has been captured?
Comments
Are you crossfading to the new scene? If you're crossfading, then autosaving right at the start will show the previous scene as an overlay - if it was removed for the sake of screenshotting, then the player would also see it flicker off and on again.
But what I'm thinking Chris, is that this can not possibly be a lag. As I mentioned this is porbably the autosave screen captures and shows us for a brief second what it snapped.
And this asks the questions if it is possible for the autosave to take the picture but not show it while it does in the game?
This lag can be observed if you have lots of animations and particle emiters in your scene, you can easily see how the game stops when autosave takes a picture and shows it.
I really want to use autosave feature for my game.
But I'm afraid to hear people complaining "This game F lags bad!"
And as I said in my first post: it's not possible to remove the effect during the autosave process without the player noticing it. I'm not sure there's much that can be done about it.
Let's leave the crossfading comlpetely out of it.
Crossfading is completed and out of the question.
Now when I do autosave, let's say I just run autosave when crossfading is done long ago. Then you can see that lag when autosave takes snapshot. And as I mentioned before this is probably due to the autosave taking picture and showing it and then hiding it quickly. So when you have lot's of animations and particle emitters running, everything would stop for a second when autosave takes that picture.
It could be that saving the data is causing the freez lag, but I think it's the austosave taking the picture and showing it.
Will have to look into coroutine now.
However I found PreScreenshotBackup function, that made me thinking I could change and keep menus and cursor on (visible) and make an autosave when I leave a scene. The screen always freezes when you leave/end a scene, so anyway making autosave there upon changing/ending the scene would be sensible instead of having a lag freez at the start of a new scene.
Thanks Chris.