Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

RTS Game Creation With AI NPC

Discussion in 'Game Design' started by naruto93, Jan 4, 2019.

  1. naruto93

    naruto93

    Joined:
    May 6, 2015
    Posts:
    4
    Hello guys!
    I want to create a simple RTS game, it like Age of Empire. I can make simple control for player, but I don't have idea AI for NPC. I try upgrade Age II - III fastest, but it has problem when be attacked or attack. Please tell me anything about AI for NPC-team, process development for level (easy, normal, hard).
    Thanks.
     
  2. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,563
    Age of Empire is far from simple.
     
    Joe-Censored, Kiwasi and BlankDeed like this.
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,577
    In fact any rts is far from simple. Lets make first units which are produced in buildings, and allow controlling them, then with gained skills, you may consider even be thinking about AI. Which is huge topic on its own. I do suggest do research on OP given keywords. That will be good starting point. The topic is just too massive by its own.

    I just little add here, as examples.
    Path planning and behavioural trees.
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    7,896
    AI for an RTS game typically uses multi-tier AI, where at the highest level broad strategic goals are chosen, and at lower levels these are converted into tactics and finally unit actions. Different techniques can be used at each level; for example, the highest level will probably be a rule-based system, mid levels may use goal-oriented action planning, and on the finest levels you'll be doing things like A* path-finding.

    As @carking1996 said, making such a game is not simple. If you lack the skill to implement all that, but have a reasonable development budget, call me. :) If you lack both the skill and the budget, you might want to pick an easier game concept. Unless of course you have lots of time and desire to build the needed skills, in which case you're in for a treat, because AI is really fun!
     
    Kiwasi, BlankDeed and Antypodish like this.
  5. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    58
    I guess you could start with your base that controls the output of AI characters. For example you could set balance for AI easy resulting in 2 harvesters and 1 soldier to protect then build out as usual vs AI hard 1 harvester 2 soldier to probe/attack then build 2nd harvester and so on...

    The individual pieces really shouldn't be too much to wrap your head around but as a whole can be complex. As it comes together you'll find it best not to get attached to your project and may have to start from scratch.
     
  6. naruto93

    naruto93

    Joined:
    May 6, 2015
    Posts:
    4
    Thank guys, I try with simple AI, such as:
    - prioritize upgrade AGE II - III
    - build Barrack to have enough soldiers defend
    - House and Villager will depend option to have resources necessary
    - Finally, I build any group soldier to fight
     
  7. FullMe7alJacke7

    FullMe7alJacke7

    Joined:
    Dec 17, 2013
    Posts:
    29
    I haven't personally used it yet, but Behavior Designer seems like the ideal asset for this.

    I'm currently coding my RTS combat system from the ground up in order to be able to use BD to allow me to control the decision logic separately from the combat.

    You need to think about what features can a RTS have? What ones do I want? What ones do I NEED?

    Some simple ones come to mind....

    Path finding,
    Ranged AI,
    Melee AI,
    Healer AI,
    Formation Support,
    AI types (Fight till retreat, Fight till death)
    etc,

    I'm also looking into using machine learning to see if I can use that entirely for AI design, or if I can use it to at least improve upon the behavior I create.
     
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,372
    Cheat.

    Check out how AI is done in Creeper World and AI Wars. Both are very good examples of indie RTS's on a low budget. In Creeper World, their is no AI. The enemy (creeper) follows a very basic fluid diffusion simulation. In AI Wars, the game is highly asymmetric. All of the tasks for the AI are simplified down to simple calculations that a computer can do well.

    You won't find a single RTS AI that actually does a decent job playing by the same rules as the human player.
     
  9. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,577
    All this thing can be achieved with Utility AI, or even Behaviour Trees types of AIs. Which are far from ML.
     
    FullMe7alJacke7 likes this.