I’ve been working on an Inform 6L38 extension I’m calling ‘CYOA Framework for Glulx.’ It’s a framework (duh!) for making CYOA games in Inform 7 driven by keypresses and/or hyperlinks. The type-and-press-RETURN parser is turned off by default. (The thing that made this extension doable is Zarf’s experimental extension ‘Glulx Unified Input’.)
The extension is Quixe-compatible so it should be as easy to get a project online as with Twine. It has real undo support, quicksave saving if you want it (IE single keypress save and restore) and transcripting.
I’m trying to make it author and user-friendly. Each choice node takes the form of a single Inform rule. In most cases, that means everything to do with a node is in one place (physically and programatically) in the source.
Contrary to advance rumours, I did not incinerate the world model. Actually there are two modes in this extension - world model ON or world model OFF.
Say you want to write a game which is a two-header dialogue piece. You don’t want rooms or objects, you don’t care about them. Turn the model off and just use nodes. But even in this mode, the turn count is real, turn progression is real and UNDO is supported.
If you put the model ON, all the model stuff is there as usual (and people and objects are supported and appear in usual Inform ways) but the nodes are on top of this. Each room has a node that runs automatically when you enter the room, rather than a room description, but you can have all the other nodes you like.
You can flip options during runtime if you want, whether within a node or from node to node. This includes - hyperlinks in the prose, autolabelling links A-Z or 1-9, or giving them specific keys - including weirdo keys - having keypress choices automatically present as hyperlinks as well, clearing the screen every move VS retaining scrollback, etc.
I’ve put a tech demo online which has world model ON, uses the quicksave option and tries to show some variety. There are 4 rooms to walk around in a square, each with a corresponding node. Also, choose the Crumple into a ball on the floor option when you see it. That shows the 5th node.
There are two versions of the demo, one which clears the screen every turn and one which keeps scrollback. This is so you can see how it formats things in general either way.
If you’re interested in this extension – either using it, or later playing something made with it – and have time, please have a look at the demos and let me know what you think. I’m interested in features or bits of presentation you like or dislike, or things you think are obviously missing, or obvious bugs. Thanks if you do!
(One thing I notice is a message that appears only in Quixe: “[stopped: success]” after a restore. This seems to be cosmetic only. It’s not present offline.)
As an example of how relatively easy it should be to program with this extension, in the rant tag is the code for the Home Room from the demo. Each node rule has a display phase, a list choices phase and then a react phase:
[rant][code]There is a room called Home Room. The node is home room rule.
Jim is a man in home room. Jim’s bowling ball is a thing in home room.
This is the home room rule:
if cyoa-node stage is “display prose”:
say “You are in the home room of the CYOA tech demo. A passage leads north to the Room Of Too Many Choices. Another leads east to the Room Of Quirky Key Assignments.[paragraph break]Because it’s in the spontaneous nature of the character you’re playing, you may wish to [hyperlink]DANCE[/hyperlink] by clicking this in-prose hyperlink. Or don’t.[paragraph break]”;
now cyoa-choice prompt is “(You can’t do anything with Jim or his bowling ball, but they’re just there to show you that real Inform objects and characters will appear in your game and be presented as usual in their location when world model support is turned on, as it is in this demo. If you want to make a game which requires no room, object or character models (eg a dialogue between two characters) you can turn the world model off and forget about rooms and all that stuff.)[paragraph break]If the dancing doesn’t appeal, select a more plebian course of action from below using the numbers of your keyboard:[line break]”;
continue the action;
if cyoa-node stage is “list choices”:
cyoa-present “Go north to the Room Of Too Many Choices.”;
cyoa-present “Go east to the Room Of Quirky Key Assignments.”;
continue the action;
if cyoa-node stage is “react”:
if cyoa-hyperlink choice is:
say “You dance the night away. After the dancing, you’re still in this room.”;
if cyoa-choice is:
try going north;
try going east.[/code][/rant]