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
    Yes
  2. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    I suspected as much. Thinking this would seem a sub-optimal threat value to check for the formation of land platoons (why would they care about ships?) I switched all of them to look at Land instead. I thought Land would, effectively, be AntiSurface minus bombers and ships, but that doesn't seem to be the case as the same values lead the AI to pretty much always form max size groups. Same thing with Naval actually, works fine as a ratio check but doesn't seem to work (or uses vastly different figures) as a set value.

    I've run into a new and interesting one. The position of the AI seems to be influence the outcome of a PotentialRESOURCEEffeciency check. Queller has the Commander do a PotentialEnergyEfficiency < 1 then PotentialMetalEfficiency < 1. In certain spawns (on symmetrical ladder map worlds) it would go factory MEX factory, on others it would go factory energy mex assist factory. 100% reproducible. It didn't matter which factories it made, all that mattered was the spawn point.

    Next I swapped the checks around so it looked at metal then energy. One still does factory MEX factory, but the other will do factory MEX energy energy factory. Both of them build the same factories in the same order and produced the same units from them.

    I'll admit to being a little baffled :) I thought maybe I'd mucked up difficulty levels, but the logs say no, and I've been triple checking before start. I've never seen this behaviour before though.
  3. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Thanks for answering questions in chat, it was very helpful.

    It'd be really handy to be able to split out AntiSurface into LandAntiSurface, NavalAntiSurface and AirAntiSurface. On a map like Meso where you might get a 50/50 Land/Naval split, it seems like the threat calculations are going to be messed up because the AI thinks it needs big land armies due to a fleet sitting offshore. This will also allow smarter threat assessments about the need for things like ground AA.
  4. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    One last thing. Naval units are split between Naval and Sub, but given that AntiSurface seems like a no-go for forming naval platoons (leads to land armies causing the AI to form huge fleets for no reason) it'd be really useful to have a threat value which gives you the total of Naval and Sub to use as a basis for naval platoons.
    Last edited: June 19, 2015
  5. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    .
    Last edited: June 20, 2015
  6. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    @Sorian, I've run into an odd one. Running sever.exe seems to cause a change in AI opening relating to factory placement.

    This is a very specific instance that I've isolated. On Pacific in a 1v1 Queller will open with the naval factory every time. But when I run server.exe that opening can change.

    I ran fifteen games with Local Server set to On with Queller being the only server mod. For all 15 both the north and south AIs started with a naval factory.

    Next I ran fifteen games where I was running server.exe (I do this to alter sim speed but left it unaltered for these tests). In a full one-third of those games the northern AI started air and not naval. The air factory is placed in the same spot each time.

    If you increase the timescale in server.exe to 2.1 (four presses of PgUp) during the commander splash screen then both north and south AIs will start with air. Interestingly, while the air factory is placed in the same spot every time it's a different spot than if the timescale is 1.0.

    It shouldn't be possible for Queller to start air on Pacific, it will only go air if it fails to find a placement point for its naval factory. This suggests that for some reason running server.exe, even without changing the sim speed, is somehow interfering with its ability to search for a placement location. That, or it's causing it to pick up items from lower on the priority list without completing its checks on the higher priority items first.
    Last edited: June 20, 2015
  7. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    I've found what I presume is a bug. An AI occupying slot 1 will have AloneOnPlanet set to true at the start of the game. Slots 2 through 10 do not. This appears to be irrespective of system.
  8. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    I think CurrentRESOURCEEffeciency needs to average a period rather than give you the current value. If enough factories have a synced up rolloff time it can fool this check into making it seem like the AI is floating even though it's not really.
    websterx01 likes this.
  9. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Is it possible to check for multiple personalities within a single HasPersonalityTag check? It'd be nice to avoid block after block of personality checks :)
  10. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    websterx01 likes this.
  11. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    If I put a CanDeploy[Land/Naval]FromBase check into a platoon creation order, which base does it check against? Main? Or does the check just fail?
  12. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Another pie in the sky thought: add a field to ai.js which causes the personality to load a second, random personality from a list in addition to the selected one i.e. personality_draw: 'turtle', 'tech_rush'

    It would allow you to select a difficulty level, but then have a variety of strategies for the AI to pursue without the player knowing in advance which it will use.
  13. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Does HaveSeenEnemyUnits stay set forever, or does it revert to false if the associated threat value falls to 0?
  14. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Yep, several people pointed it out to me. Thanks :)

    Main.

    I have other thoughts for this, if I can find the time.

    Stays true forever.
    Quitch likes this.
  15. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Are these expected errors?

    Code:
    [19:32:43.328] ERROR Error opening struct UnitSpec spec "/pa/units/land/bot_sniper/bot_sniper.json.player", file failed to load
    [19:32:43.328] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/land/bot_sniper/bot_sniper.json.player"
    [19:32:43.328] ERROR Error opening struct UnitSpec spec "/pa/units/land/assault_bot/assault_bot.json.player", file failed to load
    [19:32:43.328] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/land/assault_bot/assault_bot.json.player"
    [19:32:43.344] ERROR Error opening struct UnitSpec spec "/pa/units/land/tank_heavy_mortar/tank_heavy_mortar.json.player", file failed to load
    [19:32:43.344] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/land/tank_heavy_mortar/tank_heavy_mortar.json.player"
    [19:32:43.344] ERROR Error opening struct UnitSpec spec "/pa/units/land/tank_light_laser/tank_light_laser.json.player", file failed to load
    [19:32:43.344] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/land/tank_light_laser/tank_light_laser.json.player"
    [19:32:43.344] ERROR Error opening struct UnitSpec spec "/pa/units/air/fabrication_aircraft_adv/fabrication_aircraft_adv.json.player", file failed to load
    [19:32:43.360] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/air/fabrication_aircraft_adv/fabrication_aircraft_adv.json.player"
    [19:32:43.360] ERROR Error opening struct UnitSpec spec "/pa/units/air/fighter/fighter.json.player", file failed to load
    [19:32:43.360] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/air/fighter/fighter.json.player"
    [19:32:43.360] ERROR Error opening struct UnitSpec spec "/pa/units/sea/battleship/battleship.json.player", file failed to load
    [19:32:43.360] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/sea/battleship/battleship.json.player"
    [19:32:43.375] ERROR Error opening struct UnitSpec spec "/pa/units/sea/destroyer/destroyer.json.player", file failed to load
    [19:32:43.375] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/sea/destroyer/destroyer.json.player"
    [19:32:43.375] ERROR Error opening struct UnitSpec spec "/pa/units/orbital/orbital_laser/orbital_laser.json.player", file failed to load
    [19:32:43.375] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/orbital/orbital_laser/orbital_laser.json.player"
    [19:32:43.375] ERROR Error opening struct UnitSpec spec "/pa/units/orbital/orbital_fabrication_bot/orbital_fabrication_bot.json.player", file failed to load
    [19:32:43.391] ERROR validateOrderForUnits failed to get UnitSpec "/pa/units/orbital/orbital_fabrication_bot/orbital_fabrication_bot.json.player"
  16. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Depends on what you were doing at the time.
  17. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Playing a multi-planet FFA with no water against five AIs. Afraid by the time I checked the log I was out of the game. I didn't have naval or bots.
  18. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
  19. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Ah, fair one. There's a couple that might be the culprit. I'll look into that.
  20. Jaedrik

    Jaedrik Active Member

    Messages:
    192
    Likes Received:
    109
    I look at the steam reviews after so long and the main complaint I see is "AI is too hard"
    Sorian
    You are too good.
    pls add an ultra bad AI setting
    mjshorty and cdrkf like this.

Share This Page