Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 233f8aae1f33ee5e61554ecb56b0fdf6 > files > 51

ifm-5.1-11.fc15.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>2 Making Maps</TITLE>
<META NAME="description" CONTENT="2 Making Maps">
<META NAME="keywords" CONTENT="ifm">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="ifm.css">

<LINK REL="next" HREF="node6.htm">
<LINK REL="previous" HREF="node4.htm">
<LINK REL="up" HREF="ifm.htm">
<LINK REL="next" HREF="node6.htm">
</HEAD>

<BODY >

<DIV CLASS="navigation"><!--Navigation Panel-->
<A NAME="tex2html190"
  HREF="node6.htm">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A> 
<A NAME="tex2html186"
  HREF="ifm.htm">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A> 
<A NAME="tex2html180"
  HREF="node4.htm">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A> 
<A NAME="tex2html188"
  HREF="node1.htm">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>  
<BR>
<B> Next:</B> <A NAME="tex2html191"
  HREF="node6.htm">3 Solving the Game</A>
<B> Up:</B> <A NAME="tex2html187"
  HREF="ifm.htm">IFM</A>
<B> Previous:</B> <A NAME="tex2html181"
  HREF="node4.htm">1 Introduction</A>
 &nbsp; <B>  <A NAME="tex2html189"
  HREF="node1.htm">Contents</A></B> 
<BR>
<BR></DIV>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL CLASS="ChildLinks">
<LI><A NAME="tex2html192"
  HREF="node5.htm#SECTION00051000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Introduction to Maps</A>
<LI><A NAME="tex2html193"
  HREF="node5.htm#SECTION00052000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Adding Rooms</A>
<LI><A NAME="tex2html194"
  HREF="node5.htm#SECTION00053000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">3</SPAN> Adding Links</A>
<LI><A NAME="tex2html195"
  HREF="node5.htm#SECTION00054000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">4</SPAN> Other Directions</A>
<LI><A NAME="tex2html196"
  HREF="node5.htm#SECTION00055000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">5</SPAN> Room Exits</A>
<LI><A NAME="tex2html197"
  HREF="node5.htm#SECTION00056000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">6</SPAN> Map Sections</A>
<LI><A NAME="tex2html198"
  HREF="node5.htm#SECTION00057000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">7</SPAN> Adding Items</A>
<LI><A NAME="tex2html199"
  HREF="node5.htm#SECTION00058000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">8</SPAN> Conflicts</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION00050000000000000000"></A><A NAME="sec:making-maps"></A>
<BR>
<SPAN CLASS="arabic">2</SPAN> Making Maps
</H1>

<P>
This section gives you a tour of the main commands for making maps. It's not
complete; see Section <A HREF="node8.htm#sec:language">5</A> for a full list of commands.

<P>

<H2><A NAME="SECTION00051000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Introduction to Maps</A>
</H2>

<P>
The traditional Infocom-style way of drawing Interactive Fiction maps is the
``boxes-and-lines'' method; an example is shown in Figure <A HREF="#fig:example-map">1</A>.
This is the style of map that IFM produces. Rooms are represented as boxes on
a square grid, and links between the rooms are drawn as lines connecting them.
Links emanate from rooms in any of the eight standard compass directions, and
also follow the grid. In the following sections, we'll introduce the IFM commands
that can be used to draw this example map.
<DIV ALIGN="CENTER"><A NAME="fig:example-map"></A><A NAME="1551"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG>
Infocom-style map</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER">
<IMG
 WIDTH="381" HEIGHT="225" ALIGN="BOTTOM" BORDER="0"
 SRC="img2.gif"
 ALT="\includegraphics{example}">
</DIV>

<P></TD></TR>
</TABLE>
</DIV>

<P>

<H2><A NAME="SECTION00052000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Adding Rooms</A>
</H2>

<P>
To draw the example map from the previous section, you first choose an arbitrary
start location: the kitchen (when mapping a real game, you'd choose your actual
start location). To add the kitchen, just type this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Kitchen&#34;;
</DD>
</DL>Now you're in the kitchen. Suppose, if this were a real game, that you first
went south to explore the garage. That can be added to the map like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Garage&#34;&nbsp;dir&nbsp;south;
</DD>
</DL>Now you've said which way you went to get to the garage, and since you were
in the kitchen, IFM knows that the garage is south of the kitchen. By the way,
<TT>south</TT> can be abbreviated <TT>s</TT> (and similarly for all other directions),
just like in the games.

