Text Adventure design theory help?

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
Super-Gagme
Little Stalker Boy
Posts: 1282
Joined: 2002-10-26 07:20am
Location: Lincoln, UK
Contact:

Text Adventure design theory help?

Post by Super-Gagme »

Okay so my latest assignment in my Programming in the Small unit I have to make a text based adventure game (ala Zork clone) in C++. The catch is I have to show good use of OO techniques and all game content must be softcoded. So this presents me with a bit of a problem from how I see it. Without going into my own scripting language how can I possibly have puzzles similar to those in Zork games? As far as I can see it, I'd be pretty much limited to a few flags for doors and NPCs but other than that...any suggestions? Or am I not looking deep enough into what I can manage with just a bunch of flags?
History? I love history! First, something happens, then, something else happens! It's so sequential!! Thank you first guy, for writing things down!

evilcat4000: I dont spam

Cairbur: The Bible can, and has, been used to prove anything and everything (practically!)
StarshipTitanic: Prove it.
User avatar
Mad
Jedi Council Member
Posts: 1923
Joined: 2002-07-04 01:32am
Location: North Carolina, USA
Contact:

Post by Mad »

Just define interactions between objects, I guess. Your data files could basically be a very, very simple scripting language that only loads up data for the required fields.

Let's say a simple puzzle. There's a computer that has a key inside of its case to get through the locked door.

An incomplete data file (with incomplete definitions, but enough to give the general idea):

Code: Select all

object computer
contains: key
to_open: screwdriver
closed_description: The computer has a message: "The key is in the computer."
open_description: The computer's case is open. Its screen displays a message: "The key is in the computer."
end object

object locked_door
to_open: key
closed_description: It is a locked door.
open_description: The locked door opens up. It looks like it will lock again if you shut it.
end_object

object key
description: It is a little silver key.
end object
Then with the proper interactions:

Code: Select all

You see a room with a computer in it. There is a door to the north and a walkway to the south.

>look at the computer

The computer has a message: "The key is in the computer."

>open the computer with the screwdriver

The computer's case is open. Its screen displays a message: "The key is in the computer."

There is a small key in the computer.

>get the key

You get the key from the computer.

>open the door with the key.

The locked door opens up. It looks like it will lock again if you shut it.
How complicated of a puzzle are you trying to do? How much has to be softcoded, and how much can you hardcode? (Can you hard code certain kinds of objects, for example.. like how a door should act vs how a regular object should act, while specific interactions between objects being stored in data files?)

Basically, give some examples of puzzles you'd like to try, then we can try to find a way to implement them.
Later...
Super-Gagme
Little Stalker Boy
Posts: 1282
Joined: 2002-10-26 07:20am
Location: Lincoln, UK
Contact:

Post by Super-Gagme »

Okay to explain better, I have to softcode/hardcode it so that one could make a brand new adventure from softcoding the files alone without having to re-compile the EXE. I suppose this means that yes I could hardcode object types and such.

As for puzzles, I follow what you were suggesting there but how would you manage multiple item requirements to "finish" a puzzle? Say you needed 2 items, perhzps 3, to open up the computer to get the key. I was thinking to avodi scripting of some kind I could basicly use tons of flags and in the softcode each item would have 1-3 flags and results based on those flags being yes or no. Even then that is a bit of a scripting :/ Not that I am not allowed to do so.
History? I love history! First, something happens, then, something else happens! It's so sequential!! Thank you first guy, for writing things down!

evilcat4000: I dont spam

Cairbur: The Bible can, and has, been used to prove anything and everything (practically!)
StarshipTitanic: Prove it.
User avatar
Mad
Jedi Council Member
Posts: 1923
Joined: 2002-07-04 01:32am
Location: North Carolina, USA
Contact:

Post by Mad »

Super-Gagme wrote:As for puzzles, I follow what you were suggesting there but how would you manage multiple item requirements to "finish" a puzzle? Say you needed 2 items, perhzps 3, to open up the computer to get the key.
To avoid scripting, you'd basically have to use flags and have objects morph into other objects. Maybe have multiple objects, "computer case" and "open computer case," and have the object morph back and forth depending on its state.

If you use "screwdriver" on "open computer case," you'd take components out. If you used "screwdriver" on "computer case," you'd tighten or untighten the lid. To get "open computer case," you'd have to remove "cover" from the "computer case." Then it'd morph into a different but very similar object. Use some triggers to determine how to morph and such. It'd kinda limited, but if you set the puzzles up right the user shouldn't even notice.
Later...
Post Reply