The sorian PA AI thread

Discussion in 'Planetary Annihilation General Discussion' started by Quitch, December 23, 2014.

  1. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Do the build items have the same name?
    Quitch likes this.
  2. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    It's not a unique name, but it's not a name shared between Uber and Bronze. Let me go make all the names unique anyway just to see if that roots out any other weirdness.
  3. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Unique names seems to have sorted it, thanks! I'm such a scrub :D
  4. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    No problem. :)
  5. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    I have not.
  6. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    @Quitch I think I understand why you were having the problem. I will look into making a small change to make things work easier for you.

    The tl;dr version of the problem is this: AI bases keep track if they are able to build any of the available factories. In order to check properly it needs to account for buffer size. In an effort to not have the same value in two different places the AI simply looks at the buffer value for the build item named "Basic Bot Factory".
    Quitch likes this.
  7. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Does that mean that for the time being I should one entry for each factory simply named "Basic Bot Factory" or "Advanced Naval Factory" to ensure the buffer is getting set properly? Or is it simply that having an item with the name means any other buffer preference for that item is overridden and if it doesn't exist each block uses its own buffer?
    Last edited: July 1, 2015
  8. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    The AI has a very odd way of attacking bases. A human player will bore into it, removing each item in turn before pushing in closer (attack move pretty much). The AI will plunge into the middle of a base. It's a behaviour that sees it sacrifice a good lead regularly because it continually leads to armies getting surrounded, being in a poor position to fight, and maximising the number of enemy units (especially turrets) that can fire on them.

    Also, I don't know quite how the focus target behaviour works, but I'd say the AI needs to be stricter about who it fights. In a FFA the AI will engage with every opponent it can find, but that's how you lose a FFA. It needs to pick a target, eliminate them with all its power, then move on to the next. I'm not sure if it's trying to flank its focus target and runs into someone, but it does seem to tangle with too many people in a mode which rewards much more conservative and focused play.
    stuart98 likes this.
  9. devoh

    devoh Well-Known Member

    Messages:
    445
    Likes Received:
    404
    It wants to kill all humans. It can't help but engage them all at once. :)
    cdrkf likes this.
  10. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Are the demand and drain checks in the personalities percentage modifiers, or do they do something else?
  11. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Sometimes the AI idles its nuke launchers. I thought it was due to CanAffordBuildDemand so took it out, but even then it will sometimes idle them. The build block is literally:

    Code:
    {
             "name":"Uber - Nuke Missile",
             "to_build":"NukeMissile",
             "instance_count":-1,
             "min_num_assisters":3,
             "max_num_assisters":12,
             "priority":151,
             "builders":[
                "NukeSilo"
             ],
             "build_conditions":[
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"FactoryHasOpenSlot"
                   }
                ]
             ]
          },
    I'm just wondering if there's something that can cause FactoryHasOpenSlot to be wrong.

    2015-07-01_00007.jpg
    Last edited: July 1, 2015
  12. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Did you hit the AI unit cap by chance?
    Quitch likes this.
  13. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    If I recall correctly it hadn't finished building all the Catalysts yet. If they count towards the unit limit then it hadn't hit it yet, if they don't then it's possible it might have. It did shutdown its factories though - which I put down to it not requesting troops anywhere as it wasn't using the ones it had - so I'm tempted to say you're spot on.

    Damn, have to check that next time :)

    EDIT: Based on another game on the same map and given the timings, I'd say yes, it had hit the limit.
    Last edited: July 2, 2015
    cdrkf likes this.
  14. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Much like vanilla I have a block which grabs all the units in the pool and throws them through the teleporter. Except what I often find is that there's a large group of units which never go anywhere, only stuff rolling off the factories is grabbed. In the example below the planet is empty apart from purple.

    I was wondering as to the cause. Does it mean they were assigned to a platoon at some point and never return to the pool?



    Code:
    {
             "name":"Uber - Land Transfer To Planet",
             "to_build":"Teleporter_Attack",
             "instance_count":-1,
             "priority":210,
             "build_conditions":[
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"BaseThreatened",
                      "boolean":false
                   },
                   {
                      "test_type":"OtherPlanetNeedsLandUnitAssistance",
                      "boolean":true
                   },
                   {
                      "test_type":"CanProvideLandUnitAssistance",
                      "boolean":true
                   },
                   {
                      "test_type":"UnitPoolCount",
                      "unit_type_string0":"(Tank | Bot) & Mobile & Offense",
                      "compare0":">=",
                      "value0":10
                   }
                ]
             ],
             "task_type":"TeleportLandToPlanet"
          },
    
    "Teleporter_Attack":{
             "units":[
                {
                   "unit_types":"(Bot & Mobile) - Advanced - Fabber - Construction - Artillery - Heavy",
                   "min_count":0,
                   "max_count":-1,
                   "squad":"Fast"
                },
                {
                   "unit_types":"(Tank & Mobile & Offense) - AirDefense - Construction - Artillery - Tactical - Heavy",
                   "min_count":0,
                   "max_count":-1,
                   "squad":"General"
                },
                {
                   "unit_types":"(Bot & Advanced & Mobile & Offense) - Construction - Artillery - Tactical",
                   "min_count":0,
                   "max_count":-1,
                   "squad":"Fast"
                },
                {
                   "unit_types":"((Tank | Bot) & Mobile) & (Artillery | Tactical)",
                   "min_count":0,
                   "max_count":-1,
                   "squad":"Artillery"
                },
                {
                   "unit_types":"Tank & Mobile & Heavy",
                   "min_count":0,
                   "max_count":-1,
                   "squad":"Close"
                },
                {
                   "unit_types":"(Land & Mobile) & (AirDefense | Construction)",
                   "min_count":0,
                   "max_count":-1,
                   "squad":"Defense"
                },
                {
                   "unit_types":"Land & Scout",
                   "min_count":0,
                   "max_count":-1,
                   "squad":"Defense"
                }
             ]
          },
    
    stuart98 likes this.
  15. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    I saw a lot of these spammed in the logs for a while on PAX Prime:

    INFO Army: Triton - PlatoonTransferReconToPlanetTask: This task currently only supports 1 unit per task.

    I looked to see if there was an error in the Queller tests, but best as I can tell the selection of the unit is handled by the TransferReconToPlanet task, not the AI files.

    Code:
    {
             "name":"Uber - Orbital Radar Transfer To Planet",
             "to_build":"Orbital_Radar",
             "instance_count":-1,
             "priority":101,
             "build_conditions":[
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"OtherPlanetNeedsReconAssistance",
                      "boolean":true
                   },
                   {
                      "test_type":"UnitCountOnPlanet",
                      "unit_type_string0":"Orbital & Recon - Structure",
                      "compare0":">",
                      "value0":1
                   }
                ],
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"PlanetIsGasGiant",
                      "boolean":true
                   },
                   {
                      "test_type":"OtherPlanetNeedsReconAssistance",
                      "boolean":true
                   }
                ],
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"OtherPlanetNeedsReconAssistance",
                      "boolean":true
                   },
                   {
                      "test_type":"HaveFullPlanetIntel",
                      "boolean":true
                   }
                ],
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"OtherPlanetNeedsReconAssistance",
                      "boolean":true
                   },
                   {
                      "test_type":"AloneOnPlanet",
                      "boolean":true
                   }
                ],
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"PlanetWithoutPresence",
                      "boolean":true
                   },
                   {
                      "test_type":"UnitCountOnPlanet",
                      "unit_type_string0":"Orbital & Recon - Structure",
                      "compare0":">",
                      "value0":1
                   }
                ],
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"uber",
                      "boolean":true
                   },
                   {
                      "test_type":"PlanetIsGasGiant",
                      "boolean":true
                   },
                   {
                      "test_type":"PlanetWithoutPresence",
                      "boolean":true
                   }
                ]
             ],
             "task_type":"TransferReconToPlanet"
          },
    Also with Vanilla I saw another

    WARN Sim::retireEntities() mutated the sim history somehow

    This was ~13min into a 10way FFA on PAX Prime. No Unit Cannons in sight. Sim went to 0.2fps for a while.
    Last edited: July 2, 2015
  16. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    The platoon size is handled in content\ai\platoon_templates\platoon_templates.json. It is a fixed locally. Just needs to be this:

    Code:
            "Orbital_Radar":
            {
                "units":
                [
                    { 
                        "unit_types": "Orbital & Recon - Structure",
                        "max_count": 1
                    }
                ]
            },
    
    cdrkf and Quitch like this.
  17. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Can mobile units belong to a base i.e. when doing a UnitCountInBase do they get counted?
  18. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Just a bit of cross-thread pimpage for the AI crowd: Queller v2.0 is now out, complete with newly implemented personalities.
    Remy561 likes this.
  19. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    So obviously I got to watch a lot of AI action while making Queller v2.0. Based on my observations here are the areas I think the AI could most stand for improvement in no particular order with the understanding that I'm sure these are mostly really hard and probably on a list somewhere already and if only time and resources were infinite... :)

    1. AI troop targeting


    The AI's target prioritisation is poor. It seems to prioritise eco, which means it's almost always making bad decisions. Especially as it loves going after energy, which most people are floating hard on, has more health than most other targets, can't hurt you and is much easier to rebuild than MEX. Target priorities should be:
    1. Things that can shoot me
    2. Commander (if I can kill it)
    3. Antinukes (if you have nukes otherwise do after nukes)
    4. Nukes
    5. Fabbers
    6. Things that make things that shoot me
    7. MEX
    8. Energy
    What the AI should never do is drive into the middle of a base, because that's suicide and is throwing the game. And unless you can kill the Commander then you should run away when you see it because the Ubercannon will destroy your force.

    Where the AI is using an SXX the Commander should be priority number 1.

    2. Unit Cannon targeting

    The AI doesn't use these right. It will launch troops onto the outskirts of a base which leads to them getting picked off before they accomplish anything. These are snipe weapons which go after unprotected items in this order:
    1. Commander
    2. Antinukes (if you have nukes otherwise do after nukes)
    3. Nukes
    4. Advanced energy fields
    3. Nuke use

    Same with nukes, the AI holds on to them far too preciously. If you have a nuke, your opponent doesn't have an anti-nuke, and you're not launching it then you're mad. The only situations where the AI should be holding onto it is:
    1. Seen the enemy commander and has a second nuke (the missile not the silo) under construction
    2. You want to hit an area with antis and the additional missiles needed are still being made
    It also, again, only goes after eco. Priority targets for a nuke are:
    1. Teleporters on your world with troops flooding through
    2. Advanced energy fields
    3. Large production clusters
    I've seen the AI lose nukes with missiles. That's something that should never happen. Take out the army with the nuke.

    4. Orbital scouting

    I don't know what causes NeedReconAssistance to get set, but it's not getting set aggressively enough, or is turned off too easily. In the late game the AI has really poor planetary intelligence and needs to be far more aggressive about sending out radar. It can be sitting on piles of nukes or unit cannons, but it doesn't have good intel on where to send them.

    Don't position yourself on the other side of the planet. Drop a radar over the enemy base, it doesn't matter if you lose it, for a second you have complete vision and know exactly where to launch the alpha strike.

    This ties into nuke use as well. Finished a nuke? You should be dropping a radar on top of the enemy base immediately. No anti? Launch the nuke!

    5. Moving units between planets

    The AI will lose any game where there's a gas giant because it can't contest them. I can take every avenger from 10 planets and send them there, and there's no way the AI can counter this because it has to build an orbital army for each planet. The resources of a gas giant are vast, and losing control of this means you lose the game.

    It also needs to support more than just moving orbital fabbers to planets without one, it needs to understand where a planet needs further fabber support. Likewise with ground fabbers, it needs a way to send fabbers to other planets because currently it only expands as fast on a world as it builds factories, which is a waste of its existing fabber armies.

    6. Rally points

    The AI rallies units inside its base. In the early game this constantly loses the AI both resources and fabbers. Forge is a great example of this. Human players will rally troops to the four metal spot near the base because it's where their fabbers go to work, where as the AI will lose its fabbers and resources before it can respond.

    When the AI is alone on a planet it shouldn't be rallying troops to the base it should be rallying them to the teleporter. It's no good sneaking a teleporter onto an enemy world if your troops aren't ready to immediately pour through.

    7. Fabbers don't react

    The AI's fabbers know no fear. And it leads to the AI losing them constantly. They need to run away from threats, and not just ones they see (because that's too late), but ones nearby units have seen.

    8. Booms

    These are a very specific weapon, great against certain units and dire against others. They're reflective of a need to be able to pass commands to LandAttack to target certain units when forming a platoon. Booms should only be going for Commanders, tanks (which aren't Infernos or Vanguards) and Walls and static defence behind walls.

    9. Teleporter threat

    The AI doesn't seem to understand how big a threat a teleporter represents. Just one represents the possibility of that players entire LAND threat turning up on your planet. It should recognise that where the opponent has almost no structures on a planet except for the teleporter that this is an invasion point and must be destroyed at all costs. Failure to do so can often lose a player a game.

    The AI also lacks a means to assess threat on the other side of a teleporter so cannot adjust troop mixes appropriate to launching a planetary invasion.

    10. Multiple teleporters

    The AI needs to be able to link up multiple teleporters. Currently it can only invade one world at a time through one teleporter. This makes it both easy to stop, and incredibly inefficient.

    11. Commander behaviour

    The AI treats its Commander like a fabber and it only defends itself when it's not on its way to a build job. Commanders might be more fragile than they were in SUPCOM, but they're still units that can be used aggressively. The AI needs to, at the very least, defend itself when under attack whether it's on its way to build something or not. Getting shot should cause it to go into battle mode.

    It also needs to spam the Uber Cannon, because right now it doesn't fire it anywhere near as often as it could. It also needs to be smarter about targeting it.

    12. Walls

    The AI doesn't understand them at all. They're treated like a structure to be destroyed and the AI micros when attacking them. It needs to know that they are a force multiplier, should not be targeted and are for artillery to counter or for armies to route around.

    Likewise, the AI needs to be able to use them. Something as basic as building them 10 units closer to the nearest eco threat than the structure it's protecting. And the Commander needs to be able to use them when under attack. I tried to hack this behaviour in, but haven't successfully managed it.
    cdrkf, andrehsu, dmorchard and 2 others like this.
  20. Quitch

    Quitch Post Master General

    Messages:
    5,884
    Likes Received:
    6,045
    Am I correct in thinking that cross_planet_shared_count means the instance is counted across planets? Is this for shared instances only?

    Also, in the last patch the following block was added to fabber assist

    Code:
    {
                "test_type": "OnTaskType",
                "string0": "BuilderAssist",
                "boolean": false
              }
    It's stripped out again in PTE. Was it causing issues, or just didn't do anything? Is this related to
    • Fix for AI fabbers constantly starting and stopping assisting
    Last edited: July 16, 2015

Share This Page