AI Architecture Overview

June 21st, 2009

I’ve had a heck of a hard time with the design and implementation of the AI for Solium Infernum. I’ve erased the drawing board twice in fact. The only thing that remains from the Armageddon Empires code is the basic structure of the goal objects themselves. A goal still activates — goal.Activate() — to do its data analysis and planning and then is processed — goal.Process() — when it comes time to generate the AI’s orders and actions. I also kept the concept of an AIBrain object as a containment device and goal action interpreter but that’s not really much of an innovation or big deal. I’ve also still got all the fuzzy logic modules and work that I had done but that’s not a big deal either (although a lot of saved work)

When I first went to approach the AI for Solium Infernum my major concern was to improve the “meta reasoning” and the prioritization system for the goals that were generated. In AE each top level goal was given a priority ranking and the goal might or might not get processed depending on how it ranked with other goals and how many action points were available. The ranking was of course dynamic so as the AI Brain’s gained information or processed new meanings from information the ratings of the goals that it was pursuing went up and down. This worked pretty well for AE since you averaged a good deal of action points each turn (even if you couldn’t predict exactly what you would have each turn due to the dice buy and roll system for initiative) but for SI it wasn’t working very well.

The reason was because the actions that you perform each turn are much tighter and fewer in number. You have a maximum of 6 order slots to use each turn and most games you will only have access to 2 to 4 slots. That means that you have to really focus your strategy. You can move legions, demand resources, perform rituals, bid on items in the bazaar but you can’t do them all in a single turn. If you are pursuing a vendetta against another player and only have 3 order slots then you will be moving at most 3 legions that turn. There are other orders that you can issue but they are “Response” orders that happen when you respond to an item in your turn log. For example if somebody makes a demand of you then your “response” generates an order but it doesn’t cost you a slot. But the short of it is that a competing priority system doesn’t make much sense when your actions have to be very focused like this.

So for SI I came up with the concept of a ranked pipeline with a two tiered goal system. Critical goals are tier 1 goals that must process through until some condition is met. They cover situations that just can’t be replaced by another goal and forgotten….things like pursue Vendetta, defend against Vendetta, pursue Blood Feud, retake Pandemonium etc. Mission goals are tier 2 goals that provide not only the foundations to pursue the tier 1 goals but also the “character for the AI’s.” These are goals that focus on building up your capabilities, pursuing your primary and secret objectives and determine to a large degree how the AI interacts with its opponents. Tier 2 goals often lead to situations that cause tier 1 goals to be generated.

You can have any amount of Tier 1 goals in the pipeline and they are ranked according to how critical each one is. If you are engaged in two Vendettas then one Vendetta is going to get a higher priority than the other depending on which situation is more dangerous. If a tier 1 condition ends then the goal is removed from the pipeline (stack) and all the remaining tier 1 goals pop up to fill the vacant space…. this is actually quite rare though. It’s the AI’s job (like any good human player) to make sure that it doesn’t have more tier 1 goals than it can handle. On the eve of the anniversary of Barbarossa this ironically is always easier said than programmed. What’s nice about the diplomatic system in SI is that in most cases you can avoid tier 1 goals to a point if you are willing to sacrifice something be it prestige, resources, land or even artifacts. So you can put off an inopportune bully but at a cost (and only for so long but that’s another discussion).

The Tier 2 goals can only ever exist one at a time and are very fragile. They fail easily and are replaced by another. The AI’s have Archetypes that are randomly chosen that determine their Avatar attributes, perks, rank etc (not deterministic but random within ranges and pools of choices for perks). The Archetypes define a play style by influencing the composition of a strategy pool of rated choices. For example if the AI was an #AggressiveWrath type then it would favor building up its military capabilities and start bullying its weaker neighbors if the opportunity looked good. When it needed a solution to some problem then aggressive type goals will be rated higher. It’s martial Skill attribute will get precedence so that it can increase its Command Rating and get more legions out on the board. So when a tier 2 goal is needed the AI constructs a list of possible goals that each have a specific rating for desirability. Some situations might prompt the AI to rule out certain goals entirely or only consider a singe goal. Finally a roulette wheel approach randomly determines which goal is chosen but goals with higher ratings will of course be more likely to be chosen. That’s the key to generating “character” or “personality” type behavior.

