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,850
    Likes Received:
    6,045
    Ah, OK. So you can specify different criteria for one squad, ala

    Code:
            {
              "unit_types": "((Tank | Bot) & Mobile) & (AirDefense | Construction)",
              "min_count": 0,
              "percent": 0.2,
              "squad": "Defense"
            },
            {
              "unit_types": "Land & Scout",
              "min_count": 0,
              "percent": 0.05,
              "squad": "Defense"
            }
    And then those different units would be crammed together in defense.

    One behaviour not mentioned was escort. What does that mean to the AI? How does it differ from defense? Attack things that come into the guard radius only?
  2. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Shouldn't it instead try to micro on the edge of the ENEMY max range (+bias) instead? Respectively:

    min(enemey range + bias, own range - bias)
  3. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    I don't think so, no, because the priority is to bring all your guns to bear and the micro is to dodge shots. A Dox and Bolo have the same range, if the Dox micro at the edge of a Bolo's range under AI control then the Dox lose. Dox swarm tanks, they don't take them at range.
  4. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Also, sorian, now you've introduced multiple personality tags you're only one (tedious) step away from enabling multi-AI support. Just add a personality check to the top of each block for the "sorian" tag, and boom.

    Also, while we're at it, I'm seeing instances (this is in PTE) of factories stopping building and I see no reason for it.

    233250_2015-07-22_00005.jpg

    Base got hit with a nuke, but with that float the AI should be fine to build. Could this have interfered with CanDeployLandFromBase? Other than that the only checks are cost and personality, and all these factories were working fine earlier.
  5. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    I submitted, what I hope, will be a fix for this issue. However, I will take another look with your information in mind.

    Also, Escort squad is currently only specifically used for bomber/gunship platoons. All units in the escort squad perform an area patrol to protect the other squads.
    Quitch likes this.
  6. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    When the AI forms a platoon to move through a teleporter, is the platoon dissolved on the other side? The behaviour I've seen suggests it's forming new ones as the units arrive, but thought I'd confirm.
  7. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    .
    Last edited: July 23, 2015
  8. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    I think personality_tags doesn't work.

    Code:
    'Vanilla Uber': {
                metal_drain_check: 0.52,
                energy_drain_check: 0.57,
                metal_demand_check: 0.72,
                energy_demand_check: 0.72,
                micro_type: 2,
                go_for_the_kill: true,
                priority_scout_metal_spots: true,
                enable_commander_danger_responses: true,
                neural_data_mod: 1.0,
                adv_eco_mod: 1.3,
                adv_eco_mod_alone: 0.85,
                personality_tag: "uber"
            },
            'Vanilla Artillery': {
                metal_drain_check: 0.52,
                energy_drain_check: 0.57,
                metal_demand_check: 0.72,
                energy_demand_check: 0.72,
                personality_tags:
                [
                   "uber"
                ],
                micro_type: 2,
                go_for_the_kill: true,
                priority_scout_metal_spots: true,
                enable_commander_danger_responses: true,
                neural_data_mod: 1.0,
                adv_eco_mod: 1.3,
                adv_eco_mod_alone: 0.85
            },   
    Of these two, only Vanilla Uber will work, Vanilla Artillery will sit around doing nothing (Queller requires one of five tags to build anything). This is in PTE of course.

    To confirm I added the following to the vanilla AI and loaded up Absurd.

    Code:
    {
       "build_list":[
          {
             "name":"Wall",
             "to_build":"Wall",
             "instance_count":1,
             "priority":5000,
             "builders":[
                "Commander"
             ],
             "build_conditions":[
                [
                   {
                      "test_type":"HasPersonalityTag",
                      "string0":"PreventsWaste",
                      "boolean":true
                   },
                   {
                      "test_type":"CanAffordBuildDemand"
                   }
                ]
             ],
             "placement_rules":{
                "buffer":3,
                "threat":{
                   "influence_type":"AntiSurface",
                   "compare_type":"<",
                   "radius":10,
                   "value":50
                }
             }
          }
       ]
    }
    It built no walls. When I removed the HasPersonalityTag block it built walls.

    On a side note, you've changed the metal_drain_check on Absurd to 0.55. This causes it to go MEX first. Might I suggest 0.54? This will allow it to go factory first while leading it to run less tight on metal than 0.52 did.
  9. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Certain CSG will stop planes when they fly over them. The AI doesn't appear to ever unstick these platoons unless they're engaged in combat.
  10. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Only so much I can do from the AI side.
    Quitch likes this.
  11. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Sorian, is there a way to run server.exe to have it just run an AI game with chosen personalities without launching the GUI? I'd love to be able to quickly run a number of games to test whether change X is really beneficial. I see there's a --no-players options, but I can't figure out if it can be used the way I want or if it's intended simply in conjunction with the neural net training.
  12. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Targeting boo boo by the AI here

    2015-07-24_00004.jpg

    2015-07-24_00005.jpg

    The AI's Sheller doesn't fire on the Commander at any point during the period shown. Had it done so it would have won the game. It ends up losing to an Inferno drop because it wanders its Commander out of the base.
    igncom1 likes this.
  13. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Would including AllMetalSpotsFull tests help the AI avoid trying to find metal spots that don't exist, or is this already a part of the CanFindMetalSpotToBuildBasic test?
  14. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Also, this still happens.

    2015-07-25_00001.jpg
  15. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    They are basically the same test, just looking at things a bit differently.

    Is that two fabbers building on the same spot at the same time? If so, we know what the cause is and I think it is still on my plate to fix, when I get the time.
    Remy561 and Quitch like this.
  16. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Yeah, two armies, one metal spot, two MEX.
  17. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Another addition to the Quitch wishlist: the ability for the AI to use teleporters on a single planet :)

    It seems perfectly doable to setup the AI to erect a teleporter in a probably useful location to ferry its armies around, but right now it won't actually use them. Prepare for some non-coder stuff here :) Would it be possible for the AI, when sending army A from point X to point Y, to look at whether a trip to the nearest teleporter and out the exit point would be faster? Or even to only consider this when forming a platoon and ignore the distance to teleporter (since both would be in the main base) and then just look at whether the exit point is closer? As the crow flies distance stuff for simplicities sake.

    Obviously there are ways for that to go wrong, such as the teleporter ending up on an island or something, but it would be useful for larger maps.
  18. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Possible, yes. However, there is a significant code refactor I would want to do to support this properly which is why I have not done it yet.
    cdrkf, Remy561 and Quitch like this.
  19. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    More Quitch wishlisting:
    1. Ability to detect ratio of CSG to planet radius size (for making an educated guess as to how chokey the map is)
    2. DistFromNearestEnemyThreat is configured at the start of the game to equal the distance to the nearest possible enemy spawn
    3. Ratio of enemy players to planet radius (for FFA customisation)
    Now back to tearing my hair out on figuring out how best to integrate Grenadiers into Queller :)
    dom314 and stuart98 like this.
  20. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    Also: a pony.
    cola_colin, Remy561 and stuart98 like this.

Share This Page