I know there are tutorials using global variables for save mechanics but what i want is basically saving the entire state of the scene rather than selected stuff with variables.
Basically record the current ongoing code, export it to a file and simulate it at the beginning of the scene if “load game” is selected. Similar to “Pause and start a new scene” action.
The reason why i want this is that i have quite a bit of dynamic objects in my game you can move such as crates and so on and i plan on adding more. Saving the position of the character and variables are easy enough but keeping track of every single object position (and their duplicates) is quite hard.
I know it’s technically doable (saving the screen state) but i’m not sure how. Any help is appreciated.
Without thinking about a solution between another, i should say that JSON files would be a beginning of solution.
However, you must well analyse every things (i think about datas) you have to save in JSON’s file(s), including position of all objects and not only that (by example attached variables of objects) and all that can be very fastidious.
An advice: write all on paper before creating objects, files, etc.
That’s exactly my worry here. Having to do it for every single stuff that needs to be saved. It is doable but also extremely time consuming and can get all over the place with more objects added. I don’t want to end up with 1000s of global variables etc.
I feel like saving the current running code on a file and then simulating it is the solution but i’m not sure how to do that or if it’s even possible without changing the engine code / writing a whole extension.
What JSON files have to do here?
How does saying what you said helps anything if you don’t provide any examples?
This is not 1st time i seen you talking stuff that just don’t make sense
If you can’t provide any example of your idea
Then it means you are talking stuff that you do not even know IF are possible
If you won’t provide working example for what you just described
Next time i spot you talking stuff that simply do not exist i gonna bring it up to moderation
Cause you are deceiving users who ask for help with something that simply is not possible
Reason we are using global variables is because there is kinda no other way
What you would want like save states
I remember it was mentioned it will eventually come to engine but when in what state who knows?
On top of that how much you gonna save?
Like 100%
So if i play your game make a save and next i change volume from 20 to 40
Now i make close game and load game
Will it load with 20 or 40 volume?
Because last time i remember devs mentioned it it will be 20
Cause you save load actual state
But that is something i gonna wait and see but for now vars are your only option
It’s great hearing that it’ll eventually come to the engine.
As for what i want to save more or less… everything? Positions, animations, variables etc.
Wish we could get an estimate on when it’s coming so i can decide if i’m gonna work on a save system or not. I guess having billion global variables is the only option at the moment : D
1st of all look at date
And its still not here
So you know it can be tomorrow or 1 year from now
And the issue in detail aside from what i wrote on discord
I play your game i am at stage 3 or i reached world 7 or i reached level 12 and 40% exp to level 13
My volume and sound are at 100%
I gonna play a little bit more but its getting late i set volume of sound and music to 50%
I died half mission or whatever so i use load game
NOW it because i saved game when volume was at 100%
It not only load my progress to when i was performing a save
But will also load state at which volume was so 100%
Now do not worry about volume that is nothing
But EVERY SINGLE THING will be saved/loaded this way
Keys with which you play for example but basically EVERY SINGLE THING that you can image is some kind of value
If you make simple game like some puzzle or endless runner like flappy bird
Most likely you will not see it as issue
But as soon as you will make something like action adventure like top down zelda
You will find it as huge issue
Especially when you will want to allow multiple save files
Cause you will not be able to do that
It will be save absolutely everything or don’t save at all
And you could save/load everything and then just modify some stuff
BUT this will require more jumping around like a monkey in most cases than if you would go with save/load variables from beginning
As much as i am looking forward for such feature as much i see what potential issues it brings and trust me we should not be so happy that we will get it
Cause in most cases we gonna going with saving/loading variables anyway
If we could choose what is saved/loaded with such system in question
Then we would be perfectly fine
But as it is for now (still something can change) seems we gonna either take everything or nothing which is bad thing in my eyes
Honestly knowing that it’s in development at least is great. And it’s been like idk couple of months? Unless there was a problem that came out like save files getting corrupted after version change (of the games) it seems like it’s gonna come out at some point.
Though i’m still gonna stick to variables for now i guess. Gonna have to figure out how to make it as tidy as possible though. I don’t like the idea of having insane amount of variables in the game checking everything.
I 'll not enter in this polemic but i shall only say i didn’t known there are Police indicators in this forum and that the moderators are sufficiently adult and mature to do their job without you did denouncement on me.
That’s all for me because i don’t want to be agressive and unpolished against anyone.
Maybe let me put it in simple language
Right now you want to avoid saving each thing individually
Setting what will be saved
And i do get that i also hate it
BUT “save state” will force you to do quite opposite
Because it will save (most likely) everything
You will need to set up variables which you gonna need to load after loading save state
For example to keep audio settings like i explained above
That is IF “save state” will not affect variables
If it would then it will be useful in very poor games when it comes how much stuff you can adjust
Maybe poor is wrong word i lack word here
I mean most likely games which will only save progress or score
BUT no settings and stuff like that and no multiple saves
Maybe they will add slots but would solve very little
There is no police here idk where you even get that idea
OP did ask about saving everything without selecting what to save
You say that json file would be beginning of the solution
What solution? Elaborate?
Cause to me it looks like you claim stuff you did not check and/or do not fully understand
To write anything to json you need to specify what
There is no way to just write everything on its own
So its no different than saving variables (which you 1st need to specify which OP want to avoid)
So i ask you how does your reply help here?
You show nothing that can help just claim something that makes no sense
On top of that then you say to write it on paper before creating objects files?
How does that help? Where again OP ask for just saving everything all at once?
You should aim to provide accurate help which ppl can understand and actually implement
And if possible provide screenshot showing how to do it
Or at least part of it
That is only thing you should understand from my message
Save scene state, save settings to a seperate file from global variables, load scene state, load settings from a file. This is pretty much how certain games do their saves dude. Settings and save games being seperate.
Hopefully yeah. Though it’d be nice to know where it is at the moment. It’d really suck to just be at the middle of making the game and the save system just drops out of nowhere either forcing you to just re-write the whole code again or waste time using your own save system for no reason.
I’m still gonna work on my own save system just in case but like i’ve said it’d at least be great to know what “percentage” is the extension progress is at the moment.
Zero I think you’re brilliant and your input on threads is always in depth and interesting but …reading this quickly through I took @Amigo54 initial suggestion as implying something like… save all the objects on the scene in a json by repeat for each object in object group and storing all information inside a structure inside an array. It’s not being unhelpful it’s just it’s just English isn’t his first language… there’s always loads of different ways of doing something.
Mine neither (i mean engrish)
And i do take it into account
And that is why i did not approach him about it earlier
I do not even question the fact he want something good
But the way he try to achieve it is just wrong
Fell free to click his name and go trough his messages
You will find A LOT of instances where someone will ask something like
How do build a breaks in a bike?
And he will reply with something like well you need to have breaks and you need screwdriver
And better before you even start make a list of stuff you have
This is not what question was about this is not helping this is telling obvious stuff
Where in this case with saving from above
IF he is genuinely talking about something he understands
Then i simply ask him to show it how he would make it how it should work
Screenshot of events it even do not need to work perfectly
Cause right now i am more than sure even he have no idea what he is talking about
I DO NOT want to compare him to someone like sparckman (you can youtube him) who posted videos on YT from him playing NES games on emulators claiming he made them in gdevelop
Or that he made space shooter in gdevelop where in fact he just opened free space shooter template and recorder how he played it
But i hardly see how Amigo is doing anything different
His answers are deceiving
Rarely solves anything and most of the time there is no screenshot of events neither explanation of events structure in text like
Condition
Key pressed
Action
Play sound
NO NOTHING
This should not be ok
I do not wish to get rid of him from here
Quite opposite
I would wish for him to start providing valid help
I am all open to him proving me i am wrong
Humiliate me showing he know what he is talking about
And i will have no problem apologising
But until that moment i will stand by my claim he have no idea what he is talking about and if that is even possible
On other hand i gonna ask you same question
Let’s say you can store info of all stuff into json (well you can)
Tell me how different it will be from you storing that info into variables?
Just keep in mind that is exactly what OP wanted to avoid
So please by include explanation how that helps OP
So instead of looking for something hostile in my message
Try to find something helpful and accurate in his
Well personally I think you’re both wonderful and I have enjoyed @Amigo54 s comments on here.
I have read the above and reflected on it but My worry here is that new users, like myself …did I mention I won ‘new user of the month’ btw… will see stuff like this and be put off jumping into the water to save those who are In need of help.
Every voice on here is precious …there’s so few of us really …I mean sometimes hours go by without a post being shared …and …I don’t know what do do with myself!