## Help On Procedural Generation

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

### Re: Help On Procedural Generation

Wojak wrote:The rules you use aren't the same as in the tutorial:

Code: Select all

if Tile.Alive and NeighborsAlive <= 3 then
World[X][Y].Alive = false
end
if not Tile.Alive and NeighborsAlive >= 5 then
World[X][Y].Alive = true
end

Yeah I played with it until it felt right.

Thanks again, I never would have thought to use conway's game of life concept for this.

I'll play more with this, and maybe figure out procedural generation for pages and the like.
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

### Re: Help On Procedural Generation

Zilarrezko wrote:I see, using the 3 dimensional noise and a seed as a Z is pretty clever.

Looks like a good base, though a little too random for my taste. I could probably think of some things to make a clump of mountain tiles be together, and surround and all water tiles with sand, and keep mountain tiles away from sand tiles and make a group of forest tiles. Though I think I would hit a wall very quickly.

Unfortunately it still looks like noise.
noise.png
And I think I see where you are going with the scale. If I had a X scale and a Y scale, I still do a pages concept and every page, let's say to the right I would just have XScale + 1 and I would guess it would continue the generation seamlessly. But I don't think that's how noise works, and I still might get something like a cliffside of a mountain gets truncated and ends up straight into a water tile or something like that.

I don't know about you, but when you have a very high number for the seed, does the noise value just end up being 0.5 for you?
Something's wrong, you shouldn't get such a badly generated terrain. Play with the scale, for example, scale = 1/10, or scale = 1/50.

You should get something like this, feel free to modify the values to enlarge ponds, or mountains, etc.

As for the big number, I'm having the same issue. Not a real problem if you want to work with os.time(). Just modify the value so that it keeps only the last few digits, and it should be working like a charm.
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

### Re: Help On Procedural Generation

Yeah I would imagine that just modulusing os.time would easily solve that.

I think my problem there was that I wasn't using an inverse for scale. Such as 1000 or 3000 appose to 1/1000 or 1/3000

### Who is online

Users browsing this forum: No registered users and 16 guests