Using JSON data to keep RPG stats etc.?

0 favourites
  • 3 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Hello there!

    I'm wondering what's the best way to have all the data of a "typical RPG" stored.

    I really like the modularity of javascript objects. So is there anything wrong with using JSON to store most, if not all of the data instead of using arrays, dictionaries or global variables?

    Some time ago I worked with RPG Maker MV and liked the way the battle system handled the battle formulas. I'm thinking of a similar system where I can do things like

    player1.hp = player1.hp - (player2.atk-player1.def)

    (Just a very basic/bad formula for easy demonstration.)

    Sure I could use dictionaries for this and call them player1, player2 etc. . But with JSON I imagine to be a lot more flexible with storing the data.

    Are there any downsides in using JSON as a database and for runtime calculations (turn-based rpg)?

    As always, thank you in advance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Whatever you're comfortable with, I doubt there will be any noticable performance differences.

    I find the array object has a variety of useful tools/actions that I like to work with, but again it comes down to preference. All of the data storage options are capable of storage, but how you interact and manipulate them are different.

  • Okay thank you. Then I'll just go for it.

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