Help On Procedural Generation

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

Re: Help On Procedural Generation

Post by Zilarrezko » Thu Jan 22, 2015 10:26 am

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

User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: Help On Procedural Generation

Post by Ulydev » Thu Jan 22, 2015 12:27 pm

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.

Image

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.

User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: Help On Procedural Generation

Post by Zilarrezko » Thu Jan 22, 2015 4:26 pm

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

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 14 guests