GDevelop
GDevelop copied to clipboard
Sharp turns with topdown
When top-down behavior is used with low values for accel-/decel-eration, to reproduce movement on a sliding surface (ice), the top-down produces sharp turns at high speed that it doesn't do at low speed. Dummy project included below. Press arrows and change direction at low speed and full speed to see the sharp turns. Sometimes, the sharp turn is immediate, sometimes it comes with a little delay.
@PascalLadalle could you try 5.0.131 ?
Game engine improvements
Top-down movement extension improvements: Add a condition to check which key was used or simulated and actions to change the current velocity Fix the velocity value that wasn't exactly 0 when moving horizontally or vertically
I assign our math master @D8H here to highlight what could be a solution.
When the max speed is reached the velocity directly follows the inputted direction.
The 2 following demos show what happens if the behavior stay coherent.
Always direction inertia:
- https://liluo.io/instant-builds/2c11bf75-3f76-4a1a-a30d-3078faf556af?dev=true
Never direction inertia:
- https://liluo.io/instant-builds/197eeb7f-12dd-40fe-9a4d-472606b87899?dev=true
The second one is probably near to what you are asking and it seems usable so may be it could be chosen by property.
The second one is the current behavior, the first one is what the forum user was requesting. I guess both ways could be useful, so a property would be great, indeed.
The current behavior is:
- max speed is not reached: 1st case
- max speed is reach: 2nd case
Which topic is it?
Yes, that's right. Here's the topic: https://forum.gdevelop.io/t/how-do-i-make-player-slip-on-ice-in-topdown-game/39017
@D8H Hi! Do you have a workaround I can forward until a fix is implemented?
The case is too specific to be integrated in the top-down behavior as it would be almost impossible to control.
It can be done using variables for acceleration and force actions to set the speed or Physics2.
The current behavior produces inconsistent results depending on the object's speed. That needs to be fixed somehow, no? 🤔 If it doesn't do sharp turns at (max speed - 10), it shouldn't do sharp turns at max speed, in my opinion. Or would that create issues when other property settings are used?
I agree that having a different behavior at 99% and 100% of the max speed is an issue, but using only one of the 2 formulas make things weirder. We should probably take time to do some researches to see how games do it.