That’s a pretty good description of the high level architecture for the AI. The concept is nothing new and the hard work is all in creating the goal objects and their scripts that process information and yield discrete orders. In some follow on entries I see about discussing some of the new techniques that I used to solve some interesting problems that I encountered….like using genetic algorithms to choose the best resource cards given some desire for certain types (souls for example) and an offering of cards with different types and amounts.

Help Save The Queen!

June 3rd, 2009

That which will not be named also seems to want me to know that “My lady awaits.” I can’t imagine how it can afford to do the type of advertising it does unless it is some sort of gaming ponzi scheme. I really try never to be negative about other games and the choices made by other designers but I’m still scratching my head over this one. I do just a little advertising but wherever I do advertise they seem to be there as well probably driving up my bids. So I have had this great idea for my upcoming marketing blitz for Solium Infernum. Try these out for size:

Meet Wicked Women!

Your Succubus Awaits!

Devil Your Pleasure!

Here is the image I’ll use for the banners of course:

Iron Maidens

The Known, The Unknown and The Unknown Unknown

May 27th, 2009

One of the fundamental design concepts of my first game Armageddon Empires was that you had to make a smart effort to gather intelligence about what was going on out in the vast irradiated wastelands that surrounded you. Reconnaissance was a real force multiplier and identifying incoming threats and as well as important targets was a key to survival and eventual victory. In Hell however it seems that there is very little privacy. The Solium Infernum design treats the legions like chess pieces for the most part. There is a lot of “perfect information” for the players to evaluate about the game state. There are some mechanics to obscure the strength and position of agents on the board but they are few and require concerted effort. With that in mind, I thought I would enumerate the known, unknown and the unknown unknown aspects of SI.

The Known

Legion Position, Attributes and Some Attachments: The legions are the main actors/agents on the game board. They have a group of attributes that define how they interact with other agents as well as the ability to have “attachments” placed on them that enhance or increase their powers and abilities. One type of attachment is an evil artifact which is seen by all opponents. The position of a legion unless affected by a ritual is known to all players.

Public Prestige: This is an important known piece of information. It represents all the prestige points gained by the public actions of a player at any given time in the game. It’s also a good indicator of who is leading in the game.

Places of Power: These special locations are always visible as is the status of their ownership and how much prestige they generate for their owner each turn.

Territorial Boundaries: This is pretty obvious but important. Claims on territory are absolute and ownership of territory can only be transferred by following strict diplomatic protocols.

Diplomatic Stances: This is a very important set of information about players and is visible to all players. If someone makes a demand of or hurls an insult at another player, it is done in front of the entire Infernal Conclave. A demand or insult that results in Vendetta can require concentrated effort by the players to resolve especially since prestige is at stake. A player involved in a Vendetta or even engaged in demands and insults by other players is more exposed to further “diplomatic entanglements.”

Items in the Bazaar: The Bazaar provides players with legions and most of their power ups (attachments). All players have perfect information about the items for sale and the minimum bids needed to purchase them.

Public Objectives: Each player chooses a public objective as part of their avatar’s build. The public objectives conform to the seven deadly sins and generally operate in a similar theme. The Sloth public objective for example requires that you end the game never having made a demand or insult….perfect for the Archfiend who wants to turtle away in his own private corner of Hell. Of course knowledge of this aspect may signal a lot to all the other players concerning the aims, objectives and strategies that will be pursued.

Conclave Tokens: The conclave tokens function as the game clock. Depending on the number of tokens you selected when you created the game, once that number has been reached (a chance to pull a token exists each time a turn is processed) the Infernal Conclave convenes and chooses a new ruler. If you have pulled 14 of the 15 tokens then all players know that the end of the game is near and they must take action accordingly.

The Unknown

