Changing terrain colour palette after world generation?

As in the title: is it possible to change terrain colour palette after the world was generated? This seems mandatory for any season mod involving snowy winter.

1 Like

OK, so this is actually very very strange. Even if I change the season in biome generation data, the correct palette is applied only to the preview minimap generated at the beginning. In-game terrain is rendered with fixed palette, in case of temperate biome it is the spring palette (changing the spring palette works and that’s precisely what Frostfeast does).

Now, I scanned all the .lua files for phrases like spring, seasons, palette etc. and all the code I found in biome.lua seems to actually care about the season specified in JSON file. Can someone tell me how is the 3D terrain palette chosen and stored in-game (I guess it is just a material map and could be changed from the Lua console)?

EDIT: this is what is rendered if you use "mixintypes": {"spring": "remove"} and set "season" to a different, existing palette (in my case "season": "winter"):

I don’t want to waste anyone’s time but my inner voice tells me @Relyss could help here. Where is the palette creator hiding?

I think if we had that already implemented and/or exposed to Lua, we’d have already used it for Frostfeast (or in the game itself, seasons were a Kickstarter goal) :confused:
Frostfeast uses custom biomes with the “spring” palette. It’s the same than any other modded biome.

Looking into the cpp files that render the terrain, I see that when it reads the terrain generation file, it reads the "spring" palette, it’s hardcoded. Sorry for not being able to help much here.

Don’t know what are you referring to with “3D terrain palette”, but there’s a JSON file called “terrain_blocks.json” that defines the terrain layers used in the palettes.

Not sure about the performance implications of changing the color of the whole terrain at the same time (maybe it’d look bad and it’d have to be done in chunks or something), but probably updating all the trees and plants from the entire map to show other variant could be laggy.

1 Like

That’s a sad reply I was hoping not to get.

The performance hit depends on the way the change is performed. Changing model variant is indeed very costly, but I found a workaround. Changing material maps is actually much less demanding than I expected (my mods changes material map for all the trees in temperate at once and there is almost no noticeable change in performance) and winter models of oaks simply have completely transparent leaves. I don’t know if the terrain also uses a material map but if it does I think exposing it and changing via Lua should be quite smooth.

Technically, I would be happy with any way of changing actual terrain palette, even if it is named spring in the code.