Counterfeit Monkey — 5 of 292

Emily Short

Release 5

Part 2 - Multimedia

Chapter 1 - Images

Section 1 - Compass Rose

[The aim of the graphics is to provide the player with visual orientation. We don't ever want the player to feel lost or to feel pressure to take notes. With a large game space, this is a challenge to achieve. Even though Bronze provided GO TO and FIND commands *and* came with a manual with a pre-drawn map, a number of players reported making maps of their own. This was a failure. Note-taking should be completely unnecessary unless the player happens to enjoy map-making for some reason.

The map concept borrows from commercial game minimaps that show goal locations as the player progresses.

Like the compass rose in Bronze, the compass rose here shows exits in different shades depending on whether the rooms in those directions have already been visited. The compass is also hyperlinked so that the player can click on it as an alternative to typing directions. ]

Figure of dim northwest is the file "grey-nw.png".

Figure of dim north is the file "grey-n.png".

Figure of dim northeast is the file "grey-ne.png".

Figure of dim west is the file "grey-w.png".

Figure of dim east is the file "grey-e.png".

Figure of dim southwest is the file "grey-sw.png".

Figure of dim south is the file "grey-s.png".

Figure of dim southeast is the file "grey-se.png".

Figure of dim up is the file "grey-u.png".

Figure of dim down is the file "grey-d.png".

Figure of northwest is the file "white-nw.png".

Figure of north is the file "white-n.png".

Figure of northeast is the file "white-ne.png".

Figure of west is the file "white-w.png".

Figure of east is the file "white-e.png".

Figure of southwest is the file "white-sw.png".

Figure of south is the file "white-s.png".

Figure of southeast is the file "white-se.png".

Figure of up is the file "white-u.png".

Figure of down is the file "white-d.png".

Figure of new northwest is the file "blue-nw.png".

Figure of new north is the file "blue-n.png".

Figure of new northeast is the file "blue-ne.png".

Figure of new west is the file "blue-w.png".

Figure of new east is the file "blue-e.png".

Figure of new southwest is the file "blue-sw.png".

Figure of new south is the file "blue-s.png".

Figure of new southeast is the file "blue-se.png".

Figure of new up is the file "blue-u.png".

Figure of new down is the file "blue-d.png".

Figure of dim fore-port is the file "grey-fp.png".

Figure of dim fore is the file "grey-f.png".

Figure of dim fore-starboard is the file "grey-fsb.png".

Figure of dim port is the file "grey-p.png".

Figure of dim starboard is the file "grey-sb.png".

Figure of dim aft-port is the file "grey-ap.png".

Figure of dim aft is the file "grey-a.png".

Figure of dim aft-starboard is the file "grey-asb.png".

Figure of fore-port is the file "white-fp.png".

Figure of fore is the file "white-f.png".

Figure of fore-starboard is the file "white-fsb.png".

Figure of port is the file "white-p.png".

Figure of starboard is the file "white-sb.png".

Figure of aft-port is the file "white-ap.png".

Figure of aft is the file "white-a.png".

Figure of aft-starboard is the file "white-asb.png".

Figure of new fore-port is the file "blue-fp.png".

Figure of new fore is the file "blue-f.png".

Figure of new fore-starboard is the file "blue-fsb.png".

Figure of new port is the file "blue-p.png".

Figure of new starboard is the file "blue-sb.png".

Figure of new aft-port is the file "blue-ap.png".

Figure of new aft is the file "blue-a.png".

Figure of new aft-starboard is the file "blue-asb.png".

Figure of center-squiggle is the file "center-squiggle.png".