Avatar Attributes and Perks: The key aspects of each players avatar are concealed from the other players. This means that you don’t know the scope of powers and actions available to any given player. Some perks can affect the outcome of the game as well and it is essential that their possession by kept secret. Anything that is secret of course can become known. A prophecy ritual as well as some events can reveal information to players about the attributes, powers and perks of other players.

Combat Card Attachments: These are bonuses that are “attached” to legions to give them an edge in a single battle after which they are discarded. They are generally hidden from other players. Like everything else that is secret, there are conditions (rituals and events) where they can become known.

The Vault: When you acquire an artifact, relic or praetor in the Infernal Bazaar they are sent to your vault. Here they are safe and unseen by your rivals (some rare exceptions included of course). Your decision is whether to deploy them to the board where they will generally be of more use but at a greater risk to be destroyed or even stolen by another player or to keep them hidden in the vault. Additionally all your resource cards are stored in your vault and their number and quality hidden from prying eyes.

Your Orders: It goes without saying that each turn your specific orders are unkown until they are executed. This includes important things like your marching orders for legions and your initiation of rituals.

Your Ritual Chamber: Each player has access to a ritual chamber that has a maximum capacity of 5 ritual slots. Slots are gained by increasing your Prophecy power level. A ritual slot can be used to perform a ritual which is special action like damaging an enemy legion, stealing a relic from a place of power, hiding your own legions from view….. etc. A handful of unholy relics must be placed in a ritual slot to unlock a special ritual power that they can perform. In general your opponents can not see what is going on in your ritual chamber.

Deceit and Prophecy Rituals: The player performing one of these rituals is generally unkown to the target unless the player fails the “detection challenge.” Here the computer rolls two dice for each player and adds the appropriate bonuses (based on the players’ respective power levels, perks and relics owned). If the player performing the ritual exceeds the adjusted roll of the targeted player then the player is not revealed as the performer of the ritual. Players who have achieved level 5 in the Deceit discipline can attempt to frame other players for performing any ritual.

The Unknown Unknown

This is my favorite part of the evaluation of any given system. For a game designer it’s a perishable commodity akin to letting the genie out of the bottle. In my Cults of the Wastelands mini expansion pack it corresponds to the strategy theme of each of the Cults that you encounter. The joy is in the energy of first contact and the palpable sense that you get that all is not as it appears…. that your appraisal or judgments lack something for complete understanding of the situation. In Solium Infernum I’ve tried to use the event system to provide this. There are a range of events that break rules, alter mechanics or simply provide Solomonic decision making. After playing the game several times and having been exposed to their existence and implications you will have broken the seal on the booster pack so to speak but you’ll be left with calculations based on anticipation of how the event deck unfolds. Each player draws a card or cards as the role of Regent is passed around the board. At this point I haven’t decided on whether to even include a detailed listing of the events in the appendix of the manual. Discovering the deck would seem like part of the fun and challenge. If I do include it for reasons of fairness (the knowledge of the events will be fragmentary for players and dependent on playing time) then I would strongly recommend that you don’t read the appendix at first and enjoy some single player games of discovery.

When The Tip Of The Spear Breaks

May 10th, 2009

Sometimes success can be your undoing. Even when the thrust of the plan is carried out to perfection and the objective is accomplished, a single unattended detail can be ruinous. That’s the case here:

BrokenTipThumb

I have been testing out and refining the AI goals that deal with pursuing and defending against Vendettas. In the case above, I had gambled prestige that I could capture a single place of power from another player within a given set of turns. Since my AI opponent had been involved in some ugly disputes with his neighbor to his North , I decided to try out a blitzkrieg operation to send two legions deep into enemy territory to see how the AI would react. The AI was both unlucky and a little imprudent. He didn’t have a lot of tribute cards left so my demand of 4 tribute cards was the equivalent of “outrageous” to his silicon sensibilities. He was doing his best to maintain his holdings to the north and in close proximity to his stronghold. The AI’s appraise territory according to a value system that includes the range to their stronghold, the presence of a choke point, the connectivity it has with places of power it owns, etc.

I don’t want to discuss the particulars of how the AI’s decide some things as that can lead to a sense of having the curtain pulled away to reveal the unimpressive little guy pulling the levers feeling, but the Concede to Demand decision can really be a tough one. In this case the AI was presented with its own Kobayashi Maru scenario. Either choice was going to doom him to some very nasty consequences. This highlights one of the toughest programming problems I’ve had to approach during the development of SI…. namely getting the AI to “hope for the best.” In this case it chose to keep fighting the Devil it knew to the North and resigned itself to hoping the one to the east was just bluffing or not as dangerous.

In retrospect it was probably the best choice even if it was for the wrong reason. When the AI ran simulations to see how dangerous the opponent to the east was it didn’t quite get the consequences right because my legions were pulled away from the border a bit and they both had very unusual movement rates. One legion actually had a 4 movement point rate which is really almost unheard of in Hell. The unusual movement bonus came from the fact that my Avatar had an expensive perk “Fiendish Energy” that boosted all legions under my control by +1 movement points. Not taking this into account the AI came to the conclusion that there was a strong Bluff element going on and refused the demand. Although here is the rub. Even if it had thought that the enemy might be serious about grabbing some land, I’m not sure that the right decision would be to concede the 4 tribute cards. With an ongoing already “blooded” conflict with his neighbor to the North those 4 tribute cards might do a lot of good…like buying another legion in the bazaar. So ironically enough getting the AI to choose the lesser of two evils is really a challenge in this game. It’s an AI conundrum that I run into a lot. Adding a small stochastic element helps simulate a “human” approach to some extent but it’s not a complete solution. You have to have constructed the probability matrix correctly in the first place.

This all leads to the final little irony of the blitzkrieg gambit that I had unleashed. The AI refused my demand and I naturally made a bolt for the Place of Power which was fortuitously a lower level one that I could overwhelm with a little support. My two highly mobile and motivated legions crashed across the border and stormed the parapets (actually just one did the other was adjacent lending support) and promptly found themselves trapped in a pocket of their own making. You see the Vendetta was satisfied and the Infernal Conclave awarded me my prestige stake and a small bonus plus I got to keep the Place of Power but I had miscalculated a bit.

The Protocols about the transfer of land holdings in Hell are a little archaic and conservative. You have to occupy a Canton at the end of the turn and it must be adjacent to own of your own in order for the Infernal Conclave to award you possession. You can daisy chain them together with multiple legion placements. But I had overshot my own border by a Canton too far and despite the fact that the conquered Place of Power functioned as a new anchor for determining borders, I was trapped.

You can see that in the screen shot above. Neither legion could fly so they were both stuck there until I managed to enter a Vendetta with my beleaguered AI neighbor again…and my other neighbors would look with glee upon my borders the next turn. The hard part of course is getting the AI’s to recognize a broken tip….but that’s another story.

Monkey Wrenches Redux

April 27th, 2009

In a previous entry I discussed my desire to give players the tools to toss a monkey wrench into another player’s well oiled plans. The “Deceit” rituals are the most obvious way to go about this. If you don’t want to pursue that path you can still find the odd wrench but usually in the form of “events” that aren’t as elegant and targeted…..like the Capricious Wrath event I revealed earlier.

Usually when you plot out movement paths for your legions you expect that your orders will be carried out to the letter or there will be Hell to pay. But what if your opponent could issue false orders to one of your legions causing it to leave its nice supportive formation and flea for its life or even make a suicidal attack on a more powerful legion? The “Deceit” ritual called Secret Manipulation allows players to do just that and the results can be both unexpected and frustrating. The target legion gets a chance to resist of course and the higher the legion’s level the better its chance. In case you were wondering you can’t march an opponent’s legion against Pandemonium and get them excommunicated…..while that would be really fun it makes the game far too unstable and the positioning of units in the vicinity of Pandemonium too precarious. You’ll have to think of orders to enter Pandemonium as so important that special confirmation would be sought.

Secret Manipulation

