So most of you probably know I'm working on a Minecraft remake "Crafter" to get a bit of experience with 3D graphics.
I started work on it again today and I've been wondering for some time now, about the world and maps.
Here is a screenshot for illustration:
In Crafter each block is considered a single element of a 3D array. I've read on Minecraft wiki the maps are 128x128x64? But either way this should work fine.
EDIT:
Crafter uses 256x256x64 at the minute and Minecraft uses 128x128x64, 256x256x64 and 512x512x64 depending on the version you're playing.
I could simply have a height map or something to generate this world but that would be kinda crappy since the original Minecraft actually randomly generates the worlds.
So I'm curious about how others would try and attempt to replicate the method Minecraft uses.
Thanks.
Just wondering about Minecraft
Moderator: Coders of Rage
- Van-B
- Chaos Rift Regular
- Posts: 125
- Joined: Tue Aug 10, 2010 7:17 am
- Current Project: iPhone puzzle game
- Favorite Gaming Platforms: All - Except Amiga
- Programming Language of Choice: DBPro, ObjC++
- Location: Scotland
Re: Just wondering about Minecraft
I would dig tunnels, in fact I've tried this with a little test engine and it works quite well. Once you have a solid world, maybe based on a perlin noise heightmap, you could take a random location under ground, and dig. If you scan the blocks near a start location and work out the distance to the start location, you can dig out spheres, then move that location each time, so dig out, move, dig out, move... each time changing the movement vector. Then you could randomly stop digging, or stop when there are no blocks to remove - so when the tunnel hits a larger area it stops. With lots of these tunnels, you would have a decent representation of what Minecraft does. The same technique could be used to set ore areas. When a tunnel breaks the surface, you could expand the radius by 1 to ensure a good cave entrance. Would be a good start I think.
Health, ammo.... and bacon and eggs.
Re: Just wondering about Minecraft
That's a pretty cool idea manVan-B wrote:I would dig tunnels, in fact I've tried this with a little test engine and it works quite well. Once you have a solid world, maybe based on a perlin noise heightmap, you could take a random location under ground, and dig. If you scan the blocks near a start location and work out the distance to the start location, you can dig out spheres, then move that location each time, so dig out, move, dig out, move... each time changing the movement vector. Then you could randomly stop digging, or stop when there are no blocks to remove - so when the tunnel hits a larger area it stops. With lots of these tunnels, you would have a decent representation of what Minecraft does. The same technique could be used to set ore areas. When a tunnel breaks the surface, you could expand the radius by 1 to ensure a good cave entrance. Would be a good start I think.
I think I'm going to go with this method to be honest, it seems like my best bet to getting it as close to exact as possible. I was trying to split things up like
1- Get a random height, get a random radius, build hill with random data at random location
2- Get random crap again and generate a tree
etc
Needless to say it didn't work too well
Re: Just wondering about Minecraft
http://notch.tumblr.com/post/3746989361 ... ion-part-1
Some thing to start on.
Some thing to start on.
-
- Chaos Rift Newbie
- Posts: 42
- Joined: Thu May 12, 2011 2:45 pm
Re: Just wondering about Minecraft
Perline noise is the way to go. Has been for years. And if you can do it dynamically on the fly, as notch is doing, then your good to go. I am doing something similar to mine once I get to that point. However, I am not remaking Notches version of minecraft, mine has "some" similarities.. but its not minecraft. Meaning I am making a real terrain, not made out of blocks. And as for infinite goes, notch is using 32 Bit which limits to about 2Billion. If you run it with 32Bit x 32Bit integers and split it up, then technically it would seem infinite. Its arrays within arrays. Then you save each section . chunk to the hard drive as you explore and it will be there when you come back to it. In theory it would take you a lifetime to travel through the whole thing. The drawback, that notch never figured a way around was the memory limits of computers. But look at it this way, clear the memory when the chunk is not in use. Notch's JAVA doesn't do this efficiently, which is why I am not really fond of JAVA, which is another reason he is doing it the way he is doing it. World of Warcraft does something similar as does EVE Online. You would be surprised at how simple it is and yet how VAST those two MMOs are if you have never been in them.
I am hoping to implement this into my game as well.
If you want to see what i'm working on, keep and eye on my you-tube as well as there is a download link to a demonstration of me starting this project. ( Started it last night. )
http://www.youtube.com/watch?v=7KUzCCoa ... ideo_title
Keep in mind, I started this last night and have slept since then.. lol
The video doesn't do the program justice. I have already advanced further then my video.
If I can be of service, let me know.. Take care.
I am hoping to implement this into my game as well.
If you want to see what i'm working on, keep and eye on my you-tube as well as there is a download link to a demonstration of me starting this project. ( Started it last night. )
http://www.youtube.com/watch?v=7KUzCCoa ... ideo_title
Keep in mind, I started this last night and have slept since then.. lol
The video doesn't do the program justice. I have already advanced further then my video.
If I can be of service, let me know.. Take care.
Re: Just wondering about Minecraft
Thanks for the great links guys.
No better way to learn than biting off what you can't chew
I've tried really hard to replicate the way the maps are generated but it looks like perlin based noise map is definitely the way to go ( I believe Notch did this at first ) although I really didn't want to do it. Although Van-B's method did get a pretty decent looking map, I'm just very pedantic since I want it to look and play exactly like Minecraft.
No better way to learn than biting off what you can't chew
I've tried really hard to replicate the way the maps are generated but it looks like perlin based noise map is definitely the way to go ( I believe Notch did this at first ) although I really didn't want to do it. Although Van-B's method did get a pretty decent looking map, I'm just very pedantic since I want it to look and play exactly like Minecraft.
- MadPumpkin
- Chaos Rift Maniac
- Posts: 484
- Joined: Fri Feb 13, 2009 4:48 pm
- Current Project: Octopia
- Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
- Programming Language of Choice: C/++,Java,Py,LUA,XML
- Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk
Re: Just wondering about Minecraft
Just like everyone else said, perlin noise is definitely what you should use. Minecraft generates it's terrain in columns. If you're not already, you should do the same. It makes it easier (my opinion) to generate terrain with caves already placed using an algorithm:
Instead of first creating the land and then putting holes in it. But maybe that's just me. And since I feel like a dick by just saying "well I would do it this way", then I'll say HOW I would do it.
A hole would be randomly generated below a certain terrain height. Then the next column would decide whether this hole was going to get much bigger, and it would have possibly more "air" tiles. Then repeat with every hole, checking if each one has an adjacent air tile below a certain terrain height, and if not skipping the operation entirely, or making that one a hole. This is how I would go about it anyways, and so that caves can be in mountains and not just large underground chambers, also I would have the terrain height NOT check precisely whether it's beyond a certain depth, but relative to how many blocks are above it, this would make it so that large mountainous areas could still have caves.
Code: Select all
FROM A SIDE VIEW MIGHT SHOW UP LIKE THIS (2D)
##########
##### ##
### #
##### ##
and do each column from bottom to top/top to bottom.
A hole would be randomly generated below a certain terrain height. Then the next column would decide whether this hole was going to get much bigger, and it would have possibly more "air" tiles. Then repeat with every hole, checking if each one has an adjacent air tile below a certain terrain height, and if not skipping the operation entirely, or making that one a hole. This is how I would go about it anyways, and so that caves can be in mountains and not just large underground chambers, also I would have the terrain height NOT check precisely whether it's beyond a certain depth, but relative to how many blocks are above it, this would make it so that large mountainous areas could still have caves.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
For God so loved the world that he blessed the thugs with rock