Tag Info

Hot answers tagged

25

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 ...


22

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 ...


21

Why does Minecraft use polygons to draw the world terrain instead of voxels? Graphics hardware works with and renders triangles, so you have to use triangles if you want hardware acceleration. Most voxel renderers employ something like Marching Cubes to extract a polygonal mesh from a voxel representation and present that; direct volume rendering is ...


21

You have to remember that Minecraft only uses a very small set of possible recipes, so there is no need for anything all that smart. That said what I would do is find the smallest grid that fits (i.e. ignore empty rows and columns to find out if it's a 2x2 or 3x3, or 2x3 (door)). Then loop through the list of recipes with that size, simply checking whether ...


18

For the base land, make two 2D continuous noise fields (Perlin, Simplex, Wavelet, a combination thereof - whatever works for you), one with mostly low frequency. low amplitude parts for the upper limit of the land, the other with both high frequency, high amplitude parts and low frequency, high amplitude for the lower limit of the land. Where the lower limit ...


18

Okay, so here is my understanding of this - coming from developing games and a constant attempt to obtain more knowledge on licensing, copyright, open-source projects, etc. You are allowed to make a Minecraft clone and open-source it with no repercussions as long as you don't use the title Minecraft, don't use any of Minecraft's source code, and don't use ...


17

As others have said, yes the models as well as the animations are hard-coded. If you would like to see how this was done, go to the Minecraft Coder Pack wiki. The package was created to help mod creators to decompile, change and recompile the Minecraft classes. Instructions are included in the readme files which come with the package. The package ...


15

Download MCP, aka the Minecraft Coder Pack. This is how all the mods were released, and I've used it a couple of times, albeit for simple mods.


15

I've recently implemented an algorithm for a procedural city layout. It's still very much a work in progress, but seems promising to me. Take a look: The algorithm used to create this layout is loosely based on L-Systems. I have a base Element class, that has a rectangle marking its place on map and a method Grow, which creates other Elements inside the ...


14

Well I'm not going to write a whole tutorial (because I have limited time right now) but I will link you to some resources and give some tips. Firstly if you are going to mod Minecraft in any way, you want to go to the modding wiki. I had a look around the wiki, and found a basic mob creation tutorial. There is a massive mod creation tutorial here. You ...


14

How do you generate random X from a seed? a seed value is the initial state of a random number generator. In most programming languages, you can set this seed. For example, C uses srand(). If you don't specify a specific seed to start with, usually a timestamp value is used as the seed. That way, each time you run, the random numbers are different. // C ...


14

Would something like this be enough? If so, check this article. Quoting the most relevant parts: In order to get more interesting noise multiple octaves of simplex noise can be added together. [...] Since I want to get a roughly spherical floating rock of sorts, I need to multiply the noise with its distance from the center. [...] I also want the ...


14

Seeing if a certain grid configuration matches a certain recipe is simple if you encode the 3x3 grid as a string and use a regular expression match. Speeding up the look up is a different matter, which I'll talk about in the end. Read on for more information. Step 1) Encode grid as String Simply give a char id to each type of cell and concatenate ...


13

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 ...


13

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 ...


12

Well, Ogre already implements frustum culling (which basically does not draw anything that couldn't be seen from the camera) but I think your problem is a different one. You should not really be displaying 10000 blocks, what is commonly done (or at least, in the few Ogre3d based minecraft like clones I've seen (of which I am making one too), and in the ...


12

Another solution is to use a somewhat complicated tree. The branch nodes in your tree would be created by iterating over the recipe (once again using for (y) { for (x) }); this is your stock-standard by-the-book tree structure. Your final node would contain an additional structure (Dictionary/HashMap) that maps dimensions to recipes. Essentially what you ...


11

A JAR is simply a ZIP file, containing the various class files and other metadata used - it's a completely standardized format. ZIP files can be extracted, and the class files can be edited as necessary for the modification. The modified files are then added back into the archive, which makes the server use the modified files instead of the original ones. ...


11

Minecraft saves the world data and the player data. Saving the world data is done in multiplayer and singleplayer with the same method. It saves everything in a single .mcr file. Previous versions of minecraft saved the data in a file structure with many files, which was slower, I think. I don´t know this exactly, but I guess that a database for world saving ...


11

You shouldn't be worried if a game 'looks' like another. Take Terraria; early alpha screenshots, people were 'ZOMG IT IS A MINECRAFT CLONE'. It gets released - obviously not like Minecraft at all. Then take something like FortressCraft - that is obviously a Minecraft clone. It has the same features, pretty much. The graphics have changed, maybe. As long as ...


11

Disclaimer: I'm not a lawyer. I'm answering this on best knowledge, might be wrong, though. Yes, it's your work, you're allowed to do that. You can do with the stuff you write in your spare time whatever you want. What you're not allowed is: Use original source-code (decompiled) from Minecraft and put that under another license Use original artwork ...


11

This is not legal advice because I am not a lawyer, you should consider talking to a real lawyer if you want a proper answer to any law-related topic. You can't use the assets that ship with Minecraft. You can, however, create your own box-man avatar, and that would probably be a much better idea for a variety of reasons even disregarding the legal or ...


10

2D perlin noise is good for height maps, but in this case it seems that he is not using a height map. Instead he has a 3D grid, where any cell can be empty. This allows caves and such formations, where the ground height is not a single value for given 2D location.


10

You mention doing frustum culling on individual blocks — try throwing that out. Most rendering chunks should be either entirely visible or entirely invisible. Minecraft only rebuilds a display list/vertex buffer (I don't know which it uses) when a block is modified in a given chunk, and so do I. If you're modifying the display list whenever the view ...


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

There are a couple of aspects to this problem. Firstly, how are you drawing your 10000 blocks? Are you actually drawing them as 10000 seperate object? If so this is almost certainly your bottle neck, not the lack of occlusion culling. You should group these blocks into a smaller number of meshes (perhaps a few thousand per mesh) in order to reduce draw ...


9

Indeed, that is all you need for radiosity. There are two different (but equal) formulations. The first is to "radiate" or shoot light from each patch (in your case probably a face), and the other is to "gather" or receive light into each patch. If you iteratively do this enough times, you get radiosity. The first step is to figure out where light ...


9

To be honest, I'd take the simple solution. Make a matrix that defines the structure. Whenever a block is changed, attempt to apply that matrix to all locations that might have created the new structure. That's going to be width*depth*height locations, since the player could have finished any point on the structure, but it shouldn't be too bad because most ...


9

Simplest option is to grab the lighting from the block your standing on (or if possible the lighting on the block in the air that corresponds to the block the pickaxe is in) and use that for lighting the pickaxe/player. Or in other words, calculate the lighting for the pickaxe as if it was a block in that position. To get more realistic shadows you would ...



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