-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question/Discussion - Vehicle movement: PathBehaviours #36
Comments
Hi @getarun! First of all thank you for using the engine 😉 ! The Notice that the "right" value for BTW: It's not possible that a game entity strictly follows a path on its edges right now. We would need a separate steering behavior for this although I don't think it's possible to model this movement with forces. The problem is that a vehicle would need the ability to abruptly change its movement direction on sharp angles which is something that can't be modeled with steering behaviors (I think). Such a movement would also not look very natural compared to the current result of |
Hi, thanks for the reply. We figured out some parameter combinations that helped to improve the behavior with a more sensitive approach. I agree with you that a path as guidance for the vehicle is enough and a strict clamp would look unnatural. Following the path strictly would indeed imply rather harsh changes on the edges. A small sandbox example to showcase the addressed part is in progress and will be added if this is still open for a little. Have a nice evening ;) |
Hi Mugen87, thanks for your quick reply and your help. We are super happy that we found Yuka! We prepared this sandbox. We want to achieve a fluid movement of the skinnedmesh. Therefore we use the followPath & onpath steering behavior with navmeshes. This works already quite well. However there are some details we just can´t figure out:
An idea would be to use an initial momentum (p=mv) instead of applying force over time. It would be applied on the segments start and applied inversely at its end. Earlier, you mentioned this would lead to an abrupt movement. That will probably be an issue. Before we used navmeshes & Yuka, we handled the movement with useSpring. It was very direct yet the springyness made it fluent. Maybe there is a way to combine these or find a similar approach?
Vielen Dank und viele Grüße :) |
This is not something you can model with forces. You always have an acceleration/deceleration if you apply a force to a vehicle with a given mass.
I've never worked with
No since it's hard to define the conditions for the arrived status. When using forces, it's unlikely that the game entity ever reaches the exact destination. So a strict equal operation between the game entity's position and the waypoint is almost never true. The typical way for solving this issue is to compute the (squared) euclidean distance between the game entity's position and the waypoint and consider the entity as arrived when a certain threshold is reached. The value of this threshold is use case specific. Consider the following: If you are in a building and what to go from one room into another, you set yourself a mental destination point. However, it does not matter if you reach this point to 100%. A small deviation of a few centimeters (or even a meter in some scenarios) is absolutely fine. |
Closing. Feel free to chat about more details at discord: https://discord.gg/MhnFwYM |
Vehicles steered by a combination of onPathBehaviour/followPathBehaviour do not stop a their last waypoint, but overshoot and turn around afterwards. This can be "fixed" by either increasing the tolerance (makes to vehicle stop ahead to the last point) or changing their related weights. A weight ratio 1/100 seems to stop the character early, but this makes it skip edges of the navMesh (though the path is calculated appropriately). I tried to set .radius to make it follow the path more conscientiously, but no effect.
This occurs in a variety of examples (either 3rd party & yuka published). 1
Since documentation tells my to use followPath together with the onPath behaviour to realize accurate path following, but examples do not show this, I like to ask for an opinion on how to address/fix this. 2
I am confused by _arrive and _seek properties wihtin a followPathBehaviour. Are these used to move the character to the last waypoint of the path and manage deceleration distance and brake force? Since both receive a single target (no path) to go to, solely navigating with these in conjunction with a navMesh seems unwanted. Why are these present / named with a leading underscore?
The box-farming lady approaches her missing boxes just fine, but she does not use navMeshes and is controlled by with a single arriveBehaviour (Girl.js: 37ff, Goals.js: 217ff). 3 Ideally, I'd like to have her movement on an accurate (pre-calculated) path within the navMesh.
The text was updated successfully, but these errors were encountered: