Tag Info

New answers tagged

1

I guess licensing can also be a reason not to include content in the code. For example, your code might be FLOSS, but you don’t want to license your content at all (maybe you want to publish your game code so that others can use it for creating similar games with different content) your code might be FLOSS, but you want to use a Creative Commons license ...


2

I think a key phrase is separation of concerns. If your code doesn't include the text than the code get's less complex. The programmer writing the code doesn't have to think about the specific text and can focus on the code. He doesn't have to think about localization. The person doing the localization doesn't have to worry about the code.


2

I can't believe noone mentioned this yet, but a big reason is to make localization A LOT easier. If you need to support English, French, German, Spanish, Portuguese, Italian, Russian, Chinese and whatever other language you're aiming at, hardcoded requires you to have separate code-behind for every language. It also means that if you need to remove certain ...


2

For the sake of making changes faster, it speeds up development on larger productions by tons. You don't need to teach everyone to learn how to go in and edit source to make simple changes. By dragging it out of the actual code, more people get the chance to fool around with, it's easier to find out what options you can play around with and the whole ...


6

As always, as always, it depends. But first, I would like to argue that hard coding is not bad by itself. I have hard coded content, specifically dialog text, in some simple games, and the world didn't end. We programmers love abstracting things, but remember that each layer of abstraction you make will make your program more complex and more difficult to ...


2

A big reason for storing in text files is reusability. Creating a text game framework that reads your maps, dialog, and other resources from a text file allow you to reuse your framework for other games. Going beyond text games this is how big budget titles like Call of Duty release a new game every year. Another reason is portability. You can use the same ...


2

I think it is too easy to be the 'wither-than-white' guy and recommend warmly using an external text resource file. Why? Because there's a choice here that's about balancing each solution's cost/issues/advantages. When using an external file... Well, I guess the other answers explain the benefits well enough. But what about the costs? You have to define a ...


79

There are several reasons for that. I'm just gonna touch on a few: It makes your source code a mess. If you have a lot of dialog (trees), a huge part of your codebase is just text that has nothing to do with your actual game code. You'd need to recompile every time you change so much as a single character. The dialog itself is hard to navigate. I imagine ...


29

Putting game content data in code means that to see any potential change or iteration of that game content data, you have to recompile the game itself. This is bad for two reasons: Many languages that games are written in have long compile times. C++ is particular can be very bad in this respect, and C++ is a very common language for large commercial ...



Top 50 recent answers are included