I am making a Minecraft clone, and despite my low experience in jME’m getting excellent progress in recent days. The Chunk class contains a three-dimensional array of blocks that is initialized by an array that Noise then transferred to chunkNode and finally converted into a chunk Spatial with
chunk = GeometryBatchFactory.optimize(chunkNode);
so far so good. My question is this: I noticed that the chunk returned by the Spatial GeometryBatchFactory.optimize() is not optimized the way I wanted to apply a RigidBodyControl in Spatial chunk of each block gets physical, and I wanted only the blocks within the chunk were disregarded, as if the chunk was only one block, just a mesh, Help me!
I think I know what you mean by that. As @normen said cube worlds aren’t made from cubes, but as I see you have noticed, the whole chunk can be one mesh. Using a ton of box meshes would just lag too much.
When I wore Cubes framework I realized he “removed” the texture within the blocks, winning so much fps. But as I said before, Cubes Framework is badly done and is limited. But I need this optimization of the blocks, if you can put a code snippet here how to do this thank you very much!
Cubes is certainly not more “sloppy” than putting a bunch of box meshes into the scene and batching them :chimpanzee_rolleyes: You don’t want to “remove” textures, you want to remove the faces. Or best - not even have them in the first place - like the cubes framework. Stacking boxes is about the most naive way to do a minecraft clone.
If you use a batch of Box meshes then on average you are rendering about 5x as many triangles as you need to. (actually, if you aren’t removing the full embedded boxes then it’s much much worse than that even.)
Block worlds are made of visible faces. Not boxes.
Being limited does not mean badly done. Its funny how everyone who says Cubes does not fit his needs, is relating to not being able to create infinite worlds - As stated many times before, its not because the code structure doesn’t support it. It just wasn’t implemented yet. I know someone who took the Cubes source code and added infinite scaling and world generation to it some time ago. He even added his own greedy merger and shaders for moving water textures and stuff… And the plugin did exactly what it should: Being a starting point where people can learn about block worlds.
But just calling another persons code badly done because it hasn’t an “Instant Minecraft” button, while personally trying to build a blockworld out of boxes is a bit… “sloppy”.
Therefore, you complained about this framework without looking at its source code… pathetic.
If you’re in panic each time you have to implement something so simple (the removal of useless faces), I doubt you will succeed.
Why did you conclude it was the right way? Using boxes forces you to detect the geometrically identical faces but whose normals have opposite directions. In my humble opinion, it’s acceptable only if you don’t do it at runtime in a game and for a static world, I do it in JFPSM (an editor, not a game) for the most simplistic 3D levels created from 2D images but some other optimizations have to be used in order to avoid having tons of small bounding boxes. You can merge them in some cases, it consists in solving the problem of the maximal or largest rectangle but in 3D and you’ll need all rectangular parallelepipeds. I already solved this problem in 2D.
I used boxes to make my Minecraft because I’m learning jME is now thought that this was the way. @destroflyer Do not get me wrong, I said that your code is sloppy because while studying him, I saw several methods not used, the blocks texture coordinates are confusing, you use many classes to do a simple thing, and the ground generated by your framework has unshaded materials, which It is bad for those who do not have a computer that support dynamic shadows.
Unshaded has nothing to do with shadows… As for library design, somebody who wants to loop through a node to get the info about an array he previously used probably shouldn’t throw stones in his glass house…
Do not get me wrong, I said that your code is sloppy because while studying him, I saw […]
No - You said it before seeing the source, as stated by your own posts in this thread. :chimpanzee_rolleyes:
[…] and the ground generated by your framework has unshaded materials, which It is bad for those who do not have a computer that support dynamic shadows.
The material is customizable - You can set a Lighting material in Cubes. And normen already answered the second part of the sentence.
But I’m not trying to pick a fight here - Yes, Cubes is not perfect and it obviously can be improved and has already been improved by a lot of persons. If it doesn’t fit your needs, then don’t use it - But don’t call something bad without knowing what is happening inside of it. There are various topics on voxel worlds in this forum, they are easy to find and understand. I wish you all the best for your game - But remember that you are the one asking for help. So trying to block every criticism and making up things to appear in a good light won’t get you very far I fear.
Anyways, that’s it for me in this thread - All the best with your game.