How efficient is accessing data tables?
I would like to know how efficient it is to:
Is it O(1) or O(n) ? Do I have to manually cache Data Table in memory or will they be cached into memory at runtime?
Imagine I have to implement an item inventory system for an RPG.
Data Table Method:
Which method above will be efficient in time ? and in space ?
asked Jul 12 '17 at 08:18 AM in Blueprint Scripting
Im making an extensive data driven Rpg thats drawn from my co-dev's work of 20 years creating a Pen and paper game (which is actively played) I am using massive data driven tables for everything from item generation, player stats (temp, elevation,sickness, hunger, thirst) and have not noticed any decrease in performance pulling from the data sets (which is done though the use of onconstruct or event begin play (not on tick)
I have been smart about my data, I have sectioned it so instead of one giant table, its many smaller tables which direct the information where its needed and I don't constantly pull or set data in tables (only at certain points, like skill changes) instead of tracking things like health which constantly update (this is handled though Var's and then verified by the server for multiplayer (as a basic anti-cheat)
my world includes huge open area's an infinite procedurally generated dungeon and 2&4k textures (with tessellation/displacement) and still no performance drop, data tables are absolutely the way to go, and its far easier to deal with finding/changing variables this way.
there is apparently a known issue when a DT gets too big in Unreal editor environment (over 500) but when launches in-game/standalone no issues with data slowdown.
answered Apr 01 '18 at 03:32 PM
Data Tables are the way to go for data driven design. You won't run into any performance issues in 99.99% of the use-cases, I use them extensively for the use-case you've described.
answered Apr 01 '18 at 03:18 PM
@Demonsunder: Thank you. Do you spawn a loader object which calls the data table, then destroy the object when it's done? Essentially, I'm trying to avoid having everything that's in the data table stored in memory at all times (skeletal meshes for armor), and if I keep the call to the data table in the function on the player character, I'm worried they will be.
You can also pull datatables out of unreal and edit them with Gsheets/excel and then replace them just ensure you save as a .csv
answered Apr 01 '18 at 12:09 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here