Cloak of Darkness: Quest Implementation Issues

A few days ago The Pixie posted details of a game that has been described as the equivalent of 'hello world' for text adventures (http://docs.textadventures.co.uk/quest/cloak_of_darkness.html). I have quite a few questions/comments around its implementation in Quest, which I'll post one at a time next week. As preparatory homework for the weekend, why not try implementing it yourself? One of the first challenges is to make sense of what is meant by "disturbing things in the dark" (second and fifth requirement)! The specification is as follows:

  1. The Foyer of the Opera House is where the game begins. This empty room has doors to the south and west, also an unusable exit to the north. There is nobody else around.
  2. The Bar lies south of the Foyer, and is initially unlit. Trying to do anything other than return northwards results in a warning message about disturbing things in the dark.
  3. On the wall of the Cloakroom, to the west of the Foyer, is fixed a small brass hook.
  4. Taking an inventory of possessions reveals that the player is wearing a black velvet cloak which, upon examination, is found to be light-absorbent. The player can drop the cloak on the floor of the Cloakroom or, better, put it on the hook.
  5. Returning to the Bar without the cloak reveals that the room is now lit. A message is scratched in the sawdust on the floor. The message reads either “You have won” or “You have lost”, depending on how much it was disturbed by the player while the room was dark. The act of reading the message ends the game.
Good luck!

DavyB


One of the first challenges is to make sense of what is meant by "disturbing things in the dark" (second and fifth requirement)!

Very true. The problem is that is not enough in the game to make the player want to spend time in that room.


Very true. The problem is that is not enough in the game to make the player want to spend time in that room.

Okay, let's solve that problem first. To requirement 2, add "There is a mouse in the room, which you can't see, but can hear when the Bar is in darkness."


So I once played this horror game on Quest, and in one room you had to mess with a dead body, and there were lots and lots of objects in one cabinet. I stayed in that room for a very long time until I looked at the guide, and found out the object I needed was hidden somewhere in the body, so I needed another object from a different room!

Anyways, just make a few containers, lots of objects in those containers, and lots of scenery objects!


I got to test play the "Cloak of Darkness" game via Pixie and it was pretty awesome. I liked it a lot in spite of the simplicity. The concept was fun and the coding I think is going to be really helpful for beginners to try if they are new to Quest.

:D Give it a whirl!

Anonynn.


Very true. The problem is that is not enough in the game to make the player want to spend time in that room.

Sorry, I replied too quickly to this point yesterday. It isn't really acceptable to mess with the specification! As jmnevil54 implies it is always possible to encourage the player to stay in the room through the room description provided. As it is a bar, there could be some mention of what the player can smell, prompting an investigatation. Forget the mouse :)


Okay, hopefully some of you will have had a chance to think about this micro-game and attempt an implementation. I plan to raise raise a series of issues about its implementation. The first issue (Issue 0) is that the specification is a bit vague in relation to disturbing the message in the sawdust in the bar. Let's assume "the first time you perform any operation in the bar when wearing the cloak, other than leaving, means you receive a warning; any operation after that, other than leaving, means you have caused a disturbance."

Now we are ready to start the implementation in Quest. Creating a basic game raises Issue 1: How should the game panes, hyperlinks and the game map be set by default? At present, game panes and hyperlinks are switched on and the map is switched off, which seems arbitrary and inconsistent. Would it be better to have them all off or all on? All of them can be controlled dynamically (e.g. https://textadventures.co.uk/forum/quest/topic/hclkhpzf2e2f_repc9ycgq/dynamic-hyperlinks-success). Would it be better to have dynamic control as a standard part of Quest?


I'm going to keep to my plan to raise a single point each day but will summarise at the end.

Today's post (Issue 2) covers the built in HELP command. In The Pixie's version of Cloak of Darkness the HELP command has been overriden to simply say "Just type stuff at the prompt!". This is 'tongue in cheek' of course and in most games it is likely that "Quick help" will be updated/replaced with a description that identifies all the commands available to a player in that particular game. Perhaps "Quick help" also needs to be kept up to date, however, when changes are made to Quest? This might include, for example, commands such as VERSION and ABOUT that have recently been added.

Tomorrow: Wearables in the Inventory


I can see about works in The Pixie's Deeper 2.0.


I can see about works in The Pixie's Deeper 2.0.

It's in all games published with Quest 5.8.0. Check out those just published on the front page. Surprised that ABOUT doesn't include the game description provided by the developer...and seems to be exactly the same as VERSION?


Today: Wearables in the Inventory

In The Pixie's version of the game, the standard Quest facilities for wearables are not used. Why not? Well, there are several issues here. The first is the way that worn items are described in the inventory. For Cloak of Darkness, the normal inventory description would be:
You are carrying a cloak (worn).

This is obviously not a sentence anyone would use in English but can be improved by replacing 'are carrying' with 'have':
You have a cloak (worn).

Even better, now that wearables are built in, they could be separated from other items:
You are wearing a cloak. You are carrying nothing.

or, as another example, assuming you are holding a sword and wearing a scabbard:

>inv
You are wearing a scabbard. You are carrying a sword.
>put sword into scabbard
Done!
>inv
You are wearing a scabbard (containing a sword). You are carrying nothing.

That seems okay, but leads into another issue with wearables, which I'll cover tomorrow.

Tomorrow: Further Issues with Wearables


Today: Further Issues with Wearables

The way that the cloak is managed in The Pixie's version of the game cannot be implemented with the standard wearable features of Quest. In particular, the illustrated game allows the cloak to be dropped and put on the hook while worn. In Quest, a worn item must first be removed before it can be dropped or put anywhere. This is less convenient, but the corresponding error messages are also misleading (You can't drop it. and You can't put it there.).

For consistency, it would also be useful to allow items to be picked up and worn in one action through the WEAR command, though in this case there is a meaningful error message: You would need to get it before you can put it on.

Tomorrow: Struggling with Dark Rooms


Today: Struggling with Dark Rooms

The way that darkness in the Bar is managed in The Pixie's version of the game cannot be implemented with the standard dark room feature of Quest. The issue is that once inside a Quest dark room ALL exits are invisible and there doesn't seem to be a way of opening any exit without lighting up the room? I tried various approaches, including the use of turn scripts but MakeExitVisible continued to have no effect. The only way out seems to be to either drop the gown or UNDO the command that led into the Bar. Perhaps I've missed something?

Next: Examining Rooms


I thought you could make an exit visible by making it a weak light source.


I thought you could make an exit visible by making it a weak light source.

Oops, you are right. I never thought to read the documentation. :) ...so why is that not used in the Cloak of Darkness? It is also odd that the cloak, according to the game spec, only affects the player in the bar area...but that's another issue!


Today: Examining Rooms

The Pixie's version of Cloak of Darkness is 'old school', in that objects are mentioned that can't be examined. For example, it starts: "There is something oppressive about the dark room...Paint is peeling, dust is everywhere ... You can see doors to the north, west and south." but examining room, paint, dust and doors all produce the same response "I can't see that."

Players now, however, often prefer some more specific response to the examination of each item mentioned explicitly. One step towards making that a bit easier would be to have each location and exit as genuine objects. At present, a location can be defined as (i) a room; (ii) an object; or (iii) object and/or room, with a check box to say it is a room. I don't understand? Also, no matter which option I take I can't find a way to allow the player to type x foyer or x room? Similarly, for exits, it would be nice if they could be given descriptions and those inspected by players. Instead it is necessary to introduce other objects to serve the same purpose.

Next: Pulling it all Together


Today: Pulling it all Together

Pulling it all together has meant implementing a version of the Cloak of Darkness. This has just been uploaded to the sandpit (http://textadventures.co.uk/games/view/cxbbr4mqakkylkr80ypjhg/cloak-of-darkness-another-version). Type ABOUT in the game to get a detailed description of its implementation.

The game has the same look as the original created by the Pixie: http://docs.textadventures.co.uk/quest/util/cloak_of_darkness.aslx

As far as possible, the specification is followed precisely. Any assumptions made are listed.

The implementation also tries to make best use of what appear to be the most appropriate facilities in Quest. In doing so, a number of possible improvements to Quest are identified.

In creating the game, the following issues were noted, some of which have been reported elsewhere:
1. There is a bizarre problem with the game text scrolling up behind the map. It seems to be connected with the selection of the background page colour #333.
2. If an item is worn it cannot be dropped. However, any script defined in ‘After dropping the object’ is executed. This bug is used in the game to give the illusion of being able to drop worn items.
3. This version defines verbs ‘hang’ and ‘hang up’ for the cloak. Applying hang to a door, for example, then produces the error message “You can’t hang up; hang it”.
4. “Put cloak on hook” is equivalent in English to “Put cloak onto hook” but only the first form is supported.
5. Attempting to “Speak to cloak” (for example) produces the response “It saies nothing.”

  1. There are three entries for WearGarment in the Quest documentation.

There is a bizarre problem with the game text scrolling up behind the map. It seems to be connected with the selection of the background page colour #333.

I have since discovered Quest has an issue with three digit colours. Use #333333 instead.

If an item is worn it cannot be dropped. However, any script defined in ‘After dropping the object’ is executed. This bug is used in the game to give the illusion of being able to drop worn items.

Looks like that always runs when you try to drop anything, whether successful or not. If that is corrected, how many games will it mess up, I wonder? Odd no one has noticed previously.

This version defines verbs ‘hang’ and ‘hang up’ for the cloak. Applying hang to a door, for example, then produces the error message “You can’t hang up; hang it”.

You can edit that in the verb object (under the game object).


Thanks Pixie. Couple of easy fixes there. Fixing the drop code will mess up my version of Cloak of Darkness unless you adjust the clothing abstraction at the same time :). Others my not be affected. I would normally just script the whole 'drop' operation and only found this anomaly by accident while experimenting.


There is a bizarre problem with the game text scrolling up behind the map.

The use of Use #333333 for the background page colour sorts out the problem mentioned but a second related issue is that the display is not readjusting to the suppression of the Location Bar so some of the scrolling text can still be seen at the top of the screen.


Looks like that always runs when you try to drop anything, whether successful or not. If that is corrected, how many games will it mess up, I wonder? Odd no one has noticed previously.

Only reason I never noticed this is because none of my wearables have customized drop scripts. I'm sure other people's wearables do though. Strange...


If that is corrected, how many games will it mess up, I wonder?

Better to fix by passing a parameter to the script to say if the drop was succesful. It's safe to assume that any games currently using it will expect the current behaviour. So the sensible fix would be to change the description to "Run script after attempting to drop the item", and provide an easy way for the user to check for success in case that's what they want.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums