x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Storing Multiple Character details and Stats

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.

Product Version: UE 4.14
Tags:
more ▼

asked Jan 30 '17 at 10:21 PM in Blueprint Scripting

avatar image

Malibu Lizard
17 3 8 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Data Tables and Structs.

https://docs.unrealengine.com/latest/INT/Gameplay/DataDriven/

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

more ▼

answered Jan 30 '17 at 11:05 PM

avatar image

S-ed
1.4k 27 26 49

avatar image Malibu Lizard Jan 30 '17 at 11:33 PM

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 :)

avatar image S-ed Jan 31 '17 at 12:17 AM

Long story: https://answers.unrealengine.com/questions/172007/datatablerowhandle-to-get-data-table-row-only-lite.html

Well, If the game will be Turn Based and database will be queued not each frame it probably would be fine.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I recommend using a Saved Game Blueprint to generate and store your characters stats, cool.

more ▼

answered Jan 31 '17 at 01:38 AM

avatar image

MonsOlympus
1k 37 12 38

avatar image Malibu Lizard Jan 31 '17 at 02:44 AM

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. :)

avatar image MonsOlympus Jan 31 '17 at 03:38 AM

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 :)

avatar image Malibu Lizard Jan 31 '17 at 03:53 AM

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.

avatar image PerCat Apr 26 '19 at 06:49 PM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question