Friday, November 11, 2016

A Relatively Simple System for Relatively Complex Solo AI

While playtesting my Invasion:UFO (working title, and yes I know about the British TV series) rules, a comment from  a playtester got me thinking -- could my simple AI with semi-random movement be adapted to actually consider Objectives like a human would?  After a bit of thought I came up with a relatively simple way based on the pathfinding that units do in computer games.  It still leaves a lot to the player, of course, but it does achieve the goal of making the AI appear as if it is considering objectives.

I'm putting this out here for others to use if they would like while playtesting continues.  No frills here - the is the rough draft of the rules.

Following the rules is a playtest in action.


A Relatively Simple System for Relatively Complex Solo AI

ARSSRCSAI -- not a very good acronym!

Right now this is aimed at land operations as they usually have one thing in common -- objectives to take.  This is usually less so with aerial, space, navy, etc. although I think it would be interesting to try it with the Aeronef games being kicked around on other threads.

I've tested this half a dozen times now and I think it works, but I worry that my own biases of knowing how it is supposed to work might be influencing it, so...opening it up.  This grew out of skirmish gaming for my Invasion:UFO project but it also worked beautifully with a Victorian Sci-fi game that I ran.  Anyway...the rules!

Components required:
2 six-sided dice
Objective markers - I'm using slips of paper for now - marked
  1 - marked with 30
  2 - marked with 20
  3 - marked with 30
 Enemy force markers aka "blips" or "blinds"
    So far, I've only tested this with 3 markers.  But it should work ok with more -- and including "dummy" markers would make the game more interesting.
    How you divide the forces is really up to you -- but try dividing them into a primary and secondary group at least and maybe a tertiary.  Or the tertiary could be the dummy blind. 
        For skirmish gaming I had 2 groups of 2 figures and 1 group of 3. 
        For the VSF game I had 2 squads with 1 marker, the commander and a command squad with another, and a skirmish cavalry group with a third.
Optional:  Stance cards -- stolen temporarily from Invasion - UFO. 
    NOTE: This is _entirely optional_ but it does give the enemy a little more random movement while _tending_ to move directly toward the objectives.  But if you like, skip this and just move the enemy toward the objective when you get to that part.
    Decide what the enemy commander's temperament is or just roll d6
        1,2: Aggressive
        3,4: Confrontational (this will be renamed - it's really "normal")
        5,6: Cautious

3 foot by 3 foot game board -- I think it will work for larger areas but haven't tested it.  What's important is that you can divide it into roughly equal "squares" and having squares of 1 foot on a side is convenient.  For the AI, the board is divided into 9 numbered squares but the numbering is different for setup and objectives.

For Setup the board is numbered:
        1    2    3
        4    5    6
        X    X    X
    (where X is the human deployment zone -- no enemy units will be placed there)

For objectives the board is numbered:
        X    X    X
        1    2    3
        4    5    6
    (where X is the AI deployment zone -- no objectives will be placed there)

    Up for discussion but what I do: 
    1.  Pick the side for your forces to come in on.  Place your forces - either randomly as per the AI below or however you like.

    2.    Place the AI units using the Setup numbering. 
    3.  Place the AI objectives.  You will place one 30, one 20, and one 10 marker.  Roll a d6 and place the marker in the square indicated -- place it in cover, on top of hills, in buildings -- this is a case where the more terrain the better, probably.  If you roll the same square -- well, this is a case that needs testing.  I think it works best to just roll again so that there is only one onjectice per square but I could be wrong.
    4.  Finally, roll the Enemy Mission.  This is to determine what happens when the AI hits an objective.  So far I just have:
        1-3: Take and Hold.  The enemy will stop when it achieves an objective
        4-6: Patrol.  The enemy will continue to move when it hits an objective.  I'm not sure how well this would work, actually.  Each blip would need to track which objective it had already hit, which would be messy.  Alternately maybe each objective would simply be removed instead of reduced by 10?  More thought needed here.
    The enemy remains as blips until the player's units identify the blip.  I've just been using LOS but it depends on what kind of game you are playing.  I think it would be very interesting to play a naval surface fleet versus an AI submarine fleet, for instance, and use sensor rules to determine when the blip converts to models. 
    Converting - the provess of exchanging blips to models.  For my skirmish game I don't place the models right on the blip when it converts; I roll an offset with a d6 and a direction die just to add more uncertainty.
        Movement rate prior  to converting is abstracted.  I use 6" for my blips.  They ignore terrain and can end up on impassable terrain since I then roll an offset when I convert them (see above)
        Here's the heart of it!
        1.  Starting from left to right, select a blip.
        2.  Measure the distance to the 30 objective. 
        3.  Subtract the distance from 30 to get a score.
                    If the 30 blip is 24" away the score is 6.
                    If the 30 blip is 31" away the score is -1.
                    If the 30 blip is 9" away the score is 21.
        4.  Repeat step 2 and 3 for the 20 objective and the 10 objective.
        5.    From this you should have 1 high score -- if a score is tied the higher numbered objective wins
        6.  Take the stance card and place it against the blip.  Aim the "This side toward enemy" arrow at the winning objective.
        7.  Roll 2d6 and move the blip in accordance with the roll  (or move it toward the objective if not using the stance cards)
        8.  IF THE BLIP CONTACTS AN OBJECTIVE (or I usually give a little lee-way like within 1" or 2"):
            A) The objective is immediately demoted to the next lower level.  A 30 objective becomes a 20.  A 20 becomes a 10.  A 10 objective has been achieved and is removed from the board.
                a) the blip contacting the objective makes no further movement this game.


In this example, I did not use the Stance cards for clarity.  So the blips always move in a straight line toward the highest scoring objectives.  I used Battle Chronicler for the maps -- it's my first time using it but I think it will work pretty well for future examples.  I'm really grateful to the author for providing his work for free.

In this example, I am resolving the objective calculations from left to right (ie A then B then C).

I used random deployment in the top 3 squares.  A and B happened to end up in the same quadrant.
Objective 30 is the biggest draw on the board.  All 3 blips start moving toward it.

Nothing's changed in this relatively simple example, so all blips continue towards the Primary Objective (30).  Notice though that C is close to Objective 20.

Objective achieved!  A makes the first move and moves onto Objective 30.  Objective 30 now becomes a "20" objective.  B moves next.  Both objective 20s are a draw, but the former Objective 30 is stronger since it is closer.  B moves onto the farm house and further reduces the objective value to 10.   Finally, C resolves its move.  There are two "10" objectives quite a distance away, so C changes its path and heads toward Objective 20, the secondary objective.

Both A and B are on an objective and this is a "Take and Hold" mission.  They will no longer move (unless forced off the objective - which would up the objective by 10 - need to add that in the rules above).  C takes the hill and that ends the game as far as the AI is concerned.

Of course, this is a simple example but even this simple example has a neat flow to it that goes beyond just using semi-random movement.

Please let me know in the comments if you try this out!