Tutorial Time - Retrophantasia


Hello once again audience

As we resume with breakneck progress, I've began working on a much-needed tutorial section for our game; but what's a tutorial without DIALOGUE?  So.. today I began unraveling the expansive beast that is dialogue trees. 

Although our game isn't much of a text-based adventure, I wanted to provide some leeway in the system for branching paths in the future.

Dialogue Table

Dialogue Struct

The basic idea is that every character has their own DataTable, which has ALL possible dialogue for them across the entire game. I already have a saving system in place, so if the need ever arise for tracking NPC states-- the option is there. 

Each row of the data table is its own separate struct that contains info about when this text should appear, the dialogue itself, whether this conversation should continue, and what the next piece of dialogue should be. 

I think there's room to cut some fat and reduce the amount of rows I need by dynamically evaluating whether the text requires a fresh box, but I'm fine with it for now.. It's not like I plan to write a THOUSAND boxes of dialogue.. right?

Anyway; this works serviceably, and it wasn't actually that hard to write-- except for ONE thing.

The Beast

THIS Little piece of work took nearly 50% of the effort that went into making this system.

Since I'm a big fan of Highlighted text in old Zelda games, I thought it would be cool to both reference that and use it to guide the player toward the intended pickups, but it was simply not prepared for how I needed to parse all that info.

This piece of code basically kicks into gear whenever it senses the beginning of Markup code, denoted by a '<'. It skips ahead a few characters and starts writing to a temporary string until it sees another open bracket. Once it goes through ALL of that, it appends the temporary string to the real dialogue and skips ahead to where the main parser is actually supposed to read. 

This certainly isn't the most DYNAMIC solution, as I'm forced to use 1-character markdown tags, but it's a self-handicap I'm willing to live with if it means I don't have to play around with strings anymore. 

I love coding and I love video games. Retrophantasia's demo will be here sooner than later. 

'Till next time.

~ Jiggles

Get Retrophantasia

Leave a comment

Log in with itch.io to leave a comment.