User Tag List

Results 1 to 5 of 5

Thread: complex "database" save game... best solution?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module

    Join Date
    May 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    complex "database" save game... best solution?

    Hello y'all!
    I was wondering if the best way to make a complex save game system would be INI+3D arrays... Or is there any other option atm??
    Obviously I'd love to actually store my info into a database... But iNI and arrays should do fine, just wondered if anyone else uses something different, like is it possible to store game data remotely?
    Is it possible to store (be it INI/array data or on-going data, not necessarily saved) data to iCloud? Like, to restore a saved game after formatting or buying a new device?

    My idea (of saved data) is something like Diablo - I'd have to store player info (such as stats, points, etc), skills/upgrades unlocked, and random loot found (random properties etc).

    I remember back in the days of Click & Play, where there was no way of saving data, I used mod() of counters (using player score) a lot to check flags throughout the game, that was fun!

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I'd say use an array, you can save arrays into .arr files so the file will stay in the app package after closing, therefore you can use it as a saved game.

    One thing I did in a Metroid-style engine which remembers what enemies you've killed, what you've collected etc. was I saved a string with delimiters into an INI file. What it would do was, say you killed an enemy, it would set a global string named "Data" to Data+Str$(Frame)+Str$(Fixed Value("Enemy"))+";" (That would be a string showing the frame number followed by the object's unique 'fixed value' identifier) and I'd save that string into the INI every time you saved the game. Then at start of frame I'd loop through each enemy and do a string compare, so that if Str$(Frame)+Str$(Fixed Value("Enemy")) is found anywhere in that particular string, then destroy that enemy. It worked for any items that you didn't want to 'come back' when you returned to the frame. If all your events are in frame you can do it with a qualifier, but what I did was stored it in a behaviour and just pasted that behaviour into any other objects I wanted it to "save".

    The downside with this was that INI files are limited to 1024 characters, so it would fill it up pretty quickly as the game got bigger. But I have thought about in the future if I ever actually need to use this method, I could store one string for each frame all in an array.

    Thanks to fixed values and arrays there's really no limit to what you can save, you can even store object's X and Y co-ordinates when you left the frame etc., it's all possible, you don't even necessarily have to use a string, you could probably reserve a row in the array for each item somehow. I'd use the item's fixed value but I'm not sure what the maximum array size is and fixed values tend to be 6 figures long. This can be done with spread values and a qualifier potentially...

    I'm hoping to make an iCloud extension in a few months.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export Module

    Join Date
    May 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for replying! never actually thought of concatenating strings into an ini file to store data...
    but then again, now that I'm aware it is limited to 1024, and as far as I'm concerned, ini files are easily hacked, and arrays in the other hand is somewhat more confusing, I'll stick to arrays, I did a small test demo to try in the iOS simulator, to create a default character (with its attributes etc) if it were the 1st time running, then to load it if the game was already played before, it worked just fine.

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    DistantJ, I have an ini file that is over 60,000 characters and it loads fine on the iphone, and PC for that matter.
    I've had larger ini files and I've never run into a limit issue.

    I have heard that there was a limit, but I can't remember what it was exactly. Maybe 1024 k ?

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    complex "database" save game... best solution?

    It's something like 4096k. Strings are 1024 characters, I think I was getting muddled up. That's great news though! I can give my INI files some real work to do now I know this!

Similar Threads

  1. A universal solution for "can not find joystick2.mfx" for MMF2 .exe games?
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 30th October 2012, 07:07 PM
  2. MMF2 - Where's "Save game as Library" option ?
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd April 2009, 01:44 PM
  3. Little "Shift" and "Ctrl" signs popping up in-game
    By Jocastus in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 18th January 2009, 10:08 PM
  4. Solution for "Phizix Problem" - Game_Master
    By DanielRehn in forum File Archive
    Replies: 1
    Last Post: 22nd October 2008, 02:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •