I know most games store dialogue text in files, but I've also seen a few text-based games actually program the content (map, choices, possible player commands, story text) into the game code.
I can think of a few reasons, but what is the major reason why even text games keep everything in files outside the program?
The implementation details differ little between holding content in something like the popular XML format, parsing it, then rendering maps/displaying text based on the variables created from XML file, and simply forgoing the XML file entirely. They both end up with strings which output to the screen. Isn't the difference just notation?
Some games even hold the graphics (ASCII art?) inside the code. I know this isn't right, and I can guess a few reasons why it is bad, but don't know the major reason why either.
It is very popular to have most of the content outside the program. Even Dwarf Fortress doesn't use actual ASCII characters, but images of ASCII characters loaded into memory.
I primarily ask because it is a bit of a PITA to create, parse, and work with XML files. You know... compared to the lazy alternative of just making every unique dungeon (content) its own class.
just making every unique dungeon (content) its own class.
That just made me shiver. Separation of data from logic is such a fundamental principle to me that I'm surprised there are still developers violating it. \$\endgroup\$