Search Unity

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

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

  1. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    238
    Thanks for the reply Martin, I'll get going on it and let you know how I make out. Cheers!
     
    Skorcho and Polarith like this.
  2. MikeMalone

    MikeMalone

    Joined:
    Jul 9, 2017
    Posts:
    2
    I noticed there hasn't been an update for almost a year and the tutorials are also old. Is Polarith AI still in development? If so, about when will we see an update?

    Thank you
     
  3. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hey Mike,

    As we have already stated, we consider our steering solution as feature-complete. However, there will be a service/bugfix release in the future and other open-source code on GitHub. So, we also plan to release integrations with pathfinding solutions as we already did for the Formation addon for free on GitHub.


    Regards,
    Martin Kirst from Polarith
     
  4. MikeMalone

    MikeMalone

    Joined:
    Jul 9, 2017
    Posts:
    2
    Do you have a time frame for the additional releases?
    Also, would it be possible (it's mentioned on the unity store page) to get the source code?

    Thank you,
    Mike Malone
     
  5. Unsp

    Unsp

    Joined:
    Dec 20, 2015
    Posts:
    5
    Hello,

    Is "Spatial Partition: Regular Grid" supposed to work with static environments? My setup is working with either environment for obstacles set to static, or the grid enabled, but if I enable both - agents just ignore all objects in the obstacle layer (AIM Seek and AIM Avoid behaviors)

    This can be reproduced in Lab2D\Avoid scene by setting the Danger environment to static and enabling the grid in the steering perceiver:


    Thank you,
    Kirill Golubev
     
    Last edited: May 20, 2022
  6. Unsp

    Unsp

    Joined:
    Dec 20, 2015
    Posts:
    5
    @Polarith Could you tell me if I'm missing something? I'm trying to get a fairly big map with around 200 agents to work, and the performance is just not adequate without both, static environments and the grid

    Thank You,
    Kirill Golubev
     
  7. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    I @MikeMalone,

    I am very sorry for the long delay. Somehow, we did not receive a notification about new messages on the forum.
    There is no detailed timetable yet, we will make an announcement as soon as we have finished the major part of the code. Since all of our developers are in industrial projects that are vital for our company, and hence, enable this project, there might not be an update before the end of the year.

    The source code for the formations plugin is in our GitHub repo. For the complete source code, we offer individual options. Please send us an e-mail at support@polarith.com for further details.

    Have a great Friday,
    Martin 'Zetti' Zettwitz from Polarith.
     
  8. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Unsp,

    I am also very sorry for the long delay. Somehow, we did not receive an e-mail notification about new posts in the forum.
    First of all, I can reproduce the issue. It seems like a bug to me, but I need to have closer look at the code with my coworkers. Unfortunately, most of us have vacation today, so we can check it next week.
    If you own the pro version, I highly suggest using AIMPerformance to improve the performance using load balancing.

    Until next week,
    Martin 'Zetti' Zettwitz from Polarith.
     
  9. Unsp

    Unsp

    Joined:
    Dec 20, 2015
    Posts:
    5
    Yes, I am on the pro version and already using AIMPerformance in the scene, it does help somewhat, but not enough.

    Thanks,
    Kirill
     
  10. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Usnp,

    I've tracked down the bug to a point where the static percepts are not written into the precepts list. Unfortunately, it is tricky to find the exact root of evil, which needs more time to delve deep into the system's internals.
    In the meantime, here are some tips that may improve your performance (if you have not already applied them):
    - set the update frequency in AIMPerformance to a lower value: most of the time, it is not needed to update them at a high frequency since the controllers already limit their movement, and often changes do not happen rapidly.
    - reduce the range of the AIMSteeringFilter: the smaller the range, the fewer objects need to be processed.

    Sorry for the inconvenience,
    Martin 'Zetti' Zettwitz from Polarith.
     
  11. Unsp

    Unsp

    Joined:
    Dec 20, 2015
    Posts:
    5
    Hi @Polarith ,

    Thanks for looking into it, reducing the AIMSteeringFilter range does fix performance, but isn't ideal. I want the agents to chase the player around the map, and for that they need a big radius, is it possible to use 2 separate steering filters for player chasing and obstacle avoidance?

    Thanks,
    Kirill
     
  12. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Unsp ,

    Unfortunately, its is not possible to attach two AIMSteeringFilter to a single AIMContext. What you might do, is to use AIMFollow instead of e.g. AIMSeek. Since AIMFollow is not a RadiusSteeringBehaviour, it's not affected by the radius of the AIMSteeringFilter. Note, AIMFollow will chase the player independent of the distance. For additional range checks, you might code another script.

    Have a great weekend,
    Martin 'Zetti' Zettwitz from Polarith.
     
  13. Unsp

    Unsp

    Joined:
    Dec 20, 2015
    Posts:
    5
    Hi @Polarith ,

    Sounds like exactly what i need in my case, will try it

    Thanks,
    Kirill
     
  14. Underline404

    Underline404

    Joined:
    Jun 7, 2022
    Posts:
    2
    Hi, I am looking for steering with avoidance asset, and I am wonder if Polarith is suitable for me. I am creating a demo of 2d objects following path, they have max speed and accelation. Can you help me some directions to do that with Polarith. Thank you
     
  15. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Underline404,

    Polarith AI Pro supports connection to existing pathfinding solutions. While the connection to Unity's pathfinding is inbuild, other plugins can be connected with some coding skills. Since our AIMFollowWaypoints component is an addition to AIMFollow, you might want to test in a simple setup using AIMFollow (possibly pointing to an object you drag around) and some of the avoidance behaviours (like AIMSeek, AIMFlee, AIMAvoid) if our system fits your needs. Therefore, you can have a look at our example scenes, the documentation, and our YouTube tutorials. As a hint, prediction on the behaviours may be your friend.

    Happy testing,
    Martin 'Zetti' Zettwitz from Polarith.
     
    Last edited: Jun 8, 2022
  16. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Hey there! Just digging into the pro asset after picking it up last year, really impressive stuff!

    I'm experimenting with a simple scene based on the copter example, and there are a few things I'd appreciate your input on:

    - Firstly, how can I get the agent to stop/hover in place near a target? As I understand it, I should be able to set an inner radius with AIM seek or AIM Arrive behaviours, or run a Reduction behaviour to reduce the magnitude of an interest/target, so the agent comes to a halt. I guess the Copter Controller / Copter physics components are interfering with this, making the agent constantly adjust and recalculate, and it seems like the magnitude is overridden somehow, so the agent doesn't respect the inner radius, and tries to get to the precise point of the target transform.

    As I typed this, I came up with and tested a workaround- spawn another game object (with no colliders or mesh) as a kind of proxy target near to (and potentially as a child of) the original, and AIM Follow the proxy instead. I set flight mode on the Copter to 'Observation Point' at the real target, and reduced the roll/pitch/yaw factors to improve the stability of the hover effect a bit. Looks pretty plausible, though I guess it might add some additional complexity in a real scene; making sure the proxy target doesn't spawn in scene geometry etc. It doesn't feel like the *right* solution, though, even if it kinda works.

    So I'd love to hear if you have tried to achieve this before, or can think of a better solution, or if I'm just misunderstanding the way these AIM components work in 3D scenes.

    - Secondly, and possibly related, I've noticed when the agent gets caught on some geometry (eg. when trying to get to an interest point in the middle of a collider), it can sometimes spring off, at enormous velocity, into the distance. I'm guessing this has something to do with the way the torque is calculated, or maybe it's just a quirk of Unity rigidbodies... Anyway I wondered if you had any ideas about how I could reign this in a bit. A couple of possible workarounds I haven't tried yet: apply a small inverse force on collision, like a little bounce, to help the agent right itself and get around the obstacle, or track the agent rigidbody velocity, and if it goes above a threshold, fix the position for a couple of frames. I also might experiment with the interpolation settings on the rigidbody.

    But again- if you've seen this issue and have some ideas about what causes it (and/or how to fix it) I'd be much obliged.

    - Thirdly, did you ever hear of anyone writing any NodeCanvas Actions? I've been able to use it as an FSM/BT for Polarith just fine (by simply enabling/disabling relevant components and setting properties), but proper actions are always nice to have. Hmm, I'll ask in their discord too.

    Thanks again and love the asset!
    J
     
  17. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    ...One more- it feels like I should be able to set an AIM Follow component target (gameObject or position) at runtime, but that doesn't seem to be possible (and I can't really see why because it's dll). Why's that?

    I guess a different workflow must be intended, but I'm not sure what it might be. How should I go about setting AIM follow targets that don't exist when the scene is loaded? (preferably without using tags, as gameObject or position references are generally more flexible). Sorry if it's a stupid question, I'm still putting it together in my head...

    Thanks again,
    J
     
  18. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Jshh,

    1. I'll try to explain a little more general with respect to the example scene CopterHall, where I deactivated the patrol option in AIMFollowWaypoints such that the agent will stay at the last waypoint (-12, 2.5, -2.5). Note, that a simple AIMFollow scene is still better to comprehend. Additionally, it is mandatory to set the Copter Controller option 'Objective As Speed' to interest. Otherwise, there will be no adjustment at all. There are multiple options to achieve a hovering behaviour. Your ideas are right, you can use AIMArrive to reduce the magnitude and set the Copter Controller's Flight Mode to Observation Point. Here it is important to adjust the magnitude multiplier and the radii for AIMArrive. In the example scene, AIMStabilization is interfering with this setting since it will permanently add values to interest. So you either deactivate AIMStabilization the whole time or only while you want to hover (e.g., using a script that performs range checks, trigger, etc).

    2. We observed this sometimes. Most of the time, it's some kind of loaded energy when the agent is stuck and (step :D) force is added to the motion. When a certain point is reached, and the agent is released (e.g., better position), all the energy is released at once. We usually tune the agent's parameters so it won't hit the obstacles - but we are no game developers, and our scenes are quite small. Your ideas seem reasonable, I actually would do the same. In 3D the Bounds behaviours can be quite complicated to set up. Other guys in the forum wrote a script similar to AIMSeekGround, where raycasts are performed in multiple directions (e.g., sensor receptor directions) to observe the environment precisely. If the impact on performance is not too big for your setup, this might be a very good option.

    3. Unfortunately, I have not. I only did this with the Unity inbuilt mechanisms - but in general, state machines and Polarith AI are a very good match.

    4. This should be possible without any problems. I quickly wrote a simple demo script that works like a charm. It works with GameObjects that I spawn at runtime or that are already in the scene.


    Code (CSharp):
    1. public class TestSetFollow : MonoBehaviour
    2. {
    3.     public bool Activator;
    4.     public GameObject GObject;
    5.     public AIMFollow FollowComponent;
    6.     public AIMArrive ArriveComponent;
    7.  
    8.     void Update()
    9.     {
    10.         if (Activator) // Used like a button - quick and dirty
    11.         {
    12.             Activator = false;
    13.             FollowComponent.Target = GObject;
    14.             ArriveComponent.Target = GObject;
    15.         }
    16.     }
    17. }
    Happy coding and experimenting,
    Martin 'Zetti' Zettwitz from Polarith.
     
    Jshh and Skorcho like this.
  19. Aquarae

    Aquarae

    Joined:
    Dec 29, 2013
    Posts:
    1
    Hi @Polarith,
    Thanks for this awesome plugin. However, I'm really struggling to use this to make a MOBA warcraft3 like moving behavior. Can you guys help to make some example of that?
    Thanks
     
  20. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    @Polarith Thanks for the pointers! All makes sense.

    After some tinkering with seek/flee bounds behaviours in slightly more complex environments, I felt that some 3D pathfinding would probably be the way to go. I got it mostly working via steering behaviours, but sometimes the agent made strange decisions, like getting nearly to the corner of an obstacle, then turning back and trying the other way.

    So I found and integrated a 3D pathfinding project, which generates lists of points. Amazingly got it working, just by setting points on path objects in the scene, and enabling/disabling agent components in an FSM. Then I saw your Path page, and figured I could improve my integration while also increasing my knowledge of the system. But now I'm slightly stuck :D, maybe you could help a little:
    1. In the example code, you're invoking PathChanged(), an action from the parent class, AIMPathfinding (itself inherited from AIMPathConnector). I'm just getting a NullReferenceException whenever I call it, so I must be doing something wrong, I'm just not sure what (yes I am running it in an override of Update()). [EDIT: I figured this out, see below]
    2. I'm a bit confused about how I should actually use my CustomPathfinding component. At the moment, it sits with all the other Polarith components. I can give it a destinationGameObject and call for an updated list of waypoints, but I don't quite see how that list is supposed to get sent to my AIMFollowWaypoints behaviour. Maybe this will all become clearer once I've sorted the null ref above. As I type I realised I should also take a look at your UnityPathfinding example.
    Anyway I think in the meantime I can just use my hacky method. I'm really impressed with how flexible this system is!

    Thanks again,
    J

    [EDIT]
    So while working on my hacky system, I realised the PathChanged() action needs to be called on a Path connector/object itself. So in my case, that meant the AIMLinearPath component I was using to store the calculated points.

    However, I did experience some weird behaviour- after updating a path, and calling PathChanged, my AIMFollowWaypoints component would still try to get to the active waypoint from the previous path. So I wonder if there's way I can dump the currently followed waypoint...
     
    Last edited: Aug 21, 2022
  21. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Aquarae,
    In general, vector flow fields might be a more applicable option since the behaviour is more deterministic which might be important to the overall gameplay. However, using our AI, you would use AIMFollow(Waypoints), and combine it with the behaviours I posted here. I guess you might use a lot of agents, hence AIMPerformance is worth a look. Additionally, you have to set ObjectiveAsSpeed(Interest) in our example controllers to slow down the agents.

    Have a great start into the new week,
    Martin 'Zetti' Zettwitz from Polarith.
     
    Skorcho likes this.
  22. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Jshh,

    Your path solution sounds awesome! Nice to hear you dive deeper into the system and write custom components :)
    Maybe this part of the doc will help you - it definitely sounds odd.

    Have a maniac Monday,
    Martin 'Zetti' Zettwitz from Polarith.
     
    Jshh likes this.
  23. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Yes this is very helpful, thank you. Gives me a thread to pull anyway. I also somehow hadn't realised the whole API was documented there (obvious in retrospect), so that's great too.

    Cheers!
    J
     
    Skorcho likes this.
  24. siumanchun

    siumanchun

    Joined:
    Apr 7, 2013
    Posts:
    44
    Hi !
    Please Support Playmaker !
    Thanks !
     
    fordtimelord likes this.
  25. Skorcho

    Skorcho

    Joined:
    Jul 1, 2013
    Posts:
    16
    A simple "SetActive()" in playmaker would take you a long way, if you look at the roundabout scene, you'll see a very good example of Polarith used with a state machine. To dynamically assign targets could take a little more tinkering, but I'm sure it's possible with generic actions.
     
    Polarith likes this.
  26. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Hey again, I'm getting some pretty weird behaviour and I'm not sure how to debug it. I'm not sure if it's something I'm doing wrong with Polarith or some other configuration issue in my project...

    So I got the 3D pathfinding system working nicely with the steering algorithms and created a few behaviours for my agent. All good. Then I duplicated my test agent to get it working generically. Cleaned up a few bits where my code was too tightly coupled and didn't work with multiple agents. All smooth.

    Then I added a third agent. The first two continued to work fine, but in the third I started getting a null error where I'm calling
    m_AIMFollowWaypoints.PathConnector.PathChanged.Invoke();
    - this was surprising because each agent instantiates a new LinearPath on Start(), and adds it to its own AIMFollowWaypoints component, and I could see that this was working correctly.

    Then things got really weird: I duplicated the third agent, creating a fourth, which worked fine.

    This pattern would continue (I tried up to 10), with the agent at every odd number above 1 firing a null at that line (and not working), and the other agents working fine.

    Strange, right? The other odd thing was that if I disable the non-functioning agents before running the scene, the other ones continue to work fine.

    Have you ever seen anything like that? Is there something I could be overlooking in how I'm calling the PathChanged Action? Or do you think it's probably an issue somewhere else in my spaghetti?

    Thanks again for all your help, I'm really happy about how it's going.

    J
     
  27. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Jshh,

    Sorry for the delay! I've never experienced something like this - it's really odd. Since the invocation returns a null error (I assume the method is not assigned or where does the null come from?), you should check for the delegate. AIMFollowPath assigns its OnPathChange() method to the pathConnector.PathChanged (after pathConnector != null check). In AIMFollowWaypoints.OnPathChange(), we check for PathConnector != null, too - idk your code, but maybe a check is missing, or an assignment went wrong?

    Confused greetings,
    Martin 'Zetti' Zettwitz from Polarith.
     
    Last edited: Sep 9, 2022
    Jshh likes this.
  28. Jshh

    Jshh

    Joined:
    Sep 14, 2019
    Posts:
    38
    Thanks Martin! No worries about delays, I'm sorry too!

    So, I think there were multiple separate issues with my code. I think the strange behaviour I described before was down to a mixture of execution order, dodgy validation when generating random destinations, and possibly the 3DPathfinding algo not handling simultaneous path requests particularly gracefully (though theoretically it's multi-threaded).

    I managed to ameliorate this stuff, even if it still feels a bit arcane to me. No more nulls or mysterious alternating failures. Yay! But then the null issue came up again, when instantiating a new agent at runtime.

    Thanks to your pointers above, I was able to debug a little further, and found that the null is solved by simply disabling and reenabling the AIMFollowWaypoints component from the pathfinding system when it finds
    AIMFollowWaypoints.PathConnector.PathChanged == null
    - No other changes.

    [I also tried disabling the AIMFollowWaypoints component in the prefab to be instantiated, and only enabling it when it is initialized, but that didn't have any effect.]

    Anyway, I wondered if that might be a useful clue? My workaround is a bit ugly. It feels like maybe there's another step I'm missing when first instantiating the PathConnector and assigning it to the AIMFollowComponent, like I need to alert it to the fact it has a new PathConnector (my agents are instantiated without anything in that field).

    Turning it off and on again appears to do that, but I'd like to understand it a bit better...
     
  29. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Jshh,

    I send you a PM since this is getting quite detailed :)

    Best,
    Martin 'Zetti' Zettwitz from Polarith.
     
    Jshh likes this.
  30. Skorcho

    Skorcho

    Joined:
    Jul 1, 2013
    Posts:
    16
    Hi Jshh,
    I know it's a big ask, but I use unity and Polarith in an educational context, and a solution using 3D pathfinding would be awesome. Willing to share a subset of your framework with Polarith working with the pathfinding you discussed? Time to rebuild the setup is currently lacking!!!

    Thanks in advance!
     
  31. azanwork01

    azanwork01

    Joined:
    Sep 8, 2022
    Posts:
    2
    Hello, I was wondering if someone could help me with this tool.
    I want my agent to wander inside specified bounds what components should I use with what settings to make that happen?
     
  32. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @azanwork01,
    Please have a look at this post in the forum. Basically, you have to add interest inside the center of the zone you want to stay, the closer you get to the edge.

    It is Wednesday my dude,
    Martin 'Zetti' Zettwitz from Polarith.
     
  33. Rocky_Unity

    Rocky_Unity

    Joined:
    Oct 13, 2017
    Posts:
    96
    Hi Polarith, I just started using your asset and it's really cool! I've two questions

    1) When there is nothing of interest, the `DecidedDirection` just stays. What I'd like it to do is turn to Vector3.zero. Is there a proper way to do this? Even with AIMWander, I'd like it to sometimes choose Vector3.zero to stop moving on occasion. (Like a chicken for example. Wanders a little bit, stops for a bit, wanders some more, unless it is near enough to food in which case it tries to go for the food -- AIMSeek with the right magnitude should work for that well)
    Or maybe there's some other value I can check for to determine that the magnitude of interest is below some threshold and to therefore stop movement in my own controller?
    2) I forgot :p

    Thank you!! I hope you continue to develop this amazing asset :)
     
  34. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Rocky_Unity,

    We love to hear that you like our asset :)
    There is a pretty simple way of achieving this. First, you need a controller that scales its velocity related to the DecidedValue. In our example controllers, you achieve this by using ObjectiveAsSpeed, as you can see in the sources line 82.
    Additionally, you may have a look at our Formation extension. There, we use different radii to manipulate the magnitude, too. The line that might be interesting is 442.

    Have a great day, happy exploring and thanks for the nice review,
    Martin 'Zetti' Zettwitz from Polarith.
     
    Rocky_Unity likes this.
  35. ayockel90

    ayockel90

    Joined:
    Jan 27, 2019
    Posts:
    17
    Hi Polarith,

    I have a very simple scene set up with one player, one enemy, and some asteroids. I have the enemy configured the same way as the Avoid example, the only difference is it uses layers to identify danger objects instead of setting them manually. The asteroids are on the correct layer but my enemy ship doesn't avoid them on the way to the player. What could I be doing wrong?

    upload_2023-4-9_18-40-58.png
     
  36. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @ayockel90, the best way to debug is to enable the gizmos in AIMContext, or to use AIMContextIndicator. This way, you can see if your agents receives any information of the target at all. After making sure you can receive the agents, you need to check the properties of AIMAvoid and AIMContext. I would start checking the environmtents and layers first, then, I would check if the perceiver and filter receive the correct objects, and AIMAvoid uses the proper layers and maps to the correct objective in AIMContext. If you want to make sure your AIMAvoid is working properly, start settings objects manually first, and then update the components to the layer system.

    Best,
    Martin 'Zetti' Zettwitz from Polarith.
     
  37. gdsmssngr2723

    gdsmssngr2723

    Joined:
    Apr 8, 2023
    Posts:
    1
    When using environments to group gameObject, will a gameObject ignore itself in its calculations? For example, if I have groups of enemies and I want them to avoid each other in there movements, if I put all the enemies into an environment, will an enemy factor in its own location into determining the direction it needs to travel?
     
  38. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @gdsmssngr2723,

    I am not quite sure if I understand your question properly, but the self object in AIMContext will prevent the system from perceiving itself.

    Best,
    Martin 'Zetti' Zettwitz from Polarith.
     
  39. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    30
    Hey! Thanks for the great Asset, it really seems very feature complete and awesome to work with.

    I tried to simplify the problem I'm having. Opening the Space 3D Example I've added an Empty Gameobject somewhere into the world. I then deactivated the "Follow Waypoints" Component on the Spaceship and added a "Follow" and "Reduction" Component, adding the gameobject into the respective GameObject Lists. I also switched "Object as Speed" to "Interest".

    The Spaceship flies to my target but keeps overshooting it, the reduction component seems to have no impact. I tried playing around with the values but can't get it to work.

    Second Issue I'm having trouble to understand is, starting from the fresh example, just deactivating "Follow Waypoints" will make the spaceship fly forward. Deactivating "Stabilization" fixes this, is expected behaviour?
     
  40. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Daxten,

    I think your first issue is related to the second one, since AIMStabilization adds values to the objective, even though you want to use e.g. AIMReduction. Deactivating AIMStabilization may solve the issue. For debugging it is very helpful to check the visuals of AIMContextIndicator if the values towards the target are really getting smaller. If setup correct, the Spaceship should become slower when reaching the target.

    Have a great start into the week,
    Martin 'Zetti' Zettwitz from Polarith.
     
  41. BadEpic1

    BadEpic1

    Joined:
    Jan 8, 2020
    Posts:
    4
    Hello
    I'm trying to use the free version to make some tests, especially the enemy follow my player, but I'm having trouble, my agent doesn't avoid my obstacles. Already read the documentation and watch the videos but i am super lost.
    I saw examples with 2 AIM Seeks and examples with AIM Seek and AIM Avoid and I tried with AIM Follow but my enemy get stuck in the obstacle object, don't avoid it.

    I Attached an image to help illustrate the problem.

    Can anyone help me? I know i am doing something wrong but I can't find it.
     

    Attached Files:

    Last edited: Jun 12, 2023
  42. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @BadEpic1,

    From the given details it's hard to give you instructions. I suggest building the basic scenes by yourself to see the details. I guess, you have either a wrong assignment of the targets (avoid) such that they are not recognized, or you map them not on objective interest. Note, AIMAvoid is an active avoidance that should write into the same objective that your agent wants to move (e.g. AIMSeek). AIMSeek with objective danger is a passive avoidance such that our system looks for solutions that don't harm the threshold of objective danger. I suggest testing your setup with AIMSeek (danger) instead of AIMAvoid on the obstacle.

    Note, that our support for the free version is limited and usually only for bugs.

    Best,
    Martin 'Zetti' Zettwitz from Polarith.
     
  43. BadEpic1

    BadEpic1

    Joined:
    Jan 8, 2020
    Posts:
    4
    Thanks for the reply I will try with AIMSeek :)
     
  44. BadEpic1

    BadEpic1

    Joined:
    Jan 8, 2020
    Posts:
    4
    Hello,
    I was able to make it work with AIMSeek and AIMFollow, thanks for the help :) But I notice something weird. Inside AIMEnvironment when I add more than 1 layer for the "Danger" the agents doesn't know what they need to avoid.
    For example, If I have an environment with these 3 layers, my agents stops to work and just follow the target.


    I tried to check the tutorials and the samples but I was not able to solve this.
    Thanks!
     

    Attached Files:

  45. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @BadEpic1,

    I am very sorry for the long delay. We did not get a notification e-mail about your post.

    In general, this should work. As a first step, I recommend to debug it with the visuals from the AIMContext gizmos to check if the sensor perceives any object. In case you add objects on runtime, you need to update the environment manually by calling AIMEnvironment.UpdateLayerGameObjects().

    Best,
    Martin 'Zetti' Zettwitz from Polarith.
     
  46. BadEpic1

    BadEpic1

    Joined:
    Jan 8, 2020
    Posts:
    4
    Hey,
    Don't worry :)

    Thanks for the reply, I will try it :)
     
    Polarith likes this.
  47. Hao_Cgh

    Hao_Cgh

    Joined:
    Sep 27, 2021
    Posts:
    5
    If I want to get custom decideValue , which part shoul I modify, the source code is complex for me
     
  48. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @Hao_Cgh,
    Have a look at our example controllers. In line 93, you can check how we obtain the DecidedValue for a specific objective from AIMContext and use it to scale the speed of the controller.

    Best Regards,
    Martin 'Zetti' Zettwitz from Polarith.
     
  49. paulindrome

    paulindrome

    Joined:
    Mar 10, 2018
    Posts:
    36
    Heyho
    Is it at all possible that AIM Reduction is broken? I am still trying to have an agent follow a cart on a dolly track without bumping into any environment, but I can not get the agent to slow down when it gets closer to the cart (target).

    AIM Reduction should be exactly what I need but the decision values are not changed no matter how close the agent gets or what I put as settings on it. o_O
    (I am using "objective as velocity" in that I multiply the desired velocity by context.decisionvalue[0], which is interest.)

    upload_2023-10-5_0-10-42.png upload_2023-10-5_0-10-54.png
     
  50. Polarith

    Polarith

    Joined:
    Nov 22, 2016
    Posts:
    315
    Hi @paulindrome,

    Your configuration of AIMReduction doesn't look bad to me. Maybe the scaling is a little bit too large. Does the minimum example provided in Assets/Polarith/AI/Examples/Scenes/Lab2D/Reduction work on your machine?


    Have a great day,
    Martin 'Zetti' Zettwitz from Polarith.
     
    paulindrome likes this.