I have a choice right now in my game, but I don't know which way would be considered "more efficient", or more importantly, least laggy.
The options:
I can have descriptions for objects that players can manipulate, sticks, fountains, rocks, clothes, whatever, stored in variables. To my knowledge, this means that whenever someone looks at the item and shows the description, it will load it faster. Keeping the information loaded in the game constantly though, might to my knowledge slow things down a wee bit anyway.
The other option, I can store the descriptions in save files, like I've done with room descriptions. This makes them load a bit more slowly, but it means that the game won't have to put up with the description until it's needed.
But, I'm not sure which way I should go with. Recommendations?
ID:154305
Jan 23 2002, 7:34 pm
|
|
In response to Lummox JR
|
|
Lummox JR wrote:
In the long run it's probably easier to store your descriptions in some kind of file anyway for easy access, so you don't have to recompile your game every time. Very nice idea :) Going to incorporate that into my text engine right away! Was thinking of something like that anyways when I stumbled upon this post Alathon |
In response to Alathon
|
|
Sigh... anything I ever do behind-the-scenes is always exposed from independent development by Lummox. =)
|
If a vast set of descriptions is needed, then I recommend an associative cache. Try this out for size (code untested):
The idea behind this is to load from a file, but keep the item in memory as needed. You could then do things like this:
In the long run it's probably easier to store your descriptions in some kind of file anyway for easy access, so you don't have to recompile your game every time.
Lummox JR