Help me polish up a Minimal Twine-like interactive fiction engine

Hello everyone. Today I made a minimal twine-like interactive fiction “engine”. It fits in about 1kb minified code. There’s nothing fancy about it. The idea is that you can write very simple (clicking only, no parser) interactive fiction/choose-your-own-adventure stories in plain text, and this presents it in a nice clicky HTML way that can be enjoyed by others.

Here’s a codepen example: https://codepen.io/honeybunches/pen/OmgvrN

Here’s the github repo.

All it can do now is rooms/pages that link to one another, good for branching hypertext stories or very boring IF.

The format is to just write out text one room on a line, like so:

name|title|description

The name is a lowercase id, the title and description are what the player sees. Like so:

beach|A sunny beach|Sand stretches for miles either way, disappearing in to the distant haze, and the [calm sea:sea] murmurs and claws at your feet

Links are made by putting square brackets around the phrase you want to link, with the destination room’s lowercase id after the colon. In the example above, it will write out “calm sea” and clicking it will take you to a room with the id “sea”

I think this is pretty cool and want to make it slightly more capable, but not much more capable. My hope is to appeal to people for whom even Twee (the plaintext-to-Twine system) is too much bother.(e.g. it would be on a site similar to that codepen, but you’d hit publish and there’d be a homepage/feed of everything people make. And you could share your game embedded steganographically in PNGs, cool stuff like that)

So here’s my question: what more does it need to meet “minimum viable”?

  • images?
  • items/inventory/player variables?
  • things that cause changes to rooms (allowing puzzles and such)?
2 Likes

Also: would it be bad to further simplify the text format? The pipe-separated thing with three fields strikes me as maybe a bit too nerdy. Perhaps instead just have it with two fields:

a sunny beach:description text goes here bla bla bla isn’t this a nice beach we’ve found

(and the name of the room doubles as the system ID. I like this but fear it would be a case study in why reference IDs are kept separate from semantic names)

1 Like

Variables are a must. Being able to cause change to rooms sounds like it would make it easier to do things that are more complicated in Twine. Images are nice but overrated.

1 Like

Images seem pretty easy, though, so long as it’s just, like, a url to an image at the end of the line.

name|title|description|optionalimage.jpg

Making it absolutely dead easy to write stuff, that’s the only thing that makes it worthwhile IMO. As soon as it needs a GUI interface or anything, it’s already too complicated. So it’s a question of only adding things that can be accomplished by an author with simple markup.

Items then are easy, we could have lines for each item something like this:

name|title|descriptions|location

And the magic comes in how some appropriately minimal system of using/detecting the presence of items influences rooms and other items.

Which gets me thinking about whether there’s much point to inventory management, to making players figure out what to use with what. I feel that at the level of simple IF, you pick up and examine everything, and you end up using everything with everything to accomplish “puzzles.” So instead of having an inventory, instead of having to do all that stuff, things like this should happen when you first enter a particular room:

You see a red herring dead on the sand and pocket it

And then when you run into a lion later on, instead of having to figure out the clicks-only equivalent to FEED RED HERRING TO LION (and having to code such things into the engine) the game just says:

You throw the red herring at the lion. It munches it and you have a moment to escape

So all you’d really need to have done is visited the red herring location before meeting the lion. Which you would have had to do anyway in the more complex, traditional scenario where you EXAMINE FISH and GET FISH and THROW FISH AT LION

3 Likes

As long as I can make something slightly more complicated than this but faster. More writing and less “typing”.

1 Like

Already formulating ideas for Pac-Man: The Walking Simulator

1 Like

Really not a bad idea at all

1 Like

It is a maze of twisty passages, all alike.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.