# How is 'mass' handled in video games? [closed]

Mass is one of the basic scalar quantities, which is required in most rigid body physics calculations.

In a game, does every moving object have mass defined in the code, or is it allotted by the rendered objects size? Size should not be the only solution, though, since density also comes into play.

For example how does the physics engine handle mass in the Frostbite engine used in "Battlefield 3"?

• From my experience, mass is either defined by a base "type" (e.g., wood, rock, water, flesh, weightless) with a scalar value associated with the type that calculates based on the object size, or an individual scalar value (e.g., pounds, kilograms). Jan 3, 2013 at 8:49

Might as well make this an answer.

From my experience, mass is either:

a) A global value that applies to all spatial objects equally (or no mass scalar at all).

or...

b) An individual scalar value (e.g., pounds, kilograms) directly associated with each individual object. This approach obviously doesn't scale well.

or...

c) Defined by a base "type" (e.g., wood, rock, water, flesh, weightless...) with a scalar value associated with the type. That value could be used on its own or it could be used in conjunction with the size of the object to determine the final scalar, depending on the accuracy required.

Not sure about the Frostbite engine but I would assume it uses something similar to c).

• the (C) part looks promising, but for that, one have to tightly integrate renderer with physics engine... Jan 3, 2013 at 10:12
• For completeness there is D) Not modeled at all. Games, even games with physics, don't have to have massive objects. If all you are modelling is gravity on Earth, everything falls at a constant rate anyway, so you don't need to model Mass. Although, it occurs to me that this might fall under A. Maybe clarify A if that's the case? Jan 3, 2013 at 13:26
• A good point that I meant to include under a); edited the answer. Jan 3, 2013 at 13:44

Physically, mass is not directly related to volume. OK, technically mass is related to volume, but based on another property: density. My point is that you could only apply a volume-based mass if the object has a specific density. Which is ultimately little more than just selecting the mass by selecting a density. Though if you have breakable things, having a density is useful as it allows you to compute the mass of the broken object(s).

In general, the masses of objects that are physically modeled are usually chosen in a videogame based on the actual results of the physics simulation, not realistic physical properties. Game developers pick what looks good and behaves well, not what is necessarily "correct" in any real-world context.

there is probably diffrent ways to solve this, and depending on how important that is for your game, you could end up adding a scalar value to each entity saying it´s specifik mass that gets calulated at loading time.

Another aproach is what Djentleman said, to define stuff like wood, rock, metal and water and from there define the mass.

I dont think any one here knows the frostbite engine well enugh to say how they handle it, and if they are, they are probably not allowed to tell you how it´s working.