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


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


35

From a pragmatic standpoint.. If someone isn't going to be playing your game over and over again, but instead is going to play through once from start to end using checkpoints or free saves (like in most non-roguelikes), then why would you spend your time on implementing procedural generation for your world, instead of just making a single, static, ...


32

I'd suggest you start with 2D Perlin-noise. Something like this: Then apply a threshold on the image, so that you get several isolated islands, as shown here: I chose a threshold of 0.04, everything above the threshold would be colored blue. The rest remaining black. Then after that, it's time to determine which "islands" to keep and which to throw ...


31

I think this is good case for using either binary or ternary space partition. On first pass, split house space into halls and {blocks of rooms}. Get next big chunk, split it into {hall and chunk} or {2 chunks and hall between them}. On every step, rotate slicing direction by 90 degrees. Stop when {no more big chunks left} or {total hall area reached limit}. ...


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


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


23

There are two general approaches: The leftmost is termed the uv-sphere and the rightmost an icosphere. GLUT tends to use the uv approach: look at the function glutSolidSphere() in the freeglut sourcecode. Here is an excellent article on producing an icosphere: http://blog.andreaskahler.com/2009/06/creating-icosphere-mesh-in-code.html The uv-sphere ...


23

But why do the first two elements imply a permadeath approach? I don't think character growth or procedural world generation imply permanent death at all. In fact, there isn't a necessarily mechanical connection between any of those three elements (as evidenced by the fact that combinations of a subset of those elements in games exist). I simply think ...


22

The term you're looking for is signal processing/analysis There are lots of techniques involved but the fundamental one that those games make use of is Beat Detection. This tries to calculate the tempo of the song and where the beats in a measure are and hence place the obstacles the appropriate distance apart to coincide with each beat. The way that the ...


22

Your question leads you into the field of procedural content generation. Tile-based world generation derived from continuous/analog methods By continuous, I means something that is not tiles, something that is analog, an example being a vectorised map. You can use any continuous technique for generation, and then quantise it. For example generate a high ...


21

This has been more or less answered before. Your first stop place should be http://pcg.wikidot.com/ Since I was accused of this not being a helpful answer at all (really? Someone asks for a resource and I post a link to a wiki dealing with the subject?), this page on the wiki deals with Dungeon generators specifically and links to various articles on 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

You can take advantage from the fact that your desired design lumps the rooms in rectangular rooms surrounded by corridors. With that in mind, I would do this: Design the corridors and the "big spaces" for rooms Fill in each "big space" with rooms Filling up the big spaces with rooms can be done easily if you start with the rooms at the borders - they ...


18

First of all, I'm not sure why you want to implement a height map (i.e. geometry displacement) if people won't be able to land, it just seems more efficient to normal map it or something. With that said, what you want is to convert from an arbitrary (x, y, z) to a (u, v) coordinate, which is trivial. No cubemap needed. Every (u, v) texel has a height ...


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


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 textbook definition of "procedural" is something that's generated from some kind of algorithm instead of predefined, i.e. from a level editor or image editing program. See also this question, specifically for procedural textures: http://gamedev.stackexchange.com/questions/327/what-happened-to-procedurally-generated-textures For procedural maps, there ...


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.


15

This is a non-trivial problem. I spent a fair amount of time delving into it last year. You will want to look into the implementation of the first ever dynamic storyteller program, TaleSpin. This was written in 1976 and still things have not progressed much further in terms of dynamic story generation. TaleSpin will give you an idea of the basic elements ...


15

I travelled in a lot of "hot" countries in the 10 last years and each time I went to elevated areas it was cold or very cold even when I was close to the equator. In fact elevated areas are semi-arid to arid. Vegetation is small (except some special species like cactus) and burned (by sun and cold). Most of the time, there is very little snow except at ...


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


13

I managed to get reasonably good looking levels by using the following algorithm, based on a square grid: First, create a set of rooms. Random parameters will define the size of rooms and their numbers. An adaptive algorithm could even define some zones that are made of large hallways, and others of very small rooms. Then, you need to make sure that all ...


13

In using the word connectedness, you've come within a hair's breadth of the tool best suited to determining a solution: graph theory. Connectedness is a property of graphs. Graphs can be either connected or disconnected (as you're experiencing, AKA a multigraph). Any game level, in any number of dimensions, can be represented as a graph, and logically, this ...


13

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


13

You can use the same techniques as above-water landscape generation - but simply apply different principles. Here are some examples: Basic Landscape Underwater landscapes have much more pronounced features than above-water. This is likely because (as far as I know) the ocean beds are more tectonically active. None-the-less you will need to tweak 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

Use Prim's Algorithm to obtain the minimum spanning tree for your graph (add randomized weights, or add the higher weights near the entrance, or do an algorithm of your choice) and re-add some doors/edges at random. This way you'll have all the rooms connected and a few extra redundant paths.


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



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