Ritual: Secret Manipulation
Select an enemy legion and take control of its movement for a single turn if it fails a ritual challenge against deceit and has not already moved in a previous phase.

Armageddon Empires The Merchandising…

April 22nd, 2009

….Where the real money from the game is made.

I made a mouse pad a while back but like so many things I never really finished it off and got a Cafe Press shop online and integrated into my Cryptic Comet website. I do have a shop up now. You can catch it here if you want to check out the mouse pad.

Cults Mouse Pad

My idea is to add some coffee mugs, another mouse pad and maybe a flame thrower. If you have any favorite images from AE that you would like to see on such bling bling then let me know by replying to this thread in the forums. List your top 5 or so images and I’ll make a tally to get an idea what the most popular images are. Then I’ll try and get some merchandise up on the Cafe Press shop.

Revenge of the Underhive

April 12th, 2009

A player nick named “Keypunch” has put up an extremely clever deck for warlords of the wastelands to play as a neutral “corporation” called The Underhive. The deck is composed of a real rogues gallery of the independent units in the game. You can check out the deck here:

Underhive Deck

And get a nice AAR here:

Underhive AAR

Needless to say, AE is not the most user friendly game to mod so just getting this to work is really an accomplishment. The whole thematic approach though is what really sends it over the top. If you ever wondered what it would be like to throw Casca, ExU-88 and the Duke together and run around the map with Dune Raiders then this is the deck for you. Just a word of warning though, make sure your wasteland skills are up to snuff. It’s not really an easy deck if you don’t really know your stuff.

Dune Raiders

Capricious Wrath

April 8th, 2009

It should be noted that The Orb of Oblivion that I revealed last time is capable of not only destroying an enemy legion that it engages but also a place of power…… as in poof! zip! Sorry. And It’s Gone! It’s the only catastrophic thing that can remove a place of power from the game. In case you were wondering, Pandemonium can be removed as well. The Conclave just retires to a secluded location and the “win by force” option is removed from the game. But to get back on track, there are some fun events that you can play that have nice catastrophic results. One of them is called Capricious Wrath and it targets legions…who gets targeted depends on the particular event and the cost to play it.

Capricious Wrath Ruins Somebody's Day

Capricious Wrath
Cost: None
Play this event to destroy a random player’s (including your own) legion on the board. The target legion is chosen randomly but cannot be a personal guard.

Capricious Wrath Targeted
Cost: Tribute Cards
Play this event to destroy a targeted opponent’s legion on the board. The particular legion that is destroyed is chosen randomly but cannot be a personal guard.

Pure Corbomite

March 30th, 2009

One of my favorite Star Trek episodes is episode #10 “The Corbomite Maneuver.” Every strategy game needs something like it. I didn’t quite manage to perfectly incorporate the “Bluff” aspect but I did get some of the flavor. It comes in the form of one of my favorite Evil Artifacts that I created for Solium Infernum…. The Orb of Oblivion.

Orb Of Oblivion

The Orb Of Oblivion

Oblivion: If the legion possessing this artifact is destroyed in battle then the enemy has a 80% minus 5% per enemy level chance of being destroyed as well.

What better way to ensure power than to enforce a peaceable nature over potential peers of that power. I have discovered the existence of three spheres, one of which projects an aura of sublimity over nearby subjects. I lack the present capacity to translate the functions of the others, but undoubtedly they must be of similar power and origin.

–From the diary of Bishop Bezel

Indie Inspiration

March 20th, 2009

Jeff Vogel is a modest but very successful indie “old school” RPG game designer. He (and his 2 person crew) was recently picked as one of the “Best Studios Ever” in a PC Gamer feature. Even though I’ve never met him I feel like he is a kindred spirit. He both codes and designs his games and he has picked a niche to excel in that he loves. Seeing Spiderweb thrive has always been a real inspiration for me and a reassurance that I might be able to pull off something similar in the Turn Based Strategy niche. Jeff has put up a blog and he’s started it off with some very interesting stuff. A show me the money peep show of sorts. :)

Jeff Vogel’s Blog