Planet & Collisiondamage

Found a bug? Report it here.

Moderator: PPS-Leaders

Post Reply
The Jo
General DuGalle
Posts: 121
Joined: Mon Mar 01, 2010 7:43 pm

Planet & Collisiondamage

Post by The Jo » Wed Aug 31, 2011 10:28 pm

Collision is not properly detected on planets. I'm not sure if collision is detected "right" in general :-)
When turning off collisiondamage, it is quite easy to fit a collisionshape to a planet.
But when collision damage is enabled, usually collisions are detected before a spaceship or rocket touches the planet surface. Somehow the collision can't be understood intuitively, since there are crashes although one was moving parallel to the planet's surface.

Maybe related is the rocket behaviour: A Collision is detected if you are simply close enough. This can also be counter intuitive. E.g. in MissionOne.oxw. Try to kill the second box with manual rockets, then the third one and then the fourth one. In most cases the destruction order will be 1st, 2nd, 3rd :?
Fail. Fail again. Fail better.

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Re: Planet & Collisiondamage

Post by 1337 » Thu Sep 01, 2011 7:24 pm

I don't know exactly what's causing this, but I might have an idea...

These are two citations from the Bullet manual:
Avoid very small and very large collision shapes
The minimum object size for moving objects is about 0.1 units. When using default gravity of 9.8,
those units are in meters so don’t create objects smaller then 10 centimeter. It is recommended to keep
the maximum size of moving objects smaller then about 5 units/meters.
Avoid large mass ratios (differences)
Simulation becomes unstable when a heavy object is resting on a very light object. It is best to keep the
mass around 1. This means accurate interaction between a tank and a very light object is not realistic.
You can find the manual here

In terms of size, this gives us a maximum ratio of 1:50 whereas a planet in real life is about 500'000 times larger than an F/A-18 fighter jet.
So we'd have to reduce the game planet size by about 5.5 magnitudes if we want to keep collision functional for projectiles.
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Re: Planet & Collisiondamage

Post by x3n » Thu Sep 01, 2011 7:45 pm

I'm not exactly sure how collision damage is calculated. I guess it uses a callback from bullet, so if there is collision damage, then there was indeed a collision with the planet. There should be no difference if you activate collision damage. But maybe 1337 is right and collisions are sometimes triggered too early because the simulation is unstable? Without collision damage you may not notice it because it's only for a single tick... but that's just a guess, no clue.

About projectiles: I think the collision radius of projectiles is greater than the radius of the projectile itself. This is often intended to make it easier to hit enemies. However it might be a bit too large for some projectiles... this could be adjusted.


@Planet size and projectiles: Projectiles don't have to bounce from the planet's surface. In fact projectiles are not even real physical objects, they are ghost objects which don't collide with other objecst. Instead they only receive a callback from bullet. No one cares if this callback is a little too early or too late if you hit a planet. ;)

Also collision with planets is not even really needed for ships. If you allow a player to fly that close to a planet until he smacks his forehead on the planet's surface, you have a problem anyway. Instead we should apply some damage if you enter the atmosphere, issue a warning, and finally destroy the ship if it gets too close. At least that's how I experienced it in other games. We could do it differently of course.
Fabian 'x3n' Landau, Orxonox developer

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Re: Planet & Collisiondamage

Post by 1337 » Thu Sep 01, 2011 8:18 pm

We should definitely see to it that we apply real Bullet physics only when necessary or really beneficial. Planets do not belong to that in my opinion.
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests