"it seems to me that creating a 'world' from cubes is madness as for each cube you have 32 triangles. Wouldn't it be far quicker to use a surface/mesh comprising of just 2 triangles for a wall."
I don't know what CSHOP does with the cubes you create in it, but if it's not culling the hidden surfaces then NO THANKS. :-)
Btw, cubes only have 12 tris, not 32. 6 sides x 2.
Yes, ideally one would create a level which only has those tris that would actually be visible to the player. And all professional games that I know of construct levels in this manner.
In Angry Tanks, my own game, I have a level construction tool which allows you to place down 3d "tiles". Each tile is a 3D model, and all similar tiles are added to the same surface. Then you can push a button in the level editor to optimize the level, and it goes through and finds all triangles which have three vertices touching and deletes said triangles from the final mesh.
I posted this optimiztion function to the code archives a while back.
The trick though is that the function will only work if the triangles overlap. That means you have to specifically create the 3D models so that when they abut up against one another, the triangles match up. The cubes Blitz creates with the CreateCube comman on the other hand, (and probably the cylynders as well) do not have the triangles set up properly to do this. If you place two cubes end to end, and then look through from one side to the other, you'll see the diagonals cross instead of aligning. Ie, the front side diagonal goes top left to bottom right, and the back side goes top right to bottom left.
Solving this issue for just cubes with just two polygons per side would slow the algorithm down quite a bit, but solving for the general case... Well... I suppose if you created an algorithm which finds all coplanar tris and then makes a set of "faces" and then only compares one face to another then maybe you could handle less strictly constructed geometry, but you're still gonna have cases where you could say, place two cubes in a T contiguration over a third cube's front side and have a case where the third cube's front side is completely contained and should be deleted but is not detected. Such cases are hard to detect.
Optimization is already slow enough, taking about a second to complete for a small level which is just fast enough to use for doing it when the game is actually running when the level loads or possibly even when geometry changes if it's optimized more. But coming up with somethign that can handle any case would only be useful for precalculaton and saving the optimized level out, and that's not what I wanted for my game. :-) And it would be hard to accomplish. I don't recall ever seeing a tutorial on how to do that.
I basically just wanted a realtime optimization I could do when a level loads, which would remove the faces between cubes and floor tiles because those were creating tons of cracking artifacts. In my case, the number of polygons was so low that the speed of extra polygons in the level was not really an issue.
I don't know what CSHOP does with the cubes you create in it, but if it's not culling the hidden surfaces then NO THANKS. :-)
Btw, cubes only have 12 tris, not 32. 6 sides x 2.
Yes, ideally one would create a level which only has those tris that would actually be visible to the player. And all professional games that I know of construct levels in this manner.
In Angry Tanks, my own game, I have a level construction tool which allows you to place down 3d "tiles". Each tile is a 3D model, and all similar tiles are added to the same surface. Then you can push a button in the level editor to optimize the level, and it goes through and finds all triangles which have three vertices touching and deletes said triangles from the final mesh.
I posted this optimiztion function to the code archives a while back.
The trick though is that the function will only work if the triangles overlap. That means you have to specifically create the 3D models so that when they abut up against one another, the triangles match up. The cubes Blitz creates with the CreateCube comman on the other hand, (and probably the cylynders as well) do not have the triangles set up properly to do this. If you place two cubes end to end, and then look through from one side to the other, you'll see the diagonals cross instead of aligning. Ie, the front side diagonal goes top left to bottom right, and the back side goes top right to bottom left.
Solving this issue for just cubes with just two polygons per side would slow the algorithm down quite a bit, but solving for the general case... Well... I suppose if you created an algorithm which finds all coplanar tris and then makes a set of "faces" and then only compares one face to another then maybe you could handle less strictly constructed geometry, but you're still gonna have cases where you could say, place two cubes in a T contiguration over a third cube's front side and have a case where the third cube's front side is completely contained and should be deleted but is not detected. Such cases are hard to detect.
Optimization is already slow enough, taking about a second to complete for a small level which is just fast enough to use for doing it when the game is actually running when the level loads or possibly even when geometry changes if it's optimized more. But coming up with somethign that can handle any case would only be useful for precalculaton and saving the optimized level out, and that's not what I wanted for my game. :-) And it would be hard to accomplish. I don't recall ever seeing a tutorial on how to do that.
I basically just wanted a realtime optimization I could do when a level loads, which would remove the faces between cubes and floor tiles because those were creating tons of cracking artifacts. In my case, the number of polygons was so low that the speed of extra polygons in the level was not really an issue.