New extension: Guide Mode (for Inform 10)

@kamineko Extracted from my WIP, polished up a bit and converted to Inform 10, here’s my Guide Mode extension, based on @johnnywz00 's Readthrough Mode ideas (plus whatever he actually called it when he did it in TADS, if not Readthrough Mode)

Rubric: “Enables you to add a guide mode to your game. The guide mode walks the player through the game one command at a time. The author creates the table of commands for the game to supply. The player can accept and enter each displayed command by pressing ENTER. If the player types a different in world command, guide mode is paused (and no more guide commands are displayed) allowing the player to experiment or explore. The player can leave guide mode by typing GUIDE OFF. Otherwise, when they UNDO during pause mode, they will be rewound to the moment just before they paused, and put back in guide mode.”

The example project included shows it in action, and how to code your table for it, pretty well I think.

Attached here is version 1 of the extension plus the Inform 10-compatible version of Undo Output Control it requires.

If you use it or have any questions or suggestions for it, let me know, because having made it, I probably won’t be using it myself for years!

It has one bug at the moment that’s outlying, that will probably be easy enough to fix soon. (If the player cancels an attempted save/restore/restart/quit on the first turn of the game, with Guide Mode on, the ‘cancel this turn’ code prompts the message ‘You can’t “undo” what hasn’t been done’ and breaks guide mode.)

-Wade
Guide Mode.i7x (30.8 KB)
Undo Output Control.i7x (34.9 KB)

12 Likes

Thanks for this! I’ve had something cooking, too. Your code is so much tidier than mine.

It autopopulates the next command from a table, but a blank enter will do the same thing (I think this is Daniel’s code in undo output control)

I have an extension by @Draconis that populates the prompt with the next command. It isn’t published yet, so I’ve pasted the whole thing in the source.

Usage: press enter to move through the story. at any time, enter a different command to pause the walkthrough and enter “in-scene” mode. undo saves are paused. when player chooses to resume the walkthrough, they can press enter on a blank line or else input RESUME. The game will return to the last position in the walkthrough, and pressing enter will advance the walkthrough normally.

Metacommands are unavailable during in-scene mode (a restore after closing the game would probably wipe the undo state). once play resumes, they work as expected.

  • It uses the keypress code you gave me a long time ago!
  • I’ve also used the undo output control extension.
  • There’s a whitelist for commands that don’t interrupt the walkthrough. In RTE for instance, I wouldn’t want to pull the player out while looking at the guide.
  • undoing the first command leaves a blank command prompt, but blank enter presses move to next command.
  • in general metacommands on turn one seem ok. probably because they are whitelisted.
  • this is based on @johnnywz00 's system too (I was a playtester)

anyway, my code is always messy, so I hate to share it, but here goes… Not in extension format at this time.

story mode demo by drew cook.txt (11.7 KB)

4 Likes

I sense a trend here… good… more player friendly parser games are always good :smiley:

2 Likes

@kamineko and @severedhand , I’m thrilled to see you both porting this system over to Inform! I hope that it will catch on. In a certain sense… I mean I’d rather people play the real game! But if it helps some people get their feet wet, helps draw them in to get started, or helps them enjoy the story when they would never see the story otherwise, I think that’s great.

Readthrough mode indeed :slight_smile: In my source code I was calling it “slideshowMode”, and I never went back and changed that.

@Lancelot I’m super curious, did you see my Readthrough Mode post however many months/year ago that was, or did you create a nearly identical system completely coincidentally?

2 Likes

I think it’s a great idea! I’ve taken to calling mine “Story Mode.” I’m going to look for some “readers” once IF Comp is over…

Onno may be calling his “story mode” too? I can’t remember…

3 Likes

Yep I have a “story mode” built in (it’s also mentioned on the game blurb). I originally called it “walkthrough mode” but changed it at the suggestion of Manon.

I remember a discussion about readthrough mode but I was thinking of a walkthrough mode but functionality wise we are talking the same thing. I think I saw something like this in a game I played some time ago but not sure which it was. I basically wanted to achieve three goals:

  • quickly move through my game by pressing enter to execute a “current” command.
  • make my game more accessible for people not familiar with parser games.
  • make my game actually read like a story. That is, narrate the actions (and I do mean narrate ALL actions, you will see what I mean when you play the game), and avoid the jarring default responses like ‘(taken)’ etc.

For my IFComp entry this works perfectly but that’s because it was originally targeting the Single Choice Jam and I wanted to see how far I could go with that premise in a parser context. A simple game with a limited verb command set.

Where I differ is that when I enable story mode it means do whatever is the default command for the current game state. The player is free to do something else (like examining things) which does not change state. It works for the limited game I have now in IFComp but I am now trying to make it work for a more regular parser game.

That is, instead of going to a “save point” and undo whatever the player did after leaving story mode, I basically stay in story mode and try to take it from there. More complex but I like a challenge. This of course means that the game should never end up in an unwinnable state, in that case I do need to do a rollback until the last known safe state.

3 Likes

