Axioms Of Dominion: Now With AI Multi-Threading

Discussion in 'All Other Games' started by AltarofScience, Dec 28, 2021.

  1. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    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: https://axioms-of-dominion.fandom.com/wiki/Axioms_Of_Dominion_Wiki
    Here is the blog link: https://axiomsofdominion.substack.com/

    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.

    https://imgur.com/a/AlPew
    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: Jan 5, 2022
    The_J likes this.
  2. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    So I've got about a dozen detailed posts on the stuff that isn't really done anywhere else. Got about that many more for pure mechanical stuff to write up this week. I'm also going to do some posts on cool historical systems the game supports and that the AI will sometimes get done by itself.

    I did a post about the possibility of recreating the Roman Socii or Auxilia systems in Axioms. I might edit it a bit to add some more mechanical detail.

    https://axiomsofdominion.substack.com/p/the-socii-and-the-auxilia

    Essentially you have low level control over policy and the game supports a level of detail that allows you to do this. The laws and edicts and policies and population simulation can be set to represent Roman Citizenship, or Greek and other kinds, there are options related to rewards for military service. You can apply rules based on location or race or religion or origin.

    I think it might be possible to recreate the Roman Republic and Empire in most details.

    Someone could also always design a scenario with a custom map and simulate real history, though that isn't a personal focus of mine. I am focused on wizards!
     
    Last edited: Jan 4, 2022
  3. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    These are just working visuals except maybe the icons. I plan to finish the UI skinning and other art type stuff once the code is finalized.

    Debugging some stuff:
    https://imgur.com/a/23cnnra

    A Randomly Generated Map:


    Unique colors for province detection on maps:


    Icons:
     
    Last edited: Jan 6, 2022
    The_J likes this.
  4. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    https://axiomsofdominion.substack.c...gion?r=i2fsj&utm_campaign=post&utm_medium=web

    This is a moderately detailed expanation of religion in Axioms. If the infamous church unit carpet of later Civ games isn't your thing, perhaps you'll like this better. Religion is real, since this is fantasy, but more importantly it matters to gameplay and has significant impacts on the world.

    Also unlike grand strategy games you can do more than send council member or send missionary. And religion integrates well with intrigue and espionage.
     
  5. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    https://axiomsofdominion.substack.c...-25a?r=i2fsj&utm_campaign=post&utm_medium=web

    This is a post about how early era tribal gameplay will work in Axioms. Well technically all tribal gameplay but it is way more common in the first age, the age of exploration, that typically would last 1000 years or 12000 turns. Of course the worlds in the official release will be starting 4000 or 8000 years in to get more complex and developed societies available to casual players.

    I'll update this post with the companion piece in the development blog on my substack later. The main section is design stuff and the development sections talks about what I'm doing code wise and where we are on actually implementing all the stuff in the design section.
     
  6. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    Gonna edit instead of make a new post:
    https://axiomsofdominion.substack.c...ries?r=i2fsj&utm_campaign=post&utm_medium=web

    I wrote a post on how Axioms implements meaningful divination as part of a probably 10 part series on the unique and integrated magic in the game. I actually get Divination almost free mechanically because it merely connects to existing systems I built for espionage and politics stuff anyway.


    Been doing a lot of programming on this. Have a second section of my substack specifically about development rather than design and concept. Slowly getting core gameplay features working together. Trying to get to where a simple video will be interesting game wise by around mid March.

    https://axiomsofdominion.substack.com/p/obligations-pacts-and-treaties

    Most recent post about getting political actions enabled in the game code and UI. Still fixing some AI stuff related to that.
     
    Last edited: Jan 25, 2022
  7. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
  8. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    This system is heavily overshadowed by CK3, primarily because of their 3d models and ****. Not that the devs themselves will replicate it but the fancy modding script would let one of the insane guys like Tobbzn clone it in a few weeks or months. All because I didn't get my **** together in 2015-2016 for a 2017-2018 release. So many regrets. Regardless:

    Social Occasions: Feasts, Festivals, Hunts, Tournaments, And Ceremonies:
    Invitations, activities, and other aspects
    https://axiomsofdominion.substack.com/p/social-occasions-feasts-festivals?utm_source=twitter
    Potentially part of a series of posts similar to the Esoteric Arcana series on the character and social interactions of Axioms Of Dominion.

    The Social Occasions/Social Calender system. Who needs war anyways? Just party.
     
  9. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
  10. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    This is a new post about the social simulation. Unlike Paradox I want characters to actually be meaningful for ruling a country and not just stat sticks. If you read fantasy novels I want it to feel more like it does there where personal relationships are drivers of politics and where you have to make choices, like a real ruler, about who to spend time with and build relationships with and not just spam "Improve Relations". My eventual implementation of limits, Attention Points, per turn actually syncs incredibly well with this. Think like social/dating sim scheduling, but a little more free and open with more "slots" and obviously much less dating/waifu focus. I'm told RotTK 7 and other games in that series has a system that was like a much simpler version of mine.


    Social Simulations And Genre Blending
    Lower level details on relationships including romance


    Background

    You can skip to the next heading if you don’t care for this part, as it is pretty long.

    There are several interrelated sub-genres of “simulation” and “rpg” game that deal with social interactions. You have anything from The Sims to Japanese dating sims, to dating sims mixed into rpgs, including western games like Pathfinder: Kingmaker, to school sims like Academagia and things like Long Live The Queen. I’m not very positive about these kinds of games but not because they are inherently bad. Well, pure dating sims are not interesting to me I guess. The reason I don’t like them is that they are untethered.

    The Sims has perhaps advanced a long time since I played The Sims 2 back in the mid 2000s. Back then they didn’t really account for anything but the player family. Unless you added more families to the neighborhood. Jobs, school, cops, etc. They were all fake. Similarly many RPGs only had detailed romance options and little if any effort put into other kinds of relationships. Maybe faction “points”? Meh.

    Games like Academagia sort of had “cliques” and “bullies/rivals” and in fact seeing as they haven’t released Year 2 after over a decade the game/series doesn’t even have romance options. Similarly stuff like LLTQ and CK2-3 have very limited interpersonal mechanics.

    RPGs and most varieties of sims also don’t have an “outside world” at all. If you are playing an adventurer or a mercenary or w/e you are heavily constrained by handcrafted settings and interactions. Conversely something like CK2-3 lacks an “inside” world. Everything is shallow and limited. There are some interesting mods like the ones by Tobbzn for CK3 that add mechanics that are halfway between vanilla and fully fleshed out.

    City builders like Emperor and trading sims like Patrician 3 arepretty similar. You aren’t making connections with rulers, other merchant families, not hiring caravan guards, and so forth. And most city-builders lack a deep Guild system, even something like Majesty 1.

    My goal for Axioms is to create a system where all these genres blend together. A lot of people will talk badly about “kitchen sink” games and that is one reason another key aspect of Axioms is creating a mechanical/system “framework” that adds flexibility and cuts out redundancy and integrates the major systems I want to include without being clunky and rigid and requiring piles of distinct mechanics. That is one major problem I always had with Paradox games. It also applies to stuff like unique country flavor. Especially the HRE and ERE.

    Relationships And Dissonance
    If you’ve read most of my other posts you know that Axioms has a primary mechanic called “Opinion” that underlies all relationships. You’ll also know that I have added Fear, Honor, Trust, and Respect as Opinion modifiers. I haven’t yet worked out the final modifier for friendship or romance. Many games use some sort of “Affection” mechanic but I’m still thinking about the difference between friendship and romance and I think Affection might not be enough. I’d like to minimize the number of sub-factors beyond Opinion. I suspect I’ll have to add something.

    I don’t think it is reasonable or necessary to represent the full range of human emotions in a videogame. Especially one that is not a pure Social Sim. I did come up with a mechanic similar to Stress in Crusader Kings. Just as my Secrets system from 2013-2014 was much more detailed than the one Paradox came out with in 2019 the Stress mechanic was more detailed than what CK3 has. In this case the name is actually different.

    Dissonance is a mechanic which represents a Character feeling out of sync with the ideals and expectations of their environment. Characters have a Personality which interacts with the Ideology they have for themselves and those around them. They will be unhappy if the expectations put upon them, their own or otherwise, don’t match up with their personal desires and circumstances.

    I should make clear here that while this system is more expansive than any existing game it obviously isn’t at the level of granularity of the real world. There will be no Onegin, nor Karenina, nor Zhivago in Axioms. You might, depending on the emergent results of the simulation, get something approximating that kind of Dissonance or ennui but it can in no way match up to a novel in characterization and plot.

    In any case Dissonance can impact characters as far as being a ruler, who they marry, the expectations of their society, like being warlike or bookish, and so forth. There is a natural level of Dissonance which all/most characters can sustain indefinitely and then they start to be impacted by it. I am considering some sort of Attention Point modifier here for very low Dissonance. Characters with too much will be motivated to change their situation or act out.

    Interactions
    Those who follow the blog will be aware of the Social Occasion system in Axioms. This is a system that, as far as I know, is distinct not only in strategy/simulation games but in rpgs and social simulations as well. Those games rarely have a resource/economic model or the sandbox underpinnings to support staffing and supplying a social event. In fact even something like The Sims doesn’t allow this, as far as I know. Again I haven’t been really engaged with the series for a long time. Social Occasions create both broad impact as well as the opportunity for characters to engage on a more personal level.

    Nearly all the personal interactions possible at Social Occasions are also possible in individual or small group interactions. Basically you are making decisions on how to spend your personal time and who to spend it with. This is actually the most similar aspect to dating or school sims but with more context and consequence and obviously much less art and dialogue. Think of something like Three Houses, Academagia, Persona, or King Of Dragon Pass. They trade context and consequence and emergence for hand writter conversations and hand drawn backgrounds or character models.

    Personal relationships are impacted by a variety of factors. You need some level of “background” like familial connection, long running factional attachment, or similarity of self/circumstantial impact to overcome a lack of direct personal interaction. If you lack that then keeping a strong relationship requires actively engaging with the other person, especially at Social Occasions.

    Aside from the value of spending time together and past circumstance another key part of relationship strength is how you impact another character. Do you support them when they are down? Perhaps taking them out to dance/drink or for a ride? Do you engage them frequently but only superficially and without consideration for the circumstances? Are your interactions mostly private or do you often associate in public?

    Relevant here is that through the Intrigue/Espionage/Intelligence system you can manipulate relationships very effectively. Figure out what they like and dislike, know when they are having a good or bad time, and so forth. Intersystem integration is a top 3 goal/focus for Axioms.

    Putting all that aside the actual character interactions involve written corresponance, visits, long talks on distinct subjects, getting a drink, at home or on the town, going riding or dancing, if possible in your polity, training together, which includes martial, musical, mental, magical, and so forth. You can Bribe, Flatter, Insult others in public, or in secret, and so forth.

    All non-public interactions can create a Secret. Friends can betray you or vice versa if the situation is appropriate. You can also engage in romantic or sexual interactions of various kinds. You can give romantic or platonic gifts.

    A major value of Social Occasions is that they can provide cover for interactions of various kinds. An affair at a party is much easier than having to come up with some other excuse to travel, especially between provinces.

    Characters have Desires and Interests and thus you can, for personal or political reasons, gift a studious mage rare tomes, tell an adventurer of secret locations, or promise a friend to, as mentioned in a previous post on secrets, arrange a loving marriage for a daughter, or son.

    Interacting With Interactions
    I mentioned above how you can learn information to use in social manipulation with the Intrigue mechanics. You can also interact, as mentioned in a previous design post, with Social Occasions by doing stuff like following traveling characters and ambushing them, or getting them alone at events to blackmail or bribe them.

    Additionally you can do the same when two friends go for a ride in the countryside. Murder, kidnapping, etc. You could also, pending some possible feature cuts, meet another character during their interaction with someone else. Or specifically go somewhere with another character as cover for a separate meeting between that character and someone else. I’m sure we’ve all read fantasy novels where this kind of thing occurs. Or seen the Harry Potter movies or all those new fantasy tv adaptations.

    Conclusion
    I spent a lot of time when designing various systems designing them such that they interact smoothly with at least 3-5 other game systems and massaging the base/core mechanics to facilitate this and to avoid redundant systems. The downfall of many an existing genre blending or kitchen sink game is having too many almost totally rigid and siloed systems/mechanics which make the game complicated for players to learn without providing a proper amount of value in return.

    Axioms had originally been conceived as a real time game back in 2010-2012 but I finally came to the conclusion in late 2012 that a turn based core would allow for a lot more of the things I wanted to do in a more elegant and also more performant way. When I played EU4 and CK2 in early 2013 to early 2015 I found that their real time nature did indeed limit them in ways I had forseen and I felt pretty happy about my choices. Playing those games also solidified my feelings about having a bunch of shallow and unconnected game mechanics creating strong negative impacts on user experience.
     
  11. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
  12. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312

    This is the basic unthemed/unskinned menu for Genealogy. If the basic "Family Tree Panel" included in some of the other menus is not extensive enough you can hit a button to pop this up. Clicking the image of a Character, most of which are that default rock on a wooden background right now, centers that character and rebuilds the tree. It probably won't say "Main Character" in the final version but it gets the idea across. My plan is to have a couple different top level "formats" with some filters and stuff for each one. So you can get one that is more like CK3 or like Ancestry or w/e you like. Also all the names won't be ones that start with A but I haven't fancified the name generator yet since I just need something that has basic functions. Similar to how the map is very basic and has those weird alternating line artifacts.

    This is one of the few menus that is vaguely functional looking and people always ask for screenshots so this is the most useful one to look at. The AI can do some basic actions right now so I am thinking about releasing a barebones video of the game playing a few turns later in the month.
     
  13. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    So I spent the last week roughly on optimizations. It may seem like this is too early but mainly I was optimizing the RAM footprint of a thing that you'll often have like 200million of so getting it from 57 to 4 bytes made a huge difference and also it didn't seem to impact performance too much. Other optimizations were fixing poorly thought out nested loops in CPU hungry code and swapping all the strings out for IDs or Pointers in comparisons.

    The thing I finally finished today was multi-threading.

    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.
     
  14. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312
    https://axiomsofdominion.substack.c...ds-and-influence?utm_source=twitter&sd=pf&s=w

    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.
     
  15. AltarofScience

    AltarofScience The Brain

    Joined:
    Oct 12, 2011
    Messages:
    312

Share This Page