What should density of water be to keep box afloat? I'm writing a platformer game and my physics engine is Box2D. I have successfully implemented buoyancy, but have a question about mass and density.
My player is 80kg, a box has a density of 0.5 and the water has a density of 2.
When the crate is in the water, it floats and is only half its height in the water. When the player jumps on the box, the both sink.
What should the density / mass of the box be in order for it to remain afloat even when the player jumps on it?
 A: So I am guessing you have a a 2 dimensional density? say, kg/m^2?
In this case, you will need to get the area of your box -> say it is 2m^2.
The mass of the box is 2 * 0.5 = 1 kg.
But the mass of your person is 80kg.
So your new mass is 81kg.
This means the new density will be 81/2 = 40.5kg/m^2.
The item will only float if the item has a lower density than water of the same area (2*2 = 4kg).
To get the box to float, you will either have to change the size of the box (to 80 + areaOfBox * 0.5 < areaOfBox * 2 => sizeOfBox > (80 * 3/2)m^2).
Changing the density of the box, will have little effect in this case, as the 80 is so big in comparison.
For this density of water (2), the area of the box would have to be more than 40m^2 and in this case, the density of the box would have to be 0.
To get your value of densities that would work, you can use this formula:
densityOfBox < (80 / areaOfBox) - densityOfWater

A: The best case scenarion would be zero density. Even so, for the boat to float, it has to have a surface large anough to displace 80kg of water, otherwise the buoyancy will be never enough. So, as far as the density of the boat is smaller than that of the water, the variab;e has to be the size of the boat (or the shape), such that it can displace a volume of water that weights at least about it owen weight plus that of the person .
A: should be able to realize that it is necessary to keep the center of gravity as close to the midline of the ship as possible. Once the center of gravity is beyond the deck of the ship, it will tip over (just as the towers tipped over once their centers of gravity got beyond their bases).
