Minecraft like block building system?

Hey guys, I saw this with UDK but is it possible with UE4 too (im sure its possible with UE4, but how [and hopefully with blueprints])?
Simple thaught: I click with my right mouse button and it will build / spawn a cube in front of me. So I can even break this down again by pressing the left mouse button while looking at the cube.
So the spawn system is not that hard but my points where I can’t move further on is 1. the grid (no overlapping cubes!) and 2. break down (maybe line trace)?
Please help!

A line trace would help. Whatever face it collides with, it should look for an open space adjacent to that face (so you’d use the face’s normal). Keeping everything aligned to a grid is simple to do with modulus.

This really isn’t a simple task though. I would start by making a block blueprint that can only be placed on a grid position. The character can place them anywhere they’re looking, a few feet in front of them. Do that first to play around with the concept, then the next step is to work on preventing the player from placing blocks within blocks (so you have to just check if the position you’re going to place the block in is going to be colliding with another block, actually really easy to do in blueprint). Then the next step is to make it so the player actually places blocks from a line trace that checks for collision with other blocks.

question&highlight=minecraft

doable in blueprint but with very bad performance i mean really bad even with instanced meshes

First stop is to read through this entire tutorial, even if you don’t follow along. (Though perhaps you should as it’s quite valuable)

Once you understand how and why things are done that way, there’s a voxel system already available for Unreal Engine 4, but you’ll need to at least compile the engine from source in order to use it, if not use C++ to extend it.

Wow thats already huge! One question are you german because there are german comments and I am german :slight_smile: But thanks, I think it could be more complex with saving and loading game!

Thanks, I will read through it!

yes i am. But the main fact this isnt working well without c++ is the fact that the instanced static mesh component (wich you have to use for a shitload of mesh blocks) begins to lag if you add/remove a instance if there are already 1k+. This engine isnt made for doing such style of games imo.

I’ve proved that that’s not the case :cool:

That’s awesome, John!

We didnt had the HirachicalInstancedStatic Mesh stuff back then :stuck_out_tongue:

I really love Unreal but doesn’t really seem Indie friendly to me. Not enough resources/tutorials. I don’t wanna go back to Unity :’( I like the blueprint system, but can’t seem to find any good tutorials for random voxel generation, and John doesn’t plan on sharing/showing his.