Hi I am develpoing a Minecraft remake and have done a good amount of work on it, and was wondering if anyone knows how to optimize around 400-500 3D cubes in the players view.
*In JavaScript
Does anyone know any optimization for a 3d voxel game???
I am to broke to buy a template
I remember seeing on discord someone mention to hide objects that are not in view
But you mentioned in view
So idk
YET if same crap applies in 3D that applies in 2D
Are you sure amount of objects is issue here?
And not what you check for them?
For example in 2D when you check if player is in collision with platform
It checks if player is in collision with ALL platforms you placed in game so it will lag more platforms you add to your scene way faster than it should
What you should do is 1st check if player is in some distance with such platform and then check if he is in collision with it
I mean order of conditions is important here
If you have some raycast there or whatever idk how you check collision in 3D
Actually any crap you would check for each cube
I would apply to work only in some distance from player
Maybe Surface Culling? Minecraft uses it!
If ya dont know, surface culling is when you dont load the faces of a cube if they are blocked. Imagine there are two cubes, one in front of the other. The game engine is rendering the faces of the block that are blocked, even if you can’t see 'em! So if a face is being blocked, just don’t render it!
ah! how did I not think of either of those things : |
thanks for the ideas I will test them out soon!
I changed it so the test only applies to cubes 40 pixels away from the player and it runs much smoother!
how would I not render those faces?
I am not into 3D idk anything about it
But i would look for some action related to your boxes to remove image from faces
And now depending on what you would look in regard to each box you would either enable or disable face
This is very vague description but that is how minecraft work
IDK how to do it in gdevelop
MAYBE good idea would be to join gdevelop discord and go to channel named 3D and ask there
sadly I don’t have discord, but I may be able to figure it out.