The sorian PA AI thread

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

  1. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    A couple of further screenshots of the AI metal expansion "bug". It seems if there's a big gap between the main base and the nearest metal then the AI won't go and get it, rather it will simply get stuck in assist mode. Eventually it will find the metal and expand again, but you're talking upwards of ten minutes sometimes for that to happen.

    In these screenshots the yellow AI is Queller and blue is vanilla. On maps like Berg they work as normal. This map was a random, large, symmetrical. Air fabbers are much better than land or naval fabbers at breaking out of this cycle. the air fabber in the yellow screenshot is after one of the naval fabbers finally went and grabbed a remote metal spot (which was promptly bombed).

    It's a deadly cycle for the AI as well because it means it can mean the CanAffordPotentialDrain check for both fabbers and factories can get stuck in false very early on, leading to it doing nothing but sitting there with a couple of fabbers assisting factories.

    2015-05-02_00002.jpg 2015-05-02_00003.jpg
    Remy561 likes this.
  2. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    According to the server AI logs, the condition NeedAdvancedNavalFabber isn't recognised.
    ace63, theseeker2 and stuart98 like this.
  3. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    This piece of CSG causes problems for the AI, causing them to move the unit in tiny circles. I've seen this behaviour in scouting Dox and in Hummingbirds. Hummingbirds finally break out if they see something they can attack. I've seen it with this CSG on this random map as well as another community map.

    2015-05-04_00001.jpg
    igncom1 likes this.
  4. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    @sorian

    As you said on PA Chat yesterday you were going to get an opportunity to work on the AI again, I just wanted to redraw your attention to this topic :)
  5. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    Also, for those who weren't in PA Chat yesterday, the AllMetalSpotsFull bug will hopefully be fixed in the next patch, and Sorian confirmed that PlanetHasUseablePlanetWeapon is bugged and will also be fixed.
    Remy561 likes this.
  6. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Although I haven't been following this thread much lately since I have been busy on other tasks, I haven't forgotten about it.

    Got a couple of days this week to iron out some things in the AI.

    Here is a sneak peek (not a full list):
    • Added stuck detection for AI area build task.
    • AI will send more units at once through a teleporter from planets it has full control of.
    • AI will expand faster on planets it has full control of.
    • AI will do a better job of balancing its economy.
    • AI will once again send orbital radars to other planets.
    • AI will send fabbers with no build task back to a rally point, out of harms way.
    • AI should do a better job of not sending fabbers half way around the planet right after dropping them off at a planet.
    • AI will build more AA vehicles if it is losing the air battle.
    • AI will build a deep space radar earlier when on a planet by itself.
    • AI will build an orbital launcher earlier when on a planet by itself.
    • AI will be more likely to place a teleporter on a planet, in anticipation of needing it later.
    • AI will keep a group of fighters and bombers at the ready when on a planet by itself.
    • AI will build at least one air factory when on a planet by itself.
    And a sneak peek at stuff @Quitch will probably be the only one to care about :p:
    • Fixed the AllMetalSpotsFull build condition.
    • Added two new build conditions: CurrentEnergyEfficiency and CurrentMetalEfficiency.
    • The CanAffordBuildDemand build condition now supports build items with no spec to build.
      • This will now just evaluate the condition using the unit's build arm drain.
    • Fix for the PlanetHasUseableWeapon build condition not working as expected.
    • AI will take into account allied forces when calculating planet wide threat.
    Have more things I want to work on, and will probably get a chance to do so soon.
    Last edited: May 8, 2015
    dmorchard, cdrkf, Bsport and 17 others like this.
  7. MadGreyOne

    MadGreyOne Member

    Messages:
    66
    Likes Received:
    28
    I've been wondering if there are any plans for specialized AIs? One of my favorite parts of sorian AIs from previous games was being able to say, I want this AI to focus on turtling, this one to focus air, etc.

    I know its a little different in PA, but I'd like to have the ability to influence the AI's goals, not just its capabilities.
  8. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    Grab the AI Personalities mod by wondible from PAMM.
  9. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    [​IMG]
    stuart98, devoh and Remy561 like this.
  10. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Figured the unit modders out there might be interested in this check in:
    • AI platoon templates and unit map are now located in a separate folder in the AI content folder.
    • The AI can now load multiple platoon template and unit map files.
    Have other AI stuff I have been working on as well.
    ace63, Quitch, Remy561 and 2 others like this.
  11. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Oooh...

    Now how about allowing the game to load multiple unitlist.json files? :D
  12. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Orrrrrrrrrr

    Have the unitlist.json be unitlist.js instead. So we can add new units in a local scope. I think.
  13. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Note: This is still a work in progress

    unit_cannon_01.jpg
    lafncow, mjshorty, igncom1 and 7 others like this.
  14. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
  15. andrehsu

    andrehsu Active Member

    Messages:
    366
    Likes Received:
    120
    Don't get it , what is still a work in progress?
  16. Engineer1234

    Engineer1234 Well-Known Member

    Messages:
    325
    Likes Received:
    291
    AI building and using the unit cannon I think :)
    websterx01 and cdrkf like this.
  17. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Bingo!
    cdrkf likes this.
  18. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    Something that would be handy which I haven't been able to figure out a hack for is better handling of FFAs.

    Currently the AI seems to go a bit all over the place, rather than clearly focusing on any one player even though I know it's supposed to. From my perspective though I'd like a means to detect that it's in a FFA so I can change its behaviour, and I don't think there's any way to do that with current tests.

    Things I'd find really useful:
    1. Number of enemy teams
    2. Planet threat is based on the strongest enemy team rather than a total of all teams, or the ability to check this separately
    3. Distance between my base and enemy structures in the same way DistFromMainBase is
    Now you can make decisions about fast teching and orbital. Some of that would carry into versus play too.

    Also, helpful in multi-planet games would be:
    1. Number of spawnable planets
    2. Ability to measure UnitCount___ and UnitRatio___ checks against enemies
    3. Planet completely scouted
    Then you could check the number of planets against the number of commanders found and make decisions regarding orbital in a more sensible fashion. Item three would be the ability to know when the AI has scouted every metal spot at least once, then you know you have complete information about who started on your planet.

    Frankly, being able to pull enemy composition ratios would be really useful. Are they heavy Orca? Then let's go heavy sub.
    stuart98 and Remy561 like this.
  19. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    FocusTargetThreat might be what you need. Returns the threat total for the target the AI is currently focused on.

    The rest I can look into.
    stuart98, Remy561 and Quitch like this.
  20. Quitch

    Quitch Post Master General

    Messages:
    5,856
    Likes Received:
    6,045
    Thanks :) To confirm then, this is the correct formatting:

    Code:
                   {
                      "test_type":"FocusTargetThreat ",
                      "string0":"STRING",
                      "string1":"STRING",
                      "compare0":"COMPARE",
                      "value0":VALUE
                   }
    EDIT: Oh, right, this is used in Platoon checks.

    Code:
                   {
                      "test_type":"FocusTargetThreat",
                      "string0":"AntiAir",
                      "compare0":"<",
                      "value0":420
                   },
    But they're absolute values. Is this the only format it supports? Is there any means to figure out (other than trial and error) what a value equates to in real terms, or how much threat each unit counts as? Isn't this for a small area though, so FocusTargetThreat might be low (because it found an isolated fabber) even if a large army is coming towards its base?
    stuart98 likes this.

Share This Page