Question About Functionality

  • June 30, 2017 at 17:32 #21212

    Hey, so I’m strongly considering purchasing Apex Path as well as Apex Steer and before I do I was wondering how would you go about implementing a path agent for something like an Airplane. You probably remember me from the email I sent. I’ve since watched a large amount of your tutorial videos already and it definitely seems dynamic enough that it is something that could be implemented and I have a few ideas but I wanted it to run it by you first. Since I’ve often jumped into buying assets without properly researching them and I wan’t to make sure its a good fit.

    So most agents would just move towards the next point. Where with a Airplane you want a banking angle since it can’t really just instantly turn around like any other agent could. So my idea was to create a steer component which would clamp the desiredAcceleration from performing too hard angular turns. Would this be an appropriate means of achieving what I want to do? Also how exactly would you go about doing this? From what I gathered from one of your videos a component with a higher priority overrides the desiredacceleration of the other components. If I was to do something like this I’d probably let all the other steering components run first then ensure the desiredAcceleration is clamped to an angle or something. Would this make sense?

    Also I would want the planes to avoid crashing into each other so it would need a decent form of avoidance. Which I guess is where Apex Steer comes in? Although would Apex Steer work well enough to incorporate the delayed angular turns? I assume if you just increased the search radius it would have enough time to react.

    Lastly I need planes to maintain a constant velocity or close enough anyway. That is, a lot of path finding solutions often include a form of breaking or decelerating when reaching the end of a path. Which would cause them to stop maybe for a brief second and turn around to the next path. I’d be planning on using a wander like behaviour to keep them moving but they would have to be consistently moving. Having a plane stop in mid air just wouldn’t look right. If you understand what I’m saying. So path accuracy is not a major concern.

    Also just to note that all the Airplanes would be flying at the exact same height so 3D avoidance is not required. The typical setup for how Apex Path works is just fine. Its just the banking angle I’m concerned about.

    July 3, 2017 at 10:24 #21227

    Hi Fiachra,

    Thanks for your post, and your interest in our products.

    It sounds like you can use Apex Path and Apex Steer to achieve your vision, given that you can code up some custom components for rotation and possibly avoidance.

    In order to achieve your banking angle, you would probably need to write at least a custom OrientationComponent, which manages desired rotation. Clamping desired acceleration in turns will mean, as you expect, that turning will be slower (take a larger arc), but you will most likely still need an OrientationComponent to make the airplane rotate nicely, unless simply rotating towards the velocity direction is sufficient for your needs.

    Apex Steer’s SteerForUnitAvoidance will probably work for your use-case, based on your description. It runs a 2nd degree polynomial to figure out whether there is a collision with another unit, and if so adjusts by moving to the side or slowing down. Thus, if you need constant speed units you may need to modify or write your own version of it – to prevent slowing down. Additionally, you probably want a large ‘radius margin’ so that airplanes keep a sensible distance from each other. By default, it is setup so that units only “just” avoid each other.

    Finally, constant speed airplanes will require you to write your own speed component (IDefineSpeed). The default “HumanoidSpeedComponent” use acceleration and deceleration. Of course, you can ‘fake’ constant speed by setting acceleration and deceleration sufficiently high, but you might be better of writing a custom (simpler) version that just has a constant speed.

You must be logged in to reply to this topic.