Search Unity

Auto Battle Algorithm ?

Discussion in 'Scripting' started by zoudarren7, Oct 24, 2020.

  1. zoudarren7

    zoudarren7

    Joined:
    Jul 24, 2019
    Posts:
    11
    Helloo I am trying to develop a mobile game like the ones with auto-battle (Idles Heroes). I am stuck on the part as to what algorithm to use to backtrace the result so I can send back the information to the client to show the animation. I am also a little bit stuck on what algorithm to use to simulate the battle server side. But that is not as hard as trying to show the results in steps to the client so it can show the animation and combat to match the result of the battle.

    There are three states of result:
    Win
    Lose
    Win but lost HP.


    Battle format:

    5 Monsters vs 5 Monsters.
    Each have skill that proc with chance, rng.
    Some skill buffs characters others debuff enemies.


    Thanks
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    You probably want to find some idle battler tutorials to go through on Youtube, because somebody has already taken the time to do this I am sure.
     
  3. zoudarren7

    zoudarren7

    Joined:
    Jul 24, 2019
    Posts:
    11
    Oh I've tried >.< most of them are clicking ones or a timer function.
     
  4. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    you could follow them along and modify them so they work automaticaly :),

    hard thing is for us to help you since not everyone would write the whole code for free and post it here in,

    we can give you advices on how to approach this task :)
     
  5. zoudarren7

    zoudarren7

    Joined:
    Jul 24, 2019
    Posts:
    11
    Yeah I just need a point in the right direction. I just want an explanation of how it can be implemented, not the entire code.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    I think @Terraya just did: get a tutorial that requires clicking, then remove the clicking and replace it with a repetitive script that bangs on it at whatever rate you want.
     
    Terraya likes this.