• Advertisement

Archived

This topic is now archived and is closed to further replies.

String access in games

This topic is 5125 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I''m curious as to how different games load and display string messages to players. For example, take a FPS... I would imagine that in a FPS, strings such as "You picked up % armor" and "You picked up % health" etc. would be loaded into memory for fast access (static memory?) since a FPS relies on speed at most times for players to enjoy it (especially online FPS'') How about a RPG on the other hand? I think that RPGs would load certain strings into memory (the ones that would be displayed constantly or repeditively) whereas strings such as storyline plots or whatnot would just be loaded on the fly (plucked out of a file rather than being loaded into memory). If you have groups of strings; Action strings - "You start to run" etc. Status strings - "You lose 10hp" etc. Larger storyline strings - "You end up on this street" etc. ...would you handle them differently depending on how often they are accessed or simply handle them all the same way? I was looking at Ultima Online''s (MMORPG) file structure and noticed that they store their string messages in language files (*.enu, *.rus etc.) which I imagine they load into memory when the client is started. The problem is, you can open these files up in notepad to edit; is it dangerous to have files like this ''open'' to players to tamper with (players possibly editing them and such)? Perhaps ''hiding'' them in a compressed file format would of been better (but slower)?? Is there a typical way to store a large amount of strings? In a header file grouped under different arrays? Or in a seperate text file (i.e. a message on each line, refer to messages via. lines) etc.? I guess I''m wondering about file-management here; as I see it you would have a seperate file containing all your strings so as not to clutter up your main problem, obviously. Is this right? Or am I muddled up here? One last thing to add: is it important how you load string messages from file(s)? Or am I just nit-picking? I''m probably more concerned about the speed performance of things. Thanks to all in advance, any help is GREATLY appreciated. PS - Hope that post made sense :-\

Share this post


Link to post
Share on other sites
Advertisement
That''s part of the loading screen. You move from room A to room B, the map file is loaded for that room, along with any events (which contains the strings). Then when you move to room C, its file is loaded (This is the way I do it anyway).

/*
I use DirectX 9 and C++ (Microsoft Visual C++ 6.0 Professional edition)
*/

Share this post


Link to post
Share on other sites
Hmm, I see.

I''ve got another question to go with this. If I''ve got a heap of strings that I wanna dump into a file, but I''m gonna want easy access to all of those strings in the file, what is the best way of doing this? Would it be storing them all in an array of some sort? Then access all of the array''s individual elements? I''m not entirely sure what to do.

Thanks again...

Share this post


Link to post
Share on other sites

  • Advertisement