About Store Forum Documentation Contact



Post Reply 
Block World (like Minecraft)
Author Message
AndrewBGS Offline
Member

Post: #1
Block World (like Minecraft)
It's just a thought, but if I wanted to make a minecraft kind of game,

is there a way to turn a world edited with Esenthel's world editor into a world made of blocks like the one in Minecraft? (just the terrain surface for now, I'll worry about the underground later). But how could I do this?

I don't know how I would access the terrain and water surfaces and their corresponding textures on each square meter of the map. Could I do this?
04-05-2014 02:54 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: Block World (like Minecraft)
Off the top of my head, I would say either:
1) use the editor interface to adjust the terrain to blockiness then use the Inesis system for modifying the terrain
2) use blocks(ala Rendering/Blocks tutorial) to create the ground programmatically during init...or through the editor interface, if this is possible.
04-05-2014 03:17 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #3
RE: Block World (like Minecraft)
I have no working knowledge of this but I suspect if you want a Minecraft type world where any block comprising the world can be changed you are pretty much going to need a voxel engine as conventional 3d graphics engines are never going to cope with this.

I guess you could model the terrain generation on an existing Esenthel modelled terrain but I suspect these are normally procedurally generated using terrain building algorithms and appropriate textures and random surface feature applied.
04-05-2014 03:34 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #4
RE: Block World (like Minecraft)
I'm thinking about something like Rubeus said;
In the init phase, I would like to convert an esenthel-edited world into a world made of blocks. I'm not sure how I would go about this,
I was thinking about loading the original world, then creating blocks on the surface from the same material as the terrain, and delete the terrain when I'm done, leaving just the blocks.

I have 2 issues with this:
1) I don't know if it's the best idea
2) I don't know how to do it; don't know how to remove the original terrain, nor how to extract materials from the terrain at a certain coordinate, nor how to determine the coordinates of the terrain.

If the idea is feasible, I'd like to know how to take care of the things at point 2.
04-05-2014 04:49 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #5
RE: Block World (like Minecraft)
I would imagine you could use:
Flt hmHeight (C Vec2 &xz, Bool smooth=true)C; // get heightmap height at 'xz' world position, 0 on fail, this method is fast because it uses lookup table ('Game.Area.Data.height' Image), 'smooth'=if calculate smooth value using bilinear interpolation

C MaterialPtr& hmMaterial(C Vec2 &xz )C; // get heightmap material at 'xz' world position, NULL on fail, this method is fast because it uses lookup table ('Game.Area.Data.material_map' Image)

these funtions to get the height and material at x and z, and create blocks at x, height, and z. You could use that to populate the top layer of blocks. Upon the removal of a block, you could create in realtime the blocks underneath. Voxeling would be easier, but with some fancy code, I don't see any reason why something like this wouldn't work.
Ideally, I would say create the world procedurally. That way, you wouldn't be limited by the areas you have created, or by the load times of converting the terrain to blocks, or by the holes that would inevitably plague the games existence caused by converting an analog location to a grid.
04-05-2014 07:00 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #6
RE: Block World (like Minecraft)
Thanks, this is very helpful!

(my sister is a big minecraft fan, and I was thinking I could "adapt" my game to the minecraft style). So one last thing you didn't answer me, after I would build my top layer from the real world like this, how would I remove the actual real world terrain to leave only the blocks behind?
04-05-2014 08:00 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #7
RE: Block World (like Minecraft)
I've never deleted terrain, so I can't answer that part. Esenthel or someone with more experience with terrain will have to answer that.
04-05-2014 09:15 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #8
RE: Block World (like Minecraft)
I'd try creating a simple routine that just generates a sizable flat plane of cubes first and see how the engine handles the numbers.

Bare in mind a single square kilometre would consist of a min of 1 million cubes if you made your cubes 1x1x1 meter in size (which for this type of modelling is a pretty large size).

I suspect without special handling just these numbers of objects alone are likely to cripple the engine performance! You might get away with high levels of distance culling and keep your rendering radius small if that's acceptable

Storing and accessing all of these will be the next issue to as it will need to be very efficient in terms of your ability to edit blocks.

By all means try it but I doubt the core engine features were designed to handle this type of application.
04-06-2014 10:09 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #9
RE: Block World (like Minecraft)
I did, my remaining question was how to dynamically remove terrain. If I can manage that I can go experiment with my ideas.
04-07-2014 07:58 AM
Find all posts by this user Quote this message in a reply
para Offline
Member

Post: #10
RE: Block World (like Minecraft)
What kind of terrain do you have? ... I'd just take the height map and create the blocks from that on a new world if you don't use any custom meshes as terrain.

Don't know if water meshes can be easily exported, it's not that hard to recreate them manually if they're simple and low in numbers.. but If you want real water blocks, you could try to export just the center point of the water body, then make a simple fluid block that every few ticks tries to move to an empty neighboring position except up, and start emitting them from that exported water body location to slowly fill up the area with 'fluid' blocks..
04-08-2014 12:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #11
RE: Block World (like Minecraft)
That is a great idea Para, thanks! I think I'll give it a shot.
04-08-2014 07:16 AM
Find all posts by this user Quote this message in a reply
Post Reply