Working on text adventure in C++ - is it possible to flag things (dead enemies, items, puzzles) and

so, in order to get my skills up, Im working on a little text adventure game. I'll figure out the parser on my own, because asking for too much help with that would ruin the educational experience... but im at a design impasse and I wanted some advice.

I saw a tutorial on the subject, and I didnt really like the way they did things, so Im NOT using their engine and tweaking it, Im writing a whole new, more complex, game engine. what I did like was that they sourced the map to a text file, which made it a lot less messy in terms of code, easier to edit, and easy for people to create their own game based on the engine with no coding experience.

however, in their system, enemies were flagged and defined in the text system as well. I also forsee design issues with room-specific items and puzzles, as this was a simple program they wrote. Not only do I want to, say, not be able to pick up the club in room 3 at any time (in any room), but I also want to flag dead enemies in the code somehow, without editing the text file.

I'm going to write my own battle system too, thats more like the one from radical dreamers on the SNES (satellite internet addon game from japan) with more detail, so really, the only concept I want to take is the text based map.

is it possible for me to correlate each room in the text file with variables or something, so that way I can flag room-specific items, dead enemies (so you dont fight the same goblin a billion times if you go back), puzzles, etc?

or am I better off dropping the idea of a text-based map altogether in favor of holding all the information within the code? Ultimately, Keeping it in the code seems more flexible, if messier and more complicated, as I could control the whole element in the executable, allowing me to flag things on and off more easily, have room specific support. A simple variable like int enemy_dead=1, or int_potionrm1= 0; allow me to flag the code from within to handle these things, but I find the same thing rather difficult if those things are being sourced from a static, unchanging text file.


  • If your enemies are defined either as a structure or class, you can add a boolean isDead that is changable when their hitpoints reach 0.

    Similar principle with the rooms. By creating a base class "room" you can initiate several unique "room" objects.
Sign In or Register to comment.