Physics are not realistic...

Hello, I noticed something when doing some testing for a game I am making. The physics will not replicate a basic real life attribute.

I have a hinge joint rigidbody with the box collider. (think a door)…Then behind it I have fixed hinge rigidbodies which are also box colliders. The ones behind it we will call “blockers”…they are placed to block the rotation of the “door” type object until enough force is applied to break their fixed joint through force or torque as I set in the inspector.

Here is the problem…I can use one blocker and set the force being applied to the “door” to be enough to break the one blocker. Then I copy and paste the one blocker so there are about 5 instances of it at the exact same distance to the “door” but on different y coordinates. So the problem noticed is that regardless of how many of the same “strength” in regards to their own joint (break torque and break force) Even though I have more than one now it does not sum their strength like it would in real life.

Meaning, If there were more than one of these blockers…their individual strength joint wise before breaking would be a sum and average of the total number of blockers.

So right now if you have JUST enough force applied to break one of the blockers and then add more of the blockers you should not be able to break through them with that same level of force it took to just break only one.

The only way I can think of to fix this would be to have it check how many there were and then I can do the math to figure out the overall strength with averages and basic physics math.

How do I find out how many of a certain object type is in a certain area? Use a box collider? Then have it check its collisions. Or what is inside of that “area”? How can I do this?

physics.checkSphere comes to mind

or tag all the elements and find by tag.

or assign them to an array in script.

Or check what the door is colliding with, that might list all 5, and handle the breaking of the joint in code. Then again, physics simulations make for lousy reliability.

Yep especially lousy when its all being done in software instead of hardware and is buggy and slow. This is of course upsetting because unity advertises: "Unity contains the full capabilities of the Ageia PhysX next-gen Physics Engine. " B.S. I have no hardware physics and also no liquid…the list goes on. If it was at least hardware based I could get by with most things but the software makes it lag with only a few physics collisions going on at once. sooo slow physics that ruins game FPS = NO PHYSICS ENGINE AT ALL. In most cases. I know this has been brought up before… Just venting I guess.

Thanks for the ideas. I was thinking about using an array and checking objects in area… but honestly… with all the game lag from software physics I may end up never using physics for this sort of thing… at least not in this engine. Gonna have to hard code some stuff to make it seem to react like I need it.

Oh well back to the drawing board.

That’s really not the case…on most any computer made in the last few years or so, you can easily have hundreds of objects with physics and get a decent framerate (as long as you’re sticking to primitive colliders and not using too many mesh colliders). Hardware physics has largely been a dud.

–Eric

and don’t put them in the same place as even high end computers will break after 200-300 barrels if you stack them

I did have iterations up above 20 because the low levels seemed to cause things to fly right thru eachother. That could be a reason for the lag. I adjusted the penalty down low to try and stop it but it still went on. I may also be experiencing some burnout mentally with all of this as well. lol

I am going to try and do some more physics testing tonight I think and see what I can come up with.

This is what you have to deal with when you are working with physics. Even AAA games have these issues. I remember playing sonic and the secret rings (obviously not a AAA title) and experiencing objects passing through solid walls (using the full Ageia package I might add).

To have good physics, and good performance, and high velocities will require lots of smart coding and optimization. It will not be drag and drop with any engine.

Fortunately, if you post a problem broken down into small components, I think there are lots of folks who can help.

NVidia support PhysX on board most of their video cards now, the resistance factor doesn’t sum because it is not smart enough to sum, you have to do check collision and apply force appropriately,

Example
Object A force 0 mass 10
Object B force 0 mass 10
Object C force 0 mass 10
Door force 5 mass 15

Force being that the door is being opened at a rate of 5m per second, you have a mass of the door which is 5 greater than that of the first object so it will push the first object into the second, but the second is the same mass as the third so the second will naturally push the third at the same rate it is being pushed unless you have a value at the “door” that says, what is the mass I am pushing, you do send messages from each mass that collides and get collision point and push back based on mass + mass > door until force and mass against mass of block is greater than door force at which point the door won’t budge, then you have to figure if you want to bust the door joints, what is the breaking point.

Force doubled on door and mass behind door is greater than door mass, break the joint.

This is just a logical layout, but it is easy enough to do and have triggers on objects that make objects communicate with each other.