Advertisement Jump to content
Sign in to follow this  
fir

what scale? metric or other

This topic is 1757 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I not quite agree with the opinions that if you chose exclusive convention for defining rectangles or inclusive, or chose righthanded coordinates or lefthandet it in not to much important - this is important for at least two reasons

1) different conventions have different properties

2) it is easier to communicate if sides of communication have the same choices

 

so as to two things mentioned i chose inclusive and right-handed but 

still I am not sure what scale to chose to descript a scene coordinates in 3d

 

there are probably two main options to chose

 

1) metric coordinates where 1.0 is 1 meter

2) other than metric, (i think for example about scale where 1.0 = 1 cm,

this has some advantake that this 1 as a cm is better for my scale of details

of the things - but has disadvantage that when using this numbers need to convert something like 23300 to meters (23.3) - so i really dont know, think that maybe metric can spare me a bit of headahe (?)

 

Has some person some opinion on that?

Share this post


Link to post
Share on other sites
Advertisement

Unless your application somehow interacts with the real world, there is no reason to have any units at all - let the user decide what they want 1.0 units correspond to.

 

But if you need to be 'compatible' with the real world (eg. you want your values to be same as in the real world) I would use metric because it seems to be the most universal when it comes to more scientific stuff, however I would only do that internally. The interface might benefit from a conversion factor which you can change to get IO in whatever units you want.

 

Often applications let you choose what unit system is used for display - I dont know if they internally use one of them or if they use custom units.

Share this post


Link to post
Share on other sites

I can back #Waterlimon's advice:


Unless your application somehow interacts with the real world, there is no reason to have any units at all - let the user decide what they want 1.0 units correspond to.

 

But something confuse me:


1) metric coordinates where 1.0 is 1 meter
2) other than metric, (i think for example about scale where 1.0 = 1 cm,

 

Are you writing that 1cm is not metric? because it is. 

Share this post


Link to post
Share on other sites

I can back #Waterlimon's advice:

 

 


Unless your application somehow interacts with the real world, there is no reason to have any units at all - let the user decide what they want 1.0 units correspond to.

 

But something confuse me:

 

 


1) metric coordinates where 1.0 is 1 meter
2) other than metric, (i think for example about scale where 1.0 = 1 cm,

 

Are you writing that 1cm is not metric? because it is. 

 

1 cm (as 1.0) is centimetric (scale)

 

Ass to correspondency, if you make something that resembles

a real world (like car tree etc) it in some way corresponds to reality, even if you make some junk spirals or something it 

also in some way corresponds to reality so I could say 

everything corresponds to rality

 

though i see yet two options 1) that holding strict metric corespondence is good 2) that it is bad and better is to forgot

about real world matrics and made the one of yourself 

 

i hesitate beetween metric and centimetric  (the other one when 

you just call 1.0 as an 1u (unit, where there i was no stating correspondence between this unit and real world at all) i consider now bad one i was using it before but i was getting lost in it)

Share this post


Link to post
Share on other sites
Personally I always use 1.0 unit in my code/ data is 1 meter and degrees 0 to 360.
Keeping it simple and to prevent mistakes (ps: I'mvfrom europe).

For assets in max I therefor also use 1 = 1 meter

Share this post


Link to post
Share on other sites

Yeah, if you dont have any performance or other implementation dependent reason to not use 1 engine unit = 1 meter such as:

-You are simulating very small or big things (atomic level/universe), might be better to use another scale

-You have some very important element which is some specific size, might make sense to make that size equal 1.0 (eg in tile based game you might want 1 tile = 1.0 units even if the tile would not be 1 meter)

 

You should probably use meters. If you think 1 cm is better as 1 unit instead of 0.01, might as well use it for aesthetic reasons.

 

Of course, you can always use multiple different scales for different systems but that would probably overcomplicate it.

Share this post


Link to post
Share on other sites

Ultimately, you can use whatever you like, but unless you have a reason not to, 1 unit = 1 metre is the one that'll be least surprising to future coders that use your codebase. If your game world is particularly large/small, then use something more appropriate - e.g. my current game is at a global scale, and you can't zoom in to a more human scale (think Civilization), so I have made one unit equal 1000km.

 

Centimeters are a bit odd, because they don't fit into the pattern of 10^3 increments that are used for SI units, so if I were doing a game that was very zoomed in, I would probably go for millimeters rather than cm. Not that it's likely to be a problem once you're used to it.

 

I'll never forget the pain of having to use imperial measurements from a legacy codebase though, trying to figure out someone elses physics code is hard enough without having to deal with feet and slugs.

Share this post


Link to post
Share on other sites
We call them “game units” because they are arbitrary.  1 inside the game means “whatever the artists making assets for the game decided it should be.”
 
Before a project the artists gather around and the lead artist says, “Look, newbies, I’m the LEAD artist.  I OWN YOU AND YOU WILL… [insert long lecture about his or her greatness] …AND SO IN THIS GAME 1 = 1 METER IS THAT UNDERSTOOD MAGGOTS?  I CAN’T HEAR YOU.”
 
 

i hesitate beetween metric and centimetric  (the other one when 
you just call 1.0 as an 1u (unit, where there i was no stating correspondence between this unit and real world at all) i consider now bad one i was using it before but i was getting lost in it)

It’s not your choice what 1 is.  It’s up to the egomaniac lead artist for each game by each team.
Leave it alone and drop the issue. It’s none of your business, and it doesn’t even make sense that your API would itself define the length of 1. What are you planning to do with that “knowledge”? Limit the viewing distance? The only thing that you could possibly accomplish by assuming the length of 1 unit is to add flaws to whatever you are making.


L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites

Unless your application somehow interacts with the real world, there is no reason to have any units at all - let the user decide what they want 1.0 units correspond to.

It's mainly a concern for the artists - when they build a human, do they make them 1.8, 180 or 5.9 units tall (m/cm/ft)?
 
However, it also affects some of the programmers on the team too. Is the value for gravity 9.8, 980, or 32.17? When designing the physics system, what size object can you define as being too small or too large, and then be able to make the simulation behave in a stable way by assuming that most objects will be in this range of sizes? How does the audio guy implement the doppler shift on moving sound sources -- are those velocities in m/s, km/h, ft/s, etc...? The guys designing the streaming world system need to know what range of units they'll be working with -- the floating point accuracy of positions that are 10km from the origin differs wildly depending on whether you're using cm, m, km, etc... Whether or not they need to use hierarchical or 64-bit coordinate systems may depend on the choice of units!
 

So it's pretty important for everyone on a game team to have a common understanding of what the game units are. A good engine will let you change these choices from game to game though. 

It’s not your choice what 1 is.  It’s up to the egomaniac lead artist for each game by each team.

In my experience, the technology lead has made the decree of universal scale, forcing the art teams to adapt to His will laugh.png

Edited by Hodgman

Share this post


Link to post
Share on other sites
I believe that the game unit should be bigger than the engine unit to avoid having the camera see through meshes when very close to them.

While it is easier to define that "1 game unit maps to 1 engine unit," this would mean that if the camera is closer than one unit to a mesh (which is moderately far away), the near-plane of the camera will intersect the mesh and see through it, as usually one defines the camera near-plane distance as 1 engine unit.
In case you are thinking "why not make the near-plane distance less than 1.0," there is a considerable loss of precision with smaller values: http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html

Something like "1 game unit maps to 10 engine units" will allow you to get closer to meshes with the camera, which is especially useful in case you have cutscenes with dramatic close-ups.
With a metric abstraction, this could mean that 1 game unit is 1 metre, and that 1 engine unit is 1 decimetre.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!