DEFORK - easily create interactive, nonlinear stories, dialogs, conversations

Hi,

I would like to introduce to you DEFORK - an example of how a json data exported from Twine - a tool for creating conversations, can be used to easily create interactive stories in Defold - with DEFORK! :wink:

logo
Logo made with DesignEvo

I was looking for a tool to easily create conversations for my Pixel Art: Witchcrafter and started to play with Inklewriter, but unfortunately they shut down the project in August 2018. However I was suprised how such conveniences are needed in developing a narrative driven game. So after all, now Iā€™m using Twine to create dialog json data in this tool.
Defork utilizes an awesome library - RichText by @britzl to conveniently and easily show loaded data and create interactive dialogs with handled input.

With Defork you can easily:

  • load json data exported from conversation making tool, such as Twine
  • get text, options and links leading to next dialogā€™s nodes
  • store and manage current links, options and flow through nodes
  • use RichText to easily show dialog window, modify text effects
  • modify data by adding actors, colors and custom text effects
  • add images, portraits or emoticons to Rich Text
  • manage input and handle transitions between nodes

Here is another example of what you can do with Defork, you can modify almost anything:

dialog_defork1

With Twine and Twinson format you can export data and create a json file in a project folder, which you can attach to custom resources in game.project. In Twine remember to Change Story Format to Twinson, so after clicking Play you will get json data.

With a tool like this you will be able to separate story and dialog creation from other game development activities. Defork and an example Defold project with an example json data compatible with current Defork module is available here:

I hope it involves you to create fantastic, nonlinear, interactive stories! :wink:

Happy Deforking!

P.S.
I canā€™t add any asset on the asset page. After clicking ā€˜add assetā€™, projects available to attach arenā€™t showing and itā€™s loading all the time. Can anyone help me? It would be nice to attach Defork module via Dependency Library from game.project and add html5 example :wink:

25 Likes

Pawel, this looks awesome! Well done :smiley:

Damn, sorry to hear this. Just to clarify ā€“ is the problem youā€™re having related to the image below; that you donā€™t have any content in your drop-down list? If soā€”do you have any projects in your Dashboard? You currently need to base your community page on an existing project created from the Defold Dashboard.

If this wasnā€™t the issueā€”what browser/OS are you using?

1 Like

At last, I logged out and logged in again to my defold account on the page and they are loaded now :wink: I will now describe it and add to the asset page. I have a question about storage - can I attach link to GitLab or is the page supporting Github only as it seems? And then, how can I make Defork lua module a dependency library that can be added in game.project easily?

2 Likes

The ā€œAdd Library URLā€ feature currently only supports libraries hosted on Github or Defoldā€™s servers, as seen below.

There are two options which I think are viable:

  1. Transfer your GitLab repo to Github, and add the repo to the ā€œAdd Library URLā€ setting on your asset page.

  2. Keep it in GitLab, and edit the Description on your asset page to something like in the image below.

Make sure youā€™ve set your project up for library sharing first, thoughā€”see the manual for more info.

3 Likes

I would like to thank @Axel for a support, Iā€™ve managed to add my first asset on the page. Sorry to be an unusual user, but hopes it helps to improve website. Now everything works fine on the page and the project is on GitHub. Iā€™ve also created a whole API with detailed descriptions, so everything should be now clarified :wink: You can also check HTML5 playable demo on the page! :wink:

8 Likes

No worries at all, just glad to be able to help. And thank you for the reportsā€”it helped us find an unknown bug which we will ship a fix to next week :slight_smile:

3 Likes

Thatā€™s cool. Iā€™d note that Inkle Studioā€™s current tool is Ink which also exports JSON and is designed as middleware (they usually work with Unity) so if you ever need to go beyond the limitations of Twinson you could try looking into Ink.

4 Likes

Yes, I saw Ink also, but I had some problems decrypting the json file, so I gave up and tried with Twinson then, especially because it was open-source and available too. As Defork was only meant to show an example of using such tools, adding other format of json files would be a great addition to this, though! :wink: Ink has many advantages, as well as other conversations making tools. Worth taking into consideration are Chat-mapper, Talker Maker:Deluxe, Chronicler and my favorite - articy:draft - as I saw in a trailer it is used by my motherlandā€™s studio CD Projekt RED in upcoming Cyberpunk 2077! :smiley:

2 Likes

I am checking out Arcweave (arcweave.com) now and it has pretty useful tools for creating non-linear dialogues(/interactive stories) and also an option to export to json - I will try to adapt Defork to parse those files and use in my dialogs - if it will work, I will publish such parser in the Defork repo :wink:
It is free for unlimited projects with up to 100 elements and 2 editors, which should be enough for indie, higher options are paid monthly.

11 Likes

