Advertisement

Scripted text (dialogues, descriptions, etc.), where would you put it?

Started by May 10, 2014 05:48 PM
11 comments, last by ddn3 10 years, 4 months ago

Scripted text is a snippet of text that is used in the game. For example, a weapon description, item description, NPC dialogues, Yes/No answers, etc. are all scripted text.

I'm having a dilemma on whether or not to put scripted text inside my game, or put them outside my game as an external text file, which I can later read the text data into my game. I know there's nothing wrong with both of their usages/functionalities, and that there are pros/cons for both, I still wanted to ask the public to see which one has the larger preference for placing scripted text at. I liked to go with mainstream decisions, that's all.

Please fill out the poll if you can. It's very grateful.

Definitely outside the game. This will later make it trivial to add new translations by just writing up a new file in another language.

Additionally you will not be limited by your IDE when it comes to the format of the text since they usually have some limitations to what characters you can use and such, although it is possible to circumvent most of that stuff.

You might also prefer not having to recompile to change the scripted text, though that doesnt seem like a major issue if you recompile relatively often anyways.

o3o

Advertisement

Outside. Not hard coding allows for simpler change without recompile and probably also adding different languages.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Outside. It's cleaner and allows for easy modification/tweaking, especially with an external tool.

Ask yourself this question: What advantage do you have when hardcoding such things over designing them to be read in from an external file?

Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
It's stupid to embed onscreen text into the code -- I've had developers do that, and it causes a nightmare. Onscreen text must be in separate text files, NOT embedded into the source code.

there are pros/cons for both,


I can not think of ANY good reason to embed it into the code.

-- Tom Sloper -- sloperama.com

Advertisement

I can not think of ANY good reason to embed it into the code.

Well, for one thing, you don't need to open a file...

I guess. It's not a very good reason against the mountain of arguments against it, but it's certainly a reason.

If it's a several million line codebase with no documentation at all, being able to search for any on-screen text you see in the screenshot attached to the email from your boss's boss titled "fix this bug" (no message) is really the only way to figure out where to start.

So yeah, if you're already living in a nightmare, go ahead and hardcode those strings. Can't make things any worse, and the management certainly isn't going to let you take the time to make them any better. But if you're starting fresh, don't ****ing do it or I'll find you.

But if you're starting fresh, don't ****ing do it or I'll find you.


Heh!

-- Tom Sloper -- sloperama.com

Thank you everybody, your answers have helped me defeat my dilemma into no-questions-asked zone.

Can't ever get grateful enough. biggrin.png

This topic is closed to new replies.

Advertisement