by mynameislegion on 10/9/16, 8:26 AM with 54 comments
by dcposch on 10/9/16, 10:13 AM
--
I just tried reading the code to learn how MineTest does voxel meshing, and it didn't go so well.
(Voxel meshing is about turning blocks into triangles efficiently, and it's surprisingly tricky. Mikola Lysenko wrote a great exposition of the problem and several solutions way back in 2012: https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/ )
I was curious which approach MineTest chose, and I still don't know. I think I found the files where the meshing happens, mapblock_mesh.h/cpp. The code quality is... less than perfect.
There are 200+ line C++ functions. There's commented out code and preprocessor "#if 0" ignored code.
There's a struct that looks important, but it's called "MeshMakeData", and I don't know what it represents. The comment above just says "Mesh making stuff":
https://github.com/minetest/minetest/blob/0a16e53b40d347db7d...
The file that seems to run everything, game.cpp, is almost 5000 lines long.
--
For an example of really clean game code, check out Quake or Doom 3. Both have:
* short and sweet main() methods
* comments that guide the reader and explain what does what
* clean decomposition
* short, readable functions, and...
* reasonably small files
So far, MineTest, at least in part, took the "big hairy ball of C++" approach.
Good luck with future development!
by TamHagmas on 10/9/16, 6:38 PM
https://forum.minetest.net/viewtopic.php?f=14&t=15643
https://www.youtube.com/watch?v=ztAg643gJBA
https://www.youtube.com/watch?v=joFWr3JzBOI
That's just the thing I love about these smaller voxel games - they may not have a huge userbase, but there is innovation happening.
by giancarlostoro on 10/9/16, 9:02 AM
by qwertyuiop924 on 10/9/16, 9:55 AM
by qznc on 10/9/16, 9:29 AM
by smnscu on 10/9/16, 5:28 PM
by gravypod on 10/9/16, 2:08 PM
You can basically just define blocks and HUD items and that's it.
Good work on writing the engine, just needs a little more work on the API side.
by ghostDancer on 10/9/16, 11:26 AM