Devlog:Cloak of Darkness
August 16, 2026
Though I've been working on AdventureJS for seven years, and in many respects it has long been in a shape where a game could be made with it, in fact it always still seems to be missing baseline features for a system that wants to compete with TADS and Inform.
I recently decided to make a Cloak of Darkness port for AdventureJS. CoD is a sort of "Hello, world" for interactive fiction systems. It's a simple game with three rooms and three objects; interactions between a couple of the objects; a dark room; a tracker for actions performed in the dark room; and a win/lose state. Right off the bat I was struck by obvious absences:
I'd never gotten around to a complete implementation for dark rooms. Of course it's easy to say room.is.dark; but then to account for the presence of light sources and things like night-vision goggles; and proper
noun_must_be.visiblehandling for verbs that understand that you should be able to remove an item of clothing in the dark, even if you might not be able to find it again to pick up; and sonoun_must_be.visiblewas split intonoun_must_be.visible,noun_must_be.visible_unless_carried, andnoun_must_be.visible_unless_worn; and how the names of dark rooms are presented, i.e.In the darkvsBar (in the dark).Though my
hangverb could handlehang cloak on hook, it had no logic to automatically find an indirect object forhang up cloak, so that needed to be added.I'd recently built a system that I call
Outrocardfor displaying end-of-game messages, but it wasn't very robust yet. I needed to add handling to only allow whitelisted verbs (undo, restore, restart, quit); add proper handling for restart and quit (exactly what do those mean in a web browser?); ensure that the outrocard was dispelled elegantly on undo or restore.Along the way I also found bugs in long-standing key systems: a bug in
doVerbActionwhich handles verb hooks; a bug inmergeWorldwhich lies beneath undo and restore.I also wound up adding some small new features, and enhanced the handling of others;
doVerbActionpreviously accepted asset names as params – now it accepts name or ID; added some new conveniences to let authors use "player" or "room" as adoVerbActionorstartIntervalparameter and have it automatically resolve to the correct asset; refactored a mess of unorganized response settings into game.settings.responses to make them a little easier to understand.
All told, about two weeks of dev (bearing in mind that this is a hobby project for evenings and weekends, often in front of television) for what should have been (and one day will be) about a half hour project. But semper ad meliora, as they say.