Doom gravity metrics

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Re: Doom gravity metrics

Postby determin1st » Sun Nov 21, 2021 2:15 pm

ooke, i've measured velocity change by stepping off the roof of the "map test" in brutal doom.
the result is:

0
-2
-3
-4
-5
-6
...

at each tick it adds -1 to the z-velocity, G = 1 is the acceleration based on tick (1/35) and unit, to translate it to meters and seconds, some substitutions have to be done:

G*(m/s*s) = 1

1meter = 32units, 1second = 35ticks

G*(32/35*35) = 1
G = 35*35/32 = 1225/32 = 38.28125 (in meters/second^2)

so the doom Gravity=1.0 is more than Earth gravity in x3.9 times.


After 1 second of falling from a standstill, a typical gravity 1.0 actor will be falling at a speed of 35 units per tic.

This translates to 35x35 units per second - 1225.


35 units per second, and the second is 35 ticks, so it's 1 unit per tick.

Is Doom's gravitation acceleration really up to four times what we see in real life!?


yes, 38.28125/9.8 = 3.90625 a bit more precisely.

those are my calculations, maybe wrong somewhere, but i've made some projectile fall tests from 10 meters (320units) and it looks and feels quite natural with the g=9.8 :P
User avatar
determin1st
 
Joined: 06 Oct 2021

Re: Doom gravity metrics

Postby Caligari87 » Sun Nov 21, 2021 4:54 pm

This is actually a known factor: Gravity
the wiki wrote:The gravity in ZDoom works as normal in the Doom engine: it corresponds to a value which is added to a thing's vertical velocity linearly each tic. During the first tic of free fall, that value is added twice.
[...]
Internally, the default values are all 1.0, so a fall lasting one second (35 tics) gives an accumulated speed of 36 in the default conditions.


There's no reason for scaling things down to try and make something match. You can just change the gravity value in mapinfo. Now, 32units == 1m works for Doomguy's physical actor height. In fact, it makes him perfectly physically average. It's actually almost too convenient, which leads me to wonder if it's intentional and then got forgotten with later design decisions.

Now, based on what I hashed out on Discord a little while ago with some smarter people than me: If we take 32 units == 1m, mapinfo gravity should probably be about 205 to simulate earth gravity. (9.81 * 32 * 800) / (35^2) = 205

The problem isn't that the scaling is wrong. The problem is that the scaling is inconsistent.
  • Vertical scaling is at a 1.2 factor, so 32 units vertical is 26.6 units horizontally. Changing this requires changing virtually every asset in the game.
  • Doomguy's viewheight is in his chest, so players only feel as if they were 1.28m (41 units) tall, not 1.75m.
  • Doomguy is ridiculously fast for his height, regardless of scale factor.
  • Average doors are approximately 4m (13ft) wide (roughly a 2-car garage).
  • Small doors are 2m (6.5ft) wide. By comparison, a standard residential door in the US is .9m (3ft) wide.
That's just off the top of my head.

Basically, you can make it right if you change literally everything to be consistent. It's not impossible. it's just not really worth the effort and would break Doom's normal gameplay expectations. For something like HD or a standalone game this is generally fine. As a general purpose mutator it'll feel really weird.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Doom gravity metrics

Postby determin1st » Sun Nov 21, 2021 5:32 pm

Now, based on what I hashed out on Discord a little while ago with some smarter people than me: If we take 32 units == 1m, mapinfo gravity should probably be about 245 to simulate earth gravity. (9.81 * 32 * 800) / (35^2) = 245


to simulate earth gravity, per tick, it should be 0.256, using the formula: 9.8 * 32 / 35*35
where 32 units is the vertical meter, and 35*35 is the second (squared)

this number (0.256) could be tested by spawning a projectile at 10m (320u) above the floor. with initial zero velocity it should reach the ground in 50 ticks, from the free-fall formula

t = sqrt(2 * h / g), h=10, g=9.8

t = sqrt(2 * 10 * 9.8) = 1.4285 seconds = 50 ticks
User avatar
determin1st
 
Joined: 06 Oct 2021

Re: Doom gravity metrics

Postby Caligari87 » Sun Nov 21, 2021 5:33 pm

If you're doing it per actor or per sector, yes. In MAPINFO, no, since the scale is on 800, not 1.0.

EDIT: Also corrected my math above slightly. My formula should have been 205, not 245. But we're both right since 800 * .256 = 204.8

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Doom gravity metrics

Postby Marisa Kirisame » Mon Nov 22, 2021 3:54 am

When modding I've always wondered why is it that gravity-affected projectiles "feel wrong" unless they use a 0.25 gravity factor. Now I know why...
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests