Balancing Night Length with Day Length

This is the place to request new mods or give ideas about what could be done.
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 561
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Balancing Night Length with Day Length

Post by thereaverofdarkness »

Currently, full day is half of the day/night cycle, and full night is only a tiny bit of the cycle. I'm trying to make the day and night have the same length. I also want to shorten the time spent on twilight, so that most of the time is either full day or full night.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Balancing Night Length with Day Length

Post by bobingabout »

The day/night cycle is, what I would call "hard coded" into the game.

the only way to really play with this is to write your own script to keep track of your "Time of day", and change the game's time of day to match what you want it to be.

The value counts up from 0 to 1 over the span of a day
As an example, I think 0/1 is mid-day and 0.5 is midnight. To shorten the day, you might do a check for exactly 0, and when you get it, change it to 0.2, which skips a 5th of the day length. Then similarly monitor for 0.6, and change it back to 0.4 to make the night longer. Of course, when jumping backwards you'll need to keep track of when you jump back, to make sure you only do it once a day, else you'll be stuck in an infinite night cycle.


for more information, see this link: https://wiki.factorio.com/Game-day
(Note, turns out that 0.6 is dawn, and 0.4 is dusk, so that 0.2 span is wider than the whole night cycle... it was just an example to demonstrate the idea)

Of course, if you start playing with the time value, if you have a clock installed, like my mod, then the time it tells you will jump around all over the place as you edit the game time.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 561
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: Balancing Night Length with Day Length

Post by thereaverofdarkness »

I don't want to change the time, I just want to change how it interprets the light level relative to the time.
User avatar
Sirenfal
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Tue Jan 10, 2017 1:42 am
Contact:

Re: Balancing Night Length with Day Length

Post by Sirenfal »

There is no way to do that, you'll have to change the time. If you choose to do this I suggest just freezing time (game.surfaces['nauvis'].freeze_daytime(true) http://lua-api.factorio.com/latest/LuaS ... ze_daytime) and modifying the surface.daytime value yourself in the tick event. It will be easier to choose your own day/night length and skip specific time sections at will than having to selectively check and change the vanilla time as it ticks. The performance impact should be negligible as long as you don't go totally overboard with complex math/logic in some way.
Post Reply

Return to “Ideas and Requests For Mods”