• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] How movement speed is calculated, and other questions

Status
Not open for further replies.
Level 3
Joined
Sep 25, 2021
Messages
30
This has been discussed, but below i will retake this theme.

What i want to know is how much an unit runs if you put him certain X movement speed.

For example:
How many 512x512 squares does an unit with a movement speed of 20 walk per minute?
How many 32x32 squares does an unit with a movement speed of 100 walk per second?

I want to mark 2 things for who does not know, but want to know:

With the square grid of the world editor:
A big square, by default color yellow, sizes 512(x512) units(distance)
The medium squares size 128(x128) units(distance)
The smallest squares size 32(x32) units(distance)
In the world editor, pressing G, you can see this grid of squares.

What concerns me is that, in theory, there is a supression on higher movement speeds
This means that if an unit with a speed of 30 runs 12 medium squares on a second, an unit with speed of 300 actually does not run 120 medium squares on a second.
If you have the formula for this supression, i am interested to know.

This thread discussed the theme, but, i want a check in facts, because i do not trust on it:
Here it is said (and what i believe the most, but not on complete) that an unit runs the same number of units(distance) that it is put on his movement speed field.

If not answered, i may test a few speeds and post an unprecise table, because it may be possibly a good reference to have on hive.

Edit:

Below is some debate about microcuts in the walking of an unit, as well as their graphics and if they have impact on movement speed.
 
Last edited:
You are aware of the Advanced -> Gameplay Constants -> Movement - Unit Speed - Minimum/Maximum?
I currently believe that a unit with 256 movement speed will talk 2 "medium squares" per second (because 1 is 128).
If you have movement speed of 30, you probably hit the minimum limit in Gameplay Constants meaning it's set to something like 150 instead of 30.

Edit: Game Engine maximum (like for real maximum) is 522 (if I remember correctly) and minimum is 0. It is possible to get over 522 if you use some tricks to move the unit via triggers, but it's easy to mess up. I'd recommend finding a library to handle speeds greater than 522.
 
Last edited:
Level 10
Joined
Jan 13, 2017
Messages
88
Generally the movement speed is the coordinate units/second. Results will can be skewed however due to the above minimum/maximum reason, and also due to "Game Speed". Which makes the game logic loop faster or slower than the default "normal" speed. Almost all games in wc3 runs on "Faster" Speed unless you define otherwise or use the +/- buttons to adjust it in singleplayer.
 
Level 3
Joined
Sep 25, 2021
Messages
30
You are aware of the Advanced -> Gameplay Constants -> Movement - Unit Speed - Minimum/Maximum?
I currently believe that a unit with 256 movement speed will talk 2 "medium squares" per second (because 1 is 128).
If you have movement speed of 30, you probably hit the minimum limit in Gameplay Constants meaning it's set to something like 150 instead of 30.

Edit: Game Engine maximum (like for real maximum) is 522 (if I remember correctly) and minimum is 0. It is possible to get over 522 if you use some tricks to move the unit via triggers, but it's easy to mess up. I'd recommend finding a library to handle speeds greater than 522.


As Trees said:
The speeds are not direct, or true to the distance in the game that they run.

That would be metrical and precise:
128 is 128 in a second
256 is 256 in a second
384 is 384 in a second
512 is 512 in a second

But there is a rule of post-slowdowning.

The movements higher than 130, start to get a negative "braking" on its speed.

4 speed may be actual 4 speed
50 speed is actually 49 speed
150 speed is actually 136 speed
250 is actually 218 speed
360 is actually 295 speed

The unit of 128 speed walks very seemingly 1 medium square (a square of 128 points) in one second, but you could notice that an unit with 256 speed does not cover 2 squares (it walks 230 but not 256, 26 points less) in one second, and an unit with 512 speed will walk much less distance than 4 squares (it walks 312 instead of 512, 200 points less).

This is an overtop example, but this post-slowdowning says a rumor that it is actual.
This rare post-slowdowning that slows your units when they are faster, would be cool to be known.

Generally the movement speed is the coordinate units/second. Results will can be skewed however due to the above minimum/maximum reason, and also due to "Game Speed". Which makes the game logic loop faster or slower than the default "normal" speed. Almost all games in wc3 runs on "Faster" Speed unless you define otherwise or use the +/- buttons to adjust it in singleplayer.
That braking would be cool to know.

You are aware of the Advanced -> Gameplay Constants -> Movement - Unit Speed - Minimum/Maximum?
I currently believe that a unit with 256 movement speed will talk 2 "medium squares" per second (because 1 is 128).
If you have movement speed of 30, you probably hit the minimum limit in Gameplay Constants meaning it's set to something like 150 instead of 30.

Edit: Game Engine maximum (like for real maximum) is 522 (if I remember correctly) and minimum is 0. It is possible to get over 522 if you use some tricks to move the unit via triggers, but it's easy to mess up. I'd recommend finding a library to handle speeds greater than 522.
Note. To avoid that, i generally put 0 min 522 max on my maps.

Nonethess im talking of speeds on the standard limits, im saying that all units suffer a slowdown; not that after certain speed the speed is the same, or below a speed it is forced to a speed. There is something that affects all movements from limit to limit, X to X.

If on a map with gameplay constant speed 0 to 522 and normal speed i put an unit of 200 speed, suffers slowdown.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
There is unlikely to be any actual "breaking" occurring. Instead the lost distance is likely due to how the path finder manages the units. It only updates units movement direction at a finite rate using a staggered list approach. This means that the more units moving, the slower units might move if they need frequent attention from the path finder.

Units also might not walk in a perfectly straight line. They might have to stop and turn to make minor course adjustments.
 
Level 3
Joined
Sep 25, 2021
Messages
30
I concluded with a digital cronometer on hand that , indeed , the movement speed in the editor field is equivalent to the points an unit moves in 1 second, supossing that a medium square has 128 points, and suppossing that there is no late response for the path actualizer caused by numerous units as stated by supergood, and that there seems to not exist an apparent supression that would be exponentially stronger by movement speed value.

I made a test map intended only for a quick glance, without elaborating anything for serious testing, if anyone is curious.
 

Attachments

  • speed tests.w3x
    39.7 KB · Views: 14
Level 3
Joined
Sep 23, 2021
Messages
19
Unit speed is just one element.

You can test that if make an empty map, which:
  • flat (no high included)
  • no obstacles at all
  • click exactly to the same row or col when unit moves

Otherwise there are things what the game can calculate, but human experiment have difficulties:
  • pathfinding logic/ obstacles
  • by the previous: turn rate
  • graphical slowdown, especially on different hight levels (hills, waters, etc..) and partly based on unit graphic (abinimation always slower for some reason because it`s graphic)
  • acqusition/ sight logic (can make micro stops/ slowdown)

So on a real map it hardly can be fully accurate.
 
Level 3
Joined
Sep 23, 2021
Messages
19
can test this by measuring a unit without a model

So the proof: graphics not affects it when that is not there?
What is not there off course cannot affect.

In my experience the same happens in movement and attack speed: some kind of graphical element affects it as units with exactly the same main characteristics appear differently in speed when they do that.
It is either processing (actions), or the changing in pure graphical variability actions (move/ attack types and their complexity).
Only can be noticable in "cheat modes" when something is very high.
And off course when talk about "on foot" movement, as a float not affected, also fly less affected.


Using triggers to test movement: creates the "ideal"/ "in theory". While the player click makes the "real" / "in practice".
But for "ideal" something like this can used:
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Just did a small test myself - created a unit based off Footman and changed its model to Peasant. Then did the same again, but changed the model to Abomination.
Thus I had two units with different models, but any other thing (speed, collision size, etc.) same.
Finally I made the two units race in line, similar to the vid you posted.
As expected, both came to the finish at the same time - so the models themselves do not play part in how fast a unit is.
 

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,808
Just did a small test myself
From my testing, neither change to the model (which means difference in collision circle size), unit, selection circle or collision size did anything to prevent both copycat units with different models travelling the same distance in the same amount of time.
As expected changing the art field value of speed did not do anything to change this fact.
Also, tried making a Rifleman race a Knight, the first having the same speed as the latter and the same results. It's entirely dependent on unit speed.
 

Attachments

  • stalkerTEst.w3m
    150.9 KB · Views: 15
Level 25
Joined
Sep 26, 2009
Messages
2,378
Is that means UI walk / run, shadow W/H/X/ Y ?
Yes, the "Art - Animation - Run/Walk Speed" fields
Shadow size and position definitely don't play any role in this.

Did some additional tests out of curiosity - speed is not affected by whether the ground is unbuildable (i.e. rocks texture) or not, same for blight.
But "speed" is affected by pathing blockers. Cannot say for certain how it works, but generally speaking, if there are some pathing blockers and units close enough, then some units stop running in straight line, slowing them down a little bit.
Similar situation for shallow water - if cliffs were close enough and there were other units in "close proximy" (i.e. ~900 units/ 7 white grids), the unit stopped running in straight line.
Units running in straight line took ~3.72 seconds to get to the finish, while units that stopped running in straight line took ~3.78 seconds.
So I think the whole "some units are slower" thing really is just the path finder sometimes not choosing a straight line to the finish, which then make the unit seemingly run slower.
 
Status
Not open for further replies.
Top