• Create Account

### #ActualHodgman

Posted 31 July 2012 - 12:33 AM

what kind of sizes are used in most industry standard games. i mean if everything was microscopic you would never know because your down there with them, or everything could be huge. how would you know? would there be benefits of having a different size for one game vs other sizes.

If I write float length = 42; then that's just 42 "units" of length. It's arbitrary as to what units you actually use.
I've worked on different games with different common units of measurement, such as 1unit = 1 metre, 1unit = 1 centimetre and even 1unit = 1 inch.
In recent times, the most common one I've seen used is metres.

At one company, we had some teams working in centimetres, and other teams working in metres, which was a nightmare when sharing staff/assets! At a certain point along our project, we decided to convert everything over to metres, which caused countless bugs for a few weeks, where we'd missed converting some things, which would appear 100 times too big or too small.

N.B. there may sometimes be technical reasons for some variables to use a non-standard measurement type. For example, if you're using 16-bit floats (AKA. half floats / short floats), then they have really good precision in the 0-1 range, but quite bad precision from 1-2 and above.
If you wanted to compress the vertices of a humanoid character (~2metres tall) down to 16-bit floats, then it might make sense to use the measurement of 1unit = 2 metres, just for those models only, so that you get good precision in your vertex positions. Inside your vertex shader, you could multiply every position by 2.0f to convert them to the standard 1unit = 1 metre.

Also, some games with really large scales might use multiple different units together, e.g. in a large-scale space game, you might have something like:
struct Length { float lightYears; float meters; }
or
struct Length { int gridCell; float kilometerOffset; }

### #2Hodgman

Posted 31 July 2012 - 12:30 AM

what kind of sizes are used in most industry standard games. i mean if everything was microscopic you would never know because your down there with them, or everything could be huge. how would you know? would there be benefits of having a different size for one game vs other sizes.

If I write float length = 42; then that's just 42 "units" of length. It's arbitrary as to what units you actually use.
I've worked on different games with different common units of measurement, such as 1unit = 1 metre, 1unit = 1 centimetre and even 1unit = 1 inch.
In recent times, the most common one I've seen used is metres.

At one company, we had some teams working in centimetres, and other teams working in metres, which was a nightmare when sharing staff/assets! At a certain point along our project, we decided to convert everything over to metres, which caused countless bugs for a few weeks, where we'd missed converting some things, which would appear 100 times too big or too small.

N.B. there may sometimes be technical reasons for some variables to use a non-standard measurement type. For example, if you're using 16-bit floats (AKA. half floats / short floats), then they have really good precision in the 0-1 range, but quite bad precision from 1-2 and above.
If you wanted to compress the vertices of a humanoid character (~2metres tall) down to 16-bit floats, then it might make sense to use the measurement of 1unit = 2 metres, just for those models only, so that you get good precision in your vertex positions. Inside your vertex shader, you could multiply every position by 2.0f to convert them to the standard 1unit = 1 metre.

Also, some games with really large scales might use multiple different units together, e.g. in a large-scale space game, you might have something like:
struct Length { float lightYears; float kilometers; }
or
struct Length { int gridCell; float kilometerOffset; }

### #1Hodgman

Posted 31 July 2012 - 12:28 AM

what kind of sizes are used in most industry standard games. i mean if everything was microscopic you would never know because your down there with them, or everything could be huge. how would you know? would there be benefits of having a different size for one game vs other sizes.

If I write float length = 42; then that's just 42 "units" of length. It's arbitrary as to what units you actually use.
I've worked on different games with different common units of measurement, such as 1unit = 1 metre, 1unit = 1 centimetre and even 1unit = 1 inch.

In recent times, the most common one I've seen used is metres.

At one company, we had some teams working in centimetres, and other teams working in metres, which was a nightmare when sharing staff/assets! At a certain point along our project, we decided to convert everything over to metres, which caused countless bugs for a few weeks, where we'd missed converting some things, which would appear 100 times too big or too small.

N.B. there may sometimes be technical reasons for some variables to use a non-standard measurement type. For example, if you're using 16-bit floats (AKA. half floats / short floats), then they have really good precision in the 0-1 range, but quite bad precision from 1-2 and above.
If you wanted to compress the vertices of a humanoid character (~2metres tall) down to 16-bit floats, then it might make sense to use the measurement of 1unit = 2 metres, just for those models only, so that you get good precision in your vertex positions. Inside your vertex shader, you could multiply every position by 2.0f to convert them to the standard 1unit = 1 metre.

PARTNERS