Save data for Multiple Characters? Like an MMORPG

1 favourites
  • 11 posts
From the Asset Store
Data+ is the best Data Management solution for Construct 3. It contains 4 Addons (Plugin & Behavior).
  • I have a game which includes selecting levels from a map and upon entering, there is a turn based battle system. However, there are a few features I've been thinking about and exploring for days and have failed in trying to replicate them.

    1. I want to create a home screen with list of classes where the player can essentially play the story again with each character (1 for each class) and have their customised sprite and stats display when the button to choose their class is selected. How can I differentiate between a character which has not been created, 'new character' and one which is already been made.

    ( I have the screen, but I am unsure the best way going about saving the data of each character)

    but being able to use the 'currency' of all the characters.

    2. I also, want to implement a system such as a 'group dungeon'(not important), where the player can be on one character (e.g Wizard) and summon another character (knight) for the dungeon with their attained stats saved.

    I dont know if any has played 'Darkness Rises' or such, but basically at the start screen you can choose a class from the list and if you haven't made that character then you 'create new' and play the story again. I'd like a system like that but with shared currency.

    Previously I had a character selection screen and an array listing all the stats for each class, and when a class was selected, those stats were injected into another array for the personal character. But saving and storing info of multiple characters is out of my league :/

    tl;dr I'm not necessarily asking for code, but I would like some tips/info on how I can go about this idea and the best way to store and save these values of multiple characters.

    A sort of MMO-RPG type system.

    even the smallest pieces of info, I would be grateful!

    Thank you ever so much,


  • Looks like you've already accomplished it with arrays, what's the problem? Each class would be a row of the array and the same row in the player's array.

    "Previously I had a character selection screen and an array listing all the stats for each class, and when a class was selected, those stats were injected into another array for the personal character. But saving and storing info of multiple characters is out of my league"

    Surely the only options in the player array are either the data is filled out (they have made a character) or it's blank (they haven't made a new character and prompt this when they go to create one)

  • I guess so, so far in each array I just have health, mana, stamina and strength agility and wisdom. Which is cool. Would you recommend I add currency , exp, level onto that same array or another one or something else ?

    Previously I made exp and level instance variables on the sprite as I wasn’t sure what I was doing. Also I don’t know how that would work if the player changes character because the characters are just different frames in an animation.

    Are there benefits or negatives I should consider?

  • It really just depends on how your game works and what is important, I'm having trouble imagining the character selection and switching. All important data to be saved can be put in one array and it doesn't matter how many stats. Animation frames can be the same, if they select a skin which is frame 3, you can store 3 in the array and set the frame to this as their equipped clothing.

  • Thank you for your help :) It's greatly appreciated.

    So basically, I was thinking along the lines of a character selection screen like world of warcraft or guild wars 2. You have the list of all your characters, and you can select which one you want to use and then enter the world.

    I hope that makes more sense.

  • My approach would be to have all available classes in an array with default data for when you click on them. If changes take place on character selection then you can update the array. You only need one array. As for changes during gameplay you would probably be using global variables but when you come to save data you can set various global variables in the array.

  • So if i understand correctly:

    1. I have one array with every single stat, exp, level, health, money and whatever stored for each character in 6 long columns (6 playable classes).

    2. When I select a character and enter the game, I have global variables for each of the said stats, exp, money, etc... and load in the values from the array.

    3. When I want to leave/save/change character, I update the original array with the values stored in the global variables.

    That's what I'm understanding, and I like the sound of this idea. Hopefully i'm competent enough to try this.

  • Yes that's right. When you save you can export the array data as JSON (one string) and save this into local storage. So all stats in the game can be saved as one item. For updating stats for the array the logic will be one lot of events but you would replace the class or row number depending on the character. So selected character would also be a global variable that you can insert as the row each time so 1,1 1,2 1,3 becomes char,1 char,2 char,3 etc

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm starting to make sense of it all, Thank you so much, I want to get this start right. Previously I've started this project and then added stuff over time, then realised its all a mess and I can make it much neater. And I just keep doing that, and hopefully, this is another step to making everything compact and easy to read and tweak when needs be.

    How would I go about testing if the system works, do I need some sort of save/load system (idk how they work) or can I make a character, press like 's' to save the global variables into the array and then I'm not sure what.

    If I save variables for a character into the one array, will that array stay altered forever? do I have to make all the stats 0 again every time I want to test? I'm quite new to arrays :/

  • You wouldn't need to do any reset because you'll likely be previewing it from construct and that's like starting with new data. Only if you save to local storage and load will it remain. I don't know how to briefly explain how to use arrays, better you get familiar with them yourself, but for example you set (char,0) to a global variable, or set a global variable to (char,0) where char is the row and 0 is the first stat.

  • I understand you, thank you ever so much for you help tonight! I'll be sure to try everything out tomorrow, and I can't wait! :)

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