Hello all!
I’m working on an X4 game which I hope to be a mesh between Eve Online and Space Engineers (SE). Most of what both games do is now possible on the Roblox engine, but I’m finding it difficult to implement deformable ship parts like SE does. Now, to be fair Space Engineers uses a private in house engine called VRage (for Voxel Rage) which is built around deformable voxels. Ships in SE are voxel ‘grids’ with physics, making deformation much easier. I’d love to hear some of your thoughts on the best way to implement this in Roblox. I’ve split the problem into three major issues:
Collision Force
It is one thing to determine when parts collide, but it is a whole 'nother issue to determine the force at which parts collide! In my private tests I’ve found that
- the listener connection for the Velocity of baseparts doesn’t work
- checking the velocity delta between touch and touch ended doesn’t always work (sometimes the velocity changes the next tick?)
- checking the velocity delta between touch end touch ended can yield incorrect results if multiple parts hit at about the same time (the issue above complicates matters)
- checking the velocity can lead to incorrect results again because the change in velocity may be because of joints connected to other parts that slowed down, resulting in hitting a pebble while decelerating causing an entire wing to go boom
I’m really struggling with this issue, any of you have an idea to how calculate the collision force reliably?
Collision Location
Adding another player on complexity is deforming parts according to where it was hit. Unfortunately as far as I know the Roblox engine only tell us if parts are touching, not where they touch. The only solution I can think of to get where they collided on each other is including the custom collision detection I wrote a couple years ago (GitHub - idiomic/GJK-3D-Intersection). Is there a better way?
Part Deformation
I’m thinking that the best way to implement this is to destroy the original part and replace it with a similar model split into different parts and removing a couple closest to the collision location (the more force, the more removed). I’m envisioning a function much like the glass shattering scripts out there, but in 3D. Is this the best way, or how would you implement it?
Now I may not implement this feature until after the game is released, but I think these are issues worth discussing to explore what is possible on the Roblox engine. Thanks in advance for your responses!