• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Development] Axioms Of Dominion: Now With Awesome Multi-Threading

Status
Not open for further replies.
Level 4
Joined
Jun 3, 2012
Messages
19
Axioms Of Dominion is a project I got about 40% through and then had to let go for life stuff. Now I have roughly a year where I shouldn't have anything else to do so I'm hoping to release in late 2022 or very early 2023 if I run into serious issues.

I'd advise reading the wiki for a broad overview: Axioms Of Dominion Wiki
Here is the blog link: Axioms Of Dominion | Matthew SS | Substack

This is a fantasy geopolitics simulator that is broadly comparable to CK2+Vicky2+Dominions4+more. As a fantasy game it has tons of magic stuff but the focus is on DIP mechanics.

Diplomacy(foreign affairs)
Intrigue(shadowy affairs)
Politics(domestic affairs)

I have a Substack which can be located by searching the game name in Google.

I have a goal of enabling 40000 provinces on very new PCs but the game is perfectly functional around 14000. I have a major goal of playing an almost purely combat free couple millenia taking down a major empire in the world from the inside. I'd expect an average top tier empire to have roughly 7000 provinces on larger maps if you run history for 4000-8000 years. Anywhere from 15% to 40% of a larger map. What constitutes an empire or even a kingdom is much more fluid and dynamic than in existing games. A 7000 province empire would have something like 10 ~100 province substates at the core, 40 ~50 province "major vassals", and then 200 ~20 province periphery/border vassals. Of course you can fiddle those numbers a bit but that is a good illustration of my goal.

Several of the substack posts relate the very detailed political sim I am designing to make this goal plausible. I still have a few major and a few minor things to talk about on the blog. There is a Fandom wiki that has a few dozen pages on various major and minor systems. It hasn't been changed much since mid 2015 when I had to pause working on the game until now.

Most of the backend stuff is done and I'm primarily figuring out the equations for mechanics, doing all the UI stuff, and getting the AI to function. I expect I'll do a UI theme, smooth out map generation, and maybe polish up the art assets at the end.

The game is turn based with attention points. So you have like 1000 attention points per turn, still testing the proper amount and the costs for actions. I wanted to do a time based system but it is hard to code and people will just get mad anyways. It is a province map style like Sovereignty or Paradox games.

There is a very detailed population simulation which interacts with the character mechanics. Ideology covers almost a dozen areas, Propaganda impacts ideology and religion and the military, there's a Quality Of Life system regarding food variety/quality and material goods plus shelter, Religion ties into both magic and diplomacy/politics, population is where your troops come from and there is a logistics system.

Those are some early maps. The top one almost looks like Europe/Africa/Near East. Maps are generated procedurally as will the world be if you don't start on world creation but run history for a few centuries or millenia.

The magic aspect is highly integrated and very expansive. It impacts every game system in various ways. I have a substack post about just magic. My substack is free for anyone to read. Magic can build roads, discover secrets, troop movements, and other knowledge from distant provinces, change the weather and climate, be used in various enchantments, etc. There is even a cool The Runelords(think that is the right series) inspired magical transference/pacts thing where you can empower your soldiers or other people with the powers of captured, or tamed, magical creatures. Or sentient captives. Strength, mana pool, speed, physical features like scales or claws, etc. And you can do evil mad science [censored].

Speaking of evil Axioms allows you to play a truly ruthless tyrant rather than just a good boy. Fear, blackmail, military threats, second class citizens, slaves, etc.

The culture system allows a something like a society that reveres dragons, character secretly captures a dragon, transfers dragon traits to himself, become leader of confederation of tribes. Someone finds out, and can blackmail him, reveal him, kill him and become dragon king themselves, etc.

You can destabilize a society by cutting off their access to a prestigious food resource that is a traditional staple of cultural diet, say cinnamon, assuming the leader has depleted his political capital and put himself in a risky position. Much more detailed example on the blog.

The trade off is graphical sugar, no voice acting or 3d models, random world gen vs handcrafted map, although players/modders can make scenarios if they want, I just don't plan to release official ones but there is mod support.

A stretch goal, well not really since there isn't a kickstarter, if I finish the main stuff early before release date is to integrate a "History" system that records important actions and can be loaded/interpreted by a wiki type program to allow you to read "history books" about the game world. The "simulated" history mentioned earlier is just starting a game with no player or observer and letting the AI play a few centuries or millenia and then picking a point jump in. Player could look at data files in theory but the idea is that you only know what your AI guy knew when you swapped in.
 
