Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Include Machine Learning into AI on mobile devices

Discussion in 'Scripting' started by fred_gds, Sep 30, 2016.

  1. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    Hello,

    I was currently thinking of some future projects I would like to work on and those all require some kind of artificial intelligence. So I know that nowadays machine learning is used in a lots of fields and improves AI in a way that it could not be scripted before, making it a great enhancement to games (or at least offers the possibility :) ). But on the other side it is still rather resource intensive and therefore I wondered whether anybody has experience or like me just played with the idea of implementing Machine Learning to NPC units on iOS or Android. I'm very keen to here your thoughts on this.

    Best regards,

    Fred
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,883
    Machine learning doesn't necessarily require a ton of processing power. More often it requires a ton of inputs, but it all depends on what you're trying to do.

    I did a little project in a machine learning grad course a few years ago, that compared several different methods — simple look-up table, decision tree, neural network, etc. All of them were able to learn useful behaviors very quickly (i.e. in real time). That was done on a laptop, but it's a circa-2012 laptop... modern mobile devices wouldn't have struggled with it either.

    The real question is, what exactly do you expect your NPC units to learn?
     
  3. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    Well let me take one example right out of my mind. Imagine a multiplayer strategy game (Age of empire like). If the player is very successful using a special combination and setup of it's assets to defend itself, that then the NPC can on the one side apply that strategy to itself and on the other find a way to beat it. If it already applied the strategy to itself also learning from the attacks the player launches.
    So as the game itself would already be very demanding it could use only limited resources for (at least in my mind) a relatively complicated task.
     
  4. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,712
    I think you're making this way too complex.

    Why do you need machine learning for that? All you need is simple logic, that's definitely nowhere near AI. I'd just calculate a "success factor", and then based on the loadup of the player, the enemy could have a loadup different to counter. That would be a simple If-Then statement.

    That's a very interesting concept, but I wouldn't consider it advanced enough to call machine learning.

    Just my 2 cents...
     
  5. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    Thanks for your thought. But I would want to get the NPC more human. Of course you could design multiple difficulty levels but usually the player develops after some game time a certain pattern to beat it. I would want the ai to also learn those patterns and for my understanding that would need more then some if-then (correct me if i'm wrong).

    Of course you could design it with a simple Ai but well I personally find the standard AIs in that category usually way to stubborn in it's pattern.
     
    DroidifyDevs likes this.
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,883
    Yeah... that's going to be pretty hard, regardless of what platform you're running on.

    I'm not saying it's impossible; but in a game that complex, even standard AI techniques (minimax search for example) don't apply. So, you're really looking at heuristics, either hand-coded or learned. And learning heuristics that actually work takes a long time, even for the best of algorithms.
     
    MihaPro and DroidifyDevs like this.
unityunity