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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Creating large amount of character data and storing it

Hi,

I have a hard time figuring out how to implement a set of data to a sports game ( single player game ). I've been trying to find answers for this from the hub but none of them quite touches my problem.

In the game you are a manager and also can play matches. What I'm trying to achieve is a data set that has all of the players statistics/attributes/characteristics (playerID, how they look, strength, items they hold, which team they belong to etc.) , to which you can add more players, remove players and update players if needed. I've been trying to do that using data table but it seems, if I understand it correctly, that data tables aren't used that way. I've been trying things in the editor, no coding yet because I think I first need to understand the correct way of thinking.

My thinking is that the player data should be in an external file where from you can load player data when the game starts and while playing, it updates the data respectively. Thinking behind this is that players retire and we need to add more new players (rookies) after every season. That is why we need a system that supports adding and removing players. But the question is that which file format should the data be? JSON, csv, excel,txt or... What is the best way keeping things tidy and easy to read/use when we have let's say at start we have 1000 players and their stats. Is it the same case with team information which should have the info about the players playing in the team, overall money of the team, monthly expenses etc.

How would you guys go forward with this?

Thank you in advance -Mike

Product Version: UE 4.21
Tags:
more ▼

asked Apr 22 '19 at 05:38 PM in C++ Programming

avatar image

MikeSwede
1 1 1

avatar image mercuriusfm Apr 23 '19 at 05:28 AM

I think you need to look into config files which are .ini. Sorry I have no information on how to program them, but this might be some help. https://docs.unrealengine.com/en-us/Programming/Basics/ConfigurationFiles goodluck

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

1 answer: sort voted first

I'm pretty sure you can use Data Tables to manage this data. It is afterall just a collection of structured information. However, there might be some reason for it not to be the best solution depending on the data you actually want to store.

I've made sports games in the past and at the time we always used XML to store the data. That decision was made because we were using a custom engine that already had robust XML support and it was used farily extensively. Personally I'd use JSON now but the best answer depends on your work flow. You're going to need to create and edit all this data, so choose a format that works well for you.

For save data, you could initially read in all the 'base' stats (from your datatable / xml / json or whatever) and keep them in structures. As tou play the game these are then updated and serialised out in whatever format you think is suitable. When the game next loads, just read in this new data instead (or read in the core data then apply the saved changes to that data, depending on what is best for your game)

more ▼

answered Apr 23 '19 at 10:28 AM

avatar image

phil_me_up
1.5k 6 6 12

avatar image MikeSwede Apr 23 '19 at 11:09 AM

Thank you Phil for your insight.

avatar image Lardo Deepdelver Apr 23 '19 at 11:54 AM

you could also use csv files. Unreal supports parsing of csv files, this would have the advantage that you could use something like google sheets to store the data in a nice and multi user-editable format.

(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