[The following is a hack. Originally the figure name associations were all properties of the direction objects, but some sort of memory bug happened when image properties were added to the nautical directions. The result was that the map itself was reconfigured weirdly -- for instance, Slango's Head was declared in source to be aft from Slango's Bunk, but in the game model it would be port of Slango's Bunk instead.]

To decide what figure-name is the dim image of (way - a direction):

if way is:

-- fore-port:

decide on figure of dim fore-port;

-- fore:

decide on figure of dim fore;

-- fore-starboard:

decide on figure of dim fore-starboard;

-- port:

decide on figure of dim port;

-- starboard:

decide on figure of dim starboard;

-- aft-port:

decide on figure of dim aft-port;

-- aft:

decide on figure of dim aft;

-- aft-starboard:

decide on figure of dim aft-starboard;

-- northwest:

decide on figure of dim northwest;

-- north:

decide on figure of dim north;

-- northeast:

decide on figure of dim northeast;

-- west:

decide on figure of dim west;

-- east:

decide on figure of dim east;

-- southwest:

decide on figure of dim southwest;

-- south:

decide on figure of dim south;

-- southeast:

decide on figure of dim southeast;

-- up:

decide on figure of dim up;

-- down:

decide on figure of dim down.

To decide what figure-name is the unvisited image of (way - a direction):

if way is:

-- fore-port:

decide on figure of new fore-port;

-- fore:

decide on figure of new fore;

-- fore-starboard:

decide on figure of new fore-starboard;

-- port:

decide on figure of new port;

-- starboard:

decide on figure of new starboard;

-- aft-port:

decide on figure of new aft-port;

-- aft:

decide on figure of new aft;

-- aft-starboard:

decide on figure of new aft-starboard;

-- northwest:

decide on figure of new northwest;

-- north:

decide on figure of new north;

-- northeast:

decide on figure of new northeast;

-- west:

decide on figure of new west;

-- east:

decide on figure of new east;

-- southwest:

decide on figure of new southwest;

-- south:

decide on figure of new south;

-- southeast:

decide on figure of new southeast;

-- up:

decide on figure of new up;

-- down:

decide on figure of new down.

To decide what figure-name is the visited image of (way - a direction):

if way is:

-- fore-port:

decide on figure of fore-port;

-- fore:

decide on figure of fore;

-- fore-starboard:

decide on figure of fore-starboard;

-- port:

decide on figure of port;

-- starboard:

decide on figure of starboard;

-- aft-port:

decide on figure of aft-port;

-- aft:

decide on figure of aft;

-- aft-starboard:

decide on figure of aft-starboard;

-- northwest:

decide on figure of northwest;

-- north:

decide on figure of north;

-- northeast:

decide on figure of northeast;

-- west:

decide on figure of west;

-- east:

decide on figure of east;

-- southwest:

decide on figure of southwest;

-- south:

decide on figure of south;

-- southeast:

decide on figure of southeast;

-- up:

decide on figure of up;

-- down:

decide on figure of down.

A direction has a number called x-coordinate. A direction has a number called y-coordinate.

Include Simple Graphical Window by Emily Short. The graphics window proportion is 50. The graphics window position is g-left.

The compass width is a number that varies. The compass width is 120.

Include Graphic Links by Jeff Sheets.

When play begins (this is the setting directional hyperlinks rule):

follow the compass-drawing rule.

To establish compass graphlinks:

let ZE be grid-margin;

let D be grid-size;

let DD be 2 * D;

let DDD be compass width;

let top-edge be current graphics window height - (D * 4);

let upper-mid be top-edge + D;

let lower-mid be top-edge + DD;

let bottom-edge be current graphics window height - D;

let super-top be current graphics window height - (D * 5);

let true-bottom be current graphics window height;

increase D by grid-margin;

increase DD by grid-margin;

increase DDD by grid-margin;

if the location is nautical:

set a graphlink identified as "goFP" from ZE by top-edge to D by upper-mid as "fore-port";

set a graphlink identified as "goF" from D by top-edge to DD by upper-mid as "fore";

set a graphlink identified as "goFSB" from DD by top-edge to DDD by upper-mid as "fore-starboard";

set a graphlink identified as "goP" from ZE by upper-mid to D by lower-mid as "port";

set a graphlink identified as "lookHere" from D by upper-mid to DD by lower-mid as "look";

set a graphlink identified as "goSB" from DD by upper-mid to DDD by lower-mid as "starboard";

set a graphlink identified as "goAP" from ZE by lower-mid to D by bottom-edge as "aft-port";

set a graphlink identified as "goA" from D by lower-mid to DD by bottom-edge as "aft";

set a graphlink identified as "goASB" from DD by lower-mid to DDD by bottom-edge as "aft-starboard";

set a graphlink identified as "goD" from DD by bottom-edge to DDD by true-bottom as "down";

set a graphlink identified as "goU" from ZE by bottom-edge to D by true-bottom as "up";

otherwise:

set a graphlink identified as "goNW" from ZE by top-edge to D by upper-mid as "northwest";

set a graphlink identified as "goN" from D by top-edge to DD by upper-mid as "north";

set a graphlink identified as "goNE" from DD by top-edge to DDD by upper-mid as "northeast";

set a graphlink identified as "goW" from ZE by upper-mid to D by lower-mid as "west";

set a graphlink identified as "lookHere" from D by upper-mid to DD by lower-mid as "look";

set a graphlink identified as "goE" from DD by upper-mid to DDD by lower-mid as "east";

set a graphlink identified as "goSW" from ZE by lower-mid to D by bottom-edge as "southwest";

set a graphlink identified as "goS" from D by lower-mid to DD by bottom-edge as "south";

set a graphlink identified as "goSE" from DD by lower-mid to DDD by bottom-edge as "southeast";

set a graphlink identified as "goD" from DD by bottom-edge to DDD by true-bottom as "down";

set a graphlink identified as "goU" from ZE by bottom-edge to D by true-bottom as "up";

To clear compass graphlinks:

[first the nauticals]

clear the graphlink identified as "goFP";

clear the graphlink identified as "goF";

clear the graphlink identified as "goFSB";

clear the graphlink identified as "goP";

clear the graphlink identified as "lookHere";

clear the graphlink identified as "goSB";

clear the graphlink identified as "goAP";

clear the graphlink identified as "goA";

clear the graphlink identified as "goASB";

[and now the regular directions]

clear the graphlink identified as "goNW";

clear the graphlink identified as "goN";

clear the graphlink identified as "goNE";

clear the graphlink identified as "goW";

clear the graphlink identified as "lookHere";

clear the graphlink identified as "goE";

clear the graphlink identified as "goSW";

clear the graphlink identified as "goS";

clear the graphlink identified as "goSE";

clear the graphlink identified as "goD";

clear the graphlink identified as "goU";

When play begins (this is the setting drawing-rule rule):

now current graphics drawing rule is the compass-drawing rule.

Carry out going (this is the update compass on movement rule):

refresh compass with current directions.

Carry out someone going when the actor encloses the player:

refresh compass with current directions.

[We want the compass to stay down in a corner of the screen and not to scale up too huge if the screen is resized. One of the irritating things about Glulx window management is that it's impossible to force an aspect ratio on the player, so I have no idea whether they're going to go tall-and-skinny or short-and-wide. Testers playing in full-screen mode sometimes found that the compass got way too large and encroached on the upper part of the map if I just set the compass to be one quarter the width of the window.]

To decide what number is grid-size:

let width-quarter be (current graphics window width / 4);

let height-quarter be (current graphics window height / 4);

if width-quarter is greater than height-quarter:

now compass width is height-quarter;

else:

now compass width is width-quarter;

let D be compass width / 3;

decide on D;

To decide what number is grid-margin:

decide on grid-size / 2.

This is the compass-drawing rule:

if glulx graphics is supported:

clear compass graphlinks; [We need to reset the graphlinks every time the player resizes the window, because if the height of the screen changes, the compass may move vertically.]

establish compass graphlinks;

refresh compass with current directions.

To determine compass coordinates:

let ZE be 0;

increase ZE by grid-margin;

let D be grid-size;

let DD be 2 * D;

let DDD be compass width;

let TE be current graphics window height - (D * 4);

let UM be TE + D;

let LM be TE + DD;

let BEE be current graphics window height - D;

increase D by grid-margin;

increase DD by grid-margin;

increase DDD by grid-margin;

change x-coordinate of up to ZE;

change y-coordinate of up to BEE;

change x-coordinate of down to DD;

change y-coordinate of down to BEE;

change x-coordinate of fore-port to ZE;

change y-coordinate of fore-port to TE;

change x-coordinate of fore to D;

change y-coordinate of fore to TE;

change x-coordinate of fore-starboard to DD;

change y-coordinate of fore-starboard to TE;

change x-coordinate of port to ZE;

change y-coordinate of port to UM;

change x-coordinate of starboard to DD;

change y-coordinate of starboard to UM;

change x-coordinate of aft-port to ZE;

change y-coordinate of aft-port to LM;

change x-coordinate of aft to D;

change y-coordinate of aft to LM;

change x-coordinate of aft-starboard to DD;

change y-coordinate of aft-starboard to LM;

change x-coordinate of northwest to ZE;

change y-coordinate of northwest to TE;

change x-coordinate of north to D;

change y-coordinate of north to TE;

change x-coordinate of northeast to DD;

change y-coordinate of northeast to TE;

change x-coordinate of west to ZE;

change y-coordinate of west to UM;

change x-coordinate of east to DD;

change y-coordinate of east to UM;

change x-coordinate of southwest to ZE;

change y-coordinate of southwest to LM;

change x-coordinate of south to D;

change y-coordinate of south to LM;

change x-coordinate of southeast to DD;

change y-coordinate of southeast to LM.

[Layer the image: black in the background to fill in the top of the screen; a blue and black mix of the right height across the whole width of the screen so that if the map is too small, it will still look blue at the edges; then the map itself, proportionally scaled as large as it can reasonably be given the window dimensions; then the compass, built from the current circumstances.

In theory, it would have been possible to make the map images carry the compass directions as well. In practice, that presented several problems: more difficult to cope with minor map changes during final revisions, inability to indicate which directions have already been explored.]

To refresh compass with current directions:

if glulx graphics is supported:

blank window to graphics background color;

change currently shown picture to the figure of background;

follow the bottom wide drawing rule;

change currently shown picture to the local map of the location;

follow the bottom scaled drawing rule;

draw Figure of center-squiggle from the x-coordinate of north by y-coordinate of west to grid-size by grid-size;

determine compass coordinates;

repeat with way running through directions:

if the way is a listable exit:

let X be the x-coordinate of way;

let Y be the y-coordinate of way;

if the room way from the location is visited:

draw the visited image of the way from X by Y to grid-size by grid-size;

otherwise:

draw the unvisited image of the way from X by Y to grid-size by grid-size;