Clockwork

by Yehn

Changes the parameters of the solar cycle: Make days longer or shorter and control what portion of the cycle is night. Make nights darker if you like. Includes an optional Sun Never Rises mode.

Content
1 year, 9 months ago
0.16 - 1.1
27.4K
Environment

i Nighttime Darkness

3 years ago

Anyway to variably adjust the night time darkness? I feel like when I started to play night was a lot closer to "pitch black" but you could just barely see stuff. As I've gone along in my game I feel as though night has slowly gotten lighter and I've been trying to get back to the original illumination levels which brought me to your mod. I've had it installed for a couple days now but just started playing with the settings and options...it works great for darkening the nights if I put it in pitch black mode, but I don't want to be THAT dark...at least not at the moment. (Maybe later.) In normal mode I feel like the nights got even lighter and I'd like to just adjust the night time level to be lower.

On a related front I was tweaking the start times to make the night a little longer and as I'm writing this I just noticed the change from evening to morning I believe it was...it seemed very large and abrupt. Did you play with the light level settings for dusk and dawn too? I haven't looked at your code yet, but is your mod perhaps setting the values for the 4 time ranges? It has some drawbacks such as doubling the size and complexity of the settings menu options, but if so may I suggest adding more levels to smooth things out. Here is a possible example using 5 additional levels. (These are just relative percentages off the top of my head and have no basis on how the actual in the game light level is affected as I don't know.) To keep the menu simpler, you could perhaps even keep the 4 major points and have the intermediate levels happen based on a formula behind the scenes that evenly distributes the additional steps across the user defined start times

Start Time/Noon:" Full Illumination
Afternoon (New): 85%
Dusk: 70%
Evening: 50%
Late Evening (New): 30%
Night (New): 10%
Pre-Dawn (Current Morning): 20%
Dawn: 40%
Morning (New): 60%
Late Morning (New): 80%

One last suggesting, I don't how others feel about it and for all I know is how the API works and there is nothing you can do, but to my way of thinking Dawn is when the sun starts coming up, and Morning is the time before noon. As a result Dawn and Morning should probably be swapped. I think Dusk and Evening are ok, though with Evening being your darkest point, maybe Night would be a better description.

3 years ago
(updated 3 years ago)

Update: The abrupt change may have been something to do with being the first major change after updating the settings as I haven't noticed it again and it has been several cycles now. Could still be indicative of something I guess, but not the problem it looked like it was.

Same might be true of the over-all night time setting as it seems darker now too. That said, I'd still like it to be darker without being pitch black so the core question stands...can the darkness level be made settable?

Thanks

Update part 2: Nevermind, it just happened again. Unless I'm just missing it, it does however seem to be only happening at 6am where I have the transition form Evening to Morning set (.75 Offset). The other transitions seem to be ok.

3 years ago
(updated 3 years ago)

From what I see, adding back a visual minimum brightness setting shouldn't be a problem. This mod adjusts the "brightness_visual_weights" of all surfaces in the game.

if settings.global["Clockwork-darknight"].value then
    surface.brightness_visual_weights = { 1 / 0.85, 1 / 0.85, 1 / 0.85 } 
else
    surface.brightness_visual_weights = { 0, 0, 0} 
end

Assuming all color channels use the same value:
- 1 = pitch black
- 0 = vanilla
- <0 = makes the environment brighter, but still loses saturation compared to regular day time

With that in mind, the boolean setting for pitch black nights could be changed to a number input.
(Though would need a migration: false -> 0, true -> 1)

{
    type = "double-setting",
    name = "Clockwork-darknight",
    setting_type = "runtime-global",
    default_value = 0.01,
    minimum_value = 0,
    maximum_value = 1,
    order = "ec"
},
local darknessModifier = settings.global["Clockwork-darknight"].value;
surface.brightness_visual_weights = { darknessModifier, darknessModifier, darknessModifier } 

Then we could enter something like 0.9 and have really dark, but not pitch black nights :)

Edit 2020-08-23:
Actually, 1.1764705... (1/0.85) is the maximum value, which the mod already uses for the pitch black setting.
https://forums.factorio.com/viewtopic.php?p=474827#p474827

New response