Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Loading: Dialogue Data

Today was a doozy. What should have been simple ended up being stupid, so I got smart. I ended up using at least 5 different chat instances with Gemini to get things working. I really only expected to need 1. . . 

I started out by feeding a fresh chat instance with my data manager, dialogue definition, and initial dialogue data. I asked the AI to just copy the functionality that exists for quests and items to load dialogue. At first it seemed like all was right in the world. But then when I actually started the game up I get an error. 

Somehow the AI managed to get confused and started loading item data into dialogue, or was it dialogue data into items? Whatever it was, it tried to fix it but made things worse. I started a new chat with the same instructions to try again, but forgot to include the files, so it just spit out some garbage.

I did it again, this time with the files attached, and it did the same thing as the first try! I was getting frustrated so I changed my approach. I started a new chat and had it break apart my JSON loading function. I made it so each "type" had it's own function. So now, depending on the type of data (technically it's based off the target variable for the data) a different function is called when the JSON is loaded. This keeps the item and quest data a bit more separated.

After that refactor, I tried once more to get the dialogue data loaded. I had Gemini create a new function based on the other two. It looked great, but didn't work due to a simple variable type. A quick fix later and now my dialogue data loads! There's still more I need to do to my data manager. Right now it loads individual files as I assign them. I'm thinking I may want it to instead iterate through all files in a folder. Maybe later I'll do that. I've raised an issue to remind myself.

So, what's next?

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.