<P>
Ok, you're in the garage. Unfortunately, that's a dead end and you have to retrace
your steps to the kitchen. You've already mapped that, so there's no need to
do anything. Now you head off east to the lounge. Now, you're moving from the
kitchen again but IFM thinks you're in the garage (IFM's idea of ''where you
are'' is always the last room mentioned). You need a way of referring to the
kitchen again--to do that, you add a ''tag'' to it by changing the ''kitchen''
line like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Kitchen&#34;&nbsp;tag&nbsp;Kitchen;
</DD>
</DL>The tag name can be any name you like. You might think that you could refer
to the kitchen by using the name in quotes, but that would mean you could never
have two distinct rooms with the same name. Another advantage of tags is that
they can be much shorter than the real room names. The tag <TT>K</TT> would
be just as valid in the example above (though not as readable).

<P>
Now you can refer to the kitchen by its tag, so you can move east from it into
the lounge like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Lounge&#34;&nbsp;dir&nbsp;e&nbsp;from&nbsp;Kitchen;
</DD>
</DL>The <TT>from</TT> clause tells IFM where you're moving from. If it's omitted,
it assumes you're moving from the last room mentioned.

<P>
Continuing your exploration, you move south into the dining room:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Dining&nbsp;Room&#34;&nbsp;dir&nbsp;s;
</DD>
</DL>You exit the dining room to the east, and turn a corner north before entering
the study. How can you represent the corner faithfully on the map? Like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Study&#34;&nbsp;dir&nbsp;e&nbsp;n;
</DD>
</DL>This says that you move east, then north, to get to the study. Now, what if
someone locked the study door behind you and the only way out was through the
window? That's a one-way trip into the study, which you can indicate using the
<TT>oneway</TT> attribute like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Study&#34;&nbsp;dir&nbsp;e&nbsp;n&nbsp;oneway;
</DD>
</DL>This is indicated on the map by an arrow.

<P>

<H2><A NAME="SECTION00053000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">3</SPAN> Adding Links</A>
</H2>

<P>
The map as it stands is not complete--the diagonal link between the kitchen
and the dining room is missing (because you didn't go that way in visiting the
kitchen or the dining room). To add it, you need to modify the dining room command
like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Dining&nbsp;Room&#34;&nbsp;dir&nbsp;s&nbsp;link&nbsp;Kitchen;
</DD>
</DL>The <TT>link</TT> clause creates a straight-line link between the current room
and the room with the specified tag name (in this case, the kitchen).

<P>
Note that if this link needed to turn corners, as in the study example above,
then that method of linking the rooms wouldn't have worked. In that case, you'd
have to use the stand-alone <TT>link</TT> command. For example:

<P>

<DL COMPACT>
<DT>
<DD>link&nbsp;Diner&nbsp;to&nbsp;Kitchen&nbsp;dir&nbsp;n&nbsp;nw;
</DD>
</DL>This assumes you've given the dining room the tag name <TT>Diner</TT>. The link
starts off going north, then turns northwest, and finally goes toward the kitchen.
Note that in a <TT>link</TT> command, if you omit the final direction which
leads to the linked room, it is added automatically.

<P>

<H2><A NAME="SECTION00054000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">4</SPAN> Other Directions</A>
</H2>

<P>
Suppose that there were steps down from the kitchen into the garage, and that
you wanted to indicate that you could up or down as well. You could do that
using the <TT>go</TT> clause, like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Garage&#34;&nbsp;dir&nbsp;s&nbsp;go&nbsp;down;
</DD>
</DL>This indicates that the actual direction travelled is downwards, but it is still
represented as south on the map. The <TT>go</TT> clause accepts <TT>up</TT>,
<TT>down</TT>, <TT>in</TT> and <TT>out</TT>. As with compass directions, <TT>up</TT>
and <TT>down</TT> may be abbreviated as <TT>u</TT> and <TT>d</TT>.

<P>

<H2><A NAME="SECTION00055000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">5</SPAN> Room Exits</A>
</H2>

<P>
At various points in a game, you arrive in a room with many directions to explore.
It is useful to be able to mark some of these directions as unexplored, so that
you can come back and explore them later. You could mark these by creating dummy
rooms in those directions, but this is tedious. Alternatively, you can use the
<TT>exit</TT> clause, like this:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Dining&nbsp;Room&#34;&nbsp;dir&nbsp;s&nbsp;exit&nbsp;nw&nbsp;e;
</DD>
</DL>This says that there are two unexplored exits from this room, in the northwest
and east directions. When a map is drawn, this fact will be displayed by a small
line poking out of the room in those directions.

<P>
When you come to actually explore those directions, and add links to new rooms,
the corresponding room exit markers will no longer be drawn. So you can leave
the exit clauses in if you want.

<P>

<H2><A NAME="SECTION00056000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">6</SPAN> Map Sections</A>
</H2>

<P>
In IFM, rooms are divided into groups called ``map sections''. Each room
in a map section has an explicit spatial relationship to all the other rooms
in that section. A room which is obtained by moving via a <TT>dir</TT> clause
from a previous room is on the same map section as the previous room, since
its co-ordinates can be calculated relative to it.

<P>
There are several reasons why it might be a good idea to split a game map into
different sections:

<P>

