Basically, I am commercial .NET programmer who works on large scale commercial database applications, but I enjoy writing games in my spare time. I am working on a JRPG at the moment but have a couple of questions:
1)What do you do about persistence/Saving Games? Do you write the game state to a DB? Serialize your objects? Or even a flat file?
2)When you write a menu class, would it better to have a generic menu class and pass in the various options etc as a collection of strings or do you hard code them in a inherited class like "MainMenu" with Save, Load etc?
I am no doubt sure I will be back to ask more questions later on but for now thanks for any and all answers I get and apologies to any moderators I have upset by posting this in the wrong place.
Games (usually) just save to a raw file in binary. There's no need for something as fancy as a whole database. (And "Serializing" is just a fancy word for save) The hard part is figuring out how much to save so you can accurately reconstruct the state of the game when the user loads it again.
For a save-anywhere game this will be difficult as you pretty much need to save all game state. Things like the coordinates of all objects that can move, current animation frames, any physics forces on them, any state that has changed like if it is locked/unlocked, etc.
On the other end of the spectrum are old games with save points (like old JRPGS). They usually only save your inventory contents, which save point you saved at, and a number or two indicating how where you were in the story.
You should probably consider at least moving your strings into a data file somewhere for localization reasons. It also wouldn't be too hard to come up with some really simple text format for menus that was just a list of things you wanted in the menu and what order. I'm pretty sure there are also several open-source libraries you could use for UIs, but I'm not familiar with them. AAA games these days usually use a third party library like Scaleform (which uses Flash) to do their UI - though those will have licensing fees and are probably overkill
Edited by SmkViper, 14 August 2014 - 09:26 AM.