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

g Is this mod compatible with Space Exploration?

3 years ago

Space Exploration has multiple planets, moons and pitch black and dimly lit asteroid fields (surfaces). Is this mod compatible with Space Exploration?

2 years ago

At the moment, Clockwork breaks the day/night state of space surfaces, and as such is incompatible.

1 year, 9 months ago

Although I've tried to write Clockwork in a way to be generally compatible, there's a few problems...

  1. There's no way for Clockwork to know the intent of other mods. For example, if a surface is set "always day," it's assumed that the other mod and player would not want Clockwork to touch it, so it doesn't. But if it's not set, such as a planet that has a very different day/night cycle? Then it's nearly impossible to really know if it's something Clockwork should or shouldn't change (so it's assumed yes, unless you turn off multi surface mode).

  2. The default factorio settings menu/window is very limited; all the options are static. So the settings are sort of "one size fits all" - you can't set it per surface (planet), etc. To fix this, I'd have to take it out of the settings menu and design a custom UI for clockwork that can be accessed in game. Honestly this would probably be a good step forward for the mod, it's just dev-time-intensive, especially because I'd have to go through a big learning curve. Maybe someday?

1 year, 9 months ago

Maybe I don't understand the modding of Factorio. But, I assume that for the fashion of "Space Exploration", at least for the first time, the parameter of the coefficient of increase of the day and night cycle available to all planets would be enough.

If the coefficient can be fractional, then it is possible to increase the time of the existing cycles and decrease it at the expense of the value. For example, a value of 2 in the night parameter will increase night time by 2 times. A value of 0.5 is to halve the night. Yes, for all planets, but for all the same, and at the same time using their own value of the length of the day.

Just so there is not enough working and compatible mod so that both day and night last long enough.

1 year, 9 months ago

if it were just coefficient, then yes that would be easier and simpler to worry about - but it still creates a need to store the surface's original daylength, and a mod like SE would have to change this from the default after the surface is created because it can't be set during creation, but there's also no event to notify it's been changed so Clockwork has the monitor it and make sure it doesn't try to apply its coefficient before SE or other surface-creating mods have had a chance to configure the surface...

And then adding in the day/night offsets which some may not care about, but some do... it just gets messy very very quickly.

It would be possible for me to say something like "multisurface mode now just ignores day/night offsets and only applies the daylength multiplier," but that still means implementing data storage logic, and timing/delay logic on both reading into that data storage and applying Clockwork's settings.

I've started work on a UI-based version but no ETA on it - predictably, it's a ton of work and learning, but the end result should be flexible enough to handle any mod...

1 year, 9 months ago

Nauvis can't be deleted, ever. But for other surfaces, perhaps SE could manually retrieve the multiplier on creation?

1 year, 9 months ago

Well, the data storage wouldn't be in case the surface is deleted - if a surface is deleted, that's nice and easy since we just don't need to care about it anymore. It's in case someone decides "4x daylength is too short/long, I want to change that to 8x or 2x now" and so on - when the surface didn't have the default daylength of 25000 ticks in particular. (Factorio does not store the pre-edit value, so we have to either assume it was the vanilla default or store it somewhere, but again we have to be careful to capture it after another mod sets it but there's no event triggered by a mod changing it...)

Though, yes, in theory a mod creator could add logic that reads Clockwork's multiplier, but that would be very specific to SE or whichever mod, and they'd need to add logic in case it changes, and I'd need to add logic to exclude changing any mods that do this or it'd cause conflict... etc etc.

All that said a version that can handle SE (and anything) is coming. Please just have some patience with me as I'm having to learn a lot to get there.

1 year, 8 months ago

Meanwhile, is it currently possible to let Clockwork manage Nauvis daylength and leave all other surfaces to SE?

4 months ago

Would be great if we could only enable Clockwork on Nauvis as a workaround.

New response