Adventex: A javascript framework for interactive fiction

Hi there,
I created a javascript framework to design text adventures playable in an internet browser. You can test it by playing a simple escape game here:

The game and the source code are completely free. The source code is available on github:

Let me know what you think!
Bildschirmfoto vom 2018-03-24 11-18-09.png

I like this a lot. I like clicking a verb and a noun, or just the noun to examine, that’s good. I tried to play just with the mouse.

Where I ran into problems is when I discovered the trap door under the straw there was no “trap door” link to click, so I had to type. That makes it awkward on mobile.

You list interactable nouns below the description which makes it feel very Scott Adams. As the initial description and noun list scrolled away, I kept having to scroll farther and farther back to select a noun. It would be nice if every time a noun was mentioned, it was a link to click. If the links were inline with the text, you could do away with the row of nouns (unless you like that, stylistically.)

Nice job though, I could see this being a very useful framework for IF.

It’s cool! I like the text effect features too.

The implementation is neat, and i like the way it’s all driven, essentially, from gamestate.json. What i can see going forward though, is a need to expand on the complexity of action prerequisites and on state change triggers.

For example, sooner or later you’ll need to call user functions as part of perquisite tests. I’m wondering how this can be accommodated in json. Stuffing some javascript in there would be messy. Maybe there could be abstract prerequisites that correspond to user function calls somewhere? not sure. This is one reason why IF systems often develop their own domain specific languages.

The same argument goes for object state changes; what if changing the state of one object requires updating the state of another, or maybe performing some custom user code somewhere.

An example of this in your “escape” game is that you can get the torch, then the stone, drop the torch, get the torch, THEN get another stone! I had a whole list of stones in the end :slight_smile: The problem is that the special get/drop torch prerequisite handlers can’t check sufficient state of the stone. This could be fixed by making the stone only appear once, but then what if i put the stone and the torch back in their original places and repeated my actions. There’ll be other bizarre cases too.

one other observation;

You store what things are where, rather than where things are. In other words, a list of things in a location rather than having things store their location.

I can see why this is; it’s to solve one of the classic IF problem of how to have something in two places at once - like doors. A door connecting room A to room B is in BOTH A and B. This works nicely when you store lists of things at a location. Your system does this for the cell door and it works great. Other things that fit this model are scenery objects, like the cell bed. Since it has no state, it can be in multiple locations without problems.

I claim you’re going to run into trouble when you wish to store coordinated locations; “in”, “on”, “under” etc. eg book on shelf, coin in box, key under clock etc. Unless i missed it, i didn’t see any code for coordinated location in your system. I think the answer to this is to store an object location as a set of coordinated locations, rather than storing a list of things at a location. You can still store things in multiple locations so long as you don’t think of THE location of something, but A location of something.

Best of luck with the system. It looks promising!

Thank you both for your feedback!

It is my intention to make this user friendly on mobile phones, I am working on that after being happy with the interactive fiction framework itself.

To the remarks regarding the object system. You are right about why I decided to have a list of objects in the location. Your example with the stone was just a misuse of my event system, I fixed that and also added the functionality to actually move objects from one to another location. Before that, you had to remove an object and recreate it somewhere else, a bit cumbersome. Just check my recent commits on github.

The possibility to add user functions is more tricky, I have to think about that. Maybe I only allow user defined actions in the event system, that could be done by having user defined javascript files.