For Backers Only: AI building stuff

Discussion in 'Backers Lounge (Read-only)' started by Sorian, July 19, 2013.

  1. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,843
    UnitCount: Count of units
    UnitCountPool: Count of units in the pool (unassigned to any platoon)

    SystemThreat, PlanetThreat, and BaseThreat are not ratios, they are just raw total threat values.
    Quitch likes this.
  2. SXX

    SXX Post Master General

    Messages:
    6,897
    Likes Received:
    1,811
    I wonder what do you think about adding "Random" for AI difficulty option? :)
  3. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    Is there any way to find how the AI scores everything for threat? I'm assuming it's all in the neural networks, though the files under AI are clearly not meaningful to a human.
  4. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    I noticed some strange AI pathfinding on the Dustbowl system when working on Queller (it was the most roundabout flanking maneuver of all time), so fired up the default AI to see if it did the same. In that game I noticed this rather bizarre behaviour.



    It had no other build commands queued, and when I enabled order display I could see it had a series of movement orders plotted to take it on that loop course. I can see no reason why it would do this.
    cola_colin and stuart98 like this.
  5. stuart98

    stuart98 Post Master General

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

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    Sorian, I'm seeing some strange behaviour in the AI around buildings. It never seems to like committing Dox against them no matter the numbers, but nor does it withdraw. In the PiP the Dox are just over the NE point.



    I also noticed that once a plane flies over the AI breaks out of this pattern and commits some units,
  7. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    Sorian, would the bug with Dox shooting over bot factories have caused the neural net to learn some bad lessons about the ability of bots to kill factories?
    cptconundrum, K1S3L and ace63 like this.
  8. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,843
    Quite possibly. I have fixed the Dox bug (it was not specific to Dox, just more noticeable) and will run another neural net training session, hopefully tonight.
  9. rivii

    rivii Well-Known Member

    Messages:
    534
    Likes Received:
    474
    The thought of that being a neural net training for Real life bots just scares the **** out of me.
  10. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    Sorian, what sets DesireEnergy and DesireMetal to true? Given that a PotentialEfficiency check exists and is used, the first explanation that springs to mind seems unlikely.
  11. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,843
    DesireEnergy or DesireMetal will be set to true any time a CanAffordPotentialDrain or CanAffordBuildDemand build condition fails. They will be set based on whether the check failed due to insufficient metal, energy. or both.
    Quitch and burntcustard like this.
  12. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    If handmade maps are returning does that mean you're planning any kind of AI hint system for maps?
  13. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    hey I also have a question about AI: When makes the AI go and actually attack with the platoon?

    What the AI does it it build massive amount of units and even adds them to platoons, sometimes to more than one, but then it just leaves them in the base and never attacks. I have been playing with the AI files but I can't find a way to fix that. Earlier today I had a game where the Ai had a better unit composition and killed all of my units, but then rather then pushing into my base and winning it just retreated the units into its where they sat until ma 5 holkings battery slowly killed them.
  14. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    The AI does seem overly cautious around bases. Maybe it's because the bot factory bug has it thinking buildings are harder to kill than they are. Maybe it's because it's grouping stuff in the area together as a threat, not realising it can destroy the outer buildings safely. Maybe it's our micro means we assess a situation differently than the AI with its micro.
  15. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    Still. At times the AI can have up to 100 units grouped into 2-3 massive platoons in different parts of their base just idling.
  16. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    Also hey @sorian any chance that the ai.js file makes it into the list of files that get uplodad to server. I'd hate that everyone needed to get a ui mod for the AI to work properly.
  17. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    I can't say as I've ever seen that. Are you sure you haven't set a platoon minimum requirement that the AI cannot meet?

    It wouldn't be everyone, only the host. And my experience is it works as part of a server mod, but only if you first load a system, the UI is then refreshed with the ai.js values. An F5 in the lobby might do the same.
    zweistein000 likes this.
  18. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    My minimum counts for every platoon are half it's maximum count except in regard of special modifiers (like artillery, defence and scout). Those are set to 0.

    Example:

    Code:
        "Land_Attack_Large": {
          "units": [
            {
              "max_count": 20,
              "min_count": 10,
              "squad": "Fast",
              "unit_types": "(Tank & Mobile) - Fabber - AirDefense - Construction - Artillery - Heavy - Scout"
            },
            {
              "max_count": 20,
              "min_count": 10,
              "squad": "General",
              "unit_types": "((Tank | Bot) & Mobile) - Fabber - AirDefense - Construction - Artillery - Heavy - Scout"
            },
            {
              "min_count": 0,
              "percent": 0.25,
              "squad": "Artillery",
              "unit_types": "((Tank | Bot) & Mobile) & Artillery"
            },
            {
              "min_count": 0,
              "percent": 0.5,
              "squad": "Close",
              "unit_types": "((Tank | Bot) & Mobile) & Heavy"
            },
            {
              "min_count": 0,
              "percent": 0.2,
              "squad": "Defense",
              "unit_types": "((Tank | Bot) & Mobile) & (AirDefense | Construction)"
            },
            {
              "min_count": 0,
              "percent": 0.05,
              "squad": "Defense",
              "unit_types": "Land & (Scout | Recon)"
            }
          ]
        },
  19. Quitch

    Quitch Post Master General

    Messages:
    5,348
    Likes Received:
    6,004
    Yes, but what about the check that causes the AI to begin forming the platoon in the first place in the platoon_ files? And how many units did it have vs the minimum? What if it identified multiple threats and tried to form multiple platoons, did they all have enough for the minimum count? Have you tried removing the minimums and seeing if the behaviour continues?
  20. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    Code:
        {
            "name": "Land Attack Platoon Large",
            "to_build": "Land_Attack_Large",
            "instance_count": -1,
            "priority": 102,
            "build_conditions": [[{
                "test_type": "UnitPoolCount",
                "unit_type_string0": "((Tank | Bot) & Mobile) - Fabber - AirDefense - Construction",
                "compare0": ">=",
                "value0": 10
            },
            {
                "test_type": "CanAttackWithPoolUnitsLand",
                "string0": "WL_AnySurface",
                "string1": "WL_AnySurface",
                "unit_type_string0": "Mobile | Structure"
            }]],
            "task_type": "LandAttack"
        },

Share This Page