Tag Info

Hot answers tagged

65

With regards to Java vs C++, I've written a voxel engine in both (C++ version shown above). I've also been writing voxel engines since 2004 (when they were not vogue). :) I can say with little hesitation that C++ performance is far superior (but it is also more difficult to code). Its less about the computational speed, and more about memory ...


50

To generate a voxel terrain (a) A common method is to generate a heightmap using Perlin noise. A heightmap is basically a monochrome image representing different heights by the darkness or lightness of its pixels. You'll look at individual pixels in this heightmap to create "stacks" of voxels up to different heights (z-axis) in different (x,y) locations, ...


27

The best way to generate interesting voxel terrain is with a Perlin noise density map. Rather than using a 2D Perlin noise map defining the height of a 3D world, use a 3D Perlin noise map. Weight the map so that the values closer to the bottom will be more likely solid, and the values closer to the top will definitely be air. This gives your world height, ...


24

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


18

Sounds like your looking to learn about Trees! And I'm being serious, if your currently looping over an array of all your cubes; then you really should look into various spatial data structures. For this case, the best way to re-imagine your cube world is as a tree. Before we go into the reasons as to why, lets think about our problem. We're looking for a ...


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

It's probably easiest to understand by contrast with raytracing. To render a primitive with raytracing, you need a function that, given the primitive and input ray, tells you exactly where that ray hits the primitive. Then you can test the ray against all relevant primitives, and pick the closest intersection. CPUs are good at this. With raymarching, you ...


15

Does this unlimited detail technology actually exist? It has for decades, although it's normally called voxels. A few games used voxels back in the 90's, most notably Commanche and Outcast. The terrain in both games looked amazing at the time compared to other stuff out there. Looking at the videos the "advances" with his system, seems mainly in ...


15

From your diagram, it looks like the geometry you're constructing contains T-junctions - places where a vertex of one triangle is supposed to lie exactly on another triangle's edge (resulting in one edge meeting another in a "T" shape). Due to the limitations of finite-precision arithmetic, the vertex usually cannot be guaranteed to meet the edge perfectly ...


14

I recently did some experimentation with voxels for rendering terrain, with support for overhangs. I pretty much used these articles to build my prototype: This GPU gems 3 chapter on generating procedural terrain on the GPU. Even though my solution was CPU based (I work with shader model 3, so I couldn't reuse any of their shaders). There's a lot of good ...


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


12

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


12

A* would work just fine. Path finding is what you want, finding the shortest path is just as fast (or faster) than finding any path at all. In this situation A* is likely the most suitable given you have a start and end point. this means you have the added heuristic to speed up the search. With A* typically the first path you find is the shortest, so it's ...


12

Pixel. The term voxel is short for "volume pixel" or "volume picture element." Consequently a voxel without the "volume" bit is just a regular pixel. The term for gameplay structural unit in a 2D game that can be deformed, damaged or destroyed in the course of game play (as in Terraria and games of its ilk) would most commonly be called a "tile," although ...


11

I agree with Daniels answer, in that iterating through large amounts of boxes is the most likely cause, and that by using spacial partitioning you could speed the game up a lot - but the problem could also be elsewhere, and you could be wasting your time. In order to increase the speed of your game significantly you need to profile your code. Identify where ...


11

Thermite3D is a voxel-based game engine. It isn't an editor per se. It does, however, have a list of voxel editors on its wiki here: Thermite-Recommended Voxel Editors. Of those, Sproxel, Voxel, and QBlock are all free. Paint3d and Everygraph (Voxel3d) have trial versions, and one not on the list, Qubicle Constructor, has a crippled trial as well.


11

First. Lets write what do we know about each voxel : voxel = (x, y, z, color) // or some other information General storage General way is simply this: set of voxels = set of (x,y,z, color) Note, that triplet (x,y,z) identify each voxel uniquely, since voxel is point in space and there is no way two points occupy one place (I believe we are talking ...


11

When I had this problem while working on my Cubes, I found the paper "A Fast Voxel Traversal Algorithm for Ray Tracing" by John Amanatides and Andrew Woo, 1987 which describes an algorithm which can be applied to this task; it is accurate and needs only one loop iteration per voxel intersected. I have written an implementation of the relevant parts of the ...


10

Yes it is real, It really can render things at any detail density without slowing down. But it does have some notable restrictions. The environment is static. No dynamic lights, animations, or shaders. All objects are data heavy both in memory and in storage. The amount of unique objects is limited by the amount of memory and storage that the user has. ...


10

What about the third option, using instanced arrays? Basically you draw many many boxes (made of a simple 8-vertex cube) with a single draw call, sourcing the positions (and other data) as per-instance attributes from the voxel-data VBO (using glVertexAttribDivisor in OpenGL, I'm sure DX has that, too). This might be faster than the geometry shader approach ...


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

Castle Story looks like this due to technical constraints: Were there to be a heightmap per each voxel in the entire volume, rather than only a heightmap per each surface voxel, storage cost would be vastly greater, on the order of O(n^3) which can be prohibitive, as opposed to a more favourable O(n^2), where n is the side length of a cubic voxel space ...


9

Here is a 10 year old tutorial that goes pretty deep into Voxel rendering as a technology. It's still a good read.


9

If you end up stuck with overall body shapes that look like Minecraft's, your textures can help you stand apart. Without knowing your game's goals and limitations, you could use: -Higher or lower resolution textures. -Animated textures. -High-contrast textures (think Tron) There are lots of games done in pixel-art style that have interesting characters ...


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


9

If you're prepared to do some pre-processing and eat the storage cost, then partitioning voxels into connected groups at build time gives an obvious answer to 'is there a path at all'. There is a path between two voxels if they're in the same group. The problem with that obviously is that you have to store group information somewhere, and that depends on ...


8

I'm thinking of a minecraft type scene, where by voxel you mean a world of blocks that are actually rendered using polygons: If you use a geometry shader it will be difficult to avoid having exactly three faces (or whatever) per voxel. If you have lots of adjacent blocks that are of the same texture then you can use tiling of the textures to have much less ...


7

It has always looked like sparse voxel octrees, to me. If my guess is correct then it's real, but limited. Namely, you can't really do animation with sparse voxel octrees, so this trick is only useful for static geometry.


7

While I appreciate Kevin Reid's answer, it was at a level that was higher than what my question was asking. Understandably with out knowledge of Bullet Physics, it'd be hard to answer this question. I got this working and have an answer that is specific to Bullet Physics. Along with extending the RigidBody class like I mentioned in my question. I also ...


6

There are a lot of things that Minecraft could be doing more efficiently. For example, Minecraft loads entire vertical pillars of about 16x16 tiles and renders them. I feel that it is very inefficient to send and render that many tiles needlessly. But I don't feel like choice of language is an important one. Java can be quite fast but for something this ...



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