Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
So what I'm doing right now for shadow darkness is I'm adding up all the direct light sources and diving by all the total light sources, and that fraction tells me how black the shadows should be.
The reason right now that shadows are almost perfectly black at sunrise is that the sun is providing about 3000 lux, and the sky is providing about 25 lux (which is a realistic ratio). However, this means that 3000 / 3025 gives almost perfectly black shadows, and it's only later when the sun is high in the sky that the ratio nears 100,000 / 110,000 that the shadows "ease up" a bit and you can see through them.
In real life, we normally aren't looking down at the ground from the sky (like we do in Rimworld), we're inside the shadows so our eyes adapt to the decreased light, so the shadows seem lighter than they really are.
But realism does not always match players' expectations, which is why I added a setting for Max Shadow Strength that lets players select a multiplier for how dark the shadows should be, so if they want shadows that are only 50% as black as they "should" be, they can choose that instead.
I also am trying to design the code in such a way that it becomes trivial to add support for different weather conditions later that can dim the sum/sky or change its color, and the more "patches" I layer on top, the further the code goes from "just working" to more brittle and harder to extend.
I've been recently learning about cicrumsolar light casting - and that won't remove the abrupt transition - but it might smooth it a bit as the sun would be a bit dimmer at first (perhaps only 1000) lux and the sky would be brighter (around 100-200) giving a ratio more like midday.
Realistically, though, the sky should transition differently depending on biome. If you are in a desert or cold mountain mountain air, the sky actually should transition very similar to how the mod currently displays (and if you watch videos of sunrises in such biomes, the mod is actually quite realistic). However, for toxic wastelands or humid tropical rainforests, the transition should be a lot smoother, with the possibility of the sky even outshining the sun in extreme cases, completely smoothing the transition!
And for the weather conditions, just weight the strength of the sun/shadow/colour against the weather. Rain in game actually (at least, I'm pretty sure) has a ramp up/down which is perfect for aligning to a weight for the final effect. I think snow does as well.
Fog, any sudden weather condition not so much - but this is something that you can probably spread a transition in multiple ticks
For example - I have to use static classes, which means saving state is harder between ticks. Not impossible - but I don't get the easy compartmentalized and saved state that instance variables would give me.
Right now - I'm completely overriding all of vanilla on pretty much anything that involves the sun, moon, or sky as vanilla assumes the sun travels the same arc every day, with a very slight variation for latitude and time of year.
I'm not exactly sure what information I have to work with from vanilla yet for weather - so how easy it will be depends on how much information that's already there that I can just use versus how much I have to build from scratch.
If you look right before sunrise, the sky actually does start becoming pinkish and brightens up a lot (exponentially, in fact).
It's just that the sun is SOOO much brighter than the sky and Rimoworld's faster time scale means that what should be a 2-minute transition takes place in 1.5s, which is why it feels so abrupt even though proportionally it is correctly scaled from real-time.
(I actually do calculate how much of the sun disk is visible and divide the total sun disk lux by what is above the horizon). It's just 3000 / 25 is such a high ratio that the sun equals the sky in just 1/120th of ~1.5s).
(The sun rise slowdown factor I added actually works by making the sun disk bigger, so if you use the full factor of 20, it takes something like 1/6 of a second for sun to equal the sky, which IS slow enough for a human to see the blending, if still very fast.)