Savestate like emulators

if “keypress” savegame to slot “slotname”.

like emulators,

it means save everything
(pos,vars,timers, scene…)

Are you talking about editor or about in game?

I prefer to have it in game…
if doable…
when the debugger run all infos are in real time…
so i guess something that can freeze and reload at the same frame could be helpful in game…something like mosts emulators do

I know exactly how emulators work
Even better what save states are

But to my understanding you would save a lot of stuff that is useless
Imagine you have idk 1M objects
You would save their opacity and tint
EVEN when you do not change opacity and/or tint of any object in your game
And loading all that (reading it) FOR EACH SINGLE OBJECT
Would lag a lot for bigger games
Not to mention i only mentioned 2 attributes
Imagine height width scale angle… and so go on

I would find it very problematic
YET i would not cry to have such feature

At the same time
Are you aware you can do what you describe with saving to storage and loading from it?

Go to Save/Load ALL your objects section

I already knew it…
but then how they do it?
just for curiosity…eg…in retroarch you can save any game states and any engine state in retroarch itself…

ofc i know how to do it…but it’s not the same thing…but the results are the same idd.

savestates looks more like a player where you stop your music and resume where you left…

pratical example…imagine saving in GD your character in air after a jump with that animation and frame,timerss ecc…try doing it with json saves.

if it matter the size (or architecture?) i give u another example…skyrim (even modded) can load a state in ms…

we may talk about preloads…but even GD has that function.

I just want to point out you literally wanted to know so do not argue over wall of text i made below
And believe or not that is short answer to it
Your question is iceberg

Be aware that retroarch is not emulator on its self
To simplify imagine it is some sort of front end to manage only emulators engine

Think of it like you can use on your phone new pipe or revanced or youtube app to play youtube videos
They just all manage some medium in a different way
Where all of that is not just working in empty space
They are all working inside android device
Well more or less but again that is simplification

So retroarch alone is saving nothing for you
Emulator core is and retroarch is just managing created files for you

Anyway

Longer answer
Around 5 mins in he goes into basic knowledge how emulator works
Around 7 mins in he start explaining how save states works

And short answer would be
When you emulate something you need to create virtual environment for it to live in
And you do it by simulating what would happen on actual hardware
And because you need to prepare every possible data flow for whatever runs under actual hood of some console or system
You have ALL that data right there out of the bat
And if something can run such emulator then going back to ALL values that were there at some point in time is not anything special

Where in gdevelop you are creating some sort of snapshot to check performance and some values of various stuff

You may be confused because like wait
Didn’t i just said they are pretty much doing same thing?
Well yes i did
And no i did not

Tell me can you trough debugger run it for idk 5 secs
And tell me where was your player READING STUFF FROM DEBUGGER at each of that 5 sec time frame?
Like give me its exact X and Y pos?

Now you start to see a problem?
It does not save all values you would expect it to save and it is checking something totally different

It is like ppl argue over what is correct term cable or wire?
I ask for what?
What the F you are comparing here?
Because technically this is same as me arguing this apple is green
And you telling me i am wrong and this apple is sweet

I am arguing over its look you are arguing over its taste
Same with cable and wire
Cable describes build/construction
Wire describes functionality

Gdevelop debugger is not creating save state you could go back to
Save state is not showing you current performance over period of SOME time between two points of emulation

You have very bad concept over what you are asking for
I mean you are right to ask for it
But you have bad concept why it should be as easy as emulation save state if we have debugger right there already

Reason why save states work in emulation is because you have something already spitting out ALLLLLLLLL values you would need to go back to some state
Where in gdevelop you do not have that and that would be shiet load of data to process

Ever wonder why if in emulators save states are so cool we do not have save states in game?
In fact we have like very few games that try to mimic that

There is no easy way to create state of something especially when it comes to game engine

In my save/load tutorial i do not save every single value of objects
I save only ones i am modifying
I do not change their height or width or scale so i do not save that

And in the end what you ask for would be doable
But not like it would be something so straight forward as emulation save state

Also be aware in gdevelop you do not have anything to track music play time
You can offset it you can set some variable or timer to make fake tracker
Yet you have nothing to actually manage it in a way you would think you could
And in same fashion nothing for play sound action

On top of that particles does not even have collision
You cannot identify particles per particle and tell their position via events

You would need to check i guess from JS each particle that exist on screen save its X and Y and then be aware you would need to have info where they were going (EACH OF THEM)
With what speed
What would be the speed they should maintain and for how long
And on and on and on

I can go on whole day with it
But i believe by now you get the idea more or less

I would wish for save states as you do in gdevelop
Yet i would never even for a moment believe it would be as easy as doing it in emulator

Yes…thaz true,i’ve asked it cos this reason…i never said that’s easy to implement.

I knew it it’s not easy task…but would be cool.

I did not imply you said that
I pointed out you assume since we have debugger there is some data to work with like with save states
Problem is it is different kind of data or to be accurate
NOT all the data

Anyway even if save states exist in gdevelop i think i would stick to save / load with storage cause there i have control what to save and load and i would not go trough useless info i may not want

For example imagine loading a state of your game with save state

Would also reset settings so if your game have like idk audio sliders for volume or even better
Rebind controls option

You create save state you play your game adjust audio and remap controls
Then play a little more and you want to load state
Guess what it will be state of audio and controls as before the save
And there would be NO way for you to filter that out to not be included in save/load state

that is true too…
but even when you play
some retro game you carefully have to think when to savestate and when not…it is how they works…bad options/settings are saved anyways
at least it is how i play em.

if you wrongly savestate a character in a death situation there is no turn back,

that is what make em different to classic save system.

1 Like