Last edited:
Level 4
Joined
Jun 3, 2012
Messages
19
Something people might be interested in:
I just did three posts on the detailed and more RPG-esque character interaction:

Gonna maybe do something about the exploration system or the fantasy crafting. It has enchantments, monster parts, even monster cores as enchantment fuel.

So these images except maybe the icons aren't representative of the final result but the good enough stuff for getting all the mechanics working.

Debugging something:

A Randomly Generated Map:

Unique colors for province detection on maps

Icons:
ApBn7dH.png
 
Last edited:
Level 4
Joined
Jun 3, 2012
Messages
19

Tribal politics. Mostly based on northern Germanic and Slavic groups in the first few centuries AD.


Slightly more development as opposed to design focused post on what I'm currently working on and why.
 
Level 4
Joined
Jun 3, 2012
Messages
19
Any gameplay footage yet? For a game you intend to release in 11 months time with such a large feature set I would hope that there is at least some aspects playable. If there is then showing the best bits might help generate hype.
You can do stuff but not enough for a video. Probably doing some videos in late March. Doing most of the AI and most of the graphical sprucing up last so it wouldn't be super interesting to have a video now.
 
Level 4
Joined
Jun 3, 2012
Messages
19

I wrote an important design post about warfare. Preparing for and declaring war is an interesting process with lots of stakeholders. You don't just click and go. And in the right game that is more fun. Of course for like Total War it wouldn't work. But for a more diplomatic and character based game I think it works.
 
Level 4
Joined
Jun 3, 2012
Messages
19
Haven't posted here in a while I guess. A dozen or so new design posts on the above linked blog. Moving towards maybe doing a video but the UI is mostly doing work for verifying functions and data rather than looking nice.
 
Level 4
Joined
Jun 3, 2012
Messages
19
Still working on this. Been dealing with AI stuff and some work lowering RAM usage. Sadly it turns out the Opinions system is a bif RAM hog. I guess when you have 20 million total Opinions from 100000 characters that is unavoidable.

Got the family tree and other character interaction stuff working. Characters have moderately unique playstyles based on Ideology, Personality, Interests, and Desires. Course when you have 6 digit numbers of characters there's some overlap.
 
Level 4
Joined
Jun 3, 2012
Messages
19
If the opinions are sparse there may be data structures available that could optimise the memory usage. Otherwise you might want to simplify opinions to a few numeric metrics per character, or even associate them at a higher level like per family, clan, e.t.c.
I have a couple theories on the optimal way to resolve the memory issue without impacting the mechanics of the game. Of course these all require more effort from me as the programmer. Sad times.

I'm planning to run a test purely on switching some data to int8 or int16. I have massive numbers of ints so this could matter. My other simple change attempt is to have only a single large vector instead of several smaller ones. Then there are some intermediate changes I might be able to make. Beyond that I might just run smaller maps with fewer characters till everything is done and optimize at the end.
 
Level 4
Joined
Jun 3, 2012
Messages
19
So I ended up with a series of changes that culminated in each OpinionModifier being 4bytes, either uint8_t or int8_t. They started at something like 57 bytes. Essentially a 93% reduction in RAM use. There may be a more complex option to drop them lower but most likely I'd need to replace the whole system if I wanted a lower RAM footprint. Individual character relations are absolutely key to tons of gameplay systems so I probably can't do much more except drop the character count or something.

I think this is probably good enough. People who splurge for 120GB of RAM can have up to ~200k characters, ~100k with 64bit. People with 32bit would be stuck around 50000, which isn't terrible. Map sizes would be roughly 20000, 10000, and 5000 provinces at those numbers. If the game sells well, say 1000 or especially 2000 copies I'll be building a new PC with 256GB or RAM. My original goal 10 years ago was to have 40000 provinces which is possible with 256GB of RAM.
 
Level 4
Joined
Jun 3, 2012
Messages
19
So I got multi-threading working. It works pretty simply. The Planer for the NPC AI can't(99% sure) introduce race conditions or other undefined behavior. So I start running the Planner on 4 threads during the player's turn and since you should be spending at least 120 seconds a turn the Planner is almost 95% assured to be done well before you hit endTurn(); If you do hit it it just means the turn time will seem longer. With a special simulation of the CPU hunger of the complete AI with well above the number of characters you can actually have, this is primarily capped by RAM as explained above, you have 97 seconds on a single thread and 29 seconds on 4 threads. It goes down to 20 on 8 threads but this includes hyperthreading because I've only got 4 physical cores on my i7-4770k. So it would likely do better on an 8, 16, or 32 core CPU, or even a the 64 physical core AMD Threadripper. There's no reason you can't use as many cores as you have, so far at least. The Planner does the majority of the intense computation so that ideally you only run the "Executor" on the actual AI NPC turns. Of course the final full AI implementation may not be as core friendly but the difference won't be large. I think it is very plausible from testing that you could have 10 second max turns even with large maps and lots of characters and an AI that does a lot of reasoning.

