Putting an end to the age old controversy of 1 unit = 0.75 in

The valve wiki states that 1 unit in hammer is 0.75 inch, and the wire team believes this as many others do. It is however, incorrect.

All hl2 maps and models are on the basis of 0.75in. Player would be 54 in tall by the standard of 0.75, which is four and a half feet tall, which is the height of a child.

Now, I’ve found some concrete evidence showing that 1 unit = 1 inch holds true, as well as mass units in source are in kg, by simply reading the script file for the hl2 jeep:


// This is a test jeep type vehicle for the wasteland

"vehicle"
{
    "wheelsperaxle"    "2"
    "body"
    {
        "countertorquefactor"    "0.9"
        "massCenterOverride"    "0 -30 12"
        "massoverride"            "1000"        // kg
        "addgravity"            "0.50"
        "maxAngularVelocity"    "720"
    }
    "engine"
    {
        "horsepower"        "350"
        "maxrpm"        "4200"
        "maxspeed"        "35"        // mph
        "maxReverseSpeed"    "14"        // mph
        "autobrakeSpeedGain"    "1.1"        // 10% speed gain while coasting, put on the brakes after that
        "autobrakeSpeedFactor"    "3.0"        // Brake is this times the speed gain
        "autotransmission"    "1"
        "axleratio"        "4.56"
        "gear"            "3.2"        // 1st gear
        "gear"            "2.4"        // 2nd gear
        "gear"            "1.5"        // 3rd gear
        "gear"            "1.0"        // 4th gear
        "gear"            "0.84"        // 5th gear
        "shiftuprpm"        "3800"
        "shiftdownrpm"        "1600"

        "boost"
        {
            "force"        "1.5"    // 1.5 car body mass * gravity * inches / second ^ 2
            "duration"    "3.0"    // 3.0 second of boost
            "delay"        "3.0"    // 3 seconds before you can use it again
            "torqueboost"    "1"    // enable "sprint" mode of vehicle, not    force type booster        
            "maxspeed"    "50"    // maximum turbo speed
        }
    }
    "steering"
    {
        "degreesSlow"        "50"    // steering cone at zero to slow speed
        "degreesFast"        "18"    // steering cone at fast speed to max speed
        "degreesBoost"        "11"    // steering cone at max boost speed (blend toward this after max speed)
        "steeringExponent"    "1.4"    // steering function is linear, then raised to this power to be slower at the beginning of the curve, faster at the end
        "slowcarspeed"        "14"
        "fastcarspeed"        "20"
        "slowSteeringRate"    "4.0"        
        "fastSteeringRate"    "2.0"
        "steeringRestRateSlow"    "4.0"
        "steeringRestRateFast"    "2.0"
        "turnThrottleReduceSlow" "0.01"
        "turnThrottleReduceFast" "2.0"
        "brakeSteeringRateFactor"    "6"
        "throttleSteeringRestRateFactor"    "2"
        "boostSteeringRestRateFactor"    "1.7"
        "boostSteeringRateFactor"    "1.7"

        "powerSlideAccel"    "250"

        "skidallowed"        "1"
        "dustcloud"        "1"

    }

    // front axle
    "axle"
    {
        "wheel"
        {
            "radius"    "18"
            "mass"        "100"
            "damping"    "0"
            "rotdamping"    "0.0"
            "material"    "jeeptire"
            "skidmaterial"    "slidingrubbertire"
            "brakematerial" "brakingrubbertire"
        }
        "suspension"
        {
            "springConstant"        "40"
            "springDamping"            "0.7"
            "stabilizerConstant"        "10"
            "springDampingCompression"    "9"
            "maxBodyForce"            "9"
        }

        "torquefactor"    "0.3"
        "brakefactor"    "0.4"
    }

    // rear axle
    "axle"
    {
        "wheel"
        {
            "radius"    "22"
            "mass"        "100"
            "damping"    "0"
            "rotdamping"    "0.0"
            "material"    "jeeptire"
            "skidmaterial"    "slidingrubbertire"
            "brakematerial" "brakingrubbertire"
        }
        "suspension"
        {
            "springConstant"        "40"
            "springDamping"            "0.7"
            "stabilizerConstant"        "10"
            "springDampingCompression"    "9"
            "maxBodyForce"            "9"
        }
        "torquefactor"    "0.7"
        "brakefactor"    "0.6"
    }
}

