WebStorage, still best method to save data?

0 favourites
  • 6 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • In short Im creating inventory system (which is already working, kinda) but I would need that data to remain in-game after browser has been closed.

    Short scenario:

    * each inventory slot is made from 3 different arrays (using 10,3,1 array as in width,height,depth).

    • Pick up item.
    • Compare item name with inventory slots.
    • If item is not found at inventory, save item to first free inventory slot.
    • When hassle is done, vave data to WebStorage and update/load inventory slots via webstorage information.

    Any other suggestions? Databae support would be awesome, but I dont really doing &user=name&password=fake type of things, sounds scary to me :P

    EDIT: I assume AJAX and POST/GET functions should help me to build simple database support for storing this kind of information (and possible auto save every x minutes).

  • There is a solution ... You could save array data to Json using Local keys and then load all the data when the player reconnects ...

  • Ah, I just started reading about JSON and it could do the trick :) At least in here scirra.com/arcade/example/1539/asteroid-in-less-than-100-events high scores are saved, so looking good.

    Thanks for the tip, I was going to ignore that option but you made me look into it better :P

  • All right, back with more questions. I managed to save and load information using database, then loading/saving information via JSON and parsing necessary parts to arrays.

    For offline games, is there any way to store information in XML or any other file to player own computer and use that for saving/loading information?

    I assume we can use instance variables to check if object should spawn or not, but there is alot more information we need to be able to handle such as player own information (health, mana, skill points, money, items currently in use, skills selected etc.), inventory, map progress, dungeon progress, game total progress, karma (relationship between other NPCs) and more. Hoping that player will not clear their cookies and lose all game data is bit akward.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Small bump, would love to know is there any solution to this? Current system works only for those who have active internet connection available.

    Second thing I worry is Kongrete/other providers if they have similiar data storing solutions for us to hook into, of course Steam is another thing which Im uncertain with current setup, all seems quite scary at this point :P

    Making wrong decision now with data storing can lead into bigger problems later. I have look into other engines but to be honest, CS2 provides us fast way to make our ideas happends.

  • You cannot/should not save files. While I know some browsers are starting to dabble in the area of FILE.IO(or whatever it's called). It's not wise as browsers having direct file access has heavy negative stigma and might not become standard. Continue to use Webstorage as it actually saves data locally and not online. Webstorage uses some form of cookie and browser cache.

    webstorage is local and Kongregate should have no problems with it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)