# Tag Info

0

Damping is physics term for an influence within or upon an oscillatory system that has the effect of reducing, restricting or preventing its oscillations. I suspect your source article might have a typo & have meant clamping, which generally refers to restricting a value to a given range. As for achieving the visual effect, you might be able to get ...

5

I don't know what their project does but you can apply a reshaping function to height. Here's an example that takes h from 0.0 to 1.0 and returns a new height from 0.0 to 1.0: function R(h) { var W = 0.4; // width of terracing bands var k = Math.floor(h / W); var f = (h - k*W) / W; var s = Math.min(2 * f, 1.0); return (k+s) * W; } It's ...

1

I've thought about this, that is, creating matching heightmaps using diamond-square. I don't know how well this will work, as I've never tried implementing it, but here's my theoretical postulation: For every point along an edge, if the adjacent map portion exists, make the point equal to the adjacent edge point. What it looks like right now is that ...

0

In my own bit of code (just to learn procedural terrain generation), instead of trying to stitch together two maps (eg. two 64x64 maps), I create one larger map (eg. 128x128, which wraps), and then throw away the bottom portion. This leaves me with a 64x128 map that wraps horizontally but not vertically (which is what I want).

1

If what you mean is that you need a nav-volume with fewer nodes because the oct-tree ends up leaving you with too many nodes, the main issue behind you problem is, of course, symmetry. Or better said, the fact octrees do not allow for asymmetric nodes. The result of that is empty space ends up being wastefully divided - either in the within a given level, ...

0

What you're referring to as spin is formally called angular momentum. Depending on the level of detail you want, it can get complicated fast; this Q/A on Simulating Torque and Angular Momentum might be a good starting point.

2

A hill like this could be created with the following algorithm: Start with a small circle in form of a regular n-gone (the mountain top). Create a larger "blob" on height 0 by taking the corner-vertices of the previous circle and move each one further away from the center by a random distance. every few iterations, interpolate new vertices on straight ...

2

Your problem is this line: roomSprites[x]->setPosition(sf::Vector2f(x * 32, y * 32)); What do you think will happen in the second row? x will start at 0 again and you'll set the position of the first 10 sprites. In the third row, x will start at 0 again and you'll set the position of the first 10 sprites. See where this will end? You either have to ...

2

I'm going to drop this alternative into the mix. Its one that I really liked and used myself, with some changes. https://www.reddit.com/r/gamedev/comments/1dlwc4/procedural_dungeon_generation_algorithm_explained/ Roughly speaking the steps are: Generate a bunch of squares of various sizes, save them to an array (you probably want a class for these ...

3

I would make it little different, i would make a procedural path builder and then spawn floor tiles randomly all over the map, so the rooms will be more "natural created" and them will be linked at least for 1 tile, i can't code in java but i'll code the example in javascript, i think it's clear enough. var c = ...

1

ItÂ´s hard without seeing the code, but I think I can give you an asnwer. You can check which rooms are next to which rooms using the rows and columns of the file you created. The pathfinding is a bit harder, once you have your current room and the objetive room (the one next to the current room, I guess), all you need to do is define exact point for ...

0

To generate a random terrain, i find the 'fractal'-ish approach the most effective. Generate a first set of spikes, with a given amplitude and frequency, then add to this another set, having lesser amplitude and higher frequency, and iterate... By choosing 'wisely' the frequency/amplitude/phase parameters you should get the terrain that you wish. Find below ...

0

A good, though not particularly fast, algorithm for this is called "midpoint displacement." In midpoint displacement, you start with a flat terrain, then find the midpoint between the edges and move the midpoint up or down by a random amount. You then repeat this process, taking the midpoints on either side of the previous midpoint, and move it up or down ...

0

One (not very good way) would be to generate lots of random y coords, increase the x by, say, 50px every y coord and generate a polygon from that. Hard to explain but if you want I could do a picture.

Top 50 recent answers are included