CSG problem alignment


#21

I believe that’s just one example. If you’d make more tests like these, you’d probably see that the version doesn’t affect it very much. Not sure though, maybe there is something with v2 that changes the shape or position slightly when unioning.
But I built a lot with v1, and I can tell from experience such misalignments happen mostly (if not only) because of number inaccuracies caused by Floating Point.


#22

To get rid of the unnecessary triangles that are not visible to the player.


#23

You do know making objects a union in Roblox causes them to add MORE triangles than before right?


#24

The less surfaces there are, the less triangles I think.


#25

image
image
image

Blender model


image

Roblox is weird


#26

It is better not to use unions if you don’t have to. A union is an asset (essentially, it is a mesh) that has to be loaded by the player’s client whenever they join your game, so this will presumably take up more memory (vertex data and collision data) and more processing time for physics and rendering, because the engine is more optimized for loose separate parts rather than for unions.

I also really doubt it will lead to a lower face count (check in 3d modelling software), and even if that were the case, it could still be less efficient because of the reasons described above.


#27

But higher part count causes lag. If I were to have these stairs made with separate bricks you’ll get serverlag probably. That’s in my experience anyways, certainly since it’s a large game.


#28

No, that is way too simple of a conclusion. A single complex mesh can be much more expensive to load/render/calculate physics for than a bunch of simple parts. Remember that Roblox heavily optimized/optimizes for simple parts.


#29

Yet this stairway was a simple example. I have many complex shapes for certain assets that move. Isn’t it then wise to have less complex unions than many more simple parts?


#30

I’m pretty sure it is. Parts are still individual objects. If you can lower the brickcount and yet keep triangle count (without many unions) somewhat the same by using unions, it may be good to do so, especially if they will be moving. But that’s just the way I see it.


#31

This still depends on many factors, like:

  • Are you using the union once or many times? If you’re only using it once or a few times, you could still be worse off because the client has to load an extra union asset. There’s a trade-off there.
  • If you need physics on these moving parts, computing the physics on a set of parts may be less expensive than computing it on a union part. It is hard to say whether one is more performant than the other without a concrete example to be honest.
  • If the union has a lot of extraneous faces due to the union operations performed to get there, rendering the union will be a lot more expensive than the individual parts.

If you’re really going for performance and you do use the union multiple times, you could consider using 3d modelling software such as Blender to simplify the mesh (reduce extraneous faces created by union operations) and then reupload it as a meshpart.


#32

Yes I’ve been wanting to use blender for a while now but it’s just extra time you have to spend.


#33

This deserves a solution.