Story Importer
It’s been a while since the last (and first) update, but work is continuing. Whilst I did make progress, I came to realise that the way I was previously handling the flow of the story was going to quickly become cumbersome and annoying, so before I got too deep, I pivoted.
The Problem
Originally, I was planning on having the entire flow of the game within a JSON file, like this:
[
{
"Message": {
"Contents": "Hi there, this is an example.",
"NameOfSender": "JohnDoe"
},
"Responses": [
{
"SentTo": "JohnDoe",
"Triggers": 1,
"Contents": "Oh okay, that's cool."
},
{
"SentTo": "JohnDoe",
"Triggers": 2,
"Contents": "Hmmm, suspicious"
}
],
"Id": 0,
"NameOfOwner": "JohnDoe",
"TriggerDelay": 10
},
{
"Message": {
"Contents": "Nah, it's clunky.",
"NameOfSender": "JohnDoe"
},
"Responses": [
{
"SentTo": "JohnDoe",
"Triggers": 2,
"Contents": "Oh okay"
}
],
"Id": 1,
"NameOfOwner": "JohnDoe",
"TriggerDelay": 3
},
{
"Message": {
"Contents": "Why?",
"NameOfSender": "JohnDoe"
},
"Responses": [
{
"SentTo": "JohnDoe",
"Triggers": 2,
"Contents": "Just is"
}
],
"Id": 2,
"NameOfOwner": "JohnDoe",
"TriggerDelay": 3
}
]
This would then be loaded into memory, and the game would just run from there. The file was generated from a Canvas file made in Obsidian using a tool I made to parse the file’s contents (which is just another JSON file). If I wanted my game to just emulate a chat and have no more depth than that, I think I could’ve continued along this path — even if it was less than ideal; however, after building out the first few minutes of the story, I realised this was not going to cut it.
The tool I wrote to convert the canvas file into the aforementioned JSON file above only handled messages, responses, and which response triggered which message; however, as it currently stands, I have the following node types I need to handle:
- MessageAndResponses
- MessagesOnly
- ResponsesOnly
- InfoNew
- InfoCheck
- ReputationChange
- ReputationCheck
- GroupCreate
- GroupDelete
- GroupAddMember
- GroupRemoveMember
- MessengerStatusChange
- NewFriend
- Unfriend
- Block
- Unblock
- Wait
- Ending
With how interconnected parts of the story get, the JSON file was going to get big and also harder to test as I went on.
The Solution
SQLite. I wanted to avoid managing schema updates and the development overhead adding a database brings to the table; however, what started as a spike eventually turned into the tool I’ll be building on top of moving forward. The new tool creates a new .db
file, creates the schema using EFCore, seeds it with the necessary static data, parses all of the nodes, ensures that each type of node has the relevant data defined within, and validates that everything is linking to what it should.
Now that I have the database, I’ll be using EFCore in the backend of the game to manage the flow of the story and keep track of the choices, relationship changes, discoveries, etc. There will be more changes required to the tool as I implement new features, but I’m happy with the way I’ve architected the tool so that this won’t be an issue.
As mentioned above, I’m using Obsidian’s canvas feature to design the story. This allows me to build the story visually, and then build the database from its contents. I did look at some other alternatives for non-linear story development — some of which even had integration with Godot. None of those options ticked all of the boxes for me.
Maybe I’m wrong and I’ll come to regret this decision, but that’s all part of this journey.
What’s Next?
I have a draft of the beginning of the story. Whilst it’s only around 10-15 minutes of gameplay, it already uses a lot of the various node types I’ve defined. So my next move is working on the logic of the game itself. I need to take the data from the database and then make sure the game handles that as expected. The good news is, once I have this full workflow working together, development should move a lot faster.
This is a screenshot of the story so far:
So I’ll continue along this path, and I’ll share my progress as I go.
I noticed I did get some readers on my initial dev log, for which I’m thankful — feel free to follow this project as I move forward. I’m looking forward to one day releasing something I hope you’ll enjoy.
Until the next one!
NexOS
Status | In development |
Author | MrDKOz |
Genre | Interactive Fiction |
Tags | Dark, Godot, Indie, Mystery, Story Rich |
Languages | English |
More posts
- First Boot...Apr 09, 2024
Leave a comment
Log in with itch.io to leave a comment.