Skip to main content
GameDev.net gamedev.net
🔒 Locked

String Table System

Started by DrNecessiter Sep 9, 2005 at 9:11 AM 2 replies 1k views
Original Post
DrNecessiter
DrNecessiter
Has anybody created a "be-all, end-all" string table system for use in games? Ideally this system would cache strings from disk as needed (or via a precache call) such that the enitre table doesn't need to be in RAM at once. Just looking to learn from other's experiences.
ToohrVyk
ToohrVyk
Text is just another resource for games, so you can load it using a simple resource manager, just as you would with any other type of resource (textures, models, sounds, music, etc).

On the other hand, from a basic memory point of view, a typical 256x256 32-bit texture takes about as much memory as 45000 english words. When your game text is typed at 80 wpm, eight hours a day, by someone who knows exactly what he is writing, and with no in-game testing whatsoever, it would still take you 75 days to write those words. And today, a 256x256 32-bit texture is considered "lightweight" when in the actual system RAM.
DrNecessiter
DrNecessiter
I understand your point but, as in life, not everything is as simple as hoped. Here are a few issues:

- This is for several different consoles, so every byte counts.
- The game may have a lot of text, only a fraction of which needs to be in memory at any one time.
- Load times need to be ultra-fast. Can't parse file or directroy for each load. Must keep offset table in RAM so string or strings can be read in one swipe.
- Avoid "in-the-loop" dynamic memory allocation, so allocating and freeing memory on a per-string basis is not acceptable. Want to use a static cache buffer.

The task is fairly straightforward... just looking for somebody that has done this to see if I'm predicting all the problems.

(BTW: your calculations are a bit off. A 256x256x3 texture is really only about 40K in DXT1. That's about 6600 words (at 5 char and a space per) which can by typed in under 90 minutes :-) )

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.