Dealing with highly branching and non-linear stories in games can be pretty rough. There are a few available options out there: ink, Yarn Spinner, Twine, rolling your own custom solution.
GodotInk is an integration of ink. It needs the .NET flavour of Godot to run, but every feature is available from both C# and GDScript.
ink lets you write interactive narratives, for both text-centric games and more graphical ones. You can interact with the game state from your narrative by calling your own functions and/or reacting to changes in the stories themselves. It is quite battle-tested. Here’s an extremely incomplete list of games using ink as their narrative engine:
- Bury me, my Love[1]
- Dust and Salt
- Haven
- Heaven Will Be Mine
- Heaven’s Vault
- King of the Castle[1:1]
- Sable
- Where the Water Tastes Like Wine
And GodotInk lets you plug all of that into Godot without headaches. It uses the official compiler and runtime, which mean there’s no added latency a port would have when something new releases. It also adds a lot of quality of life features:
- Stories as resources
- Automatic recompilation of
.ink
files when needed - API fully accessible from C# and/or GDScript
- Receiving stories updates through signals
I suggest reading the quick start guide to begin with.
A dedicated branch is also present on the repository with an example[2] of how a small top-down adventure game could be implemented. The following is pulled from this example to show a few use cases.
Interacting with a gameplay element triggers a story.
Note that you’re basically just pulling text, so it’s possible to use bbcode directly. Stories have an internal state (here, the player’s inventory is managed through that state), and the flow of the narrative is conditioned by that state (the presence of the key in the inventory changes what happens). They can also interact with the game state (here, tilemap cells are updated from within the story).
Stories can present a list of choices, and wait for one to be selected.
Choices can be “consumed” (here, the first choice is never shown again after we’ve run through it once). They’re also, like everything else, conditioned by both the story and game states.
Have a look at the story for the flower girl.
I hope I at least piqued your curiosity. This covers only the very basics, and the language itself has lots more to offer. I recommend the Writing with ink page is quite a read, but is very thorough.
All the assets used are released by Kenney under CC0 1.0 Universal. ↩︎