1. Arbitology: Dei Gratia Rex
  2. News

Arbitology: Dei Gratia Rex News

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!

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!

January's Update

Another month draws to a close, so that means its time for another update! This month mostly was about boring systems work. Unfortunately it doesn't make for riveting reading or scintillating screenshots, but I'll do what I can.

Many games start with war and combat. It makes a certain amount of sense, as games thrive on two or more sides competing. In Arbitology: Dei Gratia Rex, the warfare systems appeared relatively late, as I didn't want to end up making a full-on wargame. As a result, a lot of work was required to get war properly into DGR. But first, maps!

Map Modes


DGR has had a political map for some time. This map has been shown before; it features counties that shade themselves according to which kingdom controls them and borders that likewise thicken themselves if they are external rather than internal. Since siege warfare is a big part of war in this game, I found it useful to have a resource that shows what was actually captured.



Perhaps unsurprisingly this required a bit of a refactor in the map code. It is better now and new map modes can be added easily in the future also! I'm kicking around an economic map mode, but I want to avoid making information too easy to come by. Medieval kings struggled for accurate information after all.


Medieval Musters


Summoning armies was never easy. Nobles technically owed military service connected with the lands they held, at least for a fixed number of days per year. In reality, actually getting nobles to show up with men where the king willed and when the king willed it was difficult at best. Some lords refused to show up, or showed up late, or showed up with less men than they were obligated to bring. So it also is in DGR.




Flow of Battle


I experimented with several ways of handling military exercises. Most of them ended up not meeting expectations in one way or another. It ended up taking a fair bit of time before I found the solution that was there all along: events, just like everything else in the game! The event system is robust enough to handle it, and it doesn't require a departure from the way the rest of the game works. There will probably be more on this later.

(As an aside: as a proof of concept of the technology behind this event system in DGR, years ago I made a working, dynamic item shop solely with events. It can accommodate quite a lot of needs.)


Various Other


Quite unexpectedly, I discovered that there was a local game dev community where I live. In case you missed the last update, I actually got the opportunity to give a talk about procedural and interactive narrative at their first annual summit. Should that make it to YouTube, I'll definitely post a link.

That's about all for now. More next time!

Game Development Summit

Sorry for the short notice, but I will be attending the first annual Game Development Summit hosted by the Tri-Cities Game Developers group. More info here.

I realize that there is a very slim chance that anyone reading this will be in this part of Northeast Tennessee, but if you are please come on down! The even takes place this Saturday, January 11 from 3 PM to 6 PM at the Johnson City Public Library in Johnson City, Tennessee. I will be giving a brief talk on interactive and procedural narrative, both generally and as it is specifically used in Arbitology: Dei Gratia Rex.

As I understand it there are plans to record the event. Should the video make it online, I'll be sure to post a link.

December Reflections

Welcome to another monthly update, yet again only slightly delayed by the holidays! For those who also celebrated, I hope everything went well. Here's to a new year; may 2020 be the best one yet!

There are a few new features I'd like to discuss, but first some background.

Simulation and Abstraction


I briefly mentioned a difference between individual and group scores in a discussion thread (aside: did you know there is a discussion forum?), but realized I never went into detail. Dei Gratia Rex simulates many things, but it does not use the same granularity for everything. Your family, tenants-in-chief and their families, advisors, and certain characters which have ongoing stories are relatively fine-grained simulations. They are characters with personality traits, relationships, and any other properties that are appropriate to have. For everyone else, their interests are boiled down to a single score.



If you're familiar with Reigns, it is a similar, though not identical, concept. In DGR there is nothing bad about having high scores and low scores do not generally mean instant death. Having very low scores does however open you up to very bad events that are otherwise impossible. It might be possible to right the ship, but going too low in any of these does put you in danger of a premature end to your rule. Balancing competing interests is hard for a ruler.

Particularly sharp-eyed readers may notice that compared to previous screenshots, the one above is missing a value. More on that later.


Casus Belli


People on the whole prefer peace to war. This holds as true of the 12th century as the 21st. However war then, as now, was common. Also in common between the two periods is the need of rulers to justify their wars both to their own people and to other states. In the 12th century there was also the added wrinkle of the Church actively trying to dissuade Christian princes from fighting against each other. In order to finish the conquest, an ambitious king will need to gather reasons: casus belli.

Some strategy games dispense with these altogether. Others have casus belli systems, but force their players to pick one and only one. In DGR, occasions for war are multifaceted affairs. Generally wars will have a number of reasons, some strong, some weak. These combine to form an overall case for war.



With a strong enough justification, there is little opposition to going to war; without such justification there is resistance. Of course it is possible to go to war without any reasons. This is not recommended; see above about group scores.




Warfare and Economy


Medieval warfare is often popularly presented as a gallant affair of heroic knights charging at one another. This did indeed happen… rarely. Attrition warfare was actually the order of the day. This meant raiding, siege warfare, skirmishing, and generally avoiding pitched battles. No medieval commander would willingly give battle unless he thought victory was easily attained. Consequently, war in DGR is also primarily comprised of siege and chevauchée, since economic damage is as important for forcing peace as is defeating armies.

