loading . . . Dialogue, Quests, Refactor | Sigil of Kings For the last few weeks I've been working mainly on dialogue and quests, as it's definitely a tricky one to solve, for procedurally generated quests. Dialogue - supporting shared dynamic topics In a previous quest scenario, we have a mine overrun by fire elementals. The quest giver (e.g. nearby village chief) gets some text, but everybody else, miners included, don't seem to care/know about it! So let's fix that. The simplest approach is to edit the dialogue tree and add some relevant mines to entities of interest. But it's extremely important that this is lazily evaluated, as imagine for example the following scenario: We have the main quest being completed, say the world is saved, and everybody celebrates in some way. "Everybody" might mean ten thousand entities. Do we go and edit each one when we decide on the dialogue? No. We use a shared dynamic conversation topic with an associated entity filter, which basically dictates if an entity is able to chat about that topic. We go through a global list of these topic/filter pairs each time we start a conversation, to see what needs adding (or removing) to the conversation topics. That's about it! Implementation-wise things get a bit more complicated with several corner cases. For example, sometimes, this "quest is over, thanks pal!" message should appear only once, instead of repeatedly. Also, we should be able to remove the entity filter and topic after a while, for keeping the list of dynamic topics under control. Currently this is done by assigning a timeout (e.g. 1 game year), after which people "forget" to make such comments as life goes back to normal. Dialogue tool At some point I need to write more dialogues. At the moment, the dialogue tree structure is of course some complicated json format, that supports a number of things like exiting conversations, jumping back to previous topics, show topics conditionally, execute actions with certain choices, etc etc. But of course, some times, or as a starting point, we just want to write a simple dialogue! And very importantly, to visualise it. For any sort of tree visualisation, I usually gravitate towards graphviz dot, as it does the job with nice simple text input. I did write a bunch of prototype tools to edit dialogues, but in the end I reverted to an in-game Dear ImGui-powered tool, added to the arsenal of other such tools. The extra interesting bit there is that I can quickly generate and visualize a dialogue tree, but editing the tree is still painful, so that might need work at some point. Questing A few bits of work here. First of all, some debug console commands for quest or objective progression and completion (successful or not). Pretty sensible and essential really for any non-trivial quest. Some other work involved fixing a bug related to when a quest reward was given, e.g. for the mine scenario I need to add an objective e.g. "Return to the Village Chief" which becomes successful when we interact with the village chief, at which point the reward is provided (e.g. treasure, gold, XP, etc) Game Log The more I look at other game GUIs, the more I realize how huge my fonts are for a lot of cases. I targetted the game log this time, made it smaller and added some alpha grading for older entries. The reason I ended up working on that was because I wanted to show information in the log for items received or lost, e.g. when completing the quest and the player receives the items, there should be some indicator that this happened. WIP: items of ability execution This is a tricky one, as it's work in progress and required quite a bit of refactoring. The game will contain magic scrolls as items, where the scroll will allow you to execute an ability once, at a specified level. Now there are a couple of issues: executing an ability to a given level required a little bit of refactoring, and the other problem is that using the scroll is an ability by itself, so in the middle of an ability execution we need to schedule another ability to happen immediately after. It's not too terrible in theory, but I'm still in the middle of this. The end result of this is that we can have potions, scrolls and wands being able to execute different abilities at fixed levels, so we can have something like a Greater Potion of Blur which would cast a "blur" spell at a fixed high level, that improves evasion. That's all for now, have a nice weekend! https://byte-arcane.github.io/sigil-of-kings-website/2025/08/08/dialogue-quests-refactor/