Tag Info

Hot answers tagged

58

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


26

I'm actually one of the Don't Starve devs (Kevin on our forums). I don't usually handle the rendering stuff, but I can tell you that the game is in 3D. The ground is just a regular 2D tile map with special transition pieces to make corners look better. There's no special Deathspank-style rounding going on, although we have talked about doing that in the ...


25

I think I better understand what you are asking now. Noise is not random - it's random-looking but is completely based on a mathematical formula and is repeatable. All the information is encoded in the formula. This means that you can have a formula that potentially covers an infinite area, and just use the formula on the coordinates of the area you need. ...


24

Heightmaps With a heightmap, you store only the height component for each vertex (usually as 2D texture) and provide position and resolution only once for the whole quad. The landscape geometry is generated each frame using the geometry shader or hardware tessellation. Heightmaps are the fastest way to store landscape data for collision detection. Pros: ...


24

For a 'classic' 3D terrain editor, the steps could be those: Generate a mesh (e.g a grid of squares, every square made of two triangles), all vertices are shared between triangles (so that there is only one normal per intersection). This should be made a 3DMesh and rendered in your program. Make a tool to raise and lower (smaller and bigger) parts of the ...


21

This tutorial I wrote years ago might give you something like what you want: If you do the island modification in the last step, it tends towards a single landmass that doesn't reach the edge of the map.


21

Amit Patel, a user of this site, has created a wonderful resource of information about random world generation that will certainly be of use to you. Further there are some great questions/answers about procedural generation on this site. Road / river generation on 2d grid map Procedural world generation oriented on gameplay features How can I generate ...


19

I think part of it may just be that Blizzard has an amazing number of texture artists. But let's rephrase the question a bit: I have a limited budget and want to make a realtime strategy game without obviously tiling textures. How can I accomplish that? Good question! Here's a few big tools that I'd use: 1) A reasonably large set of interchangeable ...


17

Back when I experimented with this type of thing (late 1990s), I read some papers and books to learn about water flow, but I didn't keep a record of which ones I looked at. I ended up doing my own thing because I wanted to handle erosion. I wanted rivers to produce canyons and floodplains. I wanted dam reservoirs to fill up with sediment. I wanted rivers to ...


16

The midpoint displacement algorithm is exactly what you want. That link can generate something like this: Or like your image, depending on what parameters you use. There's C source available here.


13

What is great with images is that they usually embed up to 4 channels (red, green, blue and alpha). As an height map needs only one dimension, you could just use the red channel to store the height informations (you still have 256 levels for the height), and then use other channels for other purposes (like using the green channel to map the roads, blue ...


13

Split the terrain into square "chunks", load those you care about (mostly: Those near the currently active camera) in Update() and - if you are strapped for space (you likely will be), unload the not needed ones far away. Use pre-calculated low-poly models for far-away terrain LoD, unless you don't mind having a low view distance. Also, if you need the ...


13

You may be confusing some details. A height map is simply a 2D array of data. Each point represents 3 pieces of information: an x and y location and a number to represent the height at that point. For a simpler example, lets look at a 1D array of data that creates some 2D terrain. Each data point here will contain an x location and a number to represent the ...


12

To create a large island you do not need to generate it all at once. I would build regions asynchronously as you visit them. Instead of using a mask to create the island as the article describes, one thing you can do is play with the perlin noise octave wavelengths to achieve the look you are going for. Usually, the first octave describes the general shape ...


12

Procedural textures, particularly noise-based ones, can be made to tile. See this thread at GDNet for some discussion, as well as this journal entry. There's also this link, which sounds interesting although I can't speak for its veracity. As for procedurally generating the world, there's this article written by the guy developing Infinity. His system is 3D ...


12

When I did this I ended up making a simple gradient file (xml or image based, doesn't matter) that predetermined the color used at the specified distance between the primary height colors (grass vs. sand for instance). This way, there were inbetween states. What is great about this is that you have full control over the transitions. I suppose that you could ...


11

The algorithm recursively adds a value, but the value can be positive or negative (normally +-1 / (2^octave) ) If you start at zero and only add positive values, then you can only go up, and that is why you're seeing the vertices pulled down. try starting at 127 rather than zero for the four corners, and also try signed char (then checking your bounds both ...


10

One way you could achieve this the following: Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point For every section, divide into two placing a point in the middle of this section, with (ranged) random height between its two neighbours Repeat n times. What happens is detail in the ...


10

A standard approach to this is to use Level of Detail algorithms to draw less-detailed versions of far-off terrain. These lower-detail versions can either be pre-generated, or may be generated on the fly, if you have dynamically changing terrain. (But in almost all cases, you want to pre-generate these terrain LODs, as that's dramatically simpler) A good ...


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

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


9

Since you're not looking to create layers, or do Isometric, my best idea would to create something similar to a topographic map. The higher the mountain, the darker it gets, and possibly adds distinct features based on your environment (Eg: Add snow the closer to the top), Not sure the scale of your game, but this image shows what I mean: Example


8

I'd like to point out that none of the terms you mentioned are mutually exclusive with each other - you could even have a voxel based game that used heightmaps and rendered using polygons. Height-maps are two-dimensional representations of the height of the ground at each specific point. They are often stored as greyscale images, where the brightness ...


8

I would try sticking with Perlin noise, but adding a weight to it based on height, to ensure a certain average density at certain altitudes. To quote part of Notch's post on Minecraft terrain generation: So I switched the system over into a similar system based off 3D Perlin noise. Instead of sampling the “ground height”, I treated the noise value as ...


8

One way to achieve this is to have an additional layer of noise (2D) that controls the height of your current noise. This second layer should be scaled larger to give slower transitions between terrain types. The noise you have now defines the bumpy-ness, this second layer is kind of like a scale that will flatten out or exaggerate the bumpy-ness.


8

1 : I can't understand at which point down the Chunked LOD pipeline that the mesh gets split into chunks. Is this during the initial mesh generation, or is there a separate algorithm which does this. It does not matter. For example, you can integrate the chunking into your mesh generation algorithm. You can even do this dynamically, so that lower levels are ...


7

Some useful links for you about auto world generation: http://pcg.wikidot.com/ - Procedural Content Generation http://www-cs-students.stanford.edu/~amitp/gameprog.html#tiles - Amit's Building Worlds set of algorithms


7

Instead of sampling the “ground height”, I treated the noise value as the “density”, where anything lower than 0 would be air, and anything higher than or equal to 0 would be ground. Simply put, for every place where a block can be, a noise function is evaluated, and if it is >0, a block is placed. Notch's noise function is skewed by adding height from ...


7

Probably the only way to completely get rid of floating terrain is to test for connectivity. Depending on the size of you map, that might be an option. You can do that by picking base point, like the very bottom of your world. Then ensure all your voxels are either: Connected to the base. Connected to a voxel that's connected to the base. Likely starting ...


7

The general approach is called hysteresis: instead of immediately changing when you cross a border, you change only after you are some distance past the border. For the simplest example, suppose you want to draw a warning on the screen if you are too close to something. The straightforward code is: if distance < 20: draw warning But if you're ...



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