f0ssel

Tinted Lighting, Spawning Prefabs, Terrain Research

2 min read #gamedev

It’s been a while and I haven’t really worked on much over this break, but I’ve been researching a good bit on different ways I should think about tackling procedural terrain generation that will still look like what I’m going for. It’s all a bit over my head at the moment so I think I’m going to hold off on that topic for the time being. I like the idea of starting with a hand crafted map to begin with, and then exploring procgen at a later date. For now I have a little flat valley surrounded by mountains, and it’ll be my playground until I need something else.

Despite handcrafting the terrain itself, I have no interest in placing every object in the world. So I started and finished that project today, or at least the framework for it. Right now the script finds the dimensions of the mesh, shoots rays down through the mesh, finds the normals and then places the objects along the terrain normals so hopefully I can get some interesting results on hills. For some added randomness I have the trees rotate around the trunk randomly, as well as the rocks on their x and y axis. I also added parameters so that trees shouldn’t spawn on too steep of hills, and also added a density function based on the area of available spawning places. Trees shouldn’t spawn on rocks or other trees (hopefully).

I also worked on tinting the lighting. This means that in the morning there will be a cyan tint to the light, daytime will be a typical white-yellow, and afternoon will be orange-ish into a deeper red for sunset. I’d love to add a weather system soon that can work with and affect the ambient tint of the lighting.

Tree and Rock Spawning, Tinted Lighting

That’s really all for today, I hope to work on this more often but not sure for the next few weeks. I’m moving soon, working every now and then, and starting back to school in less than a month so we’ll see.