Mark
Mark

Reputation: 31

Game Design and Architecture Advice for Text Adventures

I am trying to create an old-school Text Adventure Game. I'm a bit stuck on creating the World Map and rooms.

Should the room descriptions be part of the source code or should it be separated out? I was thinking of placing all such descriptions and room properties in a MySQL database and then have code to organize the logic of each room; putting each room description in with the actual source code seems a bit untidy.

Is this the preferred method of organising Descriptions in an adventure game? I was also thinking that this might be preferable since I could then query the database to find common properties about the data.

Any comments would be appreciated.

Upvotes: 3

Views: 3729

Answers (8)

Parham Doustdar
Parham Doustdar

Reputation: 2039

I suggest using engines that already have a vibrant community around them. That way, your source code is only that; the source code of the game. I'd go with either TADS 3 or Inform 7

Upvotes: 1

Banish
Banish

Reputation: 21

You could just use a system like ADRIFT, then all you need to worry about are the descriptions and logic.

Upvotes: 2

Kheldar
Kheldar

Reputation: 5389

I would separate the descriptions from the code, having an object Room, that owns an object Description that calls a "database" through some Facade, so that you may use a file or a database or anything you wish. It would also eventually allow you to add some scripting to the room itself, like having objects in your description that have behaviors.

Upvotes: 0

user712092
user712092

Reputation: 1986

Should the room descriptions be part of the source code or should it be separated out?

Separated out.

Try Prolog language.

  • It has similar database to SQL (actually logical predicates)
  • With some skill You may be able to check whether after some change is Your adventure finishable.
  • You may easily create this description by some logical predicates if You don't mind it being very "computer like".

You can see examples of Prolog text adventures in simple Google search.

Upvotes: 1

James
James

Reputation: 1691

I will address two issues here. First, you are right to keep the data that defines the game away from the engine that will use it. This makes it so that you dont have to recompile everything in order to fix a typo or the like in the case of a text based game.

Secondly though, I would just question the use of MySQL. If you are making a dos typed game that is to be installed on people's systems you dont want a pre-req to be 'Install MySQL', hehe. There is a little program out there that is written in C that is free for all to use called SQLite that would suit your needs much better. If on the other hand the web is the medium for the release of this text based game, then have at it :)

Upvotes: 4

Bernd
Bernd

Reputation: 3418

I would construct such a game as an interpreter which reads in room data, and based on the room data, allows for a set of valid commands (move, take, drop, change...). For movement you would have a pre-built graph with nodes being rooms and edges being allowed moves.

Upvotes: 0

mariana soffer
mariana soffer

Reputation: 1853

I work in a company where they build games, and they have the rooms separated from the code, they have it in mysql. Actually also the items that go in each room are in a table, and there is also a table that says which item is at which room at that moment. Besides if you want to expand your game or do statistics about it is much better doing it with a database.

Upvotes: 4

Ken D
Ken D

Reputation: 5968

No, don't include level/room description within code, it is not dynamic this way.

Many many development frameworks now tend to go with separating code from data. So, for usual cases, we put game rooms data within files and read those to build the level and maybe enable the user to construct a new level on his own and eventually create a new file to carry the room data.

Upvotes: 6

Related Questions