Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
12 stars 5 forks source link

[Feature] Perfect welding #180

Closed FlorentP42 closed 1 year ago

FlorentP42 commented 2 years ago

Is your feature request related to a problem (if not, explain why you think this feature should be added)? Please describe.

So what I am looking for is a way to weld perfectly two shapes together, as if they were spawned as part of the same body: so they will only separate if the voxels making contact between them are all broken.

Describe the solution you'd like

I was thinking about some functions like:

I am aware most of these solution may lead to issues like having orphan bodies with no more shapes in them, hopefully this is not critical, or maybe they could be cleanedup automatically somehow.

Describe alternatives you've considered

I was able to "stick"two shapes together using a "ball" joint with maximal resistence, sadly it is still possible for the shape to rotate relatively to each other if too much force is applied on them. Also this solution does not work well to make sure both shapes will stick until all of the voxels making contact between them are broken. (yes making one joint per voxel in contact could work but that sounds pretty suboptimal and potentially laggy).

I am also aware of the existance of the Constrain*() functions, but I believe this does not allow to separate the shapes automatically when voxels between them have been broken. And trying to compute the list of all voxels touching between two shapes from scripts sounds to me like a potentially laggy process...

Additional context

The Nythroglycerin/Bomb seems to work a bit like what I want, so I'm curious how this is done in the background. Even if I can't confirm that the shape would stick perfectly until all the voxels touching its base will be destroyed, as said voxels will explode if you break one of them for Nytro and are unbreakable for Bomb :p

Thomasims commented 2 years ago

This is extremely similar in scope to #144, is there a use-case here that does not fit in that request?

FlorentP42 commented 2 years ago

That sounds perfect as long as the MergeBody(bodyA, bodyB) part is implemented, we all want to be able to stick existing bodies as well, not only newly spawned ones ;)

So yeah I don't know if "close as duplicate" is a thing in GitHub but I guess we could put a mention to this ticket near your MergeBody(bodyA, bodyB) for more detail on that use case and then close this one.

FlorentP42 commented 1 year ago

https://teardowngame.com/modding/api.html#MergeShape <3