Tag Info

New answers tagged

0

No, Pincushion distortion is not actually the inverse of Barrel distortion. (Proof below) This paper seems to be shooting for exactly what you want: http://sprg.massey.ac.nz/pdfs/2003_IVCNZ_408.pdf (Formulas inside) Proof as promised: By contradiction for simplicity. Extracting the relevant fact about Barrel (and/or Pincushion) distortion: (2): We ...


1

at the base of some perlin noise implememntatio there's a perturbation array private static int[] p = {151,160,137,91,90,15, 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 88,237,149,56,87,174,20,125,136,171,168, ...


1

As Menno Gouw mentioned, you could use a noise function although you can actually use any PRNG. You will need to seed it every frame though, based off some predictable, relative value, such as the player position. If the player only moves horizontally, then this is simple. seed = player.x I don't suggest a noise algorithm in this case, since the ...


0

You need something like perlin or simplex noise. This will always generate the same noise based on position with a certain seed. Now you can add stars where the noise is a certain level. Simplex and perlin noise always create the same noise based on location and seed. So if you would create a noise ranging from 0 to 255 you could generate a stars at a ...


2

Given credit to Alan Wolfe for what he said on "INFINITELY tile". A 2d perlin noise (or a 2d simple noise) will have no seam problem as far as you stay away from noise borders (defined by floatin point dimenision) Referencing the image: and said that you have chunks with 128X128 vertex, in chunk i,j you compute each vertex as : for x : 0 .. 128-1 for y ...


0

You could also not re-invent the wheel and use some already existing library for noise-generation. I recommend libnoise2, which is highly optimized and uses SSE/2/3/4/AVX to speed up the process and does a great job. It also has multiple generators and multiple parameters which make later terrain varieties easier to implement. You could also use libnoise, ...


0

With Simplex noise, lower frequencies are smoother and higher frequencies are bumpier. The first thing to try is to use a lower frequency, and take out the smoothing step. I have a rough demo here — use a lower freq start and freq range to see smoother noise, or use a higher freq start or range or see bumpier noise.


0

Always hard to answer a "best way" question, it really depends on what you want to generate. But anyway, you say you are smoothing out the vertices in relation to it's neighbor. But the smoothing should already be done by the noise itself with the correct parameters. You can generate all kinds of noise patterns with multiple iterations of different ...


1

Your point selection rules can be satisfied by a Poisson-Disk sampling distribution & can be solved in O(n) with Bridson's algorithm. Basically, the algorithm divides the output region into a grid of cells sized relative to the minimum allowable distance, such that only one point can appear in each cell. Then, when you consider adding a new point, you ...


0

You could just have the tiles created deeper in the hierarchy and close that folder and don't be bothered. What you can do as well is hide your game objects from the hierarchy `myTile.hideFlags = HideFlags.HideInHierarchy" not sure about how much performance would be gained. Showing 100x100 textures on the screen is never a good idea drawing textures is ...


0

The simplest solution is to use the Relative Neighbourhood graph which provides a nice balance between the Delaunay Triangulation and MST.


4

Given only the sparse information you've supplied, and assuming that when creating a red edge, you wish to avoid collisions against both other edges and rects (which I assume are rooms)... What you are trying to avoid are crossings. What you want (red + green loops) are cycles in graph theory. Minimum Spanning Trees are tree-graphs - that means no cycles to ...


4

I suggest this aproach. Let fs(x,y) be your simplex noise function. Let's introduce a second function : f(x,y) = ((float)Math.Sin(((float)x/(float)WIDTH) * Math.PI) ) * ((float)Math.Sin(((float)y / (float)WIDTH) * Math.PI) ) or any function that rassemble the following and that gives values from 0 to 1: at this point take your simplex noise fs(x,y) : ...


1

It's all about adding more features and doing some processing on your output. You are currently generating a heightmap but what seems to be missing? First off there are no rivers or trees. To generate this I would sugest creating a second noise map that contains rainfall. Then maybe add a third one for fertility. The areas with high rainfall and fertilty ...



Top 50 recent answers are included