V3 release bringing ultimate flexibility, customization and extension
July 15, 2017Announcing the release of version 3 of the Elm Narrative Engine!
Until now, games on the Elm Narrative Engine have all basically looked the same. That is about to change.
The release of version 3 has been completely redesigned to allow for ultimate flexibility, customization, and extension. The engine can now power many different types of narrative based games.
If you can imagine it, you can add a story to it.
Why?
Initially, client code (the game files the author would write) was little more than a config file or manifest that the engine would consume to spit out a game. The engine was in control how the game worked and how it looked.
People started asking questions.
“What if I want a different layout?”
“What if I want to embed the story inside a larger app?
“What if I want the story to progress based on geolocation?
“How about 3rd party plug-ins and tooling?
“Can I make it looks like Twine?
And so on.
With the new design, all of that and more is now possible!
How?
Unlike before, the design of the engine has been completely decoupled, creating a total separation of logic, content, and presentation.
-
The engine handles the logic with the same rule-matching approach from before. It holds the state of your story world model, and updates it based on the matching rules.
-
The content can be anything you want. Each matching rule has a unique id, which you can match up to any kind of content – text, “rich text” intended to be parsed, a dialog tree structure, arbitrary code, an image, a sound file, a video, etc.
-
The client defines the views for the presentation and can query the engine for any information about the story world. It can request and render a list of inventory, or not. Or it can render the content of choice how ever you like, for example, playing a video clip or rendering an interactive dialog tree.
Also, instead of the engine “running” the client code, the client can be its own app that “embeds” the engine, interfacing with it through a new, more open API. This lets the client run its own logic in parallel to the engine to do anything it wants. It also can tell the engine to arbitrarily change the state of the world model, or respond to matched rules on its own. This opens up a world of possibilities, such as building multiplayer interactive fictions, or tracking choices the player makes and comparing them to other players.
What can it do?
As a demonstration of types of games that are now possible on the new engine, I made a few new sample games that were not possible before.
In the video above, I go into detail on how I used the “Entity Component System” pattern to make the above games, and how that even made it possible to integrate with other tools and game frameworks.
Change log
This version is a major architectural shift from previous versions, allowing for extreme flexibility. Some notable changes include:
- updated to Elm 0.18
- top-level module namespace changed to
Engine
- the view layer has been completely removed from the engine. The engine solely handles maintaining the story world state by matching interactions against rule sets.
- exposes many accessor functions for the client to use as needed
- rules are now matched based on a weighting scale to pick a winner when multiple match
- some new/different matchers and change world commands
- replaced
withItem
/withCharacter
/withLocation
with simplywith
, as there are no technical differences between items, locations, and characters - ids are now Strings instead of types, allowing for dynamic generation and serialization, and also fitting well with the Entity/Component/System pattern
- added
changeWold
function to directly alter the story world - added
chooseFrom
function to encode conditional choices in data - scenes are now just another condition rather than a grouping of rules