Having troubles with LibNoise.XNA and generating tileable maps
Posted
by
Jon
on Game Development
See other posts from Game Development
or by Jon
Published on 2012-05-13T09:47:35Z
Indexed on
2012/09/21
9:51 UTC
Read the original article
Hit count: 299
Following up on my previous post, I found a wonderful port of LibNoise for XNA. I've been working with it for about 8 hours straight and I'm tearing my hair out - I just can not get maps to tile, I can't figure out how to do this.
Here's my attempt:
Perlin perlin = new Perlin(1.2, 1.95, 0.56, 12, 2353, QualityMode.Medium);
RiggedMultifractal rigged = new RiggedMultifractal();
Add add = new Add(perlin, rigged);
// Initialize the noise map
int mapSize = 64;
this.m_noiseMap = new Noise2D(mapSize, perlin);
//this.m_noiseMap.GeneratePlanar(0, 1, -1, 1);
// Generate the textures
this.m_noiseMap.GeneratePlanar(-1,1,-1,1);
this.m_textures[0] = this.m_noiseMap.GetTexture(this.graphics.GraphicsDevice, Gradient.Grayscale);
this.m_noiseMap.GeneratePlanar(mapSize, mapSize * 2, mapSize, mapSize * 2);
this.m_textures[1] = this.m_noiseMap.GetTexture(this.graphics.GraphicsDevice, Gradient.Grayscale);
this.m_noiseMap.GeneratePlanar(-1, 1, -1, 1);
this.m_textures[2] = this.m_noiseMap.GetTexture(this.graphics.GraphicsDevice, Gradient.Grayscale);
The first and third ones generate fine, they create a perlin noise map - however the middle one, which I wanted to be a continuation of the first (As per my original post), is just a bunch of static.
How exactly do I get this to generate maps that connect to each other, by entering in the mapsize * tile, using the same seed, settings, etc.?
© Game Development or respective owner