minecraft block creation question

is their a tutorial on how to do a blueprint to let me do like minecraft does with placing blocks in the world by left mouse click?

So far all I’ve done is go through the Unreal Editor tutorial series (up to maybe #77 now). I would say open the project properties, go to Input and add a new action mapping for left click. Call it “Place block” or whatever.

Then, under your player’s event grid (assuming you have a player set up?), add the “Place block” event trigger. Have it create a static mesh relative to your player’s location.

I imagine the only challenge would be aligning it to a grid, but it could probably be done by getting the coordinate offset relative to the player, getting the world coordinates of that location and rounding it to the nearest ~200 unit interval (or whatever your block size is).

well i have planar snaping meshes in my project… it was a sh…load of brainwork i got things going… wish i had paid more attention in math class back then =)

i could give you some infos on how get you started

yeah that would be great. I just dont know where to start to do this

no problem i had struggles myself but when you an idea of how to get things going its kinda just mathematics xD

Okay spend the half day working on a solution. Its all Blueprint!

This thing is not even close to beeing a thing! I used several Layers of InstancedMeshComponents because the first test with StaticMeshComponents just dropped the framerate lower than a virgin pants seeing a naked Brad Pitt… :confused:

Well it should give ppl an idea of where or how to start when planing on doind such stuff with the UE4 engine… anyway enjoy

Oh forgot the controlls… Basic WASD/Space

Left Click = Place Block
Right Click = Switch Active Block
Shift-Left Click = Remove Block

7-Zip’ed

I worked on a minecraft “clone” in unity and you will not place a real block.
You would more likely calculate each side of a block. Than you would need
to define blocktypes by numbers. Each blocktype uses different graphics for
the block sides. You also need to point out what side is really visible for the
player.

In minecraft, only the visible sides are drawn. If you delete a block, it’s not
really deleted. It was changed to the air blocktype. So you want a block side
only be drawn if its next to an air block.

The minecraft world is just a NxNxN “array” with numbers in it. And you draw
the sides of the blocks only if an air block is near. Everything else is invisble.
Otherwise your framerate would go to 0 in an instant.

Look up videos of Notch first trys on setting up the minecraft world.

I don’t know how you can do this in UE4, but in Unity i calculated every point,
triangle and UVs manualy.

has made a minecraft like plugin not only for the actual brickgame stuff, like placing blocks removing blocks and ect, ect, BUT hes made also a terrain generation plugin too. Its default version is 4.3 i think for the game

You can find the entire project here <–located on github

Within this game it includes both plugins that you can copy to a new project or what ever.

You can find the licence on the page above too, its pretty much you can use it type of deal

yea i saw that one i just gave a pure bp variant and in my oppinion its not possible to do a blueprint only mc clone wich runs smooth on normal hardware

How do you handle generating the chunk mesh from within Blueprints? I haven’t seen any nodes that might let you build a mesh at runtime.

the isnt really a generation process… just 3 Loops wich plug into each other to add 50x50x2 blocks (its inside the construction event of the BP_Block)

as i said this is just a simple “how to i place blocks like in minecraft” example

Oh. If that’s how you’re doing things I don’t think your problems in performance have anything to do with Blueprints yet.

You should read up on how to actually create a game like this. First step is you cannot place a block for every block you want to have in the world. Instead you should chop the world into “chunks”, which are collections of blocks that are all rendered as one object.

Here’s a tutorial in C++ for creating a chunking system, though you’ll probably want to go back to the first step and find out if Blueprint nodes have a way to even generate the mesh for a single block. If so you should be able to pull off converting this tutorial to Blueprints just fine, it’ll be slow but it should work acceptably on modern hardware, especially at the early stages of testing.

He can still make the function that not exist BlueprintCallable.
Than he can use them in his Blueprint System.

iam not interested in creating such a game is was just an example for the autor of the post :smiley: … but i must admit this thing taught me some stuff about instanced meshes and performance so it was still no wasted time

If you’re going to spend the time to recompile the engine you might as well do it in C++ anyway.

Sorry, in text that came out more hostile than I intended. And apologies for confusing you with dabluezpreacher.

Glad it taught you something in any case!

, did you even contiunue with this?

I see the blueprint is in the mycharacter section, why doent building work in a new level?

also, everything bcomes very dark whe you build the level.

I really want to put building in #microbotsGame i am building supermegagameplaymovie - YouTube

I tried to merge your project but it was a disaster ^_^, i have only been building games for 2 weeks. I am quite proud becasue i made those levels, and models, and i made them come to me by pressing a key, yesterday i made a teleport gate, if i couls incoorporate building the game would be enhanced conciderably

Hi ,
Thank you so much for your project MinecraftStyle.7z. It is helping a lot to understand a basic things.
Is it possible in your project instead of using a layers in InsancedStaticMesh BP object, to use dynamically load files “.uasset” assets in game (not in editor)?