The Bunny Quest
The theme of this week was mostly quests again, and in particular, facilitating a specific generalizable scenario: the ... Bunny Quest! or, more boringly, a dynamic escort quest
Dynamic escort quests
This is a staple RPG quest, so how do we implement that? A static scenario, where everything is known in advance, it's easy: pick the entity, adjust the AI to go somewhere specific, and form the quest around that. However, what if we don't know the entity yet? What if the chosen entity is picked based on particular conditions? What if the quest should start only after you've seen the person? So, I did a bit of ground work on that, that led to a proof of concept, and several improvements overall:
- There's a "blackboard" per questing entity for quest-related data, for example we can set up:
- a condition that "if we see an entity that matches a given filter, then write sth to blackboard"
- on success, we fire up a "creature-based" quest generator, e.g. this could be a "escort creature to safety"
- when the quest generator runs (after the condition gets satisfied and blackboard has been updated), we look up the blackboard for a given value to instantiate the quest
- Location markers can be dynamic! E.g. we can track the bunny and the position that it's aiming for. Some extra functionality was needed for this
- Create an effect to "remove from game" or "send to limbo" to run upon quest success (e.g. bunny reaching an exit)
- Creature AI now supports some additional high-priority targets, so that a creature can run its AI in addition to extra temporary goals, like "go to that place". Targets at the moment can be static, and I haven't really tested it in conjunction with more complex behaviours. Some future work here is to add a moving target, and to follow that target up to a certain provided distance.
- Some quests can be secret, and revealed only if you complete some particular objective. Also, some objectives can remain hidden. All this can assist narrative, setting up objective chains/dependencies but only sharing with the player some parts.
Non-determinism
I spent a day or two (well, a few hours each) trying to solve some non-deterministic bug. And here I thought I was done with the rng work! So, long story short, there were two bugs that both caused non-deterministic behaviour. The first was in the temporary object pool, for which I rewrote the core more simply. The second was extreme silliness that's hard to catch. After a savefile has been loaded, I call a post-load function on all systems. Well, some of those functions used the game RNG, which means by the time the savefile is loaded, the RNG is in a different state. Yay! Anyway that's fixed, back to deterministic behaviour, even with a bit extra functionality to force all realtime-based code to work in a repeatable way.
A bit of GUI
I changed the GUI a little bit, yet again. I've added a hourglass icon for time, changed some fonts, and added an icon for the moon phase.