Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How does saves work?  (Read 1355 times)
0 Members and 1 Guest are viewing this topic.
Offline defrazr1

Senior Newbie


Medals: 2
Exp: 1 year



« Posted 2014-02-26 23:26:56 »

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 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.  Huh

Thanks for the help and sorry for the 'noob' question.
Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #1 - Posted 2014-02-26 23:32:02 »

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!

Offline defrazr1

Senior Newbie


Medals: 2
Exp: 1 year



« Reply #2 - Posted 2014-02-26 23:37:09 »

You're right, I feel bad for asking now 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 Sad

Thanks for the advice opiop65!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dime26

Senior Duke


Medals: 2
Projects: 3
Exp: 5 years


Should traffic wardens be armed?


« Reply #3 - Posted 2014-02-27 00:31:09 »

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:

http://carelesslabs.blogspot.co.uk/2014/01/libgdx-and-parsecom.html

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.
Offline defrazr1

Senior Newbie


Medals: 2
Exp: 1 year



« Reply #4 - Posted 2014-02-27 00:49:03 »

Thanks dime26, I'll give these a look. I hope to post how my ventures go in learning to save Tongue
Offline ctomni231

JGO Wizard


Medals: 99
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #5 - Posted 2014-02-27 07:39:00 »

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

Offline defrazr1

Senior Newbie


Medals: 2
Exp: 1 year



« Reply #6 - Posted 2014-02-27 13:27:42 »

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!

 Grin
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!