I have been terribly frustrated with the black box that is the NavMeshAgent, so I have designed a wrapper around it that allows me near full control like waypoint setting, events for reaching corners/start and end of pathing, a almost exact replacement for rotation, debugging the multipath, and more. The only thing im still using the agent for is the actual movement, but with the lacking documentation, the fact that Ive already replaced so much of the original NavMeshAgent with my current, and my growing need for exact control for my project, replacing the acceleration,speed, autostop featues with my own implementation I can actually see,understand, and extend is the clear next step.
I have so far worked out the equations used to start moving the agent. They are quite simple, constant acceleration over time produces a pretty clear square root curve for velocity given the equation of motion : V^2=V0^2 + 2A(ΔX). It goes until it reaches the velocity is equal to the speed, at which point it is capped as seen below:
My main question is what determines the distance the agent starts to slow down to reach the point using autostop and what formula can be used to model it? I tried a wide variety of speed and acceleration values and got a not so obvious result each time. The ending velocity and the distance the slowing starts at dont really ever map to whole values no matter what I put in (except 5 for speed and 5 for accel which had the agent stopping at a velocity of 2.5 which is neat). (in the current graph it uses a 2 for speed and 8 for accel). Despite how it looks, the velocity curve on the left is actually curving so its using what I assume to be a constant deceleration similar to how it starts. I also assume that because I plotted the velocity with respect to time at the same time and both curves turn into nice straight lines:
With the left side being pretty obvious, starting at 0,0 going to 0.25,2 gives a slope of 2/.25 which is 8, the acceleration. I however could never find an obvious or clear connection to the line on the right. They are not tangent and the line changes slope based on various parameters. There is no clear way to find the velocity it will end at. Can anyone help point me in the right direction as to what formula is used for the autostop feature of the agents?