Conversation and Journal Screens
Conversation System
For the last couple of weeks I've been working on the conversation system, yet again. As with a lot of systems that I develop, the first version usually leaves a lot to be desired. The problem with the previous version was partly architectural, partly premature optimisation, and partly non-encapsulated code. The architectural aspect was that entities kept conversation branches as a component, and part of the optimisation problem was how shared topics and the conversation tree were stored there. The end result was that writing dialogue was complicated and error-prone, especially when coming back to it after a long time, and inevitable bugs would be hard to fix.
One of the challenges that I face, and I bet I'm not alone, is that when I start making a system and the high-level aspect of it is set it place, it becomes really hard to judge the system and see outside of that self-imposed box. The only way is to let enough time pass, so I can see it with fresh eyes. And of course, when I see with fresh eyes some "first version" system, there's plenty of "WTF was I thinking". With a small project, the idea is "just release it and use knowledge for next game" but I'm not taking that approach.
Back to the new and improved conversation. The new approach starts with the question "what if we don't store entire conversations in entities". The question then gets refined to: "Given some conversation presets, what information do we need to construct a custom branched conversation, when needed?". This bespoke information is usually related to quests, rumours and trade, at least so far. Working from that baseline has been enjoyable and effective, and there are just a couple of things that need ironing out, such as knowing when we've exhausted a conversation subtree. Also, as this work is tightly coupled to quests, there's some relevant refactoring work there too, for the quest conversation parts.
A side-effect of this work is the addition of rumours: it's basically a dynamic conversation topic, that some entity can have if passing some condition. We can figure out which rumours an entity can tell us about the moment we start conversation. This is also where the premature optimisation mentality had to be pushed back: there's "plenty" of work to be done when we start a conversation - go through all quests, not started, running or completed, and look if there's anything relevant to this entity. For <100 quests I can't foresee a problem, and if there are any performance issues, caching is also possible, but that's future work if necessary.
Journal screens
I've also been working on conversations has resulted in working in other adjacent systems like some of the Journal subscreens. The Journal screen is a basically meant to be the knowledge-base of the player. It now contains tabs for cities, quests and skill trainers:
- The quest tab contains all quests, completed or not, and information for each quest (objectives, reward, etc). It also supports setting location tracking, if provided by quests. I did a bit of a revamp on how this looks. The location tracking is fun, but I currently have the "fun" subproblem which is a result of my weird rendering approach (game rendered in a Godot Sprite, and UI on top), which is that the location tracking arrows could be behind UI elements. Oops! Fix for later.
- The city tab contains the list of cities in the world, and it contains information if the player has visited, otherwise just the name and its size. I had a thought of partially populating this based on rumours, stay duration etc, but might be too grindy/fussy. The plan is to create rumours for partial city information, but not in a way that it registers in the knowledge base. e.g. Cities X and Y hate each other. City X has a surplus of food reserves. City X has very strong army. City X has a Wizards Guild (this one will be registered in the knowledge base, but in future work)
- The trainers tab contains all skills, and where to train each skill at what mastery level. Trainers are strictly guild chapter heads. Trainer information will be obtained via rumours, e.g. "Hrothgar, the head of the Warrior's Guild in Falcon's Crest, can train Experts in Dual-Wielding".
Here's a video that shows the (new) city and trainer screens
Some associated fun bit of work was to add some logic to create guild chapter heads/trainers taking into account the guild type, the city race distribution, skill mastery levels, attributes of different races etc, so that e.g. a trainer who is a grandmaster in Fire Magic would probably be of a race that has a good intelligence modifier (which is a primary skill for fire magic) and probably of advanced years and level.
