I’m in the process of making a turn based strategy game similar to Xcom or Fire Emblem. I’m now at the point in which I want to create multiple characters with different stats based on different ‘classes’, which change upon levelling up by a somewhat random amount etc. I’ve finished working out most of the formula and maths needed, and have a basic turn based setup working.
I’m having trouble figuring out what the best method might be to keep track of many different characters, their ever changing stats, and the flexibility to add and remove characters as the game progresses. Characters will be randomly generated and practically unlimited in that a player can have anywhere between 1-100 characters at a given time, and as some are permanently removed (i.e Death), more will be generated. Each will have different stats, names, classes, and all that good stuff you’d expect.
It’s complex I know, and I’ve created a number of enums and structs to manage all the stats, and blueprint interfaces to handle some of the formula for the stat calculations and pass variables but, how can I store all this ever changing information efficiently? Where should I store all the players obtained characters?
If anyone has any experience with this kind of data or rpg/strategy gameplay mechanics or a good amount of blueprint knowledge (mine is somewhat lacking) then please share it with me, any help will be appreciated greatly.
Data Tables and Structs.
Data Tables not very flexible imo.
So I would probably create a class like “DataManager” that would hold all necessary data in structs.
That may be a problem if You’re no familiar with C++, since working with data in BP it a bit slow. Especially loops.
Also join Discord server, we have many devs who have experience especially with RPGs: http://join.unrealslackers.org
I figured that Data Tables would be the way to go, but I didn’t have enough experience using them in the few small projects I’ve done over the past year. May I ask why they are NOT flexible in your opinion?
Unfortunately I’m not familiar with any coding language, so blueprints are how I do everything. I know people think it’s slow and inefficient but the scale of my project is quite small so I hoped it wouldn’t be noticeable slower since most of that rpg stat and database stuff will be in menu ui stuff rather then in actual gameplay. In actual gameplay at any give time I expect there to be no more then a dozen or so pawns on a small level map, with simple low poly graphics that actually even use the database to retrieve their initial stats before storing it somewhere else for the duration of the ‘gameplay’.
I may join the server, I’m quite a noob still so I imagine it will be quite helpful hanging around with people who have experience.
Thank you for your reply
I recommend using a Saved Game Blueprint to generate and store your characters stats, cool.
I feel like a Saved Game blueprint wouldn’t be ideal. It certainly can hold all the information necessary , but there will be many characters in some cases, and the dozen or so stats for each possible character aswell as info on the characters appearance, weapons, clothing, names, and god knows what else seems like alot to seperate save game objects and casts in other blueprints- this is why I initially thought a data table and structs and enums would work, because there alot more organised and easy to make tweaks to throughout the testing phase without having to navigate through multiple blueprint parents to make changes.
But you might very well be correct, as I’ve only used Save Game blueprints in the past to save things like score, lives, levels, weapons etc for a single character and play file in my other projects.
Thank you for your reply, I’ll look more into save game blueprints and their possible limitations and efficiency for such a task.
Well its basically a data class, you can save structures and arrays of structures in there so you could save out all the characters in a single master saved object rather than trying to save individual characters as saves.
Ive used Data Tables myself but I wasnt entirely sure if they allow write access which is why I suggested Saved Game instead. There is also nothing that says you cant use them in tandem so using a Data Table to pull in your base numbers and then generate the randomness and save them out in a Saved Game.
I assumed by Store in the thread title you wanted the ability to save out these generated characters and Data Tables might well be flexible enough to allow you to add entries in BP. When you talk about numbers in the hundreds of characters it leads me to believe you do want to be storing them out when they arnt active and only pulling in active characters when you need them and this is why I think a Saved Game object is best. I think any reference you have in a Data Table will be loaded with the table in its entirety where with Saved Game you could optimize and only load in the references for given characters as you need them lowering the overhead.
Now I could be wrong but I did give this some consideration before replying
You make some very good points, and yes the characters will be stored out when not active as pulled via player choice before each ‘level’ so to speak. I believe you can add entries to a data table via blueprint but I must check to be sure.
It sounds like Data Tables and Save game mixed might be the safest option.
I was hoping someone with expirience with this type of game might notice the question and provide clear cut answers, but I’m happy other people have been replying with helpful advice and suggestions for me to try out. I’ve got a lot of testing ahead of me for now.
Thank you for taking the time to consider your reasoning and reply, it’s appreciated.
Hey I’m actually making a similar setup to yours in a different type of game(my characters are random gen with enums, data tables and have distinct features that set them apart)
Anyways, how did you end up going about storing your characters? Cause I’m running into the same issue as of now, thanks for your time!