Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Polarith AI (Free/Pro) | Movement, Pathfinding, Steering

Discussion in 'Assets and Asset Store' started by Polarith, Apr 18, 2017.

  1. nerzoff

    nerzoff

    Joined:
    Jun 9, 2019
    Posts:
    5
  2. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @BCFEGAmes @stevenwanhk,

    As you can read in Frays publication (Steering Behaviours are doing it wrong), it is inspired by racing games, though it is applicable for a much bigger field. Herds and flocks are possible, though the classic approach by Reynolds is fine for this since small errors on individuals do not have a large influence on the overall perception of the flock. However, it is perfectly fine to combine those two since Polarith might steer some key individuals (leaders) or the overall flock direction. Of course, Polarith is capable of flocks, too, but it is more expensive than Reynolds. Depending on the number of individuals, Reynolds is preferable. As you stated correctly, some learning is needed depending on how deep you will dive into AI behaviour and combinations.
    It depends on what to do on the Navmesh. We provide NavMesh support (border perception) and navigation through external (e.g. Unitys) pathfinding. Polarith is fine to combine with pathfinding since pathfinding yields the overall direction and Polarith is doing the local avoidance.

    @Artini
    Polarith does not provide animation models. We offer a steering solution that will decide where your NPCs will move (locally). Animals are fine though since flee and hunting behaviours are easy to set up. Additionally, we provide components like AIMWander which is nice for idle state. I highly recommend reading our manual and watching the examples on YouTube.

    Have a great day,
    Martin 'Zetti' Zettwitz from Polarith.
     
  3. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Last edited: Jun 29, 2021
    nerzoff likes this.
  4. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    84
    Thanks for the answer. This AIMWander is probably something, I will start using from the beginning.
    Does anybody use Polarith with:
    https://assetstore.unity.com/packages/tools/game-toolkits/third-person-controller-126347
    This one has easy setup for NPCs and IK, that works well with my projects.
     
  5. nerzoff

    nerzoff

    Joined:
    Jun 9, 2019
    Posts:
    5
    hello again, I really like your asset, but I can't figure out how I can combine avoid and arrive? or rather, what scripts should I put on the object for them to work together?
     
  6. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @Artini,

    I am not familiar with this asset, but I assume it will 'only' do the actual movement and camera control? This should be fully compatible with our asset since we only compute the movement direction. The actual movement act is up to you. Note, our example controllers are really basic and should only serve as an example. Custom controllers that fit your needs are mandatory most of the time.
    In your case, I assume ThirdPersonController needs some input such as direction and movement speed. You can obtain this from Polarith AI from AIMContext. Have a look at our example controllers :) You can try the free version to create simple behaviours and integrate with the ThirdPersonController.

    Happy experimenting,
    Martin 'Zetti' Zettwitz from Polarith.
     
  7. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @nerzoff,

    They are not designed to have the same purpose. AIMArrive is designed to reduce the magnitude (that's why it is set to Subtraction) when arriving a specific target (Vector3). AIMAvoid is designed to create magnitudes parallel to a target object such that the agent actively moves around the obstacle. If you want to combine them for any purpose you may play around with the sensitivity offset, the magnitude multiplier, the plane bend, and so on.

    Greets,
    Martin 'Zetti' Zettwitz from Polarith.
     
    nerzoff likes this.
  8. stevenwanhk

    stevenwanhk

    Joined:
    Jul 20, 2016
    Posts:
    109
    Any idea why `Context.DecidedDirection` gives y = 0?
    Points from AIMFollowWaypoints and AIMUnityPathFinding are correct as you can see
    The one in example scene "UnityPathfinding" gives y certain values so the context can climb up the slope
    Not sure why it happens
     

    Attached Files:

    • pic.jpg
      pic.jpg
      File size:
      325.2 KB
      Views:
      16
  9. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @stevenwanhk

    You are using an XZ-sensor, thus the decided direction is only inside the XZ-plane, which should be no problem in a 2.5D game. If your character is able to move in full 3D (as in space games), you need a spherical sensor.

    Have a great start into the week,
    Martin 'Zetti' Zettwitz from Polarith.
     
  10. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    39
    Question - Setting Environment in a prefab.

    In the video How to Move an AI Character - Part 1/3 | Polarith AI Unity Tutorial [Basics] you explain how to set up the AI from the level of the scene hierarchy.

    Obviously this is not the way we will create enemies - which usually are prefabs. As far as I understand the AIM Steering Perceiver component is general for all enemies. How do I assign it for the prefab enemy that I will spawn. Now I know that I can do it through my own custom script but what is the workflow for this in your framework?

    Later on in AIM Flee you select one of the environments:
    upload_2021-7-22_7-48-52.png

    Which obviously I don't have in my prefab because I don't have the Steering Perceiver assigned in the AIM Steering Filter on my prefab. Do I type the string name instead of the environment that I have created in the main hierarchy? Or do I also have to set this up through a custom script together with the assignment of the Steering Perceiver

    Edit - Putting the string in doesn't work.

    upload_2021-7-22_7-51-29.png

    I would really appreciate the help!
     
  11. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    39
    Does the AI Flee behaviour (or your AI system) work with tilemap 2D composite colliders? I have a collider surrounding a top down 2D island to prevent the Agents from exiting the walkable terrain - like an outline. Wił it work correctly?
     
  12. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @SunnyValleyStudio,

    1. There are multiple ways to do this. First, as you said correctly, you can use a script to assign the AIMSteeringPerceiver to the SteeringFilter. Second, you can use the ObjectTag property to look for a valid tag in the scene as written in our doc.
    2. I need to have a closer look at the code, usually, a string should work since the property is a List<string> as long as (1) is fulfilled.
    3. You need either AIMSteeringTag with a proper range on each tile (limited to circles), AIMFleeNavMesh, or AIMFleeBounds.

    Have a great Thursday,
    Martin 'Zetti' Zettwitz from Polarith.
     
    SunnyValleyStudio likes this.
  13. GameForger

    GameForger

    Joined:
    Feb 22, 2013
    Posts:
    2
    I'm trying to learn Polarith Ai Free and I'm getting werid behavoir in the Avoid 2D demo Scene.
    I can't make the Agent turn left to avoid the Danger. I moved the Danger2D Object down to Y= -0.5 and this happens.

    2D Avoid Scene error.gif
     
    Last edited: Jul 23, 2021
  14. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    39
    Hey Martin!

    The tag solution worked and I can use a string as a name of a Filtered Environment. I do need a detailed instruction on how to set up a flee behaviour for a bounded space using unitys standard 2d tilemap collider (2d composite collider):
    upload_2021-7-23_10-11-50.png

    I have used AIM Flee Bounds simply doesn't do anything and AIM Flee works only with non 2d tilemap colliders. I have tested it with a 2d box colldiers and the setup works. If I change the layer for the 2d colldier bounding box it works so the setup should be ok.
    upload_2021-7-23_10-33-8.png

    upload_2021-7-23_10-14-49.png

    This is a default Unity 2d composite collider with "Obstacle" layer that I have added to the Steering Perceiver.

    upload_2021-7-23_10-15-22.png

    I mean I know I can place additional 2d box colliders on the border of the collider but this seems like a hacky way.



    How do I set it up?

    Take care!
    Peter
     

    Attached Files:

    Last edited: Jul 23, 2021
  15. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    39
    Adding additional colliders works but it looks awful and it adds a lot more work for me - I mean instead of placing only the tiles and getting the colliders generated automatically through tilemap collider I have to manually generate those and adjust them for efficiency.
    upload_2021-7-23_10-43-31.png

    The Tilemap collider even non composite doesn't work.

    upload_2021-7-23_10-42-50.png
     
    Last edited: Jul 23, 2021
  16. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @GameForger,
    This is only a demoscene to show the overall behavior in this particular scene. The agent will move straight if you reduce the outer radius, the magnitude multiplier, or the value mapping. Note, you must adjust the params for your particular scene/game setup.

    Have a fresh start into the new week,
    Martin 'Zetti' Zettwitz from Polarith.
     
  17. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @SunnyValleyStudio,

    Sorry for the delay, we had our second vaccination at the end of last week and many developers got sick.
    The composite collider won't work for this purpose since you are inside the collider. Thus, the bounds check won't work. Additionally, you need to perceive at least the center of an object to check if it's in range and process the bounds (this is why it's hard using bounds on very large objects since the radius must grow large).
    Unfortunately, the tilemap, or its individual tiles, are not supported yet. I'll put it on the requested feature list.
    As a quick workaround, you can write a script that iterates over each tile of the tilemaps and either generate a box collider 2d or generate an empty (static) game object at the center (additionally with AIMSteeringTag and set radius fit to the tile size).
    Another, but more complex way, is to write a custom behavior that processes the tilemaps and handles the individual tiles.

    Sorry, I can't help more at the moment.
    Martin 'Zetti' Zettwitz from Polarith.
     
    Last edited: Jul 27, 2021
  18. gerlachharz

    gerlachharz

    Joined:
    Sep 12, 2020
    Posts:
    1
    Hi @Polarith,

    you wrote that the interfacing/integration of Aron A* Pathfinding project is on your bucket list. Any details when this will come to pass?

    Kind regards,

    Jan
     
  19. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hey @gerlachharz,

    we are currently working on releasing our formations add-on as open-source for Free and Pro users. After this, we will work on an open-source interfacing/integration of Aron A* Pathfinding. ETA is autumn this year.


    Regards,

    Martin Kirst
    Polarith CEO
     
  20. sfilo

    sfilo

    Joined:
    Oct 23, 2012
    Posts:
    27
    Hi @Polarith,

    I have a problem configuring AIM Seek with outer radius smaller than 20 for a 3D environment with a SpatialHigh sensor.
    I have really tried to figure it out and was unable.
    I can easily reproduce it in the the AircraftTown scene by following a few easy steps:
    1. Deactivate Aircraft Controller, Aircraft Physics and set rigidbody to kinematic for Agenr Aircraft to make it easy to move by hand
    2. Deactivate the "Aim Seek Don't hit ground" and the "Seek Ground" components ( so that the context indicator doesn't show it )
    3. Lower the outer radius on the "Aim Seek Don't hit buildings" component to less then 20
    4. Move the Agent Aircraft game object by hand so that the "Aim Seek Don't hit buildings" out radius indicator clearly tuches one of the buildings
    To my understanding, the context indicator should be showing red bars toward the intersected building, but it's not happening. If I set the out radius to more then 40 it starts working again.

    I need a smaller agent that could fit through narrower passages. Am I using it the wrong way?

    I uploaded a screenshot to show this. Am using an empty project with the Polarith pro 1.7.1 on Mac OS, unity 2019.4.18.f1.

    Kind regards,
    Stefan
     

    Attached Files:

  21. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @sfilo,

    The (bounds) behaviours are radius steering behaviours. Thus, they need to perceive the center of a game object to get the position (and the bounds information of its collider). For larger objects, either the radius must be bigger, or the objects must be subdivided into smaller parts.

    Have a great Friday,
    Martin 'Zetti' Zettwitz from Polarith.
     
    sfilo likes this.
  22. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279



    Hello, our dear community!
    It has been a long time since we released an update for Polarith AI. So, here we go:

    As a humble thank you for your continued loyalty, we have added 2D and 3D formations to Polarith AI Pro and Free. We hope that they will save you some of your valuable time. The source code of this extension is publicly available on GitHub. Besides the repository, you can directly download the Formation sources into your project with the help of installer scripts bundled in a ZIP archive within the latest Unity Asset Store packages.

    Thank you for understanding that we can only offer limited support for freely available open-source code. Feel free to commit your ideas to the public GitHub repository if you like.

    The next thing we will work on this year will be the official integration with the A* Pathfinding Project. Thank you all for your continuous support.


    v1.8 Open-Source Formations

    Changes
    • Changed visibility of some editor classes for compatibility with the Formation behaviours
    Enhancements
    • Formations are available as source code on GitHub
    • For convenience, you can use the download script in /Polarith/AI/Extensions
    Fixes
    • Changed flat circle gizmo in AIMSteeringFilter to spherical gizmo if a spherical sensor is attached


    We wish you a productive time and much fun using the new formation components.

    Martin Kirst
    Polarith CEO
     
    Last edited: Aug 23, 2021
  23. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Last edited: Sep 23, 2021 at 7:09 AM
  24. skinnylizardstudios

    skinnylizardstudios

    Joined:
    Friday
    Posts:
    1
    Do you have a discord? there are a few times when I need instant help :p

    Thanks
     
  25. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    279
    Hi @skinnylizardstudios,

    We do not have a Discord server, please use our official support form at the bottom of the page.

    Have a nice Monday!
    Martin 'Zetti' Zettwitz from Polarith.
     
unityunity