• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Spell] Save & Load System

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
I am creating a multiplayer RPG game based off Pokemon (woooohhh another one!) I've been busy developing lots of systems to build up the game and I thought it'd be better to consider a save load system sooner than later. It's important to allow players to save and resume their game.

I was researching into how they work and found this system.

In addition to what these system appear to support, I need to save arrays, hashtables and even custom objects. Below is an abstract of what I think I need to save. If you haven't played Pokemon for reference, just look at the Data Type I mention which is either how I currently have or how I think I will save the information during the game. This is an early list and I'm sure I'll need to add more to it later.



Character Name
Data Type: String

Game Progress to track what players have done
Data Type: Boolean array

Gym Badge Completion (I want to keep this separate to game progress)
Data Type: Boolean array

Pokemon Party & Pokemon Storage
Data Type: Hashtable

Custom Inventory System (allows multiple inventories)
Data Type: Hashtable

Pokemon Info (Pokemon's stats, levels, abilities, status, HP, MP, etc.)
Data Type: Custom Object (there will be 1 per Pokemon as saved in the Pokemon Party & Storage hashtable)

Player Zone
Data Type: integer

Player Music Key
Data Type: integer

Player Location
Data Type: loc object or real X & Y co-ordinates


I think the challenges I face are:
- Using a custom object like "Pokemon Info" for the Save & Load system.
- Storing a Hashtable into a Save & Load system
- Ensuring compatibility of old codes with new versions

I think these code systems essential convert rudimentary data types (ints, strings, reals, booleans) into encrypted text, often using the player's name as the encryption key. What of the Hashtables and custom objects? Do I need to break them down into rudimentary data types first and use the system? These save & load systems look pretty complex to create, so I'd like to use an existing system if possible.
 
Level 5
Joined
Dec 20, 2008
Messages
67
You probably want to look at the newest save/load system made by Triggerhappy, which is this one: Codeless Save and Load (Multiplayer) - v2.0.0

I do not know however if that system can deal with arbitrary custom data like hashtables.
I strongly believe that there is currently no save/load system which can save hashtables. But it should be possible to save arrays - and it is possible to create arrays from hashtables and vice versa.
 
Level 39
Joined
Feb 27, 2007
Messages
5,024
You can't sync/save a hashtable with the Sync library that @TriggerHappy based his system on because there's no native SyncStoredHashtable. What you can sync/save is the data saved in the hashtable, which is mostly going to be integers, a few reals, and a sparse few strings (from what Radicool described). Since the system is fully configurable you should be able to save everything you need to. Try it first with a few parameters like player name (string) and list of pokemon (presumably these are unit IDs, aka integers); once you get that loading properly you can increase the amount of data you're saving and loading.
 
Status
Not open for further replies.
Top