Hello! Sorry for bringing this thread back from the death but I havenā€™t found a newer one about DEFORK.
Iā€™m new to Defold (migrating from Unity) and Iā€™m searching for a branching narrative solution.
Currently Iā€™m between Twine and Ink.
Twineā€™s visual editor seems more suited for my purposes and Iā€™m glad you made DEFORK to import Twine jsons, but Iā€™m wondering if variables and conditionals are supported by your framework, because I will really need them.
Thanks! :slight_smile:

1 Like

Besides DEFORK, you should also take a look at these Defold extensions:

1 Like

Thanks, I have also taken a look at them, but since I find the Twine visual editor better suited for my project, Iā€™m prioritazing Twine for the moment. If DEFORK doesnā€™t support variables and conditionals, I would have to either implement them myself or switch to Ink and use Narrator.

1 Like

Defork was not being updated, because I am not using Twine anymore and variables and conditions were introduced later on.

Iā€™m using ArcWeave right now and my DefArc module is pretty much up to date (at least working will all my dialogues) and supports conditions, variables etc.

If anybody has a time and strength to add support for Twineā€™s new features and revise Defork branch - its fully open source and I would gladly accept PRs or welcome a (nomen omen) fork branch - it would be great to have it in our community :heart:

4 Likes

The thing about ArcWeave is that I donā€™t want to support subscription services.
I know there is a free version of ArcWeave, but I really donā€™t want to enter an ecosystem based on subscriptions ever again. (I come from Unity and I got burned for life on this)

Iā€™m still evaluating all the options, but if I end up using Twine, Iā€™ll probably make a fork of DEFORK adding variables and conditionals support.
Iā€™ll let you know if thatā€™s the case. :slight_smile:

4 Likes

I tried Twine and I didnā€™t like it, INK is much better to me. Let me explain :slight_smile:
Yes, Twineā€™s UI looks cool and if you have a small game with minimum logic in twine script it works well. But, imagine few hundreds of blocks and your layout turns to hell as well as Twineā€™s performance.

And mixing script with text very quickly becomes a mess, no variable validation only makes it worse. I had that experience porting about 500k words from Twine to ink.

Ink has a nice editor too, but without graph. You can split your code in multiple files easy to work, it has validation and code is not such mess (however itā€™s better to avoid excessive coding). And with Narrator or defold-ink itā€™s easy to make your ink script play in Defold.

5 Likes

Yes, I read that Twineā€™s visual view could be a nightmare on anything more than simple projects, but I find Inkā€™s lack of it even worse: from my point of view, on Twine I can spread the game on two axis, X and Y, and have a quick overview zooming out. While on Ink, I can only spread the game vertically, ending like a wall of text.
I didnā€™t think about dividing an Ink game into multiple files though, and that way organization could be good: after all, thatā€™s what we do when programming.

What is your personal experience with Ink?
And also, have you dealt with translating an Ink game?

I tried to use Twine for quick prototyping, but very quickly abandoned this idea - really hard to read all this text\code mess. Ink was like a breath of fresh air - fast prototyping, ability to reuse prototype in actual Defold game. You can keep all logic and dialogs in ink and use Defold just for rendering and UI, manipulating scene from ink script (e.g. by sending commands via tags).

Drawbacks - ink is still evolving, json compiled with newer version of inky might not work as you expect, itā€™s possible old code wonā€™t even compile - itā€™s the issue with Inky & defold-ink (works with json, format changes from version to version). Narrator uses its own parser and doesnā€™t have this problem, but can have issues supporting new features (itā€™s not so easy to add new parsing rules and its codebase is much bigger).

Localization can be easy or hard - it depends on your game. If you have a lot of text modified inside paragraph by some logic - I have a bad news :slight_smile:
Anyway itā€™s not that much different from localising any other game - lua table with [ā€œoriginal text stringā€] = [[translated text string]] does the job. Plus some stuff like setting the correct font for each language.

5 Likes

Totally support the words of @Ivan_Lytkin. I just canā€™t imagine how to physically represent dynamic capabilities of Ink in the readable node graphs. Splitting into files is an required approach if the game is more than 5 minutes long.

But that doesnā€™t take away from Twineā€™s advantages, for example, if the structure is simple and straightforward, which is often the case.

Iā€™d like to add about localization that ChatGPT is capable of translating Ink script with preserving the original syntax. It translated a small 40kb file without a single Ink syntax breaking error.

2 Likes

After trying Twine for a while and reading your posts, I think youā€™re right and Iā€™ll go with Ink instead.
Iā€™ll avoid Inkā€™s exotic capabilities and keep it simple to make translations easy.

The ChatGPT direct translation is SUPER interesting! Thanks a lot! (although I wonder if it will also translate variables and knot names, which would be problematic and render save files incompatible between languages)

Now, if anyone knows about an actually good text-to-speech AI service or software, that would be perfect! :stuck_out_tongue:

1 Like

Thatā€™s the surprise that it translated only the literature text for me, all the variables remained the same, all the syntax was in the original. Just ā€œcopied and pastedā€:

2 Likes