Thursday 22 October 2015

Game Design #56: Solitaire Wargaming & NPC AI - Part 2

When I say this I really kinda mean "immediate reactions" (tactical) vs "overall plan" (strategic).

I think tactical AI ("what") is the easiest to do, through a reaction system - which are already common.  Tactical, short term decisions usually has a clear trigger (e.g. when you come into/act within LoS of enemy)  and triggers tend to have have commonsense solutions or responses according to the genre being played.

I.e. responses to receiving fire trigger set in WW2 might be to: duck back/move to cover/hit dirt, return fire or a combination of the two, made against/tied to the units training stat.   Or perhaps even (Japanese) to banzai charge headlong....

2HW already does tactical AI, and reaction-centric games like Infinity and Ambush Alley could easily be modified to do so. 

Strategic AI ("why") is harder to do.  This is where 2HW falls down a bit.  Once you move into contact (unless you are a "hero") you get locked into a cycle of tactical "AI" reactions.  However for the sake of a fully automated AI opponent, it does not answer the question WHY the unit chose to move around that particular corner into LoS.

Strategic AI - vs "bias"
Yet strategic AI is very important as when playing yourself: "bias" towards a particular army tends to be most evident when you plan ahead and execute long-term plans.  It's easy enough to put yourself in the shoes of a single soldier in a single moment of time and say "what would I logically do" - but what are his overall objectivesWhy did he get himself in the situation in the first place?

It's another reason IGOUGO is bad.  The ability to plan flawlessly ahead without interruption tends to emphasize any bias.   A turn broken up (and/or unpredictably) means you make short term tactical choices, logically, rather than "I sacrifice x to acheieve y". (...though this is a decision commanders would be called to make at times...)    It helps you to "live in the moment" and be in that soldier/unit shoes with less bias.

If you can move everything without interruption, your decision process is different to if you only get to move one unit then your opponent moves. If you don't know when you will "lose" the initiative, your decision making is different again.  The further you think ahead, the more bias can creep in.  An alternate-move game where players take turns activating units makes you "live in the moment" as it were, compared to IGOUGO.  A focus on micro over macro. "What is best for blue x, right now - rather than "how can I make red/blue win overall?"

Yet ignoring the macro doesn't work: after all, having red/blue "win overall" is the purpose of the game....

Strategic AI - the nut to crack
For me anyway, the main problem seems to be (#1) having a good strategic AI; and (#2) how it synergizes with tactical AI.  I.e. why are units moving to a particular spot or concentrating on a particular target; and how does this influence their immediate tactical reactions?

Making a decent tactical AI without a strategic element can be done easily enough, often by only slightly modifying the existing game if the game already has inbuilt reaction mechanics.  (I know 2HW has PEFs and stuff like that, but it is more unbalanced randomness that adds uncertainty to the game, rather than coherent, strategic AI).  That's why bug hunt "alien"-style games are easy to make AI for - cos there is no strategic AI needed besides general guidelines such as "charge towards the nearest guys and eat them." No further "why" is needed.  You don't have objectives to secure, acceptable casualties or morale to consider.  Neither is there a compelling need to outflank/outmaneuver foes.  There's just one overriding imperative: charge at them and gobble em up!

Well, that didn't help...
Sorry this does not offer any great solutions.  I just ask the questions!
I'm just trying to define the issues to I can start to look for solutions.  That said, I'll try to explore some concrete methods in later posts - but this will be handicapped by my lack of background knowledge in solo boardgames/cardgames.  


  1. "WHY has it got to be built?" "It's a bypass. You have to build bypasses!" - Foreman explaining why he has to knock down Arthur Dent's house in Hitchhiker'sGuide to the Galaxy. (Sometimes even the reasons why people do what they do isn't clear to us. Or them.)

    Which is to say - yes, it would be ideal if the AI had a why. The challenge is keeping that knowledge from the player. The game Ambush did this by having pre-plotted moves on maps that were triggered when the player's forces moved into certain areas. But that trick only works once -- once you've played the scenario, that's it, because the enemy reacts the same way every time. But it's really cool that one time!

    In my own solo games, I've toyed with giving the AI objectives to take. The problem is - I know where those objectives are! And it's almost impossible to not use that knowledge. I've been toying with some card based ideas to solve that but so far it still seems just as arbitrary as THW (totally agree about the THW PEFs -- they are a good idea but need more intelligence)

    1. "In my own solo games, I've toyed with giving the AI objectives to take. The problem is - I know where those objectives are! And it's almost impossible to not use that knowledge."

      Does it matter? Many times the mission of the attackers IS obvious to both. If an enemy attacks a city block, it is reasonable to assume they are sizing the TV broadcast building rather than the hundred faceless solicitors offices and fashion boutiques that make up the rest of the map, and react accordingly.

      If they are boarding a starship, they are probably heading for the command centre or reactor core.

      I think you may be "over thinking" things a bit here. A pure, totally unpredictable AI is difficult enough for PC programmers, let alone analogue boardgames.

  2. This reminds me of your post about the importance of scenario design. I wonder how these two elements work together?

    1. Well, logically, strategic AI should flow down from the mission type.

  3. This is why you generally need to bolster the AI with 20-25% more force points/value/cost to makeup for the dumbness factor. The other option is to hamper yourself to make up for it through mechanics like randomised setup, staged entry that sort of thing. The problem then is not the knowing what the enemy force is trying to do, its about how you can stop it with what you've got and where it is.

  4. My thinking on this topic is that it comes down to the tactical doctrine of the unit (your tactical AI), and the mission objectives (your strategic AI). No game should exist in a vacuum. Each fireteam/squad/platoon must have been given objectives before the shit started to come down. So in answer to the 'where' they are going, you'd refer to the original instructions that would have been given. For example: fireteam A to flack objective south; fireteam B to provide overwatch while fireteam C to close on objective and secure it. Those are the strategic AI guidelines, and the teams act accordingly... B will not charge the enemy, C probably might, and A will look for move/fire opportunities

  5. Super late to the party... But one thing computer game AIs struggle with is not creating perfect AIs. Those are no fun... And fun is the name of the game.

    An example, basically every stealth game resets the alertness level after a timeout ("must have been the wind") ... That's not realistic/perfect, but having to restart a game because a facility goes into lockdown is not fun.