The sorian PA AI thread

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

  1. lafncow

    lafncow Active Member

    Messages:
    153
    Likes Received:
    103
    Again, just talking out of my *** here, but one way to address this would be to have the AI assign probabilities of threat to all map areas that get updated by game events, scouting, etc. This might also solve situations I've seen like this:
    I have one planet on lockdown, the AI has another. I have a beachead of avengers and anchors that prevent the AI from sending orbital to scout my planet. The AI builds up nukes but only uses them on my beachead and never takes a potshot at my planet.
    cptconundrum likes this.
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    It might be better to attach it to whatever the AI uses to decide where to scout next. I assume the map for choosing scout locations is probably based just on the amount of time since the last scout flew over. That value could be modified when the AI detects incoming artillery so that it will focus on scouting that. Once it does, the threat map could take over and it will respond as needed. It's not perfect because it means the commander wouldn't immediately run away from incoming artillery, but it is probably the cheapest way to deal with the problem without forcing Sorian to change a lot.
  3. Going4Quests

    Going4Quests Active Member

    Messages:
    238
    Likes Received:
    71
    The best and simple fix is I think to simply get cover if being hit by artillery. And not "iiii'm siiingiiing in the-wait, it's artil"*COMMANDER DESTROYED*.

    EDIT: Although it's a nice idea to let him also scout: where does the artillery come from? When attacked. :p
  4. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    The AI still handles Dox like they can shoot while underwater.
    Last edited: January 5, 2015
  5. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    What causes Need____Fabber to be true? I thought it was linked to fabber_to_factory_ratio_[basic|advanced], but Queller never seems to keep to the ratio despite having its sole checks be the Need____Fabber and CanAffordBuildDemand, with a priority higher than the troop units.
  6. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    I can look into that.

    It is the fabber_to_factory_ratio, as long as the AI does not have more than than max_(basic | advanced)_fabbers.
    stuart98 likes this.
  7. Going4Quests

    Going4Quests Active Member

    Messages:
    238
    Likes Received:
    71
    Sorian can you look into the issue where the Ai didnt flee and just died from the Holkins? :)
  8. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    Indeed, I found it worked as expected in my naval tests and having just done some double checking it looks like I was using a make believe check of NeedBasicLandFabber. I've fixed them to Bot and Vehicle.
  9. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    No, because I already know why that happens. Will I add something in the future to prevent this? Maybe.
  10. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    OK, but if our Holkins suddenly self-destruct, that's cheating.
  11. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    If the AI can't find a location to build which meets the requirements of the placement_rules does it build it anyway, or abandon the build? Do those rules link to the CanFindPlaceToBuild check?
  12. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    If it can't find a place to build that meets the requirements it wont start the build. The build item still exists, so if it finds a a spot later (threat was removed, spot opens up, etc) it will build it.
  13. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    You noted here that NeedLandFabber was split into bot and vehicle due to the split in the AI personality file of land into bot and vehicle.. This implies some interaction between the bot and vehicle weightings and the fabber_to_factory_ratio_basic. Is this correct? Certainly my tests suggest that the AI builds fabbers before the ratio requires it when driven solely by the need test.

    Here's my guess:
    • The AI has a number of fabbers it needs to obtain as determined by the fabber_to_factory_ratio_basic.
    • This number is then divided among the basic personality percentages for bot, vehicle, air and naval.
    • So 10 factories at a ratio of 1 means 10 fabbers. Under the default personality this would mean
      • 4.5 vehicle fabbers
      • 2.5 bot fabbers
      • 2 air fabbers
      • 0.5 navy fabbers
    • The AI rounds these numbers, leading to a total of 12 fabbers where you would expect to see only 10 (assuming all factory types exist), and this is why the fabber total doesn't match the ratio.
    I literally just pulled that out of my backside now, it's not based on testing :)
    Last edited: January 6, 2015
  14. Going4Quests

    Going4Quests Active Member

    Messages:
    238
    Likes Received:
    71
    But without this the AI becomes super easy to beat. Put artillery in range of the commander and dont let the ai know you have it there. :(
  15. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    Also, does the AI ever reinforce platoons, or does it simply form new ones?

    When figuring out whether to fight or retreat does the AI take into account other platoons in the area?
  16. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    I found a case that would cause the issue you described. If you are using the NeedLandFabber test and have a bot or land factory, but not both, the AI would build more fabbers than necessary. This is because of the ratio calculation. The ratio of fabbers to factories is numfabbers / numFactories. However, to prevent a divide by zero error if there are no factories the ratio is trated as 0, which is normally going to be less than the personality dictates. I am submitting a fix now.

    This only affects the NeedLandFabber test because it checks for needing either a bot or tank fabber.

    Also, the ratio is a float, so no rounding is performed. A desired ratio of 4.5 will mean 4 fabbers for 10 factories, but it will also mean 45 fabbers for 100 factories.

    The AI can merge two nearby platoons together to form one platoon. Otherwise, no it will not reinforce a platoon.

    Yes, the AI takes into account nearby allied units.
  17. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    Oh, so NeedBasicLandFabber and NeedAdvancedLandFabber are in fact still valid tests?
  18. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Actually now that I look, they are not valid.
    squishypon3 and Quitch like this.
  19. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    So does this cover the whole planet, or only areas within the AI's bases? What constitutes a base to the AI?
  20. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    A base is just an area on the planet the AI has designated to build stuff.

    AllMetalSpotsFull will be true if all of the AI's bases on a planet have no metal spots to build on. The AI is pretty aggressive about expanding and creating new bases, so this will only be true if the entire planet is covered, or if all of its bases are full and it cannot safely expand any further.

    UnableToExpand is kind of related. If the AI cannot safely expand any further on a planet, this will be true.

Share This Page