Page 1 of 1

Text Table Max Items?

Posted: Tue Aug 18, 2020 12:15 am
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?

Re: Text Table Max Items?

Posted: Tue Aug 18, 2020 1:31 am
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.

Re: Text Table Max Items?

Posted: Tue Aug 18, 2020 11:03 am
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.

Re: Text Table Max Items?

Posted: Tue Aug 18, 2020 2:29 pm
by VoodooDetective
Oh fantastic! Well that makes things really easy :)
Thanks!