Sign in to follow this  
DarthSheldon

Design Question: Handling Save-states & Text

Recommended Posts

DarthSheldon    108

Hello, First Time Posting here and I have a few questions on
Game making, more specifically how to manage save files and in-game text.

First I'll talk about what I'm doing/ what I'm working with. I'm currently starting work on a point & Click adventure game using XNA 4.0 and visual studio 2010, the game will have a heavy amount of Dialog and feature a bit open ended as far as which order puzzles can be completed. I decided to do this project as all of my games up to this point haven't really dealt with either of these concepts (endless shooters, checkers, tick-tac-toe, simple Mario clone..), so I am wondering about how to handle the sheer amount of text as well as the ability to make appropriate, efficient save files.

On the topic of save files, I understand how one would go about making a save as seen here: http://msdn.microsoft.com/en-us/library/bb203924.aspx

But I'm unsure as to how I can handle the save storing where the player is, what the player has in their inventory, and what events/puzzles/objects have been completed or interacted with? If anyone has advise or opinions on the best ways or standards on storing and keeping track of all of this info let me know.

The second thing I am curious about is how to handle large quantities of text for dialog, do I hardcode it into my C# code, or is there a better way to set this up? and when set up how am I going to be able to access it?

Share this post


Link to post
Share on other sites
Khaiy    2148

For save-state considerations:

 

How are you storing the information you describe right now? Serializing that information to your save file is no different than serializing anything else, and you can define your save files in any configuration you like. If your player character has a location field, that can be serialized along with all other data contained within "Player" and loaded at need. If you have something like an observer class monitoring that sort of thing, you can serialize the data contained within the observer in the same way.

 

Events, puzzles, and objects aren't conceptually different. How does your game currently mark a puzzle as "done" or "not done"? Serialize that, and the work is over. Something I see often is a list of puzzles/events/objects/whatever that can be interacted with (the same sort of list that initializes those when the game is started) stored in one section in the save file, and updating the puzzle/event/object/whatever status to "completed", or something similar, once the player is done with it.

 

Something that seems to trip people up a lot game saves is thinking that it's a big, separate enterprise from programming the game. If this is the case, I haven't come across much evidence of it. If the data you want to save exists (and, to interact with the game, it must), you can take that same data and serialize it. The hardest piece is using save/load methods to translate your saved data into game-world data and vice-versa.

 

For dialogue text, the standard way is to store the dialogue in chunks which can be parsed by your game and then loaded on demand. Hard-coding everything isn't generally recommended because you are more likely to add or change dialogue stuff than you are to fiddle with game code, and rebuilding the whole project because you decided to change punctuation marks is a hassle. For a relatively simple project you could just store your text in a notepad file with tags your code will understand to help it load what it needs to when it needs to load it. You could also use a scripting language (like Lua) for this sort of thing, but adding in the code to handle scripting is a non-trivial addition to the code you've already written.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this