Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Are ML Agents what I need?

Discussion in 'ML-Agents' started by Tairos, Nov 18, 2023.

  1. Tairos

    Tairos

    Joined:
    Mar 24, 2013
    Posts:
    5
    Hello,

    I'm working on an idle game where your choices are which characters will be placed in the battlefield (let's call this a Deck). And then you battle without any interaction from the player.

    I would like to build a "software"/data model that allows me to generate these Decks, so I can use them in an adventure map or something that progressively increases difficulty.
    So I have many variables that I would like to give in the input, for example, "Don't use flying units, use one of these...." whatever.
    But so far first step is to find the general way to do this xD

    I've been looking at MLAgents, but what I see is that it works more in the reinforcement way, where there is a constant analysis and every action is evaluated.
    Most of examples that I found oh MLAgents are based on the game having a main character that performs actions. But as explained, this would not be my case.

    So looks like I should be using some different, but I can't find much infomration googling around. Probably using wrong words because i might be too newbie.
    Anyone here can help? some thoughts?
    Anyone things I should use MLAgents 100%?

    Thank you!
     
  2. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    144
    ml agents would work for that quite well, it's good for strategy games that require AI that might be complex to write normally.
    as for if you need to do the above with ml agents? no, you could definitely do it with handwritten AI, i.e. just buy the most expensive unit you can afford that is not on cooldown would work fine for such games.

    in your case your "main character" or agent would control the unit to spawn - you can train a brain quickly via masking off discrete actions if that unit is not available in the level and while on cooldown or not affordable etc
     
  3. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    144
  4. Tairos

    Tairos

    Joined:
    Mar 24, 2013
    Posts:
    5
    Hello!

    Thanks for your fast reply.

    So your proposal is not fully what I need. There are no economy costs involved in what I want.

    SO Imagine I have a game that looks like this:


    What I want is an IA that proposes me X Deck of enemies, for stage one, Y Deck of enemies for stage two....
    So technically is a balancing tool, not a gampeplay itself.


    So I understand that based on your code, I could remove the Observation and whatever economy related stuff. It still creates a Model that could be usefull for me. So we create a model that bases on my health and enemy health.

    But how would I do the 2nd step of using this model to get Decks? Because again this is not like normal MLAgents where I want this IA to play, I just want to use it as a tool to extract some Decks.
     
  5. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    144
    if you break down what you want the AI to achieve based on the given data and let it train to do so - as long as you know the expected outcome so you can reward it correctly for doing well it's ok.
    i.e. give it a bunch of observations so it can see health and stage number and whatever else is necessary
    then let it pick from the list of enemies to fill the deck
    if the deck is reasonable based on the observations give it a reward - how to determine what is reasonable is up to you, it could be based on some strength stat of the enemies or whatever