To my understanding (and how I used them for dialogue in a game with ID, Speaker, Text etc) you re/import your data, use it in a DataTable and then access the content to get data for your game. You can’t write into a data table either. Here is some more info: Data Driven Gameplay Elements | Unreal Engine Documentation
I’m experimenting with DataTables and I feel like I’m missing something. How are we supposed to use them?
a) Create and modify all data in JSON/CSV text file. Don’t deal with DataTable assets in the editor at all. Do everything in C++.
b) Use DataTable assets. The fact that they export to JSON/CSV is useless. All edits must be done in-editor. Reference assets from C++.
I guess my confusion is that these both work, but being able to import-export to/from CSV/JSON seems only useful once? Are we expected to manually export, edit data, then manually re-import over and over, if dealing with Data Table assets?
What does everyone do?
Not really. We use Data tables for basically separating data and logic to the max extent. We use a purely blueprint based project. I try to pass in data everything ahead of time and construct my objects with the data that is already passed.
AI : You can pass in, AI class, Gun, Spawn Location, Num Of AI, Death FX, Animations it can play (specific to our game)
Weapons : Have a big data table to get in recoil spread, rate of fire etc
Good part is, I can export this as CSV and give it to my designers, pass it around to bosses, get it back and re import into data tables. This way people who don’t have UE4 can still modify things that they want (assuming its a tweak that won’t require a lot of testing using the editor)
We use data for “Spawn Construct”, “Animation tables”, “Weapon data” , “Level data” etc. If you are from Unity, this is basically like the scriptable object. Best part is, I don’t have to waste time trying to write editor code as Data table is giving me everything I need for the most part.
So you manually re-import your CSV/JSON data every time you change the original CSV/JSON file? That seems like a hassle…
OK but you have to manually re-import the modified CSV every time someone modifies it? So you have both the CSV and the datatable uasset. What if someone modifies the datatable uasset from within the editor, and someone else modifies the CSV, one of those sets of changes will get lost?
You can do it in editor via project settings or datatable file