<UL>
<LI>Some maps can be very large, and may not look good on a single piece of paper.
</LI>
<LI>It might be awkward to put rooms in relation to each other because of, say,
a lot of up/down connections which have to be ``flattened out''.
</LI>
<LI>The game might naturally divide into sections--a prologue, middle-game and
end-game, for example.
</LI>
</UL>
IFM manages independent map sections automatically, by deciding which rooms
are on which section. No special command is needed to start a new map section--simply
define a room which has no connection to any previous room, by leaving out the
<TT>dir</TT> clause (note that that's how the kitchen starts out, in the example).

<P>
Rooms on different map sections are completely separate, and you may not link
them via the <TT>link</TT> command. However, you can indicate where a room on
one section is connected to a room on another, using the <TT>join</TT> command:

<P>

<DL COMPACT>
<DT>
<DD>join&nbsp;Room1&nbsp;to&nbsp;Room2;
</DD>
</DL>As usual, <TT>Room1</TT> and <TT>Room2</TT> are tag names. You can also use
<TT>join</TT> as a clause in a room command (usually done with the room starting
in a new section):

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;Basement&#34;&nbsp;join&nbsp;Ground_Floor;
</DD>
</DL>The ``joined'' status of the two rooms is indicated after their description
text; the default is to use an increasing number.

<P>
Each map section can be given a title using the <TT>map</TT> command, like this:

<P>

<DL COMPACT>
<DT>
<DD>map&nbsp;&#34;Kensington&nbsp;Gardens&#34;;
</DD>
</DL>This names the next map section that hasn't been named. Note that you should
have as many <TT>map</TT> commands as you have map sections, although this isn't
enforced--any names that are missing will be assigned default names, and extra
names will be ignored. It's conventional to give a <TT>map</TT> command just
before starting a new map section.

<P>
In rare circumstances (e.g.&nbsp;a three-dimensional maze) you may need to have
rooms on the same map section which are not connected to each other. The room
<TT>dir</TT> clause creates an implicit link from the previous room by default,
but you can stop this from happening by using the <TT>nolink</TT> attribute.
As a trivial example:

<P>

<DL COMPACT>
<DT>
<DD>room&nbsp;&#34;One&nbsp;Side&nbsp;of&nbsp;Wall&#34;&nbsp;tag&nbsp;this_side;

<P>
room&nbsp;&#34;Other&nbsp;Side&nbsp;of&nbsp;Wall&#34;&nbsp;dir&nbsp;e&nbsp;nolink&nbsp;tag&nbsp;other_side;

<P>
room&nbsp;&#34;Underground&nbsp;Passage&#34;&nbsp;tag&nbsp;passage_1;

<P>
room&nbsp;&#34;Underground&nbsp;Passage&#34;&nbsp;tag&nbsp;passage_2&nbsp;dir&nbsp;e;

<P>
join&nbsp;this_side&nbsp;to&nbsp;passage_1&nbsp;go&nbsp;down;

<P>
join&nbsp;passage_2&nbsp;to&nbsp;other_side&nbsp;go&nbsp;up;
</DD>
</DL>In this example, there are two map sections: above ground, and below ground.
But the two above-ground rooms are not connected directly.

<P>

<H2><A NAME="SECTION00057000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">7</SPAN> Adding Items</A>
</H2>

<P>
As well as rooms, IFM can indicate the initial rooms of various items found
in the game. To add an item, use the <TT>item</TT> command like this:

<P>

<DL COMPACT>
<DT>
<DD>item&nbsp;&#34;Spoon&#34;&nbsp;in&nbsp;Kitchen;
</DD>
</DL>The <TT>in</TT> clause can be omitted, and then the room defaults to the last
room mentioned. You can also add an arbitrary note to each item (e.g.&nbsp;to remind
you what it's for) using the <TT>note</TT> attribute:

<P>

<DL COMPACT>
<DT>
<DD>item&nbsp;&#34;Spoon&#34;&nbsp;in&nbsp;Kitchen&nbsp;note&nbsp;&#34;Stirs&nbsp;tea&#34;;
</DD>
</DL>Here's the completed map description for the above example, with a few other
items thrown in:

<P>

<DL COMPACT>
<DT>
<DD>
<BR>
<PRE  CLASS="verbatim">title "Example Map";

room "Kitchen" tag Kitchen;
  item "spoon" note "Stirs tea";
  item "sink";
  item "monkey";

room "Garage" dir s go down;
  item "monkey wrench" note "For wrenching monkey out of sink";

room "Lounge" dir e from Kitchen;
  item "TV set";

room "Dining Room" dir s link Kitchen;
  item "table";
  item "chair";

room "Study" dir e n oneway;
</PRE>
</DD>
</DL>See Section <A HREF="node7.htm#sec:using-ifm">4</A> for how to display it.

<P>

<H2><A NAME="SECTION00058000000000000000">
<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">8</SPAN> Conflicts</A>
</H2>

<P>
After creating a map from a real game and sending the results through IFM, you
may get warnings which talk about things overlapping. This is due to two rooms,
or a room and a link, wanting to occupy the same space on the map. There are
several ways that this could occur:

<P>

<UL>
<LI>The game designer made some room links longer than others, and you haven't taken
that into account. To extend the length of a link, just add a length indicator
after the direction in the <TT>dir</TT> clause (e.g.&nbsp;<TT>dir&nbsp;e&nbsp;2</TT> instead
of <TT>dir&nbsp;e</TT>).
</LI>
<LI>One of the links turned a corner, so that the direction you use to go back isn't
the opposite of the one you used to get here. In that case, you need to add
the corner-turn in the link (e.g.&nbsp;<TT>dir&nbsp;e&nbsp;s</TT> instead of <TT>dir&nbsp;e</TT>).
</LI>
<LI>The map is multi-level, in which case it's probably best to split it into different
map sections.
</LI>
<LI>The map is just weird. Colossal Cave is a good example, particularly the above-ground
section and the mazes. There seems to be no logic tying the rooms together.
You're on your own.
</LI>
</UL>

<P>

<DIV CLASS="navigation"><HR>
<!--Navigation Panel-->
<A NAME="tex2html190"
  HREF="node6.htm">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A> 
<A NAME="tex2html186"
  HREF="ifm.htm">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A> 
<A NAME="tex2html180"
  HREF="node4.htm">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A> 
<A NAME="tex2html188"
  HREF="node1.htm">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>  
<BR>
<B> Next:</B> <A NAME="tex2html191"
  HREF="node6.htm">3 Solving the Game</A>
<B> Up:</B> <A NAME="tex2html187"
  HREF="ifm.htm">IFM</A>
<B> Previous:</B> <A NAME="tex2html181"
  HREF="node4.htm">1 Introduction</A>
 &nbsp; <B>  <A NAME="tex2html189"
  HREF="node1.htm">Contents</A></B> </DIV>
<!--End of Navigation Panel-->

</BODY>
</HTML>