Upcoming AI Neural Net Change

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

  1. Engineer1234

    Engineer1234 Well-Known Member

    Messages:
    325
    Likes Received:
    291
    I find it really helps to quickly write the ideas down so you don't forget them, it's the worry that you might forget them that might be keeping you from getting to sleep :) once I know they are safely written down I can suddenly relax and go to sleep usually.

    Also +1 internet point on the sharing what you're doing.
  2. Gorbles

    Gorbles Post Master General

    Messages:
    1,832
    Likes Received:
    1,421
    All the best ideas happen when you're in the most inconvenient place to act upon them.
    squishypon3 and websterx01 like this.
  3. zgrssd

    zgrssd Active Member

    Messages:
    658
    Likes Received:
    185
    Sounds interesting. Should certainly improove effective use of special units like inferno's. I am certain I already saw the AI suicide a squad against Economy before. This basically expands this to "sucide if you cannot run away".

    With the release of offline mode, any chance we could get tools to growpram* our own AI for balance mods? Stuff like Startera or RCBM really change the balance so we would need a different AI for those.
    And it looks like Server switches like "--no-players", "--no-waiting" and "--no-throttle" would be ideal to set up a hothouses for the AI to learn the balance.


    *A term I grabbed from Schlock Mercenary Webcomic slang

    I guess the real tricky part is to not let it become too good, where it start getting unbeatable. I am not quite as good at AI programming but I thought that low AI is often best classified as "making intentionally dumb decisions" despite better knowledge.
    AI on lower levels should be challenging, but not actually interested in winning the game. Because people who play on normal/easy are not really looking for a AI that can beat them, only one that can challenge them.

    One of ther curses of being a programmer. You always get your best ideas in the worst place to act on them. Like in a train/car, far away from any computer or way to properly wrtie it down. Or when trying to grab some Z's.

    A wise man once said: "If you are butting your head against a problem, let it rest and go for a walk."
    Trying to sleep is just really trying to give problems some rest and go for a mental walk. So no wonder we always keep getting them then.
  4. Ringworm

    Ringworm Active Member

    Messages:
    245
    Likes Received:
    81
    "All the best ideas happen when you're in the most inconvenient place to act upon them.
    "

    Funnily enough, it's the complete opposite with me.
    I get all my worst ideas at the most inconvenient times/places....
  5. stevenrs11

    stevenrs11 Active Member

    Messages:
    240
    Likes Received:
    218
    Oh man. There goes all of my free time for the week.
    silenceoftheclams and optimi like this.
  6. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Actually you can run neural net only game with "--state=neural_net", but no idea how to enable learning even if there is flags to control it ("--neural-learnrate", "--neural-momentum").
  7. jables

    jables Uber Employee

    Messages:
    812
    Likes Received:
    5,537
    gerii, squishypon3, Remy561 and 2 others like this.
  8. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    I just the AI play against itself. Yes, there is a lot of noise using that method, but it is easier to implement, doesn't require changing the scenarios constantly, and is completely hands off process. I also filter the noise by keeping a version number in the neural net that increments every time the network back propagates. I use this to prevent a platoon from altering the neural net based on data from an old version.

    Adjusting the desired output is part of the back propogation process. You are telling the neural network, "This is what the output should have been, now adjust yourself so that the inputs I gave you are closer to this output." The neural network has no idea what the output signifies, it just knows the output is a number between 0.0 and 1.0 on that particular node.

    This has been discussed internally before. I might take a look at that at some point.

    Neural net training is controlled by a #define in the source code.
  9. mjshorty

    mjshorty Well-Known Member

    Messages:
    871
    Likes Received:
    470
    indeed, community loves these kind of posts, now go get (force) the others in posting stuff :p
  10. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Sad, hopefully you'll make it available for us one day. ;)
  11. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    @sorian you have exposed a bit of the neural net, however, as said above doesn't seem to be any way modders can do anything to train it. Any idea if there will be some improvements for us to mod the AI coming down the line any time soon? It would also be very nice to see some more information on what all of the trigger functions and such we can use in the JSON are... maybe some documentation?
  12. zgrssd

    zgrssd Active Member

    Messages:
    658
    Likes Received:
    185
    The modders would certainly love it, as it would allow them to do balance changes that the AI recognizes. Some resources to run the random cases asumed.
    But a #define it is about as far from something that can be turned into a commandline paramter as is possible.
    It is still an integral part of mod support, so it should come around down the line somewhere.
  13. scifiz

    scifiz Member

    Messages:
    75
    Likes Received:
    5
    Oh good. Hopefully I wont see this again then.
    http://imgur.com/D8gpo9r
    It never re-considered getting that 3rd metal spot...

    I'd post a video, but twitch is refusing to admit the stream was active.
  14. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Documentation is on my personal to-do list.
    Imsvale, lafncow, ace63 and 1 other person like this.
  15. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    The worst is when you get one of those brilliant ideas at night, you stay up mulling it over, get up in the morning all excited and proud of yourself. You even eat breakfast before turning the computer on to implement it.

    Then you code up your brilliance, all is good and right with the world. It may even compile the very first time. Good omen that.

    Then you run it for the very first time.
    Segmentation fault.

    WTF you shout.

    Return to staring at code. Trace through program. Find source of seg fault.
    while understanding the cause, come to inescapable realization.

    Your logic was flawed right from the beginning.
  16. nofear1299

    nofear1299 Active Member

    Messages:
    294
    Likes Received:
    147
    I had a massive assignment due, and two days before I had a spark of brilliance(BRILLIANCE!!!!) and was in bed at the time. So I pulled my phone off and jotted notes on it.

    The next day I coded it and nothing worked, it broke the entire program with no indication where the error was. I sat for 6 hours to find that it was a space included in the wrong place.

    FML. I nearly cried and broke a screen in this process.
  17. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    never done that one before, seen the like a number of times though.
    Most recent painful experience I had was forgetting that the == operator doesn't work for Integer objects in java.
    3.5 hours of debugging, and all I needed to do was change it to int. (course, it's java so it was doing funny **** in the background which made this process much more difficult)

    I felt so dumb. I've been doing this **** for years. Java is my first language. Terrible.
  18. nofear1299

    nofear1299 Active Member

    Messages:
    294
    Likes Received:
    147
    Haha, I know that feeling :( I need to get back into my Java programming though. I'll pm you though, there is something I'd like to ask you :O
  19. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    returning to the black magic of the programming realm eh?
  20. towerbabbel

    towerbabbel Active Member

    Messages:
    182
    Likes Received:
    106
    One thing I've been wondering about regarding neural nets and AI. To train a neural net you need a cost function to optimize against. Your neural net can only be as good as the cost function. Doing an AI via a neural net sounds to me like you are tradeing the difficultly of designing a smart AI for the difficulty of designing a smart cost function. How do you build a smart enough cost function to allow you to train a decent neural net?
    lafncow likes this.

Share This Page