Building a New Interactive Fiction System: Difference between revisions

From IFWiki

(added link Wiki Based Interactive Fiction System)
Line 32: Line 32:


==Links==
==Links==
An idea for a [[Wiki Based Interactive Fiction System]]

Revision as of 20:52, 12 February 2005

This is an index that will help those that wish to develop their own interactive fiction system. Feel free to edit this index.

World Models

[Samwyse] I don't like this page. See the discussion tab for my reasons, but I've inserted some notes below.

A World Model is the collection of rules and concepts that define how things are modelled in Interactive Fiction. There are many aspects of world models, and they are arguably the most important aspect of building a new IF system. Designing the world model is definetly the first step in any IF system. [Samwyse] Good start!

Most systems will use the Object as the basis for everything. [Samwyse] Look out! We're starting to discuss how to implement a world model, instead of how to write one.

An Object is simply something in the game world. It could be the Player, a room, a key, and so on. Objects have many sorts of data associated with them. Properties are any sort of data, usually, like Name or Description. Attributes are yes/no variables stating whether or not an Object is a weapon, container, etc. Usually giving an Object an Attribute also makes it inherit data and methods from a Class or Template, a predefined Object. States or Conditions are similar to Attributes, but more dynamic. If an Object is switchable, it can be on or off. A candle can be lit or unlit. A dial on a machine could be 0, 1, or 42. [Samwyse] Ok, now we've jumped the tracks. This paragraph and the following, IMHO, needs to go in a page on objects, to which a section on world model implementation could then point.

Usually NPCs, Players, and Rooms are implemented as Objects, too. But how are Objects organized? By an Object Tree, usually. Objects have a Parent, Siblings, and Children. If two keys are in a box, then the box's children are the keys, the keys' siblings are each other, and the keys' parent is the box. There have also been proposals to implement more abstract Relationships between Objects. For instance, you could say that John IsA EmployeeOf Mike. This has never really be implemented before, but is a good idea. One-to-one, one-to-many, and many-to-many Relationships would be an absolute must.

The second most important aspect of the World Model is Events. Events are simply things that take place in the game world and how Objects react to them. In Inform, this is known as the Before/After rule system. [Samwyse] We get back on track here, although I'd drop the bit about Inform.

An Event is simply something that happens. It's usually an Action, such as the Player eating a cookie. It could also be when something changes States or Conditions. This Event triggers a Stimulus, which is forwarded to the appropriate Objects. They may respond to this trigger in any way they see fit. Usually this style of Events will merely change the default library action. [Samwyse] Again, this paragraph and the following, IMHO, needs to go in a seperate page that defines events.

There are many more aspects of Events, but will be covered later.

These two elements make up the majority of modern IF world models. However, recently there have been ideas floating around about a higher level of abstraction. Such things as Scenarios or Puzzles could be implemented? Perhaps. [Samwyse] From here on, the discussion is pretty good, but I'm not sure it's appropriate for this page. Puzzles and scenarios are perhaps better discussed in a page devoted to writing a game, not a system. OTOH, a world model probably should recognize that puzzles and scenarios exist, setting things up for a discusion in the implemenation section.

A Puzzle has a Goal and one or more Problems and Solutions. The exact implementation details depends on the IF system being built.

The same goes for Scenarios, which are parts of the game. For example, in Christminster the first Goal is to enter the college. This has a specific Goal and many Puzzles. The main use of Scenarios is Context, the idea that Objects should behave differently under different conditions. Scenarios merely organize these conditions into logical components of a game.

Compilers

Interpreters

References

Links

An idea for a Wiki Based Interactive Fiction System