Interactive Fiction Game

Game file format

node::unique name::description
edge::unique name::node from::command[,command]*::node to[,node to]*::description::+/- health::[::constraint name[,constraint name]*]
# Comments begin with hash
# edge with multiple node to's will pick one at random
object::location node name::unique name[,name]*::short desc::desc::weight
constraint::name::object name::state name | "backpack"::weight
constraint::name::eval::PYTHON BOOLEAN EXPRESSION
constraint::name::exec::PYTHON STATEMENT(S)
backpack::max weight::VALUE

Example

node::lab::You are in the lab. It has exits to the north and south.
node::southern antechamber::You are in the southern antechamber. There is an exit to the north.
node::northern antechamber::You are in the northern antechamber. There is an exit to the south.
edge::name1::lab::go north,north::northern antechamber::You go north::1::c1
edge::name2::lab::go south,south::southern antechamber::You go south::1::c2
edge::name3::northern antechamber::south::lab::You head south::-1
edge::name4::southern antechamber::north::lab::You head north::-1
object::southern antechamber::key1::golden key::A beautiful golden key::1.0
constraint::c1::key1::backpack
constraint::c2::eval::self.counter > 10
constraint::c3::exec::self.counter = 100

Properties

  1. self.counter - Move counter in the Engine class
  2. self.initial_time - Time in seconds since loading in Engine class
  3. self.health - Value (real or integer) that indicates score

Imports

Your game file should "import time, random".

Health

If self.health falls to zero (or below) then the game is over. Health is changed through edge traversals. Health should have an initial value of 10.