HentHighSchool Development Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

collapse
* Recent Posts
Re: [HHS+ 1.9.5] Official Bug Report Thread by Shilo
[Yesterday at 07:42:57 pm]


Re: [Mod] King's Way 2.0 by Spellsword
[Yesterday at 05:21:58 pm]


Re: [Mod] King's Way 2.0 by vadi92
[Yesterday at 04:13:53 pm]


Re: [Mod] Grafitti and interrogation (function) by fateavernicus
[Yesterday at 02:05:31 pm]


Finished the events/game/entire town enslaved by you! by fateavernicus
[Yesterday at 02:00:29 pm]


Pages: [1]   Go Down

Author Topic: Save Format - XML Serialization and related issues  (Read 10004 times)

Zythen

  • Code Monkey
  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 406
    • View Profile
Save Format - XML Serialization and related issues
« on: June 04, 2010, 11:00:34 pm »

A discussion thread to keep notes and discussion over the save format of the game. This also has direct impact on the storage of any addons and extensions for the game world.

At present XML serializations of the data structures used in the game are used with very few top level global variables:

TheSchool
A variable representing the top level school container. As a school should have, it contains rooms (built and unbuilt) which provide jobs which contain staff. A school also has a student population etc etc.. Serializing the public properties/variables of the school object should result in a totally saved school which can be deserialized from the exact same file and restore the school to its state.

Calendar
The master scheduling point for all events, serialization of this could be more complex since it carries references to the event objects held within the school object. The eventchain within it carries the information relating to previous executions and any states, whereas the calendar purely holds scheduling information. It may be pertinent to add a ReadOnly method to the EventChain which fetches all its schedule information and convert the property into an XML Serializable piece of information which when reloaded populates the calendar with all the scheduling information - this is likely to prove the largest challenge, as in a general scence the whole school revolves around the events and thier scheduling - whereas everything else is purely a piece of information.

Once serialization/deserialization of the school has been tested, it maybe worth considering saving the file in a compressed form (zip or otherwise) automatically to reduce the savefile size (XML is after all highly verbose, which is helpful, but it will compress well). The XML file also provides users the ability to "hack" their saves. If this is a desirable approach or not is yet to be decided, but with source code available I see no point in encrypting or putting in measures to stop game tampering. If people want to unbalance thier game I see no reason to stop them.

ToDo:
  • Master Save routine, that for now just serializes the whole school and Load that can reload the data in its simplest form
  • Locate and mark/comment on every reference store - references will create copys of data on load, so they will need special handling (this may result in consideration of per-save related uuid's for objects, and use them to rejoin references within the structure on load).
  • Repeat reference work for Calendar object, and absorb the Calendar information (via the EventChain class) into the school hierachy to be saved and restored at a later time in fresh data structures
Logged
Pages: [1]   Go Up
 


SimplePortal 2.3.3 © 2008-2010, SimplePortal