Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Query regarding AI implementation for a turn-based strategy game

Discussion in 'Scripting' started by claytoncurmi, Aug 1, 2014.

  1. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    Hi all,

    I'm currently working on a turn-based strategy multiplayer game and I'm at a point where I want to implement a rudimentary AI to be used as a bot for the initial take-off. I've read the book entitled Artificial Intelligence for Games which gives a very good introduction about the various algorithms used in the industry. I found that the most suitable algorithm is tactical pathfinding, which is based on the A* algorithm. In a nutshell, the algorithm finds the best path, which is not necessarily the shortest, based on a number of tactical qualities (attack units, generate units, etc). For example, if you have a weak unit, it would be more wise to restore its energy rather than to attack an enemy unit. Therefore, the algorithm would return a path that avoids enemies and if possible collect energy along the way. The algorithm works fine but requires some weight calibration to get the desired results. The issue I'm faced with is that the algorithm still requires a target endpoint. Now this target endpoint could change depending on the current game situation. It appears as though I need to implement another level of AI that determines a valid target for each unit. If possible I don't want to hardcode this but feed the game mechanics with the desired goals and let the algorithm deduce the most appropriate target. From what I've read it looks like the Goal Oriented Behaviour (GOB) is a good solution for this situation. Has anyone implemented something similar in the past? Any suggestions?

    Thanks,
    Clayton