Your procedural tree/plant seeding technique?

View previous topic View next topic Go down

Your procedural tree/plant seeding technique?

Post by raistlinthewiz on Mon Mar 19, 2012 7:01 am

Hi slaihne,
Does blockworld also use a procedural plant seeind technique on the world? If so can you please a bit explain your technique?

raistlinthewiz

Posts : 5
Join date : 2012-03-07

View user profile

Back to top Go down

Re: Your procedural tree/plant seeding technique?

Post by Slaihne on Sat Mar 24, 2012 3:10 am

If you're talking about the grass plains, then yes it does do that procedurally.

Basically, i have a number of 'plant' tables. Off hand, i think i have 1000 values in each table. The tables are filled with plant block values, dependent on what type of terrain they are meant to cover.

So, the table(s) that cover desert have about 10 'dry plant' blocks in there first and 990 empty spaces following that. The grass area tables have 1000 'green grass' blocks in there. I have several variations of each plant, so i use these. EG, the grass table has 1000 grass blocks but the first 100 are version 1, the second 100 are version 2 etc. The versions are slightly different colours and slightly different heights. This serves to make the plains looks a bit more organic.

It's not working 100% atm, there's loads of stuff not showing correctly.

Now, i use a procedural system to generate the landscape types. This gives me 'contours' as such. These contours split the landscape into several coarse types (grass, desert, mountain, plains, swamp etc) but also split each coarse type into 10 sub-types. One type is always beside two definate others (pretty much). You will not see mountains directly encroaching on swamps.

This image should illustrate it...



Each colour represents a "type", and each shade (from black to full brightness) represents a sub-type.

Now, i know that, for the desert type, on one side it will have the tropical type and on the other it will have the dry plains type. The tropical type is bordering the high subtype of the desert while the dry plains are bordering the low subtype. So, for the desert type i have 10 tables as detailed above. They are mostly the same, but in table 0 and 1 i put a few "dry plains" type things and in table 8 and 9 i put a few "tropical" type things. This helps the transition look a bit better and also, as you can see from the image, the contours aren't smooth in the first place.

For each vertical column of blocks i use the type, plus the subtype to get the table i will be using. Then i calculate a "random" value generated from the coords and use this to reference into the table.

This allows me to 'fade' from one landscape type into another, but it is a pain to set up initially Smile It also allows me to have 'fields' of poppies in amongst the grass (i set a couple of the grass tables to have loads of poppies in them while leaving the others just grass).

I hope you followed all that.
avatar
Slaihne

Posts : 264
Join date : 2011-03-17
Age : 50

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum