Q: What unit of measure are the speeds in the scripts?
by Jarrod Roberson · in Torque Game Engine · 05/15/2002 (6:26 pm) · 19 replies
In /server/scripts/player.cs
there is the following
maxForwardSpeed = 14;
maxBackwardSpeed = 13;
maxSideSpeed = 13;
maxUnderwaterForwardSpeed = 8.4;
maxUnderwaterBackwardSpeed = 7.8;
maxUnderwaterSideSpeed = 7.8;
What units are these in? Meters? Feet?
or are they some arbitrary units that are extrapolated to real world units, if so what = 1 METER?
Looking thru Player::updateMove()
I can not derive what these units might be?
there is the following
maxForwardSpeed = 14;
maxBackwardSpeed = 13;
maxSideSpeed = 13;
maxUnderwaterForwardSpeed = 8.4;
maxUnderwaterBackwardSpeed = 7.8;
maxUnderwaterSideSpeed = 7.8;
What units are these in? Meters? Feet?
or are they some arbitrary units that are extrapolated to real world units, if so what = 1 METER?
Looking thru Player::updateMove()
I can not derive what these units might be?
About the author
#2
05/16/2002 (2:17 am)
I thought it was in meters. But then you can set your own unit.
#3
METERS per second? or minute, or tick or what?
05/16/2002 (9:11 am)
I guess I should have been more specific,METERS per second? or minute, or tick or what?
#4
It is probably feet per second, judging from that number. However, it could easily be an arbitrary number. The units shouldnt really have any importance, just guess and check until you find something workable.
05/16/2002 (1:18 pm)
14 meters per second?!? My my, what a speedy player.It is probably feet per second, judging from that number. However, it could easily be an arbitrary number. The units shouldnt really have any importance, just guess and check until you find something workable.
#5
I want to have absolute speeds instead of "eyeballing" what "looks" for "feels" right.
Everything else I have found is in Meters, I just can't find what this means SPECIFICLY. Velocity is measured in meters for sure, but player velocity is calculated in updateMove() based on this number some how! I am re-writing updateMove anyway, so I might just figure out how to make this number == meters per minute if I can't get any definative answer by the time I get around to that part of the code.
To complicate matters I read somewhere else that the default player speed in the demo game was 20km and hour, that does relate to the 14 any way I can figure.
05/16/2002 (2:32 pm)
well they do have importance because without knowing what kind of scale these numbers represent you can not calculate any thing but RELATIVE speeds of players, vehicles and other objects.I want to have absolute speeds instead of "eyeballing" what "looks" for "feels" right.
Everything else I have found is in Meters, I just can't find what this means SPECIFICLY. Velocity is measured in meters for sure, but player velocity is calculated in updateMove() based on this number some how! I am re-writing updateMove anyway, so I might just figure out how to make this number == meters per minute if I can't get any definative answer by the time I get around to that part of the code.
To complicate matters I read somewhere else that the default player speed in the demo game was 20km and hour, that does relate to the 14 any way I can figure.
#6
In the "Movement Keys" section, on line 33 of my build, there is the following:
So from that I would assume that its in meters per second. Tho 14 m/s does seem extremely fast to be running.
05/20/2002 (9:28 pm)
I could very well be wrong on this, but if you look in ~/example/fps/client/scripts/default.bind.csIn the "Movement Keys" section, on line 33 of my build, there is the following:
$movementSpeed = 1; // m/s
So from that I would assume that its in meters per second. Tho 14 m/s does seem extremely fast to be running.
#7
Anyway, I might have to email one of the GG privately, because I have exhausted every possible idea for figuring this out and have not found a definative answer yet.
I am sure who ever "knows" this will say, simple it means THIS but just have to find that person!
05/21/2002 (1:23 pm)
thanks for the post Dave, I saw that also, and all it did/does is muddy the water even more, as that does not seem to be _directly_ related to maxFowardSpeed in any obvious way I can find!Anyway, I might have to email one of the GG privately, because I have exhausted every possible idea for figuring this out and have not found a definative answer yet.
I am sure who ever "knows" this will say, simple it means THIS but just have to find that person!
#8
05/26/2002 (11:13 am)
If getTransform() returns numbers in units, then by my calculations $mvForwardAction etc are in 20 - 25 units per second.
#9
05/30/2002 (12:26 pm)
Isn't it Kilometers per CPU Cycle? :)
#10
When you scale everything to twice the size, the player will walk 1/2 of the previous distance in the same time, because the scripted value did not change.
If you want values easily to calculate with, I would do the following things:
- Set terrain square size to 1 (meter).
- Create a cube and scale it until it is as wide as a terrain's square.
- Because it is a cube, you know that this cube has to be 1m tall. If you want your character to be 1.80m, just multiply the cube's current scale with 1.8, because in your world it is 1m, so the cube becomes 1.8m high (1m * 1.8).
- Now adjust the speed of your player in the scripts, because you know that one square of the terrain is 1*1 meter and you can stop the time.
- Adjust the value until your player has the speed you want it to have (1square in 1s = 1m/s). Probably, you have to add a factor (1 *1.3 = 1m/s).
- The only thing left to do is to scale your models and for this, you might have to calculate a factor to get your game's units fit to the units of your 3d software.
Now, after the unit setup, you can change your terrain's square size while knowing that squareSize= 5 is 5m.
greetings
Daniel
05/30/2002 (3:40 pm)
Why don't you set your own units?When you scale everything to twice the size, the player will walk 1/2 of the previous distance in the same time, because the scripted value did not change.
If you want values easily to calculate with, I would do the following things:
- Set terrain square size to 1 (meter).
- Create a cube and scale it until it is as wide as a terrain's square.
- Because it is a cube, you know that this cube has to be 1m tall. If you want your character to be 1.80m, just multiply the cube's current scale with 1.8, because in your world it is 1m, so the cube becomes 1.8m high (1m * 1.8).
- Now adjust the speed of your player in the scripts, because you know that one square of the terrain is 1*1 meter and you can stop the time.
- Adjust the value until your player has the speed you want it to have (1square in 1s = 1m/s). Probably, you have to add a factor (1 *1.3 = 1m/s).
- The only thing left to do is to scale your models and for this, you might have to calculate a factor to get your game's units fit to the units of your 3d software.
Now, after the unit setup, you can change your terrain's square size while knowing that squareSize= 5 is 5m.
greetings
Daniel
#11
2. as I stated earlier I want to be able to set ABSOLUTE speeds in the script instead of RELATIVE sizes and speeds. Scaling things and eyeballing them is NOT consistant and repeatable, two things required for effecient projects and development.
this is a good example why ABSOLUTE measures are important
awesome work, the bridge is way out of scale, he realized that and the rest of the buildings are correct.
Same goes with speed, when making maps I will be able to measure the meters and calculate EXACTLY how long it will take for a player running at a certain speed to get from point A to point B.
Since my player speeds will vary greatly based on encumberance and other factors this calculation is NOT something that could be consistent and repeatable, without an ABSOLUTE measure.
If anyone has any other sources that show definatively what that particular datablock attributes unit of measure is please let everyone know.
05/30/2002 (4:06 pm)
1. because there is already a unit set, I believe it is meters per second from my experiements. So that is what I am going with until I am proven otherwise?2. as I stated earlier I want to be able to set ABSOLUTE speeds in the script instead of RELATIVE sizes and speeds. Scaling things and eyeballing them is NOT consistant and repeatable, two things required for effecient projects and development.
this is a good example why ABSOLUTE measures are important
awesome work, the bridge is way out of scale, he realized that and the rest of the buildings are correct.
Same goes with speed, when making maps I will be able to measure the meters and calculate EXACTLY how long it will take for a player running at a certain speed to get from point A to point B.
Since my player speeds will vary greatly based on encumberance and other factors this calculation is NOT something that could be consistent and repeatable, without an ABSOLUTE measure.
If anyone has any other sources that show definatively what that particular datablock attributes unit of measure is please let everyone know.
#12
From what I can tell velocity in physics is usually measured my Meters per second or M/S but compaired to above where the players move speed is 14 this is over 10 times fasters than the life like setting of 1.3 ms human walking speed.
hypertextbook.com/facts/2001/ConnieLau.shtml
Those are some numbers and as you can see we as humans cant get much faster than 4.5 ms "walking" our butts off, but if you take into account we can run 3 times faster than we can walk, our running speed would be 13.5 ms if Im not mistaken.
From my studies ( last 10 mins ) it seems everything is in order and the 14 max speed in the player datablock seems to be right on the numbers in meters per second.
*EDIT*
I found a MPS to MPH converter here but I cant conclude if I am wrong about my explanation above.. This is why I dont work at NASA.
Link to converter( javascriptkit.com/script/script2/mps.shtml )
Seems 14 MS is about 31 MPH. But Olympic runners can top out at about 25mph so maybe its close.
I remember years ago running beside dads Camaro and him telling me I was running 15mph, I felt I was hauling booty but it only comes out to be 6.71 MS.
In conclusion I think the Torque player is running a bit to fast heh.
"Run Torque-Dude Run!"
10/16/2003 (12:03 am)
Now that the head version comes with a nifty speed O'meter this is something Im wondering about as well..From what I can tell velocity in physics is usually measured my Meters per second or M/S but compaired to above where the players move speed is 14 this is over 10 times fasters than the life like setting of 1.3 ms human walking speed.
hypertextbook.com/facts/2001/ConnieLau.shtml
Those are some numbers and as you can see we as humans cant get much faster than 4.5 ms "walking" our butts off, but if you take into account we can run 3 times faster than we can walk, our running speed would be 13.5 ms if Im not mistaken.
From my studies ( last 10 mins ) it seems everything is in order and the 14 max speed in the player datablock seems to be right on the numbers in meters per second.
*EDIT*
I found a MPS to MPH converter here but I cant conclude if I am wrong about my explanation above.. This is why I dont work at NASA.
Link to converter( javascriptkit.com/script/script2/mps.shtml )
Seems 14 MS is about 31 MPH. But Olympic runners can top out at about 25mph so maybe its close.
I remember years ago running beside dads Camaro and him telling me I was running 15mph, I felt I was hauling booty but it only comes out to be 6.71 MS.
In conclusion I think the Torque player is running a bit to fast heh.
"Run Torque-Dude Run!"
#13
The Torque guy appears to have powered armor, so he can probably run faster than you ;)... Games typically scale speeds up, anyway, to deal with impatient players. Look at Quake!
10/16/2003 (4:16 am)
AFAIK, Torque runs in units. So you're going to have a hard time getting scale right unless you set up your own metrics and stick to them.The Torque guy appears to have powered armor, so he can probably run faster than you ;)... Games typically scale speeds up, anyway, to deal with impatient players. Look at Quake!
#14
First I made a 100 meters long track in Hammer and exported it.
Dropped it in thee map.
Then made a model i Hammer with different gaps to jump over and small fences with different heights.
Then I did some test with real humans on a similar track.
How far can an avarage human walk, run, jump (long and high).
Then I matched the numbers in TGE to fit the real numbers and guess what?
The game was extremely slow and you could hardly walk up "normal" game steps on stairs.
Its all comiing down to that the game default FOV is very different than real life. In order to compensate for this the speed is scaled.... a lot.
Games in real life speed is unplayable.
I Quake you can almost jump on top of crates that are as tall as a player, well almost. In real life you can hardly do half of that.
10/16/2003 (5:09 am)
I once did this simple test to calculate the speed in TGE.First I made a 100 meters long track in Hammer and exported it.
Dropped it in thee map.
Then made a model i Hammer with different gaps to jump over and small fences with different heights.
Then I did some test with real humans on a similar track.
How far can an avarage human walk, run, jump (long and high).
Then I matched the numbers in TGE to fit the real numbers and guess what?
The game was extremely slow and you could hardly walk up "normal" game steps on stairs.
Its all comiing down to that the game default FOV is very different than real life. In order to compensate for this the speed is scaled.... a lot.
Games in real life speed is unplayable.
I Quake you can almost jump on top of crates that are as tall as a player, well almost. In real life you can hardly do half of that.
#15
10/16/2003 (8:00 am)
That's exactly right, Karsten.
#16
"200 m: 19.32 Michael Johnson (US) Atlanta, Georgia, July 21, 1996" 10.352 m/s
hypertextbook.com/facts/2000/KatarzynaJanuszkiewicz.shtml
10/16/2003 (9:07 pm)
Speed of the fastest human, running:"200 m: 19.32 Michael Johnson (US) Atlanta, Georgia, July 21, 1996" 10.352 m/s
hypertextbook.com/facts/2000/KatarzynaJanuszkiewicz.shtml
#17
33.95456 ft/s
23.15 mph
"The record for the fastest men's indoor 5,000 m walk is held by Russia's Mikhail Shchennikov, with a time of 18 min. 7.08 sec. recorded in Moscow, Russia, on February 14, 1995." 4.60 m/s
4.60 m/s =
15.088 ft/s
10.29 mph
Average human walking speed = ~4 mph
Average human running speed = ~15 mph
10/16/2003 (9:10 pm)
10.352 m/s = 33.95456 ft/s
23.15 mph
"The record for the fastest men's indoor 5,000 m walk is held by Russia's Mikhail Shchennikov, with a time of 18 min. 7.08 sec. recorded in Moscow, Russia, on February 14, 1995." 4.60 m/s
4.60 m/s =
15.088 ft/s
10.29 mph
Average human walking speed = ~4 mph
Average human running speed = ~15 mph
#18
I modified the servers/scripts/game.cs script to scale him by ".7 .7 .7" when he enters the world, which reduces him to around 5 foot 8 inches. Presto, he immediately had a better height when moving around on my very accurately proportioned ship model.
I am unable, however, to modify his movement speed by changing the values in server/scripts/player.cs -- for some reason the change to this file are not causing the engine to recompile the player.cs.dso file. If I remove the player.cs.dso file, the engine wedges on load. How is one supposed to modify these server scripts?
tone
03/24/2004 (6:47 am)
I found the units in TGE extremely distressing for a bit. One thing that makes it all seem somewhat perverse is that the player model is too tall -- around 2.6m tall if I recall correctly!I modified the servers/scripts/game.cs script to scale him by ".7 .7 .7" when he enters the world, which reduces him to around 5 foot 8 inches. Presto, he immediately had a better height when moving around on my very accurately proportioned ship model.
I am unable, however, to modify his movement speed by changing the values in server/scripts/player.cs -- for some reason the change to this file are not causing the engine to recompile the player.cs.dso file. If I remove the player.cs.dso file, the engine wedges on load. How is one supposed to modify these server scripts?
tone
#19
I guess this is one of those rare situations where one must run before he can walk.
tone
03/24/2004 (6:51 am)
Doh... just discovered that the non-debug build was not showing syntax errors in the player.cs modifcation I made. I have it working now and indeed he does finally WALK.I guess this is one of those rare situations where one must run before he can walk.
tone
Torque Owner Anthony McCrary