Text Table Max Items?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Text Table Max Items?

Post by VoodooDetective »

Is there a recommended upper bound on the number of items that should be in a text table? I have one text table for all menu/item name translations in my game. Probably under 1,000, but still several hundred. I was just wondering if it's a hashed lookup or if it's doing something really expensive like string compare on all entries?
User avatar
digiwombat
Posts: 50
Joined: Sun Jun 16, 2019 4:59 am

Re: Text Table Max Items?

Post by digiwombat »

Pretty sure (Tony can correct me if I'm wrong here) TextTable uses Dictionary<T,T> to hold the text table data and those are handled as a hash table so you should be good.

Even then, lookup times for a C# List<T> or similar data structure of hundreds of elements should be fairly negligible unless you're doing it every frame. And I can't imagine any application of pulling localized text that would happen every frame. But you can always profile it and make sure it fits inside your constraints just to be double sure.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text Table Max Items?

Post by Tony Li »

What digiwombat said. :-) TextTable uses Dictionaries. The editor is fairly optimized, too. I've seen more than one project that has over 10,000 items, and it's relatively responsive.
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: Text Table Max Items?

Post by VoodooDetective »

Oh fantastic! Well that makes things really easy :)
Thanks!
Post Reply