

A weighted normalized stack in this context is just a mapping of biome to weight, which is a number between one and zero, where all the weights combined add up to 1. What I really needed, I thought, was the ability to apply a weighted normalized stack of skybox configurations to a weight. So I took the interpolation back to the drawing board. Just getting the alpha and color keys of a UnityEngine.Gradient allocates memory.

I experimented with pooling these gradients, but it was kind of a rabbit hole. However, Time of Day implements animated colors via the UnityEngine’s Gradient class, which contains two arrays of the color keys and alpha keys, meaning it’s allocation city. This was easy to do in the previous version of Time of Day, because all the configuration was structs or value types so we could do quick lerps without allocation. You need to interpolate, or tween, between the configurations. A cell can contain an arbitrary amount of biomes at different strengths. One of the requirements for a skybox is interpolation. However, it did lead to an interesting performance issue. Previously we had to implement this ourselves with this whole layer of abstraction, and now we don’t need to, which makes the whole system way cleaner and better. This means things like if you want the color of the sun to change throughout the day, this is now much more viable. Also, the latest Time of Day implements natively animated parameters. There are some pretty nice features in it, like a cool atmospheric scattering effect, which might make the world look a bit prettier with minimal effort. We also upgraded Time of Day, the skybox plugin that we use for skybox rendering. A map will now have a ‘base biome’, which acts as a fallback for when there is no mapping for the cell a player is in. Now, their configuration is entirely serialized and configurable, everything from the color of the sun to the temperature to if you want it to blast a gazillion units of radiation every day at noon for an hour. They are no longer concrete enumerations that are linked to a script that builds how they work. While that will still be an option, we now have a MapMagic output that will work as well, and a biome painting tool in the editor.īiomes have changed a bit in how they work.

While the ShigiTools biome tool was usable, it wasn’t super user friendly. The first thing that needed doing was rethinking the usability of the biome tools we have in place. This refactor will enable users to specify custom biomes, weather systems and biome-influenced client effects in the SDK, something that was previously impossible. I also kept fiddling with and making some biomes. This week my SDK work has extended into reworking the biome, weather and skybox system (it’s really sort of one system, so the reworking encompasses all of it).
