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
    Skirmish or Galactic War?
    What kind of planet?
  2. bengeocth

    bengeocth Post Master General

    Messages:
    1,285
    Likes Received:
    657
    skirmish, ice
  3. pagabumba

    pagabumba New Member

    Messages:
    13
    Likes Received:
    8
    Playing skirmish, 1v1/2v2 and tested 4v4, Absurd difficulty, Resource multiplier 1.2
    1) AI won't advance to T2/T3 in any moment of the game, even if it is in eco advantage;
    2) In 4v4, AI generally spawns at the very same planet, even if there are 3-4 starting planets; nevertheless, it's very hard to see a planet colonization in every game;
    3) Anytime AI goes for orbital, it just spams out idle units and just awaits your move;
    4) Strangely enough, AI is capable of colonizing random planets, producing blobs of idle units and ignoring you for the rest of the game;
    5) Random bugs, like building land factory on a tiny isle, or Naval Factories on small "lakes";
    6) AI is extremely efficient in finding weak points in your base at the start of the game; but after you have successfully managed to survive its raids, it just pushes all its units in a linear path waiting for you to demolish its force, refusing to use the first strategy and focusing on destroying your most defended part of the base;
    7) Whenever AI starts from sea, the base defenses lack of torpedo turrets, leaving the base free from naval attacks; AI will focus building AA turrets, even if you don't focus on air.
    Last edited: January 7, 2015
    Remy561 likes this.
  4. Engineer1234

    Engineer1234 Well-Known Member

    Messages:
    325
    Likes Received:
    291
    PTE: 76695
    AI doesn't grab all the metal when he's got a planet to himself, he needs to be more greedy, I've been saying this for months.
    Just make AI do a mex area build of the entire planet... the unit-AI will sort out the rest.
    ace63 likes this.
  5. dopefisher

    dopefisher Member

    Messages:
    54
    Likes Received:
    0
    I really enjoyed your ai in FA and SC2. I'm glad to see you're still around, Sorian!
  6. theseeker2

    theseeker2 Well-Known Member

    Messages:
    1,613
    Likes Received:
    469
    it needs to not conserve nukes, too... there are situations when the AI has one nuke already built, and is in the process of building the 2nd or 3rd, but it won't fire the first nuke even if it would win the game, it will hold them all, and probably lose because it's wasting resources on nukes that aren't being used in a timely manner.
  7. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Not seeing that issue, but I will keep an eye out.

    I could add a small bit of code to take enemy commander health into account when deciding whether to nuke. Right now it waits until it has enough nukes (based on commander max health) to kill a commander outright, if it can't find anywhere else worth nuking.
  8. ace63

    ace63 Post Master General

    Messages:
    1,067
    Likes Received:
    826
    I've been experiencing this issue like forever aswell. There have been situations against the AI where I left it pretty much alone and after half an hour it still hadn't claimed more than half of the spots on a planet...
  9. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    Is that perhaps because the ai doesn't treat being alone differently to being on the same planet as its opponent?
  10. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    It does treat being alone on a planet differently.
  11. Quitch

    Quitch Post Master General

    Messages:
    5,855
    Likes Received:
    6,045
    Sorian, looks like formatting wasn't stripped from the latest platoon_templates file. Also, fabber_economy_builds has two rules called Basic Metal Extractor - Expand 2 rules in it now (though they're different).

    Updates to the AI in 76766:
    • fabber_economy_builds
      • New high priority MEX area build for one fabber
      • Advanced MEX priorities increased
    • factory_naval_builds
      • Typo fixed
    The expansion change has made a surprisingly positive difference to the AI's performance.

    AI is still too happy building over its own metal spots. If you watch it on Berg it'll block two to three of its five opening spots.

    The AI doesn't like maps like Forge. The commander will switch to energy plants after the first two factories every time. It becomes entirely reliant on its fabbers to build more factories, while on more open maps you'll see the AI take the more optimal route of having the commander build them. Eventually the southern commander will just sulk on the shore of the lava lake and do nothing, while the northern commander will tend to eventually break out. This is almost 100% reproducible.

    On a likely related note, does the AI have a bias when searching for space? On Forge you'll see the North AI expand over the mountains on its right, while the southern AI will expand towards the middle never over the mountains on its right.
    Last edited: January 13, 2015
  12. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Not sure what you mean. What does the file look like?

    Also, I don't have control over the formatting of the files, that is a build process thing.

    Thanks. Fixed locally.

    Still haven't done anything about that. It is easy to change, just have to find the right value.

    Build items can be changed to fix this. I may look into it, but for your mod it should be easy to fix.

    For most build items it wants to find a location close to the center point of its base. Unfortunately, this is a straight line distance. There is no way for me to take into account obstacles.
    Remy561, Quitch and cdrkf like this.
  13. crizmess

    crizmess Well-Known Member

    Messages:
    434
    Likes Received:
    317
    Can't you use the navigation data and do something like an Dijkstra flood fill from the center of the base to get a estimated value that approximates the "real" distance?
  14. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Sure, but doing that for all of the possible build locations for each engineer every time I want to build something would cause the sim to stall, hard.
    Remy561, squishypon3 and cdrkf like this.
  15. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    Out of interest, would it be more feasible to do a 'general' assessment (so instead of looking at specific fabbers, look at it in this way from the centre of the base). Then use that to identify priorities for expansion?
  16. crizmess

    crizmess Well-Known Member

    Messages:
    434
    Likes Received:
    317
    Oh well, I thought of it more as static information.
    Once the AI decides on a base center point one flood fill determines the distance values for all navigation cubes. Buildings that existed before the center point is placed may cause some disturbance within the distance field, but only edge cases where buildings cut of complete areas may alter the distance field so much that is noticeable and since we are only interested in an approximation of the static terrain there is no need to recalculate this every time.
    For every AIs I would only store the shortest base distance in the navigation data cubes, even when there are multiple bases on a single planet. There is no need to store an pointer to the actual base center from which the distance was derived, because we are only interested to build near our base centers.

    However I'm not sure how much memory overhead this would cause, because it depends on how "dense" your navigation data is.
  17. Quitch

    Quitch Post Master General

    Messages:
    5,855
    Likes Received:
    6,045
    Please envision the three tab spacing.

    {
    "platoon_templates":{
    "Land_Raid_Small":{
    "units":[

    Rather than

    {"platoon_templates":{"Land_Raid_Small":{"units":[

    For some reason the spacing didn't get stripped by the build tool. Doesn't cause any problems with the AI, but might indicate a bug with the build tool that needs fixing.

    The only way I can envision fixing this is by allowing the commander to always build metal when all else fails to force him to walk somewhere, unless you meant something else. I did try reducing buffer sizes to see if it helped, but it didn't really.

    Well, I was less thinking about fixing it as I was wondering why the AI in the south behaves so reproducibly differently from the one in the north on a map with identical spawns and terrain. The southern AI commander has a sulk on the shore every game, while the northern commander will remain active every game. This is true both for vanilla and Queller.
  18. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Just use this:
    https://forums.uberent.com/threads/reformat-your-json-files.47529/
  19. Quitch

    Quitch Post Master General

    Messages:
    5,855
    Likes Received:
    6,045
    No, my point is that normally their build tool removes the spacing, and it has done for every other AI file. They may want to find out why it hasn't for this.

    I don't like that script, it reverses the logical order of the file. I prefer this.
  20. Quitch

    Quitch Post Master General

    Messages:
    5,855
    Likes Received:
    6,045
    Why are WantCommanderOffPlanetByTeleporter and WantCommanderOffPlanet not one and the same check?

Share This Page