[V1]Performance question (lots of static boxes versus mesh)
Posted: Sun Sep 15, 2019 9:36 am
Hi,
I've been continuing my 3d game sticking to V1 (I think I'm too late on development to move to V2). The game is mostly done with basic shapes (cubes mostly), however there are LOTS of them. The game is quite simple physically talking (several slow moving character controllers across a big scenario, I use bepu mostly as a collision detector)
Lately in order to speed up map creation, I decided to add a component I call "Patch2D". It's basically a 2d tilemap which has 3D presence (each tile of the 2D tilemap is a box or compound of boxes). This of course generates lots of (static) boxes. In example, in the attached test map image, ~4000 boxes are generated.
This leaves v1 needing 5ms/frame while playing the game. My next step was optimizing the patch2D to generate "big boxes" instead of one box per tile. However I decided to test a StaticMesh first instead. There's a huge speedup, around 30x faster.
So my question is: is there anything I should be aware of if I convert the whole scenarios to a big static mesh? Converting the patch2D was easy but converting all the other objects will take some time, and I'd hate to get bitten in the back once the work is done.
Also, are the numbers in V2 proportional to these in v1? I mean, meshes being faster than ~4000 boxes.
Thanks!
I've been continuing my 3d game sticking to V1 (I think I'm too late on development to move to V2). The game is mostly done with basic shapes (cubes mostly), however there are LOTS of them. The game is quite simple physically talking (several slow moving character controllers across a big scenario, I use bepu mostly as a collision detector)
Lately in order to speed up map creation, I decided to add a component I call "Patch2D". It's basically a 2d tilemap which has 3D presence (each tile of the 2D tilemap is a box or compound of boxes). This of course generates lots of (static) boxes. In example, in the attached test map image, ~4000 boxes are generated.
This leaves v1 needing 5ms/frame while playing the game. My next step was optimizing the patch2D to generate "big boxes" instead of one box per tile. However I decided to test a StaticMesh first instead. There's a huge speedup, around 30x faster.
So my question is: is there anything I should be aware of if I convert the whole scenarios to a big static mesh? Converting the patch2D was easy but converting all the other objects will take some time, and I'd hate to get bitten in the back once the work is done.
Also, are the numbers in V2 proportional to these in v1? I mean, meshes being faster than ~4000 boxes.
Thanks!