Axioms isn't a min-maxing head to head 4x or something like that so the NPCs won't all be geniuses exploiting every little thing. Even if they were it'd cancel out as they went after each other as well as you. They should be flavorful/immersive, engaging in distinct behavior, and generate great narratives.
 
Level 4
Joined
Jun 3, 2012
Messages
19

This is a new post about Friends, Partners, and Social Stuff in Axioms. It expands on and connects to my previous posts about Social Occasions, Opinion, Attention Points, and Desires/Interests/Personalities/Ideologies.

I've linked the post mostly because the formatting of the intra-substack links to relevant posts detailing specific things I talked about doesn't work on reddit for obvious reasons. I'm going to excerpt some sections here though as well as include some new thoughts.

Axioms Of Dominion is a strategy game I've been working on for a while. Maybe 3 years if you elide long breaks. One of the, many, unique things about Axioms is the in-depth character/social simulation. I looked at strategy adjacent games like Academagia, King Of Dragon Pass, and Kudos, and I tried to figure out how I could aggregate their systems while adding unique and more elegant stuff on top. My goal for Axioms is to more faithfully recreate the experience of being a protagonist, antagonist, or major supporting character on either side, of a speculative fiction story. Fantasy, science fantasy, historical fiction, etc. On top of a strategy layer that allows for more precise simulation of plausible alt-history or a fantasy equivalent. What is the difference betwee feudal vassals and the Roman Socii and can they be represented as meaningfully different in the same game?

Of course much like medieval aristocracy some of the most important and iconic parts of Roman society and history are the interpersonal dramas.

In Axioms you have to manage your "Attention", with the Attention Point system, such that you can cultivate a few key relationships, many more casual relationships, or even focus primarily on your family. Creating and intergenerational lattice of connections between you and key retainers or allies is both possible and meaningful in a way it isn't in games like Crusader Kings, much less more abstract 4x style games. Attention Points are also used for actual management type decisions and military ones, not just interpersonal stuff. You can't just micromanage every single thing every turn, and neither can the NPCs. Unlike GalCiv or Stellaris delegation is both necessary and typically effective with larger sized domains. Of course you can play a non-landholding character as well. Get a little Patrician 3 or Theory Of Magic in your strategy game shell.

As noted in more detail in the linked post maintaining regular relationships, real friendships, and also romantic connections is both important and nuanced. Characters have Interests that you want to be in sync to get the maximum relationship bang for your Attention buck. They have Personalities that make them studious and introverted or extraverted and prone to carousing. They have often specific desires. A father may want his daughter to marry a supportive spouse or a princess may want to be allowed to engage in meaningful non-domestic activity.

An important section of the post is about how if a Character already has four friends he does weapons training with becoming the fifth is hard but if he also has zero friends who study philosophy or magic you can find an opening there if you have the talent and inclination.

You can also do stuff liek break up a friendship by hosting a key political event the night of a party that two characters would otherwise attend and hang out at, making one character feel unimportant and creating a gap in the social circle of the other you can wiggle into.

Also unlike many games with "characters" if you murdered some guy's son he won't be willing to be a loyal general, giving you the power of his 44 martial stat, just because you gave him 40 gold. Or maybe he will? His son could have been a disappointment and he could be avaricious.
 
Level 4
Joined
Jun 3, 2012
Messages
19
Haven't posted in a while. Did a lot of work on the map, which you can see on discord, and new blog post about the more RPG side and also the kinds of roles you can have besides landed noble.


My grandfather passed away so that was like 2 weeks of not getting much done. He was 95 and went quick, though, so not too traumatic. Great funeral.
 
Level 4
Joined
Jun 3, 2012
Messages
19
Done a ton of work the last weak on turn based adventure combat mode. Most of the framework is there barring a couple fancy effects like malady-spreading or duplicating and some time based stuff. Gotta do a little more on the basic AI. Got tons of magical "Aspects/Talents/Paths", sort of like very coherent sets of ~4 abilities, done. Mostly malady focused. Poison, acid, disease, decay, miasma.

Of course normal magical damage stuff also works. Firebolt, Thunder, Meteor Storm, etc. But that already exists in many games and isn't as enjoyable for me. Still gotta do some work on ally targeted spells.
 
Status
Not open for further replies.
Top