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

[Bug] Bad object splitting after MakeHoles #608

Open FlorentP42 opened 3 months ago

FlorentP42 commented 3 months ago

Describe the bug

I was doing some tests to find a way to reduce lag when a very large object (200x200x200 vox) is being carved (eg: through MakeHole, bullets or explosions).

One of my attempt was to split the object into multiple shapes: making a large cube out of 64 smaller 50x50x50 cubes.

This successfully reduced the lag significantly, sadly this object seems to behave a little weirdly when being cut in half : image

As you can see the bottom part of the cube is fine, but in the top part, two of the cube (those that were not touched by the cut), detached and became a separate body. This feels wrong.

Steps to reproduce the behavior

  1. Make the following prefab.xml spawnable :
    <prefab version="1.3.0">
    <group pos="0.0 0.0 0.0" rot="0.0 0.0 0.0">
      <body tags="">
        <voxbox pos="0.0 0.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 0.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 0.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 0.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 5.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 5.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 5.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 5.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 10.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 10.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 10.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 10.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 15.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 15.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 15.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 15.0 0.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 0.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 0.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 0.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 0.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 5.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 5.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 5.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 5.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 10.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 10.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 10.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 10.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 15.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 15.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 15.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 15.0 5.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 0.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 0.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 0.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 0.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 5.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 5.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 5.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 5.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 10.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 10.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 10.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 10.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 15.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 15.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 15.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 15.0 10.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 0.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 0.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 0.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 0.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 5.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 5.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 5.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 5.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 10.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 10.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 10.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 10.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="0.0 15.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="5.0 15.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="10.0 15.0 15.0" material="plastic" size="50 50 50"/>
        <voxbox pos="15.0 15.0 15.0" material="plastic" size="50 50 50"/>
      </body>
    </group>
    </prefab>
  2. Spawn it on a map.
  3. Cut a corner of the object with Onmicutter.
  4. Observe some of the cubes ending up detached from the main body they should stick to (as in the screenshot above).

Expected behavior

After a large body made of several shapes is being cut, each half of the cut remains as one solid piece, even if composed of multiple shapes.

Environment

Additional context

No response

nooitaf commented 3 months ago

What if you put a voxboxes inside a compound?

Or maybe just something like this..

<prefab>
  <group>
    <compound>
      <voxbox material="plastic" size="200 200 200"/>
    </compound>
  </group>
</prefab>
FlorentP42 commented 3 months ago

What if you put a voxboxes inside a compound?

Will that not fuse all boxes into a single shape? If so this is not the objective (see below).

Or maybe just something like this..

<prefab>
  <group>
    <compound>
      <voxbox material="plastic" size="200 200 200"/>
    </compound>
  </group>
</prefab>

This is really laggy when you try to cut through it, which is why I was splitting it into smaller boxes in the first place ;)

YuLun-bili commented 3 months ago

What if you put a voxboxes inside a compound?

Will that not fuse all boxes into a single shape? If so this is not the objective (see below).

compound have an option to configure chunk size iirc

nooitaf commented 3 months ago

This is really laggy when you try to cut through it, which is why I was splitting it into smaller boxes in the first place ;)

I'm sorry.. i forgot to add the tilesize like @YuLun-bili mentioned

This should literally be the same as your original thing..

<prefab>
  <group>
    <compound tilesize="50">
      <voxbox material="plastic" size="200 200 200"/>
    </compound>
  </group>
</prefab>
FlorentP42 commented 3 months ago

This is really laggy when you try to cut through it, which is why I was splitting it into smaller boxes in the first place ;)

I'm sorry.. i forgot to add the tilesize like @YuLun-bili mentioned

This should literally be the same as your original thing..

<prefab>
  <group>
    <compound tilesize="50">
      <voxbox material="plastic" size="200 200 200"/>
    </compound>
  </group>
</prefab>

Okay this seems to actually work the way I was expecting, thank you :)

EDIT: So this is a solution to my initial objective, but is the behavior described above the expected one or is it still a bug regardless?

EDIT2: Actually maybe I was just lucky the first time? I just experienced the same issue had with the cube made of 50x50x50 blocks with the compound version :/ Maybe one difference though is that the compound body was made static (when in my original test the whole body was dynamic).