lazerwalker / twison

A Twine 2 story format that provides JSON export
MIT License
148 stars 34 forks source link

Differences between other libraries #13

Closed Immortalin closed 7 years ago

Immortalin commented 8 years ago

Out of curiosity, what are the main differences/pros and cons between this and twinetojson or TwineJson?

lazerwalker commented 8 years ago

I hadn't seen twinetojson before. Looking at it, I'm not 100% sure how it works – it operates on "Snowman-formatted Twine story files", but Twine 2 doesn't generally store your work as userspace-accessible files unless you manually export. Unless they're doing some fun spelunking into Twine 2's internals, I'm guessing they're going to make you manually export or run your project, save it to disk, and then run that through their node/cli program, which is a few extra steps than TwineJson or Twison. Maybe @tinwatchman can illuminate.

This project actually started out because I was getting opaque errors trying to use TwineJson, and reimplementing its functionality myself ended up being quicker than diving into someone else's code. This project's main differences over TwineJson are (on the technical side) a far smaller codebase and strong test coverage, and (on the user side) an emphasis on both preserving the original Twine-provided data and augmenting wherever possible.

tinwatchman commented 8 years ago

Hello,

Looking at it, I'm not 100% sure how it works – it operates on "Snowman-formatted Twine story files", but Twine 2 doesn't generally store your work as userspace-accessible files unless you manually export. Unless they're doing some fun spelunking into Twine 2's internals, I'm guessing they're going to make you manually export or run your project, save it to disk, and then run that through their node/cli program, which is a few extra steps than TwineJson or Twison.

That's correct. I made twinetojson as part of a project where I was pulling passage data out of a Twine file and importing it into a server-side database. (If you're curious, the story was then displayed to users via server-side rendering rather than client-side. This allowed us to do something akin to a multiplayer game.) So as to not tie the library to a specific database implementation -- and to give myself an intermediary step where I might be able to check the data over myself before it was upserted -- I made the tool output a JSON file.

You're correct that my library does require exporting a story HTML file, and that this adds an additional step that your story format (which I naturally failed to come across before this point) does not. That said, this worked out for me anyway, since someone else was doing the majority of the writing on the project and he would've had to export his changes to a file regardless.

Anyway, glad to see someone else doing Node work with Twine files! I'll have to keep an eye on your stuff from now on.

lazerwalker commented 8 years ago

Makes total sense, @tinwatchman! This whole space is full of "I had a specific need, so I wrote my own thing to handle it" :). The idea of piping Twine output into a server-side thing to allow multiplayer is super interesting – would love to see documentation of the finished product if any exists!

For me personally, this project was essentially a stepping stone to realizing "hey, for what I'm doing I really want to just build my own frontend instead of trying to fit a square-shaped Twine UI into my round hole". (If you're curious, there's no real documentation yet, or even a proper authoring UI yet, but all that work is continuing at https://github.com/lazerwalker/storyboard)