30

Minecraft's caves are generated by "perlin worms" method. The generator snakes through terrain and caves out a tunnel. Minecraft does not use 3d perlin noise for cave generation, because it tends to leave unconnected pockets in the terrain. Minecraft caves have not been generated through 3d Perlin noise since very early Alpha versions. Here are caves in ...


27

This would depend on the game and the indexing structure used for the chunks. Though, at such a high level, it's not too likely it has much to do with memory or a specific performance enhancement. More than likely it's an arbitrary decision for sizing chunks in a predictable way. It allows for some counting and indexing tricks using bit shifting that wouldn'...


23

Yes, it generates more chunks (or at least more of the village tree) than you think it does. This is what I call "area of interest" in my voxel code. There are two kinds of area of interest: Logical (which is what we're discussing here) Rendering (which is typically be smaller in radius than the logical area) Remember that the only way your renderer can ...


16

What you need to do is separate terrain from live blocks. For example you could store the live blocks in a dictionary that uses a point as key. And then unload the terrain. This way your live blocks stay in memory in a way you see fit, and you can still look them up based on position, but the terrain is stored on disk for later retrieval. This will increase ...


15

First, multiplying by powers of two is much cheaper than multiplying by an arbitrary number, since you can do it by bit shifting. Most of the time the compiler can do this for you, so whenever you write "* 16" in your code, the compiler actually does a shift by four, and you don't need to worry about it - you just need to give the compiler the opportunity by ...


15

Actually, Minecraft will run at whatever resolution you size your window to (348x866): So it's likely that whomever took the screenshot you grabbed, just happened to have their window sized that way. The default screen size when I start the game appears to be 856x482, which is pretty close to 16:9. It doesn't need to use a standard aspect ratio or ...


11

I saw a video from GDC where he said that he used Java because it's what he felt most productive in, at least at the time. It was only a passing comment though and note that this video is post-Minecraft, so his reasoning may not have been the same when he started Minecraft. Source: This video from about 14:45 in answer to the question "What Tools or ...


10

Yes, if you examine Minecraft under the hood you can see that it's just a separate file that will launch the JAR file afterwards. However, you're probably more interested in implementing an update solution for your game yourself. If that's the case, check out Sparkle.


9

The real answer is just this: On a binary computer, powers of two are nice round numbers. When a normal person needs to pick an arbitrary number for some purpose, they typically choose nice round numbers in the number system they're comfortable with, base 10. So they'll pick 10, 100, 1000, etc. Because they're simple and easy and don't require much ...


9

There are a couple different ways to store the data for a game with blocks like Minecraft. The way I believe Minecraft does it is breaks the world up in the 16x16x256 Chunks. The chunks around the player are loaded into memory when the player starts the game, then a background thread loads more as you walk around. Here is a video that shows it: http://www....


9

You could look in the game code to find the code for enchanting. Since that takes away experience, it should tell you how, although it may be in levels. Also, you could look in the code for the anvil. In those, you should find variables for experience. You could probably subtract from those variables for every 2 or so blocks that you mine/dig/chop, like the ...


8

This lag-vs-responsiveness issue is the situation with virtually all motion controllers, whether something like the Hydra, the Wii Remote, the Kinect, or the PlayStation Move. The problem is this: When an input stream is coming in, you're making a decision on a frame-by-frame basis about whether or not to trust the input data; whether the trends you're ...


8

I'm going to assume you're using the Forge API, given the parameters you listed. EntityLiving is an abstract type representing living entities like players and mobs. When it is passed into your block break event, it indicates the entity which broke the block. It's not guaranteed to be a player, so you need to try to cast it to the subtype that represents a ...


8

Technical stuff During Minecraft's chunk generation a chunk passes several stages before it is done and can be rendered. These stages, in order, are as follows: EMPTY: Just as indicated, the chunk barely exists and is empty. STRUCTURE_STARTS: Here world generation decides whether a chunk might be the origin of a structure, and if so, it also generates the ...


7

I would generate a cloud of points inside areas where the terrain is solid - you can experiment with different densities. Then I would use an algorithm like a minimum spanning tree to connect all of the points - this will ensure that every area is reachable. Then simply draw big hollow (composed of air) areas from node to node (i.e. a thick line of voxels)....


7

There are two ways. Using MCP obfuscation mappings, the first and proper way to do so is with: EntityLiving.attackEntityFrom(DamageSource, damageDealt); You need to specify where the damage came from in the first parameter though, so the simpler one is to simply use: EntityLiving.setEntityHealth(health); Use this with getHealth so you can do stuff like ...


7

No. Notch said at some point that he plans to release the sources once the game is no longer selling, but that was WAY before it got this big. And yes, it's still selling.


6

One reason not mentioned in other answers is that if needed, powers of two numbers can always be halved without rounding problems. This is probably not a reason in Minecraft clones, but is in some other cases such as in textures with mipmaps.


6

I think Minecraft is almost a genre, at this point. There are many success where people are taking the core concept adding something new. But you have to find the core mechanic that differentiates you from the original.


6

I know there's an already accepted answer and it's not quite on the spot - but I also came here via Google and I was looking to learn and thought others might, too. There are other open-source Minecraft clones (and InfiniMiner which is what Minecraft is based off, too). I'd suggest anyone who is looking to study up on it looks at these: TechCraft ...


6

The bulk of Minecraft's chunk rendering goes through a vertex array. The world is split into 16x16x16-block render-chunks (which currently happen to be the same as storage-chunks, but it wasn't always that way). Each render-chunk is converted to a vertex array, and rendered. It uses OpenGL display lists (one per render-chunk) as an older alternative to VBOs....


5

There are many reasons why a game may be limited to a specific framerate, and only one of them is relative performance of the API version. Let's look at two of the most simple examples. vsync can limit framerate to the refresh rate of your monitor. If you have a 100hz monitor and if vsync is enabled, you'll never run faster than 100fps. The game may have ...


5

Most perlin noise algorithms will allow you to retrieve the noise value at any given location, with something like noise(x,y,z). This makes it fairly trivial to generate noise on a chunk by chunk basis. All you need to do is pass the global position, instead of the chunk position. for(int i = 0; i < CHUNKMAX_X; i++) for(int j = 0; j < CHUNKMAX_Y; ...


5

You can't just open the jar in Eclipse. Even if you have some kind of decompiler-plugin, you will only see obfuscated code. You will need the Minecraft Coder Pack to decompile and deobfuscate the jar (as well as MCP can anyway) so you can work with the code. Additionally, if you want do develop Minecraft-Forge mods you should check out this page. Forge ...


5

First, we need to identify the square consists 4 symmetric sides, each of them of length 2*r. 1 1 1 1 2 4 x x x 2 4 x C x 2 4 x x x 2 4 3 3 3 3 As you can see, the sides are symmetric relative to center, that means we can can take one cell from each side in each iteration, one coordinate always fixed while the other controlled by offset. To make it easier ...


4

If I understand you correctly... Could you not just load the chunks in a spiral around the player? Each time you check for the next chunk to load you could start whole spiral process again (or come up with a better way to find 'missing' chunks) as this will loads the correct chunks whilst the player moves.


4

The objects in collections in Java are usually indexed starting with zero. Also, the method .size() returns the numbers of elements inside the collection. So, if the size is 1, you can only access the element 0. Not 0 and 1 like you're doing, because the element 1 do not exist. Try this: for(int i = 0; i < staffOnline.size(); i++) { // changed here ...


Only top voted, non community-wiki answers of a minimum length are eligible