f0ssel

Tiling Based on Movement, Trees Placed by Noise

3 min read #gamedev

I’ve had some free time before school starts so I’ve been crunching out as many updates as I can. The chunk tiling I mentioned last time (like has Minecraft does it) is started and I learned a lot today about making Lists in Unity and working on items from the list every frame, instead of trying to start and finish a loop in a single frame. I originally wrote the tree placement and chunk generator to be done all at Start(), but it started taking a lot longer the more I added things, and I never planned to actually pre-generate the whole map at start anyways, it was just a good place to start learning how to do these things. So now I have chunks filed into a queue whenever you move out of the area that is already generated, and the queue loads exactly 1 chunk every frame. It works surprising well, and I’ll probably keep it like this since I plan to add distance fog in the future that will cover up any chunks being rendered in the distance. Cubeworld has a really nice looking fog that basically increases your draw distance based on your computer’s performance, or maybe based on how many chunks away it’s already rendered, not really sure since it’s just speculation. Either way it’s cool and I’d like to do something like that soon.

Screenshot 2015-08-14 17.33.51

I messed with the colors and the height cutoffs to make it look a little better. Still needs a lot of work. Still cheating with the water plane too. The trees are generated 1 tree per frame per chunk. So where there’s 49 chunks (like in the video below) around you they are generating at 49 trees per frame. Again, except for at initial generation, you will almost never see them being generated. Still looks cool though.

ProcGen 0.1 and Tree Placement from Noise

The placement of the trees are based on a Perlin noise with a cutoff value, and after messing with the cutoff value to find the sweet spot, I really like the results. Here’s a short list off the top of my head that I think are doable goals I’ll be working on next:

  • More tree models
  • Rock spawning
  • Other object spawning(ruins / driftwood / flowers )
  • Water Implementation (just the surface)
  • Tweak colors / scale / noise of terrain

And here’s some stuff I have no clue how to do and plan to tackle next:

  • Biomes
  • Ocean edges
  • Ambient Sounds
  • Better Day / Night
  • Post Processing Effects

Honestly I’m not even thinking about a character model / controller because I think the world and the feel should come first, and I think there’s a lot more documentation on the more classical game elements than the other things listed above, so I don’t think I’ll have a hard time with it.