Upcoming AI Neural Net Change

Discussion in 'Planetary Annihilation General Discussion' started by Sorian, October 14, 2014.

  1. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    By constraining the scope of what the neural net has control over. The neural net only has to determine whether X ally units against X enemy units will result in a positive or negative outcome. That is a narrow enough scope and an easy enough question to design a fitness function for.
    towerbabbel, lafncow and cdrkf like this.
  2. Zainny

    Zainny Active Member

    Messages:
    123
    Likes Received:
    146
    Super interesting discussion. A couple more Q's:

    If the neural net is trained by the AI playing itself, how do you ensure you have get good coverage across all the different types of units scenarios? Couldn't the AI have blindspots w.r.t building units, etc. resulting in big gaps in the possible input space?

    Also, would it be possible to train the AI from multiplayer games?
    magisterquis and devoh like this.
  3. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    The AI doesn't use the neural network to decide what to build, if that is what you meant. Although, if the AI does not build a unit (ever) it could result in a gap in its knowledge. If the AI only builds a unit sometimes, I run so many simulations that it should not result in a gap.
  4. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Is the ability to train our neural networks packaged with the server files? If not, could you see about giving it to us?
  5. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,357
    I believe he said earlier it's a part of the actual engine, and not the server. Not sure if it's possible to give, but if it is- then that'd be nice to have.
  6. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    It is there .... somewhat .... but it's currently not part of the shipped binary. So these option are currently non-functional.

    And it's not so much likely that you could actually improve anything by training it yourself. Unless of course you were able to improve either the input functions or the fitness function, but especially these two are entirely out of scope for now.
  7. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    The code necessary to train the neural nets is compiled out of the public build (really, any build that is not on my machine). Would it be possible to expose it to the public? With a bit of work, sure. Would it be useful? I have no idea. The whole point of using a neural network is so that it can survive balance changes. The only time it really needs retraining is when bugs gets fixed or behaviors change that could alter a units effectiveness (i.e. nav gets better or weapon bugs gets fixed)..
  8. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    I guess it could be good for modders?
  9. Yazilliclick

    Yazilliclick Member

    Messages:
    9
    Likes Received:
    40
    I believe Documentation is on the personal to-do list of every single programmer everywhere.
  10. zgrssd

    zgrssd Active Member

    Messages:
    658
    Likes Received:
    185
    Balance mods do have the effect of changing the balance. Much more even then the average update. That means the "Vanilla trained" AI is not able to work with balance mods effectively.
    So modders being able to give a custom trained AI with thier mods would be a huge boon for modding community and thier balance mods.
    It is like the AI being able to build and use modded units in SupCom.

    And since all the process does need is processing time it should be doable by any modder. All you need to do is give the AI some matches to gather statistical data on relative unit effectiveness. Plus maybe some testing.
    So expose the learnign routines in stable/PTE builds, pretty please :)
  11. websterx01

    websterx01 Post Master General

    Messages:
    1,682
    Likes Received:
    1,063
    It sure would be interesting if the AI trained itself from every single game played on Uber's servers. Imagine how much better it could become, since it would be learning just like we do, only dozens of games at a time.

    Edit: Then again, Skynet.
    cwarner7264 likes this.
  12. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    It would probably hit a diminishing returns wall
  13. zgrssd

    zgrssd Active Member

    Messages:
    658
    Likes Received:
    185
    During the learning phase the AI is choosing randomized actions. So each action has equal propability to happen.
    AI in the learning phase is acting totally random on purpose (simply so it can learn every scenario).
    Now the productive AI is doing actuall, meaningfull decisions. That means not all actions have an equal propability of happening. That means it is only gathering data about actions it was going to choose anyway. "Good action is good action" does not help as much in refining the AI.

    Learning routines would also cause quite an overhead. Currently those routines are not even compiled into the PTE or stable builds (#define switches are used for conditional compilation). If the same code is not compiled on Sorians's computer, the AI is not learning.
  14. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    As I said, neural nets are good at coping with balance changes. The data fed into the neural network is not what types of units are in play, but all of the raw stats. Messing with the stats of a unit will change the numbers that go into the neural network and it will modify the AIs behavior accordingly.
    NERDsEd, squishypon3, Quitch and 3 others like this.
  15. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    I am curious as to what stats it takes into account. Some of these stats play such a minor role in the vanilla balance that they can almost be ignored.

    Does it take into account things like turret turn rates? If yes, do you think the output of the neural nets would differ significantly when gameplay is heavily impacted by stats that are negligible for the vanilla balance?
    emraldis likes this.
  16. Suhiyn

    Suhiyn New Member

    Messages:
    8
    Likes Received:
    0
    @sorian: Thank you for your informations about the AI, I was exactly looking for that...

    I will read all that later but before there is a very important and noob thing the AI does in PA I would love to see corrected.
    The AI never repairs his Commander and it gives many easy "steals" for human players.
    Could you please fix that ^^

    best regards and keep up the good work :D
  17. zgrssd

    zgrssd Active Member

    Messages:
    658
    Likes Received:
    185
    I regulary see the commander being repaired in GW nowadays. Especially after a nuke strike.
    Not fast enough to make a difference for the next nuke, but noticeable.
  18. Suhiyn

    Suhiyn New Member

    Messages:
    8
    Likes Received:
    0
    I dont know about GW.
    In Skirmish with AI in absurd, I see a real weakness with the commander not being repaired.

    Or, yesterday, I was watching on Twitch a guy playing versus a relentless AI.
    His economy was disastrous and he made only booms the whole game. He made few raids with his booms on the AI's commander and after few failed attempts, he finally killed it. The AI never tried to repair the commander.
    If only that, it was an easy victory for the AI.
    I really hope a change with that ^^
  19. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Yet another thing on my list.
    thelordofthenoobs and cdrkf like this.
  20. Asterisk135

    Asterisk135 Member

    Messages:
    37
    Likes Received:
    4
    I love reading about how the AI works! It's so rare to actually have someone who knows what they're doing working on that. So often it's stuffed into games as an afterthought.

    I'm curious: from what you've said, Sorian, it sounds like the neural network stuff is only one component in the AI's decision making process. If the NN governs only the tactical, combat-related decisions, how is the rest of the AI structured (building structures and units, creating strategies, etc)? Given the unique nature of the game, I have to imagine that strategies like "send orbital units to secure enemy planet's atmosphere, construct teleporter, flood planet with huge army" would have to be hard-coded in some fashion.

    I always figured that a good strategy game AI would be layered in some way, with different, independent components (with different decision making architectures) dealing with various problems (a NN architecture for handling small tactical skirmishes; a more hard-coded architecture for the strategic stuff, probably with the battlefield data abstracted in some way to make it easier to organize and command groups of units).

    I watched your GDC talk about NNs (and read your blog too) and it left me almost literally salivating for more of the nitty-gritty, under the hood, dev stuff that has slowly dried up since the beta started. Leaning more about specific problems like creating an AI that is clever and hopefully creative is the main reason I backed PA. I expect you're really busy, but if you could go on a 'dev rant' about the overall design, that would be pretty awesome! If not then I guess I'll just read every post you've made on the the topic of AI and hope that sustains me...

Share This Page