February Report
This month saw the conclusion of the raiding and economic warfare content. Mostly of course — there's always a chance that it will be revisited for a few additions or touch-ups before the end. However that has already been discussed a bit. Beyond that, a lot of work was done behind the scenes on optimizations.
Also during the month I made a very brief tweet about "trait-constrained roleplaying." This has been in Dei Gratia Rex almost from the beginning, but it occurred to me I've never written about it. Since optimization may not be terribly interesting for people who follow strange, niche narrative games on Steam, let's start with that one!

Here we see our intrepid king on a mission to loot Somerset — I'm sure there's a good reason for this. During the course of this a dangerous opportunity presented itself! Naturally the choice is given to attempt this anyway or to avoid it in favor of safety. However in this case, our king is quite brave, and as such he would never countenance letting such an opportunity pass him by. One thing that often irked me about games in this space is that I could be a kind ruler, but happily do cruel things. Or I could be a gregarious ruler and avoid social interaction. I wanted to change that, and this is the method I struck upon.
On the other hand, DGR is a game of decision above all else. If a player were to find themselves locked out of a choice they really wanted to make because of something utterly unrelated that happened hours ago, well, that wouldn't be fun, would it? To that end, DGR allows limited sidestepping of this mechanic by spending willpower. By spending willpower, it is possible to make the king act in uncharacteristic ways — this usually affects his personality going forward. This is a resource that is in very limited supply and whose extent is intentionally never fully communicated. The choice of whether or not to spend this resource is another layer of choice on top of the surface layer choice, which I think is entirely congruent with the themes of this game.
If this sounds like "resource narrative" (or quality-based narrative or whatever you want to call it), that's intentional. All of the choices eventually lead back to a handful of resources which must be balanced. Willpower is one of these resources, though a less important one than the realm values that are always graphed and plainly visible.

Ensuring that a system works is always the most important thing. Premature optimization is also said to be the root of all evil. Eventually however there comes a time to look at performance. In terms of actual gameplay I had not quite reached that point, even on the practically medieval hardware being used to develop DGR. (Seriously, I use a 10 year old desktop, a Windows 8 era minspec laptop, and even a CRT monitor. Perhaps one day I can upgrade.) However one tool I use to find bugs is to let a fairly stupid bot auto-play very large numbers of turns. This was beginning to slow down under the weight of the content. That's not good, as much more content is planned.
Choosing an event requires first making a list of all eligible events, determining their weight, then performing a weighted random selection from those candidate events. This involves a trip through the entire collection of events. As that goes into the four figures, it rapidly becomes less than ideal. As of this month, DGR now at runtime partitions the event space into smaller buckets of events that can occur at certain times. Performing a linear search across dozens of events at a time turns out to be much nicer than across thousands.
I also found a way to save memory by caching values. This isn't quite as important, but every bit helps. Many events end up pointing to "dispatch" events. For example during war, a common event briefs you of the situation and offers the common choices of what to do. Consequently, a great many events will return "war_main". Now the event to return "war_main" exists only once, rather than many functions with identical effect. All such redundant functions (including those for weight, eligibility, and much else) are now eliminated.
In any case, the bot can play faster now!
Finally getting out of the war content! It's important, but I'd quite like to write about other things soon.
Beyond that, spreading the word: DGR has to launch at some point. However even if it was ready to go today, I wouldn't press publish. When there's something that's enjoyably playable from beginning to end I'm counting on YouTubers. Between now and then though I'll try to get the game in front of people who might be interested. If you happen to know any such people and want to help, please send them a link! Wishlists are a very important metric to the Steam algorithms, so building those up is a bit of a priority before launch.
More to come next month!
Also during the month I made a very brief tweet about "trait-constrained roleplaying." This has been in Dei Gratia Rex almost from the beginning, but it occurred to me I've never written about it. Since optimization may not be terribly interesting for people who follow strange, niche narrative games on Steam, let's start with that one!
Trait-constrained Roleplaying

Here we see our intrepid king on a mission to loot Somerset — I'm sure there's a good reason for this. During the course of this a dangerous opportunity presented itself! Naturally the choice is given to attempt this anyway or to avoid it in favor of safety. However in this case, our king is quite brave, and as such he would never countenance letting such an opportunity pass him by. One thing that often irked me about games in this space is that I could be a kind ruler, but happily do cruel things. Or I could be a gregarious ruler and avoid social interaction. I wanted to change that, and this is the method I struck upon.
On the other hand, DGR is a game of decision above all else. If a player were to find themselves locked out of a choice they really wanted to make because of something utterly unrelated that happened hours ago, well, that wouldn't be fun, would it? To that end, DGR allows limited sidestepping of this mechanic by spending willpower. By spending willpower, it is possible to make the king act in uncharacteristic ways — this usually affects his personality going forward. This is a resource that is in very limited supply and whose extent is intentionally never fully communicated. The choice of whether or not to spend this resource is another layer of choice on top of the surface layer choice, which I think is entirely congruent with the themes of this game.
If this sounds like "resource narrative" (or quality-based narrative or whatever you want to call it), that's intentional. All of the choices eventually lead back to a handful of resources which must be balanced. Willpower is one of these resources, though a less important one than the realm values that are always graphed and plainly visible.

Optimization
Ensuring that a system works is always the most important thing. Premature optimization is also said to be the root of all evil. Eventually however there comes a time to look at performance. In terms of actual gameplay I had not quite reached that point, even on the practically medieval hardware being used to develop DGR. (Seriously, I use a 10 year old desktop, a Windows 8 era minspec laptop, and even a CRT monitor. Perhaps one day I can upgrade.) However one tool I use to find bugs is to let a fairly stupid bot auto-play very large numbers of turns. This was beginning to slow down under the weight of the content. That's not good, as much more content is planned.
Choosing an event requires first making a list of all eligible events, determining their weight, then performing a weighted random selection from those candidate events. This involves a trip through the entire collection of events. As that goes into the four figures, it rapidly becomes less than ideal. As of this month, DGR now at runtime partitions the event space into smaller buckets of events that can occur at certain times. Performing a linear search across dozens of events at a time turns out to be much nicer than across thousands.
I also found a way to save memory by caching values. This isn't quite as important, but every bit helps. Many events end up pointing to "dispatch" events. For example during war, a common event briefs you of the situation and offers the common choices of what to do. Consequently, a great many events will return "war_main". Now the event to return "war_main" exists only once, rather than many functions with identical effect. All such redundant functions (including those for weight, eligibility, and much else) are now eliminated.
In any case, the bot can play faster now!
What's next
Finally getting out of the war content! It's important, but I'd quite like to write about other things soon.
Beyond that, spreading the word: DGR has to launch at some point. However even if it was ready to go today, I wouldn't press publish. When there's something that's enjoyably playable from beginning to end I'm counting on YouTubers. Between now and then though I'll try to get the game in front of people who might be interested. If you happen to know any such people and want to help, please send them a link! Wishlists are a very important metric to the Steam algorithms, so building those up is a bit of a priority before launch.
More to come next month!