"vehicle_sounds"
{
    // List gears in order from lowest speed to highest speed

    "gear"
    {
        "max_speed"        "0.27"
        "speed_approach_factor" "1.0"
    }

    "gear"
    {
        "max_speed"        "0.5"
        "speed_approach_factor" "0.05"
    }
    "gear"
    {
        "max_speed"        "0.75"
        "speed_approach_factor" "0.052"
    }
    "gear"
    {
        "max_speed"        "0.95"
        "speed_approach_factor" "0.034"
    }
    "gear"
    {
        "max_speed"        "1.5"
        "speed_approach_factor" "0.033"
    }
    "gear"
    {
        "max_speed"        "2.0"
        "speed_approach_factor" "0.03"
    }
    "state"
    {
        "name"        "SS_START_WATER"
        "sound"        "ATV_start_in_water"
    }

    "state"
    {
        "name"        "SS_START_IDLE"
        "sound"        "ATV_engine_start"
        "min_time"    "4.0"
    }
    "state"
    {
        "name"        "SS_SHUTDOWN_WATER"
        "sound"        "ATV_stall_in_water"
    }
    "state"
    {
        "name"        "SS_IDLE"
        "sound"        "ATV_engine_idle"
    }
    "state"
    {
        "name"        "SS_REVERSE"
        "sound"        "ATV_reverse"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_0"
        "sound"        "ATV_rev"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_0_RESUME"
        "sound"        "ATV_engine_idle"
        "min_time"    "0.75"
    }
    "state"
    {
        "name"        "SS_GEAR_1"
        "sound"        "ATV_firstgear"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_1_RESUME"
        "sound"        "ATV_firstgear_noshift"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_2"
        "sound"        "ATV_secondgear"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_2_RESUME"
        "sound"        "ATV_secondgear_noshift"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_3"
        "sound"        "ATV_thirdgear"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_3_RESUME"
        "sound"        "ATV_thirdgear_noshift"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_4"
        "sound"        "ATV_fourthgear"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_GEAR_4_RESUME"
        "sound"        "ATV_fourthgear_noshift"
        "min_time"    "0.5"
    }
    "state"
    {
        "name"        "SS_SLOWDOWN_HIGHSPEED"
        "sound"        "ATV_throttleoff_fastspeed"
        "min_time"    "2.0"
    }
    "state"
    {
        "name"        "SS_SLOWDOWN"
        "sound"        "ATV_throttleoff_slowspeed"
        "min_time"    "2.0"
    }
    "state"
    {
        "name"        "SS_TURBO"
        "sound"        "ATV_turbo_on"
        "min_time"    "2.5"
    }
    "state"
    {
        "name"        "SS_SHUTDOWN"
        "sound"        "ATV_engine_stop"
    }
    "crashsound"
    {
        "min_speed"            "350"
        "min_speed_change"    "250"
        "sound"                "ATV_impact_medium"
        "gear_limit"        "1"
    }
    "crashsound"
    {
        "min_speed"            "450"
        "min_speed_change"    "350"
        "sound"                "ATV_impact_heavy"
    }

    
    "skid_lowfriction"        "ATV_skid_lowfriction"
    "skid_normalfriction"        "ATV_skid_normalfriction"
    "skid_highfriction"        "ATV_skid_highfriction"
}


The vehicle top speed as it states, is 35 miles per hour. If you clock this using wiremod using a speedometer or e2 tomph function, the jeep’s top speed will register as 26 miles per hour, because these are on the basis of 0.75in.

If you clock it as inches per second / 17.6 (formula for in/s to mph, 1 unit = 1 in), you get 35 miles per hour.

:wink:

Wait, when did it become 1 unit = 0.75 inch?

I did a decent amount of mapping years ago (wasn’t particularly good at it, don’t think I ever released anything I’d like to mention, but I did), and it was always 1 unit = 1 inch. Now, maybe I’ve just been out of the game too long and Valve switched to 0.75 at some point, but that seems unlikely to me. Unlikely enough that the title of this thread managed to catch my eye, at least.

I just did a brief check, and it looks like as of 2006 it was 1 inch = 1 unit. And again in 2007.

The first reference I found to 1 unit = 3/4 inch is from November 2007, and it notes that architecture uses 16 units = 1 foot, while models use 12 units = 1 foot. As it’s a good idea to make game levels “larger” than they ought to be (easier to enter doors and such), that makes sense.

That general distinction seems to hold to the current version of that page. That seems like a possible source for the confusion between unit values.

Interestingly, November-ish 2007 would be right around the release of Team Fortress 2, which has different sizes for player hulls, which might have played a part in the 1 -> 0.75 change.

fuck

Does that mean soda cans weigh 1 kg and containers weigh ~8 tons?

just because it’s in kg doesn’t mean things are properly weighted

spotlight models weigh 500, what’s your point

Have you tried setting a weight of a prop under 1?

[editline]28th August 2012[/editline]

Not that 0.75kg would make anymore sense anyway…

Just because the script says the jeep should move at 35 mph doesn’t mean it actually will. You’re assuming that the jeep will reach that speed. If you provide some proof that both speeds do coincide, then your argument is sound and you’d be correct.

I’d like to hear Garry’s opinion also, since he works with the engine of course. :L

It’s hardly an opinion, being very visible in the code and such.

read the op, the specified speed for the jeep is 35 mph. if you clock it using inches per second / 17.6 you get 35 miles per hour.

35 miles per hour to inches per second = 616 in/s. Calculate 75% of that for .75in = 1 in, you get 462. 462 / 17.6 gives you 26.2 mph. Therefore, 0.75in is wrong.

[editline]29th August 2012[/editline]

http://www.conversion-website.com/speed/inch_per_second_to_mile_per_hour.html

inches per second to miles per hour conversion is in/s / 17.6.

[editline]29th August 2012[/editline]

And also, things can be weighted below 1, you can go as low as 0.001 iirc. I do it frequently for ACF things.

you’re all wrong nobody is right 1u = 1cm :wink:

That’s well and reasonable but what are you using to measure the speed in inch/s ?

Probably an E2 function that measures prop velocity in units/sec.

That would be great.

People are still hung up on this?

The truth is it really isn’t because there’s no accurate way to convert a virtual unit to a real one.
(:v:)

Can we get someone to correct the wiki then? Or can valve members only do this?

The wiki is correct

0.75 in/unit for mapping
1 in/unit for modelling

having big maps just makes things easier and less infuriating to do.

How does that work if models are smaller than their environments?

As for the weight, most physics engines flip out if the mass ratios between colliding objects are too high, and it mostly doesnt matter much anyways about your soda cans weighting the exact proper values