So, practically we did arrive at nearly the same point from disconnected origins. Very cool! I wasn’t trying to insinuate that my rendition of it is the only right way. Just the broad concept of “game plays itself, but lets you do your own thing too”.

2 Likes

Exactly! As I mentioned above, more player friendly parser games are always good :smiley:

If I get at least one player who feels uncomfortable playing parser games play my game, I consider it a success. And I know of at least one, so no matter what happens in the comp, I feel like I have won something already there.

2 Likes

I hope to post a version 2 pretty shortly, getting rid of the bugs from version 1 and hitting a TODO or two. Then I think I’ll be able to leave it alone for people to use.

@kamineko I think the whitelist is a great idea. I’ve decided it’s still handy to have my extension handle the built-in out of worlds in its own way, because SAVE/RESTORE/QUIT/RESTART seem to produce all the edge case bugs in this system. But I am going to add a whitelist mechanism so the author can put new out of world commands on it and not have to flag them every time they appear in the guide.

On top of that, I decided I’ll leave the ‘out-of-world’ column mechanism I already have in place as a safety override. This means that no matter what series of actions ends up running during a turn as a result of a guide command (in world, out of world, mixed, any order) – if the end result is that the command pointer isn’t moving on, and you want it to, you can make sure it will move on by adding a TRUE in that column.

I also decided the whitelist will take exact matches only. e.g. If you put HELP in the list, it’s not going to match on HELP JOHN. It can match multi-word phrases, but they have to match exactly. If the author has out of world commands that take further variable input from the player, they can just flag them in the out-of-world column in the guide guide.

-Wade

2 Likes

Okay, attached is version 2 of Guide Mode, which is a major improvement in ways I didn’t even know version 1 needed to be improved. I think this is now field-ready.

VERSION 2: 2023-10-06

IMPROVEMENTS SINCE VERSION 1:

  • Extension does a safety check on boot. It needs to be able to write temp files to function. If it finds it can’t, it silently disables the guide mode code.
  • Code should all be safe now. No significant guide mode code runs when guide mode isn’t supported or has been turned off.
  • Player input is converted to lower case behind the scenes. If all table content is entered in lower case, there can be no case mismatches.
  • Parser errors no longer cause the guide to pause.
  • G/AGAIN are now interchangeable as far as the player and guide author are concerned. If the guide command is G/AGAIN, the automatic expansion shows what command the player will actually be entering.
  • Out of world commands are now handled by a whitelist table. The author must add any out of world commands they create to this table. Thanks Drew Cook for this idea.
  • Fixed a bug: Guide mode no longer breaks if player cancels a SAVE/RESTORE/RESTART/QUIT on the first turn of the game, though some extra linebreaks might be generated upon the cancel. That’s the cost of victory.

-Wade
Guide Mode.i7x (34.7 KB)

5 Likes

With another minor bug fix, I’ve gone to version 3. And from now on, the extension will live in the I7 Friends extensions place on Github, and any future updates will occur there.

-Wade

4 Likes

Is there a sample game that uses this so I can see how your mode works? (I’m not an Inform writer so the code wouldn’t mean anything to me…)

Yeah, this extension includes an example. I find examples are easiest to play if you just bake them as games, so that’s what I’ve done. It’s attached. Drop it on your Inform-capable interpreter of choice.

Here’s the note from the extension docs about the example:

Example: ** The Sawyer Place - A short adventure demonstrating most features of guide mode. The game has one randomised element which is figured into its guide: Each game, the target safe is randomly located in one of three upstairs rooms. The other two rooms bring instant death. A clue downstairs informs the player which is the correct room. The game's guide makes sure the player will have read the clue before encountering the numbered rooms, then uses a pre-command rule in its table of guidance to jump to the correct spot in the guide so that the player enters the correct room. In other words, the commands dispensed near the end of the guide automatically cater for the randomised content.

If you want to die during the game (doesn’t happen if you just follow the guide) you can either go all west from the start, or deliberately enter the wrong room of three upstairs.

sawyer-place.gblorb (619.5 KB)
-Wade

3 Likes

I’ve updated Guide Mode to version 4. It now uses @Draconis’s Autosave extension so that it can keep working even in situations where the UNDO stack isn’t preserved between sessions. e.g. In Parchment. It’s in the I7 extensions github: https://github.com/i7/extensions/tree/10.1/Wade%20Clarke

-Wade

4 Likes

Side note, I’m going to update Autosave soon to allow passing a filename to the relevant phrases directly. This would mean that Guide Mode can make its own autosaves separate from the game’s code without conflicts. (Currently you can do this by setting the autosave filename right before calling one of those phrases and restoring it afterward, but that’s a pain.)

Do you mean that the game could be doing something with autosaving, and that the extension could be doing its thing on the side? In other words, they don’t both have to pass through the needle eye that’s the autosave file name variable?

-Wade

Exactly. The reason to make it a global was because I was having trouble passing text from I7 to I6, but I think I’ve got that sorted now.

Finally downloaded and ran the Guide Mode example! It’s great seeing the readthrough mode taking forms elsewhere! I also thought it was interesting how you displayed the upcoming command, too. I’ll have to give that approach some thought.

2 Likes