How does saves work?

I know this is a really silly question, but I’ve no idea how to create a save game function for my visual novel (or any game for that matter). To make matters worse, I also have no idea how it would bring all of it back so (Loading a game). If there is a tutorial on here, I’d be more than happy and grateful to read it.

It’s something I’ve taken for granted over the years but never put any thought into :stuck_out_tongue: (I know bad me T__T)

I would think the basic idea would be to read/write from/to a file, however I don’t want to oversimplify something that could be rather complex. At first I thought I’d just save every single variable state the game is currently in when a user saves. ???

Thanks for the help and sorry for the ‘noob’ question.

No offense but this question is best left to Google. Saving and loading basic text files is a breeze in Java, search for InputStreams and the like. I guarantee you’ll have something working by the end of the night, and you’ll learn more if you research it yourself!

You’re right, I feel bad for asking now :stuck_out_tongue:

I’ve been tossing it around in my head all day, and I’m eager to start messing around with it when I get home! I made the mistake of asking before trying… a learning mistake :frowning:

Thanks for the advice opiop65!

Depends on saving local or online. There are lots of free online data stores like Parse.com for example. Convert your objects into something light weight like JSON, compress the string and push it to a database or document storage.

I have used Parse for mobile apps mostly at work but have played about with storing high scores and inventories etc:

These are also worth a look at:

http://api.shephertz.com/

If you are storing local though just save to a file “Java JSON serialization” is what you might want to search. You can use something like GZip to compress the string. If you are saving periodically a lot of data then pass this save off to a background task.

I know you could have Googled some of this yourself but you did ask so its just friendly to answer, good luck.

Thanks dime26, I’ll give these a look. I hope to post how my ventures go in learning to save :stuck_out_tongue:

Last but not least… hopefully. I wrote a post that goes over the general ways of saving a file. The thread has some extra knowledge if needed…

Storing levels

Thank you ctomni231!

That is a very helpful link indeed! I’ll strive to make all the advice I get on this forum well worth everyone’s time!

;D