Creating a minecraft-like game for mobile with decent performance?

I think there comes a time in every Minecraft player-turned-developer’s life where they consider creating a Minecraft clone. It’s not really that I want to make a full game, but I think creating the engine would be a fun challange. I would very much like it to run on mobile, but I worry about the performance. I’ve considered using Unity, but I feel like I would get much better performance if I wrote the game from scratch. I’m not sure though, and I have no idea what I should use, which still works on mobile. I would like the performance gained to be worth it, compared to the extra time spent coding, so if I only gain a few FPS worth of performance by writing my own 3D engine from scratch, maybe that off the table. Though it might be an interesting challange.

What are the pros and cons of the different approaches to creating something like this? Can you recommend me anything specific?

Thanks!

There’s a whole 10+ page thread here on minecraft clones.

Edit: It’s 50+ pages. I think it’s been going longer then I’ve been on the forums.

3 Likes

First of all, you need to limit world size, so more of MC classic than regular one. Next thing to make it run well on regular Joe’s smartphone (i.e. not iShit or newest Samsung Galaxy) is to forget about any advanced connections, like redstone (simple cell machines, like spreading fire are probably ok tho).

As one who is also making a voxel engine (I’m not going to call it a Minecraft clone because it’s fundamentally in a different direction), I’ll say that Unity is perfectly capable of making a well performing voxel engine for mobile. You just have to code it well.

I personally don’t use “infinite” terrain because my game design doesn’t require it, but you should be able to have it on mobile without issues as well - the performance difference is fairly minor.

Also, that topic about voxel engines is really useful and I encourage reading it. You learn a lot :slight_smile:

I’ll add, because I forgot to mention it and it’s important, your biggest concern with mobile will likely be memory. Most iOS devices only have 1 GB of it (thankfully they’re going to 2 GB with the 6S devices). Voxel terrain takes up a lot of memory and it’s not too hard to reach that 1 GB. So:

  1. Only keep chunks loaded around close to the player. If it is out of range, save it to disk and destroy it.

  2. Don’t use mesh colliders for the chunks if you can help it.

  3. Use bytes for blocks if you only require less than 256 types, otherwise use ushorts.

  4. Be careful with lighting. You can do separate byte arrays for sunlight and block light, but it’s more efficient to use a single array for both and bit shift to access the first four or last four bytes (each half gets a light type). This doesn’t work if you want colored light though.

1 Like