User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Saving game in a file (Like an RPG)

  1. #1
    Clicker Fusion 2.5

    Join Date
    May 2008
    Location
    In Your Cheese
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Saving game in a file (Like an RPG)

    I'm working on a platformer game in which there will be save points scattered across the level. When the player touches on of these save points I want the game to be saved in the player's individual file. When the game is started again, I want the player to be able to select his file (out of two or three total) and start at the point at which he saved.

    I assume the ideal tool to use here would be an "INI" file. The problem is: I have absolutely zero experience with INI files or saving in general. Would someone be so kind as to walk mw through how to do this?

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    Popcorn has an excellent tutorial in the Tutorials section in the ---> sidebar. This is an excellent way to get started with INI.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    Quote Originally Posted by nivram
    Popcorn has an excellent tutorial in the Tutorials section in the ---> sidebar. This is an excellent way to get started with INI.

    Marv
    Right on...

    http://www.clickteam.com/eng/resources/ini_tutorial.pdf

    Go check it out, the knowledge of INI files is worth having and limitless in making games, if you build more in depth games, you will probably use INI. It can hold how many lives your player had, how many points, etc... that tutorial is simple too, giving you basic ideas.

  4. #4
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    INI files are great for this type of thing, however the only issue with them is that are not secure and can easily be edited in a text editor.

    Once you learn how to use the object properly, I would suggest you use the binary object or blowfish extension to encrypt the file preventing it being edited easily (only if you are concerned about this)

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    You don't really need to worry about that though, unless you're going to publicly release it, to prevent the user from cheating the engine into thinking they are at a certain point.
    Sometimes I just give the ini file a really random name so the person will never find it :P

  6. #6
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    Quote Originally Posted by bigredron
    INI files are great for this type of thing, however the only issue with them is that are not secure and can easily be edited in a text editor.

    Once you learn how to use the object properly, I would suggest you use the binary object or blowfish extension to encrypt the file preventing it being edited easily (only if you are concerned about this)
    Using array objects is better than the ini. It's easier to store and save to a file, plus you can encrypt it too without using something extra like blowfish. Currently, I've been using the associative array extension. Love it.

  7. #7
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    I second what Shawn said. Using the associative array is not only more straight forward and practical, but also saves you the one step of encrypting/decrypting the file - as it is one single action.

    INI files are meant to store options (always have been), so the user can, in the worst case, fix a broken option (e.g. a resolution he set that his screen can't handle). That's why they're human readable. Savegames should not be that.

  8. #8
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    417
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    Optional you can give hash of save and save it. For example:

    save01.ini
    [SaveData]
    PlayerName=Tux The Penguin
    Score=9876
    SavePoint=3
    ValidationHash=2343f23a35(...)

    Hash you can get from QuickHash object. You simply generate hash from data, saving it, when loading generates it again and checking. If these aren't match -> user tried to "improve" his position.
    _________________________
    Dragons ARE

  9. #9
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    417
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    Optional you can give hash of save and save it. For example:

    save01.ini
    [SaveData]
    PlayerName=Tux The Penguin
    Score=9876
    SavePoint=3
    ValidationHash=2343f23a35(...)

    Hash you can get from QuickHash object. You simply generate hash from data, saving it, when loading generates it again and checking. If these aren't match -> user tried to "improve" his position.
    _________________________
    Dragons ARE exist. And I want to meet someone, o'kay?

  10. #10
    Clicker Fusion 2.5

    Join Date
    May 2008
    Location
    In Your Cheese
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Saving game in a file (Like an RPG)

    Thanks so much for all the info and tips guys. I got it to work fairly easily using an Ini. I'm too much concerned about having the ini file tampered with. I actually like having the code readable by anyone, so they can understand how it works. If a person wonts to tamper with it, it's their loss, since they won't get the full enjoyment out of the game. But anyway, thanks again for the info. =)

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Saving more than 50 values into an ini file...
    By Shmuper in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 4th April 2012, 12:52 AM
  2. Saving game in a file
    By qenio in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 25th June 2010, 02:34 AM
  3. Saving to File
    By Guitaristinmakin in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th December 2007, 09:18 PM
  4. File Options not saving
    By mdrd in forum Install Creator and Patch Maker
    Replies: 3
    Last Post: 28th December 2006, 05:06 PM
  5. File object - file selector saving issues
    By Gary_Molton in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th November 2006, 08:25 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
  •