Infantry is levied from the free farmers and burgesses of the counties. First a base number is derived from the amount of productive land there. This is then modified by the group scores described earlier. This amount is next reduced by a rate determined by ruin caused to a county. Ruin can come from a number of sources, but the most common is warfare. Cavalry is provided by the nobility (again modified by group scores, but also individual relationships). Each of your vassals has a certain amount of wealth derived from the manors which they hold. If they are deprived of this wealth, or if their manors are badly damaged, they lose the ability to provision knights and men-at-arms. Protecting your own land against economic damage is important if you wish to be a conqueror.

As a king, you also have a certain amount of household knights, the number of whom can be raised and lowered over time. Hiring temporary mercenaries is also an option. Both of these tend to be expensive though.

After making all these systems, I realized that the level of simulation for military matters was fine enough grained that a group score for the military was superfluous. There really were no other factors that were not captured in what I described above. Additionally I found that this nebulous "military" score was only referenced in three previous events that I had written. Given all that, it was an easy thing to drop.


2020


I'm trying really hard to get the game out this year. Economic realities of my own mean that this is probably not going to be a choice, but rather a requirement. I don't have a specific date yet, but I'll definitely announce it when there is one!

Until next time, thanks for reading.

November Retrospective

Welcome to another monthly update, only slightly delayed by the holidays!


Continuation Events


In the previous post I mentioned what I am now calling “continuations events.” These are small story hooks that can trigger on previous events and give delayed consequences. At this point I think it might be helpful to back up a bit and discuss terms. There are many common patterns found in interactive narrative. The first, dating back to physical books like Choose Your Own Adventure books or gamebooks like Fighting Fantasy and Lone Wolf, is branching narrative. In its purest form it is known as the "Time Cave" pattern. It typically looks like this:



It's very intuitive. Unfortunately it has a big problem: combinatorial explosion. Imagine a game that presents an event with two choices, each leading to another event with two choices. At a depth of 10, there would be 1024 choices! Despite that amount of content, a player would only make 10 choices and have a very short game. This is not really tenable for a game of any length. A common solution to this, used by Telltale Games and others, is shallow branches. This is know as the "Branch and Bottleneck" pattern.



This is a much more reasonable approach for writing interactive narrative. Unfortunately, on replays, players tend to realize that the decisions that feel weighty the first time around are in fact usually not. The path is a little different, but it all collapses to the same set of bottlenecks.

A solution to this is to create “storylets.” There are many definitions for this, but the basic idea is a discreet, self-contained chunk of story. These can be Time Caves, Branch and Bottlenecks, Gauntlets, or any other pattern, but they must above all be brief. How do storylets solve anything? Using the power of simulation and random numbers, these storylets can be arranged in unpredictable, though plausible, ways. This is variously called the "Floating Modules" pattern, probabilistic-driven narrative, and probably other things as well; whatever it is called, this is the approach used in Dei Gratia Rex.



DGR is by no means the first game to arrange its narrative around simulation-driven storylets. King of Dragon Pass did this back in 1999, and even it had some forbears. Since then, different takes on the approach have been tried in such diverse places as Reigns and Crusader Kings 2, to say nothing of the recent KoDP spiritual successor Six Ages.

Circling back to continuation events: those are floating modules that may or may not be triggered by previous choices in events, though experienced at a delay. Much of the month's work went into writing these.

If you'd like to read more about these narrative patterns, I'd highly recommend Sam Kabo Ashwell's post on the subject. For an even deeper dive than that, Emily Short has written extensively on this and many related topics. Here is a recent post; read that and follow the links to previous material.


Warfare


One of the bullet points for DGR is “hard historical fiction.” The reference there is of course hard sci-fi. By that I mean the game is a work of fiction and not a pure simulation, but at the same time I am making every effort to avoid the grossly ahistorical. Some research revealed that mass peasant levies — present in just about every medieval game I have played which has armies in it — are about as historically veracious as horned viking helmets, at least in 12th century England.

The Anglo-Saxon period did indeed have the fyrd. This isn't quite the pitchfork-wielding peasant horde of the popular imagination, but it was a large mobilization of commoners. It was however a fairly unique institution created to solve a specific problem, and in any case it withered under Norman rule. That's not to say that peasants didn't fight. The Assize of Arms, which historically appeared at the tail end of our time period, gives clues as to how things worked.

What I'm currently working on is turning the historical facts into a system that both fits the gameplay mechanics and is also fun.


Other Stuff


There were also some other changes. Some stubborn bugs were squashed. Info windows were expanded and improved. There are also some experiments with larger coats of arms; this is still very much a work in progress, as the SVG I wrote for the randomized coats of arms assumed a much lower resolution.



That's probably about everything worthy of note from November. More next month!