
Minetest – A free, open-source voxel game engine and game - mynameislegion
http://www.minetest.net/
======
dcposch
This is pretty cool. Props for doing a massive amount of work and creating
something open and extensible.

\--

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/](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...](https://github.com/minetest/minetest/blob/0a16e53b40d347db7dcd04cb694d0f8f2ed1a5a7/src/mapblock_mesh.h#L40)

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!

~~~
morganvachon
I'm not a programmer so forgive my armchair ignorance, but as a player I've
found Minetest to run exceptionally smoothly even on 10+ year old hardware
with crappy integrated video. On the other hand, Minecraft on a modernish
Haswell based PC with a GTX 960 requires Optifine to run as smoothly as
Minetest does on that ancient machine.

"(B)ig hairy ball of C++" or not, somehow it's optimized to the point that it
feels more modern and advanced than Minecraft, if not as visually polished. My
question is, is this purely a C++ vs Java thing? I've played some Java games
that look and play awesome on older hardware so I have to wonder what the deal
is with Minecraft.

~~~
exception_e
The poster was commenting on the maintainability of the C++ code.
Unfortunately, poorly written/structured code can still be as performant as
well designed code.

As for your C++ vs Java question... put very simply, C++ will be faster than
languages like Java when it comes to graphics and any software that is close
to the hardware.

~~~
morganvachon
That's what I figured on both accounts. I guess I'm just bothered by the
obvious inefficiency of Minecraft versus practically any other Java game I've
played. Even other Java-based voxel games have far better performance.

~~~
exception_e
Interesting aside: I just installed/ran Minetest and then compared it to
Minecraft and Minecraft feels/looks a lot smoother on my basic HP laptop.

------
TamHagmas
A minetest developer just recently published a sphere-shaped planet version of
minetest:

[https://forum.minetest.net/viewtopic.php?f=14&t=15643](https://forum.minetest.net/viewtopic.php?f=14&t=15643)

[https://www.youtube.com/watch?v=ztAg643gJBA](https://www.youtube.com/watch?v=ztAg643gJBA)

[https://www.youtube.com/watch?v=joFWr3JzBOI](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.

------
giancarlostoro
It's worth noting that Minetest is available on Ubuntu (and possibly Debian?)
via apt (apt-get). Not sure how dated it may be, but it's still playable and
useful.

~~~
Sylos
Ubuntu 16.04 seems to ship with 0.4.13, Debian Jessie with 0.4.10.

Current version is 0.4.14, which is also what Ubuntu 16.10 will then ship
with.

~~~
_JamesA_
Debian has 0.4.14 available in jessie-backports[1].

[1]: [https://packages.debian.org/jessie-
backports/minetest](https://packages.debian.org/jessie-backports/minetest)

------
qwertyuiop924
As a longtime MC user, I have to say this is really cool. OTOH, it doesn't
have MC's amazing mod ecosystem, which is a huge part of why that game is so
great.

~~~
Sylos
It doesn't have as big of a modding ecosystem as Minecraft, simply because it
doesn't have even a fraction of the community, but apart from size, I don't
think I would agree on its modding ecosystem being less amazing.

Minetest has for one a stable modding API, meaning that mods generally don't
break left and right with each release. If you find a mod, chances are that
it's going to work, even if it hasn't been maintained for a while. The whole
game content itself is also built using this modding API, meaning that there's
nothing stopping you from making mod-content, which has just as high quality
as the built-in content. Or you can write your own game completely from
scratch. Or you can create mods which have then again other mods as
dependencies.

Minetest also has what's probably best described as "Modpack as a Service".
When you connect to a server, your client downloads the mods that the server
has installed and applies them. This means that you can play on a modded
server without making any changes to your client. You can just connect to
random servers to take a look at the different mods that exist, without any
hassle whatsoever.

This also works in singleplayer, i.e. you can play with different sets of mods
on different maps, again without hassle. You just use the built-in mod manager
to enable the mods that you want on a per-map basis.

~~~
ryukafalz
>When you connect to a server, your client downloads the mods that the server
has installed and applies them.

From a security perspective, this is concerning.

~~~
greenfire
The server doesn't send code to the client, all mods are executed by the
server. Server then send textures, models,etc to the client.

~~~
qwertyuiop924
...No. The code is actually sent to the client. It has to be, in order for
interfaces to work properly.

~~~
greenfire
It isn't code is ran by the server and the client only sends information to
the server about the current state of the client. This of course is sub-
optimal as it can introduce a lot of lag to a game with mods that add vehicles
or mobs

------
qznc
I made a few mods a while ago. Pleasurable experience even though I was new to
Lua.

------
smnscu
One of the best 'downloads' page I've seen

[http://www.minetest.net/downloads/](http://www.minetest.net/downloads/)

------
gravypod
Unfortunately this doesn't seem to expose nearly enough features to the
programmer of mods. No way to do direct rendering of your own, add AIs, or
many other much needed things.

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.

------
ghostDancer
There's also a fork Voxelands
[http://www.voxelands.com/about.html](http://www.voxelands.com/about.html)

