User Tag List

Results 1 to 10 of 10

Thread: Saving game level in Android in 2021

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Aug 2019
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Saving game level in Android in 2021

    Hi guys,

    All of my games have different levels. I want to save the user's progress in Android using the latest techniques with minimal permissions from the user as possible.
    So far I have been using a simple INI file with one variable in it (LEVEL_REACHED) that gets updated after each level in the external directory ("ExternalStorageDirectory$( "Android object" ) + "/" + "savegame*****.ini"")

    How should I do it now in 2021? I have updated to 293.6

  2. #2
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    821
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Don't use external directory. Data Storage is more secure and doesn't require any permission.
    DataStorageDirectory$( "Android object" ) + "/savegame*****.ini"

    If you will only use a single ini, you don't even need to write the path, on the "Ini Name" just put the name (for example: savegame*****.ini)
    If you need to check for the file, use the expression I showed above.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Aug 2019
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much!

  4. #4
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    821
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    No problem, I've created my first full mobile game these days, had to tackle with that

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,179
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    Keep in mind if you change it now - all of your existing users will lose their saved game data, unless you first retrieve it from the old save directory, and resave it in the new save directory, the first time they run the update.

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)

    Join Date
    Jan 2022
    Location
    Peru
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it is no longer possible to create folders in the root of the storage?
    I have a game that creates a folder to save levels and my problem is that I don't know how to fix this.

  7. #7
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    7,165
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    oh, you need to organize your game to write this information inside the scope storage now, in all devices from android 10, also considered migrating that information from root in previous version.
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    403
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I use the List Object to save user values. However, instead of putting .txt. I use .VBE so text editors refuse to open the Save.VBE file which is truly a SAVE.TXT file.

    The File uses Global Values and Global Strings.

    I.E.

    Line 1 = User's Name / Global String A
    Line 2 = User's Power level / Global Value A
    Line 3 = Level Currently on / Global Value B
    Line 4 = User Position X / Global Value X
    Line 5 = User's Position Y / Global Value Y

    Saving is in Scoped Storage as per google.
    Files are created and Named by the User via the Edit Box object.
    Updates to file are saved automatically when the user clicks END GAME or the Back button ( Disable Back button behavior ).

    For me, this is the easiest I found for saving Game Data. Works on Windows as well with ease.

    Hope this helps

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleXNA Export Module
    Dobermann's Avatar
    Join Date
    Feb 2009
    Location
    France
    Posts
    921
    Mentioned
    38 Post(s)
    Tagged
    0 Thread(s)
    Use AES Fusion to securize your data instead of just another ext name.

    Using INI with Android is really easy, no need to specify a path, just set the name of your file and voila. Android will create it in the app folder.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    403
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dobermann View Post
    Use AES Fusion to securize your data instead of just another ext name.

    Using INI with Android is really easy, no need to specify a path, just set the name of your file and voila. Android will create it in the app folder.
    Never Tried AES Fusion. I will give it a go. Thanks

Similar Threads

  1. Replies: 0
    Last Post: 14th June 2018, 11:58 PM
  2. Android game level system
    By nyme in forum Fusion 2.5
    Replies: 33
    Last Post: 12th August 2015, 04:04 PM
  3. Cross saving game between platforms (iOS / Android)
    By paobrasil in forum Fusion 2.5
    Replies: 2
    Last Post: 31st May 2015, 03:13 PM
  4. Simple level editor with saving and loading
    By Konidias in forum File Archive
    Replies: 30
    Last Post: 8th June 2012, 08:37 AM
  5. Saving/editing/loading a large level, server-side.
    By SergeantBiscuits in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd March 2012, 05:42 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
  •