Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#Actualfrob

Posted 01 February 2013 - 04:27 PM

Probably not, if you want to have an actual replayable game.

 

Consider running the game with several state machines.

 

It is basically a bunch of data tables that look like this:

  • Object name.  This could be "NorthRoom" or "Hallway37" or whatever
  • State.  For example a room could be "dark" or "bright"
  • Available Transitions and method to get there.  It will need to represent the pair of "west" means the new state "WestRoom", "east" means "Riverfront".
  • Inventory of stuff.  Maybe there is a rope, or a bottle, or a little spring.  Whatever it is, there should be an array of them here.
  • Description string.  This could be "You are standing in front of a beautiful mountain stream", or "You are in a maze of twisty little passages, all alike".
  • Assorted other goodness you want in your game.

 

Another set of tables for the objects in use.  You will note that it looks suspiciously like the one above.

  • Object name.  "rope", "bottle", "knife", "box", "water fountain"
  • State of the object.  "Full", "Empty", "Buttered"
  • Available transitions and method to get there.  "drink bottle" leads to the bottle's empty state.  "Eat rope" leads to somewhere exciting.
  • Inventory of stuff.  Maybe the box contains another box, and that box contains another box, and so on.
  • Description of the object in that state.  "A coiled rope"  or "An empty knife".
  • Assorted other goodness you want in your game.

 

A text adventure game is little more than a collection of small state machines and inventories.  I've seen them implemented in Excel with a set of macros and three sheets that look basically like the above items.  This type of games are a great learning exercise.

: Had to look up the reference to EAT ROPE.


#1frob

Posted 01 February 2013 - 04:23 PM

Probably not, if you want to have an actual replayable game.

 

Consider running the game with several state machines.

 

It is basically a bunch of data tables that look like this:

  • Object name.  This could be "NorthRoom" or "Hallway37" or whatever
  • State.  For example a room could be "dark" or "bright"
  • Available Transitions and method to get there.  It will need to represent the pair of "west" means the new state "WestRoom", "east" means "Riverfront".
  • Inventory of stuff.  Maybe there is a rope, or a bottle, or a little spring.  Whatever it is, there should be an array of them here.
  • Description string.  This could be "You are standing in front of a beautiful mountain stream", or "You are in a maze of twisty little passages, all alike".
  • Assorted other goodness you want in your game.

 

Another set of tables for the objects in use.  You will note that it looks suspiciously like the one above.

  • Object name.  "rope", "bottle", "knife", "box", "water fountain"
  • State of the object.  "Full", "Empty", "Buttered"
  • Available transitions and method to get there.  "drink bottle" leads to the bottle's empty state.  "Eat rope" leads to somewhere exciting.
  • Inventory of stuff.  Maybe the box contains another box, and that box contains another box, and so on.
  • Description of the object in that state.  "A coiled rope"  or "An empty knife".
  • Assorted other goodness you want in your game.

 

A text adventure game is little more than a collection of small state machines and inventories.  I've seen them implemented in Excel with a set of macros and three sheets that look basically like the above items.  This type of games are a great learning exercise.


PARTNERS