Tharsis . Website . UsingTheAreaEngine

The Area Engine


The Area Engine is a "device" that allows builders to make areas in an easier fashion - at least that is the idea. Down the track it should even have a graphical interface!

Essentially it is a single "controller" that creates the rooms for you based on an area file. As a builder you write the area file and the area generates itself - no more creating rooms. At this time the area file only controls the rooms and their exits, but it will soon provide the ability to place monsters, and then to define monsters. After that, I'm open to suggestions.

File Format

The area file is a normal text file - you can edit the file in notepad, under windows, and using ed inside the mud.

The file is broken into a series of sections, each section having a heading and some content. Headings have the form [heading-name], and a section is all the content from its heading until the heading for the next section. Section headings have to be on a single line of their own.

The following shows you the outline of the file. A complete area file will probably include the sections shown here as well as having lots of content inside each section







You can put comments anywhere in the area file. Comments are notes that are completely ignored by the Area Engine. Comments are lines beginning with a #

# I am a comment
I am not a comment.

# I am another comment
# that goes over multiple lines
I am not a comment

The [general] section

This section is used to define some global variables: constants and rules that apply across the whola area.

Supported constants at this time are:

Name Purpose
domain The numeric id for your domain - ask a wiz. This makes all rooms be in this domain
startroom The roomkey for the room which the player will start in by default

Each constant goes on a line of its own and is assigned a value using the = operator.

For example:

# Define 'domain' to be 123

#define 'startroom' to be 'hallway'

The [map] section

The map section is used to define all the rooms in the area and the exits between them.

This section does not define the contents of rooms, nor the room descriptions, just the exits/links between rooms.

Each room is defined on a single line. The line has the format:

room_key : exit = destination , exit = destination ....
So each room has a room_key, which is a unique name for this room. It might be a word, as in the following example, or it might just be a number - maybe you just number your rooms from 1 to 100.

After the ":" are the exits for the room, separated with commas. Each exit is a direction, an "=" sign, and the room_key for the destination.

So - the following map is used to describe a 2 story house with several rooms:

# Make people start in the lounge

# This comment is just describing the layout below, 
#   the area creator ignores it completely
# The ground floor map looks like:

# kitchen   -  dining  
#    |      \     |
# hallway    lounge - outside
#    |
# hallway - bedroom
#    |
# hallway - bedroom
#    <

# The second story looks like

# bedroom - onsuite
#   |
# landing
#   >

# The "outside" room is not in this area, it's the room for entering this area

# Below here are the actual rooms with their exits
kitchen: e=dining,s=hallway1,se=lounge
dining: w=kitchen,s=lounge
lounge: nw=kitchen,n=dining,frontdoor=outside
hallway1: n=kitchen,s=hallway2
hallway2: n=hallway1,s=hallway3,e=bedroom1
hallway3: n=hallway2,e=bedroom2,u=landing
bedroom1: w=hallway1
bedroom2: w=hallway2
landing: d=hallway3,n=masterbedroom
masterbedroom: s=landing,e=onsuite

Note that there is no room with a room_key = "outside". This is because the room is specially coded - it is either a hand-coded room which you want to connect with, or it is a room managed by a different area engine.

The [exitnames] section

The [exitnames] section is sort of optional.

In this section you define the details of exits. At this time you can only define the "full name" for an exit.

So, for example, in the map above there are exits described as "e", "w" and so on. In this section you can define the full detail of "east" and "west".

More interestingly the definition for room "lounge" has an exit called "frontdoor", which leads to the outside. For simplicity we could add an entry into the [exitnames] which says "frontdoor" is "east". The player would then never see an exit called "frontdoor", and the lounge would contain an "east" exit.

# define normal directions

# define the frontdoor as a normal east exit.  In the
# future we might define this as an actual door which opens
# and closes

The [specialrooms] section

The [specialrooms] section is used to define rooms that are not to be controlled by the area engine, but are linked to by the rest of the map.

In our example map above the "outside" room is such an example. It is not to be created by the area engine, but we want the "lounge" to be able to connect to it.

At this time it is only possible to link to hand-coded rooms such as those created by the blob. It is not possible to link to rooms in a different map controlled by the area engine.

To link the lounge to a hand-coded room called "thestreet.c" would require the following:


For this to work the "thestreet.c" file would have to be in the same directory as the area engine map configuration file. In most builder-managed domains this is not the case, the "thestreet.c" file is in the rooms directory:


The [roomdescriptions] section

The [roomdescriptions] section defines the appearance of rooms - the description, items, light levels, etc.

The [roomdescriptions] section is broken up into a series of individual room definitions. Each room definition can apply to one or more of the rooms which are defined in the [map] section. This is deliberately done to allow you to use a generic room description for multiple rooms in your area.

Each room definition starts with a line that begins with room: All subsequent lines until the next room: are considered to be part of the room defintion.

# this is the first room definition
# and so is this

# this is the definition for the next room

Understanding how room descriptions are allocated

----- Revision r1.4 - 28 Nov 2006 - 00:09 GMT - FantoM
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding Tharsis? Send feedback.