Where to add/edit card game data?

0 favourites
  • 6 posts
From the Asset Store
Data+ is the best Data Management solution for Construct 3. It contains 4 Addons (Plugin & Behavior).
  • Hello there!

    I'm wondering what the most practical way to add and edit card data would be.

    Of course ingame I will be storing all the data in a JSON object. But I think it is very error prone and slow, due to formatting, to manually write hundreds of JSON entries into a JSON file.

    Additionally I really like being able to write down new card ideas on my phone on the go.

    So Google Sheets comes to my mind. Is there another good way to do this?

  • If you're going to utilize Google sheets and your goal is mobile data entry for ideas, I'd recommend setting up a Google form for ease of use.

    However for actual game data I'd definitely recommend using json, xml, or other suitable data format as an included project file.

  • To enter data I use the array editor in C3, because it's convenient and you can copy/paste values from Excel or Google Sheets.

    And then on start of the game I convert this data to JSON, because it's much more flexible and easier to work with than arrays.

    Here is an example, the ShopStock array, it contains multiple sheets for different shops in the game. The first cell contains the name of the shop - "Blacksmith".

    On start of the game I'm loading this data into a temporary array and then parsing it into this neat JSON format:

    {
     "Blacksmith": {
     "copperaxe": {
     "Price": 2000,
     "Materials": [{"ingotCopper":3},{"axe":1}],
     "Quantity": 1
     },
     "copperhammer": {
     "Price": 2000,
     "Materials": [{"ingotCopper":3},{"hammer":1}],
     "Quantity": 1
     },
     "ironaxe": {
     "Price": 5000,
     "Materials": [{"ingotIron":3},{"copperaxe":1}],
     "Quantity": 1
     }
     },
     "Greenhouse": {
     "plantPurpleHeart": {
     "Price": 2100,
     "Quantity": 1,
     "Randomize": 1
     },
    .......
    
    

    I can then access any product in any shop using ShopStock.get("Shop.Product") expression, I can add new keys to JSON, remove products etc.

  • oosyrag Interesting. I will look into Google Forms (I guess that's what it's called?).

    dop2000 Cool. Thank you very much for the example. So depth translates to the different pages? When I copy data from Google Sheets, can I just copy the whole page?

    I also found this. That is a script that can export JSON from Google Sheets.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you very much for the example. So depth translates to the different pages?

    It's up to you how you organize your data in table format. Pages may represent a parent object in JSON. (shops in my example above) I also often try to split big arrays into multiple pages, simply because it's easier to read and edit than one huge wall of numbers.

    And of course not all JSONs can be done this way, I have a few plain-text JSON files in my project as well.

  • It's up to you how you organize your data in table format. Pages may represent a parent object in JSON. (shops in my example above) I also often try to split big arrays into multiple pages, simply because it's easier to read and edit than one huge wall of numbers.

    Okay great. I think I already know how I'm going to structure it.

    And of course not all JSONs can be done this way, I have a few plain-text JSON files in my project as well.

    Yeah I have that as well. But I think for database-like it is better to use actual tables.

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