Choba, an experimental choice-based IF engine

I’ve released a first version of Choba, an experimental choice-based IF engine written in JavaScript.

Although I don’t claim it to be immediately useful to anyone except myself, it’s open source: https://github.com/jhorneman/choba-engine.

Announcement blog post: http://www.intelligent-artifice.com/2016/02/announcing-choba-experimental-interactive-storytelling-engine.html.

It’s used in a game I worked on last year for the Procjam: http://mainframe.intelligent-artifice.com/

It’s currently parser-less (I told you it’s not immediately useful :wink:) and sparsely documented. Internally, it uses a Lisp-ish expression language to build scenes. There is some minor procedural content generation in there.

It’s reasonably clean JS with few dependencies. It’s been designed to work well in the browser but it should also be possible to port it to mobile (React-Native) or desktop (NW.js or Electron).

Future plans: a parser, tools, more procgen, ports.

I don’t consider myself an IF expert, and I’m not claiming Choba will set the world on fire. But perhaps it’s interesting.

Congratulations! The example game looks great.

If it’s a choice-based engine, what’s your plan for the parser?

Hey Carolyn :slight_smile: Thanks, most of the creative work on Mainframe was done by Liz England.

I plan to write one from scratch, in JavaScript. I was just working on the design, in fact.

Mainframe originally used XML because that was the easiest to get running during a game jam. But I’m not a fan of XML and some constructs are awkward to express. E.g. … is fine. But …… is ugly, I find.

My initial direction is to look at web template systems for inspiration, because that fits IF well, I think - content interspersed with logic. So perhaps:

{if }…{endif}
{if }…{else}…{endif}

I’m now thinking that through and seeing whether that’s a good idea.

Writing the interpreter before the parser is perhaps a strange approach, and there’s a risk that it will limit me when writing the parser. We will see :slight_smile:

Jurie

The example game looks lovely. Wishlist: inline links (links in prose). Multimedia. Undo (browser back). Persistence; Save-and-resume/saves.

For Mainframe (the example game) or for the engine?

For the engine mainly. I would like save-and-resume for Mainframe.

What I meant was, why a parser on a choice-based system? Will this be a hybrid system eventually?

Oh! Ha. That parser :slight_smile: Sorry, completely misunderstood your question.

No, I meant a parser that turns a writer-friendly format into the format the engine reads.

What do you like about inline links? (I’m not saying I don’t like them, I’m just curious.)

Ah-ha! Now I understand. (I’m so used to talking about parser IF vs. choice-based IF that this definition of “parser” went straight past me.)

What ho, that demonstration game is a strong start! You’ve out-Twined Twine!

Thanks :slight_smile: Most of the creative work was done by Liz England, who has also worked with Twine. Twine can still do a lot of things Choba can’t.

Briefly, inline links are quicker. The difference is more obvious for long nodes like a page long.

Thinking about it, a separate link section has some advantages e.g. you can put links in boxes so they are more distinct (and easier to select on a small touch screen where my fingertip is the size of 3-5 lines). Placing links together in a separate section from prose emphasizes that they are alternative choices. Leaning towards interaction as a big important choice model. But a digression or footnote link which soon links back to the parent node seems like a trivial choice. Quick links correspond to impulsive choices - you can act hastily without further thought.

Good points. I also like inline links as a pseudo-interactive way to control pacing.

The thing with a digression link is, where does the new text appear, and what happens to the old text? Does the new text appear inline? Does the old text go away? I can imagine all of those options.

Inline text expansion is cool. Personally I like the old-style separate nodes for digressions. Unless an inline expansion is small (like one line) I lose my place reading - but it’s a popular mechanic. I suppose highlighting (a temp outline?) the expansion could help. The other day I played a game where the text mutates by itself right in front of you!

Would it be possible for games made in Choba to be distributed for offline play? For instance - say you zipped up all the files necessary to play Mainframe, could you distribute that zip and have the game be playable offline?

…in fact, could I ask you not to be hypothetical and to indeed distribute that file? :slight_smile:

One of the reasons I wrote Choba is so we could do that :slight_smile:

I’m not sure if it works if you play it as a bunch of files on your hard drive, there are some restrictions with that.

tries it out

OK, everything works except the background images. I’ll talk to Liz about it.

Well, that’s excellent news! Many thanks!

It may take a while!

I’m patient. :slight_smile: Others around here may disagree, because I’m also insistent, but hey, if someone tells me it’s coming - then I can wait.