Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Improve the obstacle avoiding ?

Discussion in 'AI & Navigation Previews' started by Quast, Oct 28, 2017.

  1. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    530
    Hi
    I hope to see some good improvement in the AI agent work. When it comes to think on many agents on when place...headache :confused:. Is a headache to make a tanks avoid hitting each other. NM obstacle not really good option for avoiding. So, i'm asking the Unity engine Devs. What is your next plans for AI agent ?

    My regards.
     
  2. PedroDuran

    PedroDuran

    Joined:
    Aug 19, 2014
    Posts:
    22
    I am waiting for this too .. the default obstacle avoidance is very poor...
     
    Quast likes this.
  3. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    530
    I agree with you.
    I hope they will hear us and do something.
     
  4. BastienDigixart

    BastienDigixart

    Joined:
    Apr 4, 2017
    Posts:
    13
    I'd love to have news on that too :)
     
    Quast likes this.
  5. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It depends on what type of avoidance, for what type of AI and for what situation ?

    There is many ways :

    - Raycast based :
    Agent raycast forward or on both forward sides at regular interval to check other agents are blocking
    ( some games uses mutli threaded raycast and many raycast per AI )

    - Grid points :
    Each agent can create a small grid virtual points around them while moving (similar to EQS) .
    Updating each grid unit per frame for example, the agent can check it each meter it wants to move if it is possible and where is the free space direction to move.
    Check Unreal 4 EQS for more details, myself and other users already implemented a similar grid system with Unity.
    If your level is small you can bake a complete level grid with informations like covers , open areas and more.

    - Player position slots
    Use player position slots (CryEngine like) to check continuously free space around player.
    For example eight positions around the player, so you can tell AI where to go, and tell other AI to wait , wonder or do strategic positioning (like combat melee ticket system).
    This can be used also for ranged AI that is at the same height as other melee AI , to know if there is some free space direction around the player for ranged attacks for example.

    - There is also other techniques like curve trajectory for avoidance for melee groups
    look at 17:00



    Anyway, Unity just give you the basics (navmesh, navmesh raycast, raycast, sphere raycast, sphere overlap etc ...) , advanced positioning and navigation or AI behaviours is up to you.

    I wish someday, Unity will bring advanced avoidance and navigation AI (EQS or advanced AI techniques used in AAA games ) for everyone, who knows lol
     
    Alverik likes this.
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,948
    what unity navmesh needs are path query modifiers: volumes that change the cost of a path for the query
    this will take care of formation and can be used for smart avoidance
     
  7. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Or some sort of heatmap navigation.
    A* plugin with it's gridmap is another solution, a virtual grid knows what places are free , what are obstacles or blocked by dynamic AI, and you can query to get a valid path.
     
unityunity