Today was tree planting day. At first I was like, OKAY GIVE EVERY TILE A TREE WITH A CHANCE of 0.5, but that looked but ugly, so I thought of something else. I changed up my "Map generator" a bit so that instead of giving out "Tiles" it gives out a value between one and hundred, and I do the title choosing in my "TileGrid" class (which makes a lot more sense).
Now, to plant my trees, I seeded another world, and used the values of the mapgenerator to choose where to place trees. This way, just like I use the map generator to make water appear together, with sand at the edges, I now use it to make trees appear together, with bushes along the edges. It works pretty fine! Here is a screenshot of the world zoomed out:

As you can see the trees form nice little woods! Which is pretty cool.
I also split all the parameters of my map generation so that I can easily load different "prefabs" for different terrains, and I added another bit to the terrain creation, for more randomization, which is what I dubbed "Cliff" generation, it works kind of like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| for(int i=0;i<cliftimes;i++) { pointX=genValue(WIDTH); pointY=genValue(HEIGHT);
mult=genValue(clifmult); for(int x=0;x<WIDTH;x+=1) { for(int y=0;y<HEIGHT;y+=1) { int t=distance(x,y,pointX,pointY); value[x][y]+=(int)(5*mult*(2/(.5*(t+1)))+mult*5*(1/(t+1)*Math.sin(t/5+90))); } } } |
This piece of code makes it possible to create nice islands, here's an example of my island biome:

As you can see, the cliff script is still, pretty ugly, I circled in red the ugly sudden rock formations it creates so I will have to tweak that to make it better. My goal with this addition is to make it possible for cliffs to appear next to the water (So that I can later add pretty waterfalls), but it isn't working yet : (. I'm thinking of doing something with "Erosion", evening out the low slopes, and extremizing the high slopes, but I'll have to look into that
Here is my swamp "biome" which does look pretty:

It's "initialization" code looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13
| case 3: ranmult=50; laketimes=12; lakemult=10; cliftimes=0; clifmult=0; aatimes=5; break; |