Minecraft style terrain performance is suffering...
Posted: Sun Feb 26, 2012 7:54 am
So I'm working on a minecraft style game using BEPU physics. All was well when I was the only thing roaming aroud my terrain, but I've started adding enemies and its going downhill quickly. Before I went off and randomly tried stuff to improve performance I figured I'd ask here.
Roughly what I'm doing:
Player/enemy is a capsule
Each player/enemy has an array of Boxes (Total 36 boxes, 3 wide, 3 deep, 4 high) that it uses to represent the terrain in the physics engine (Rather than load all of the terrain into the engine and then regen when modified)
Each frame we move boxes as needed to surround the capsule with the terrain. If a box is not needed (No block at its location) I move it out of the way (As an easy way to avoid collisions).
Questions:
Would using collision groups to link the capsule to only its terrain blocks for collision improve performance? Basically I don't want a terrain block to ever collide with another terrain block or another player/enemy.
Would loading the terrain into the engine be better than doing this conveyor belt style system?
Are there other things I could do in this type of enviroment to improve perf?
Any help would be appreciated.
Roughly what I'm doing:
Player/enemy is a capsule
Each player/enemy has an array of Boxes (Total 36 boxes, 3 wide, 3 deep, 4 high) that it uses to represent the terrain in the physics engine (Rather than load all of the terrain into the engine and then regen when modified)
Each frame we move boxes as needed to surround the capsule with the terrain. If a box is not needed (No block at its location) I move it out of the way (As an easy way to avoid collisions).
Questions:
Would using collision groups to link the capsule to only its terrain blocks for collision improve performance? Basically I don't want a terrain block to ever collide with another terrain block or another player/enemy.
Would loading the terrain into the engine be better than doing this conveyor belt style system?
Are there other things I could do in this type of enviroment to improve perf?
Any help would be appreciated.