Pages

Friday, March 23, 2012

User Interface, Saving

So another week has gone by, where I have been incredibly preoccupied with school and life in general.
Luckily I managed to get some more coding in :p
Things accomplished:

  • Saving and loading!
  • Multiple save games, up to 3.
  • The intro Ruined screen, has been implemented*
  • The screen to select a save game has also been implemented*
  • A "MessageBox" for handling, well messages.
Yes, I know "Press Start" is not centered, I still need to make an image for the start button.

An early version of the save manager, showing two saves games.
* Neither of these screens have backgrounds yet. Both saves in save manager pic -above- are for testing purposes: one puts the engine in debug mode, the other returns an error to simulate a broken save.

So yes, saving and loading has been implemented. Save files are created byte by byte and, as such, currently only take up 80 bytes! Of course this will change, but I don't see the save-file size growing to over 500 bytes.

A save-file contains:
  • Save File Version
  • Player name
  • Play time (days, hours, minutes)
  • Money!
  • Max health and current health
  • Max magic and current magic
  • Equipped items in right and left hand
  • The current level, and position
  • Flags! (these are where most of the player's progress is stored)
All of that data, sans flags is only 24 bytes! I store flags as single bits, so I can store 8 flags in one byte.
Currently save files are defined for only 256 flags, but that number can easily be expanded to the 2000 or so I'll probably need.

I also came up with a nifty save game manager. Quite simply, it allows for three unique save games, so three different people can have their own save.
Both the save game manger and the intro screen are in EARLY stages (they don't have backgrounds, music, some textures etc..)

Finally, the "MessageBox" displays messages like: 

Disconnecting the controller, results in this message.
Until next time!

No comments:

Post a Comment