Progressive Running 2.0

by Maoman

Start off running slow then rapidly accelerate to full speed while the key is held; useful when your run speed is very high and you want to move precisely

Utilities
a month ago
2.0
1.09K
Transportation Character

b Possible fix for Jerky movement.

a month ago

Hi, I've been looking into the issue with the jerky movement when you initially start walking. I think the issue lies in how it's calculating the movement speed modifier each tick.

Looking at the code, on line 224 you are checking for not walking, then on line 225 checking for having stopped walking this tick. If you were to insert an else statement here for the second if, it seems to fix the issue.

https://i.imgur.com/FfODnw7.png

Hope it makes sense or just ask :)

a month ago
(updated a month ago)

This doesn't seem to make any difference on my end. Set your initial_speed_factor to 0.1 to really exaggerate the effect for debugging.

https://i.imgur.com/MuJWIXs.png

a month ago

Sorry, it's a bit hard for me to explain, but basically every tick you are setting the speed modifier back to 0, which means normal (max) speed. When you start moving, the game moves your character one tick before your code reads the is moving part, which then sets the code to apply the movement speed modifier of -0.9. This doesn't take effect until the second tick, which is the problem. In your code you need to set this value earlier by setting it while not moving, so that when you do start moving, the progressive running starts from -0.9 instead of 0. The place in the code I mention putting an else statement is where this might fit in properly. The code I added was more of a pseudocode implemention, rather than a direct use case.

I'll do some more testing to see if I can fix it, but I'll have to spend some time learning the source code :)

a month ago
(updated a month ago)

I think I fixed it! Though it required removing the RPG mod compatibility, as there's likely something wrong in that calculation. I'll mess around with it some more, but if I can talk to you on discord or something, I can show you what I did.

Before fix:
https://streamable.com/8utd8w

After fix:
https://streamable.com/kmo93f

a month ago

I've fixed the movement speed issue. It will not work with RPG system however, as there's no remote interface to grab the running speed level modifier from. (Was it even working properly anyways?)

Here's what you do. I marked the additions with -- MODIFIED:

https://i.imgur.com/G7NuIgK.png

https://i.imgur.com/lw7Ko51.png

https://i.imgur.com/WEEVB6J.png

https://i.imgur.com/bp9rqp7.png

https://i.imgur.com/dz56JI0.png

And here's the source code if you'd rather just grab this :)
https://puu.sh/Kypbm/74ca6584ad.lua

New response