Dark matter is indestructible, but it's also immutable. It would be fantastic to have a material that cannot be broken by physical stress (material that won't go "crunch") that is also moveable.
There a few applications this has. The big one I can think of is for making intentional collisions between two solid objects, where you don't want your objects breaking by accident in the process. Another case is when using small loose objects in and around large machinery bits... smaller objects are more brittle than large objects and can easily get broken if they snag on the larger object.
Results 1 to 10 of 10
Thread: Indestructible material
- Join Date
- Nov 2008
- Blog Entries
I've done some tests on material destructibility myself.
It seems the general rule the engine follows is :
-Lighter objects are crushed by heavier objects.
-Smaller objects are crushed by bigger objects.
Through my experiments I've also noticed that the whole "crushing" aspect may be a method to avoid weird behavior with collision detection in the physics engine.
For instance, I made a pipe shape out of stone and made it spin incredibly fast. I put random objects in it to see how fast the pipe had to spin in order to destroy what was in it. When big chunks of stone were put inside the pipe, they would actually phase through the pipe walls and spin outside of the pipe for a moment before being crushed, this happened with golf balls also and is definitely an oddity of the collision detection. Additionally, if the piece of stone was big enough, the pipe was crushed instead of the stone piece.
For this reason, I think if some materials could be made indestructible, they would reveal flaws in the collision detector and things would be phasing through objects. It would be fun to be able to make grabable objects "near" indestructible (like stone) though.
I have a hunch you're absolutely right on this. As soon as the collision detection finds that one object has violated the space occupied by another object it destroys one of them.
But, we have dark matter which never breaks, even though objects can collide into it, so its theoretically possible...
- Join Date
- Nov 2008
- Blog Entries
I get the feeling Dark Matter is a special case. I feel it isn't calculated in the physics engine at all, but it is calculated in collision detection. I have seen objects phase through Dark Matter when given enough stress though.
I've also recently come across an odd bug that caused two pieces of Dark Matter to exist in the same place at the same time, while remaining two different pieces.
Even if dark matter does trump other objects, it wouldn't be impossible to implement an indestructible material.
Once the collision system detects a crash, reverse the trajectory vector of the mobile object(s). Instead of destroying the object, make it bounce back, despite the fact it may have violated another object's space.
Right now I get the feeling that the fact objects break from collisions is more of a band-aid solution to cover up a suboptimal collision detection algorithm than it is to imitate reality.
The crushing mechanism isn't a property programmed into the materials. It's an error detection system utilized by the game that destroys objects that are acting in a manner the physics simulation cannot otherwise handle.
No, the collision detection is not the major problem. The system works a bit like you describe as "bouncing back" - all collisions and inter-object connections are seen as motion constraints. The system tries to relax all constraint violations by gradually "bouncing back" a couple of times. If not all constraints could be satisfied within a couple of iterations, the game will start breaking things to achieve this goal, starting with the weakest object or connection.
Since the computing capacity - and therefore the number of relaxing iterations possible per time frame - is limited, an unbreakable object is only possible if it's either immutable or if it cannot collide with other objects.
For more background info, there's always http://en.wikipedia.org/wiki/Verlet_integration.
Hmm, very interesting read.
But what then about a more forceful approach if a constraint cannot be relaxed after x iterations, such as relocating the object to the last unconstrained location?
Obviously other games have successfully handled this, but none have been anywhere near as open-ended as LBP in terms of what they were designed to accommodate.
I'm not sure what people are even thinking of using this for. I have yet to have something break on me that wasn't caused by creator error (typically forgetting to set a piston stiff). The only thing that could be done is to have a material that was just under dark matter in the crushing priorities calculation. This would not stop crushing, it would just make it so the other object was crushed. For example, you could drag the indestructible object to use as a door jam and it would crush the door instead of being crushed by the door.