English Formular for calculating movement speed

5 replies
Goto Page
To the start Previous 1 Next To the start
Up
FishyFinThing
User
Offline Off
Hi there!

I just want to know how to calculate a player current movement speed?

All I know is that there a value called "speedmod" which is set on 0 by default.

And on top of that we add in weapon weight to get the value

But what is the true speed in term of pixel? I did some test but the result doesn't seem to be consistent.

Also, I want to know the true minimum speed.

It seem the speedmod limit is [-100,100] but when player get to a certain point before -100, they kind of stop moving.
17.09.19 08:50:32 pm
Up
DC
Admin
Offline Off
I'm pretty sure that I posted this at least once in the forum already... I can't find the post though
Does anyone know where I posted it? I don't want to write it again

In general you're right:
base speed + weapon modifier + speedmod

and base speed can be two different values (running or walking)
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
17.09.19 09:16:31 pm
Up
TrialAndError
User
Offline Off
I mean I found this

http://wiki-en.unrealsoftware.de/index.php/Pixels/Frame

but it was last updated some 3 years ago.
17.09.19 09:59:57 pm
Up
DC
Admin
Offline Off
Ah, perfect! Thank you!
That's what I posted in the forum somewhere. It's old but still true.

Only change is of course the frame rate from 50 to 60 FPS. But there's an unmentioned frame time based factor which makes the movement speed the same no matter what the FPS are (factor is higher with low FPS and lower with high FPS). So the values and the sample calculation should still be right.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
17.09.19 10:30:58 pm
Up
TrialAndError
User
Offline Off
Also to calculate the speed you would need to halt a player with any weapon is to calculate the speed for the weapon with the highest weapon speed modifier (in this case, the knife and wrench).

Short answer: -27.5 (or -28, because decimals get truncated) to make a player halt with any weapon.

b: base speed = 2.0
w: weapon modifier = 0.75 (for knife and wrench)
s: speedmod = this is our unknown, is also divided by 10

(There's also a 1.2 multiplier)

so our formula would be:

(b + w + s/10) × 1.2 = 0
or
(2 + 0.75 + s/10) × 1.2 = 0

2+0.75 = 2.75

and multiply 2.75 and s/10 by 1.2:

3,3 + (s × 1.2)/10 = 0

which is

(s × 1.2) / 10 = 3.3

1.2/10 = 0.12

s × 0.12 = 3.3

s = 3.3/0.12 = 27.5

And there we have it. -27.5 (-28 because -27.5 will be truncated to -27) is the true minimum speed to stop with all weapons.
edited 1×, last 17.09.19 10:51:03 pm
17.09.19 10:54:26 pm
Up
FishyFinThing
User
Offline Off
Thanks guy! I appreciated it.

I'm trying to make a progression system and part of it is to modify speed and display it on the screen.
Now I can try to implement it into a HUD now.
To the start Previous 1 Next To the start