jschomay / elm-narrative-engine Goto Github PK
View Code? Open in Web Editor NEWA tool for building interactive fiction style stories in Elm.
Home Page: https://enegames.itch.io/elm-narrative-engine
License: Other
A tool for building interactive fiction style stories in Elm.
Home Page: https://enegames.itch.io/elm-narrative-engine
License: Other
I have a commit to push
I've given a lot of thought on the dsl for the story rules, and if you've seen my ElmConf presentation you know it went through a number of iterations.
However, I'm thinking of changing it one more time!
Reasons:
I really like Luke Westby's forward apply approach, and think it would work well, though it does have some implications on the design.
This is what it would look like:
myStoryRules =
[ Story.rule
|> onInteractionWith (location Hallway)
|> when (inLocation Kitchen)
|> moveTo Hallway
|> narrate "You find a back door leading out..."
...
]
That would build up a record for a story rule of trigger
, condition
, commands
and narration
.
As nice as that is, it loses some constraints from how I have it currently:
Although these implications change some of the fundamental ways of thinking about story rules, I think they make sense and are even more expressive. One downside is losing the possibility to specify all
or any
when giving multiple when
s. I don't see a clean way to add that to the dsl.
Thoughts?
For what it is worth, here are some other alternative approaches that I have considered, but don't like as much:
howItIsNow =
[ interactingWith (location Hallway)
`when` (inLocation Kitchen)
`changesWorld` []
`narrates` afraidOfHallway
]
rawRecord =
[ { trigger = interactingWith (location Hallway)
, condition = (inLocation Kitchen)
, changes = []
, narration = afraidOfHallway
}
]
constrainedTuple =
[ ( interactingWith (location Hallway)
, when (inLocation Kitchen)
, changesWorld []
, narrates afraidOfHallway
)
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.