RLHD icon indicating copy to clipboard operation
RLHD copied to clipboard

Add a Day/Night Cycle

Open allenkinzalow opened this issue 4 years ago • 10 comments

Description This PR adds the ability to turn on a day/night cycle.

The sunrise and sunset are currently hardcoded to 7 am and 7pm. The precision is down to the second, so you should not see the shadows "jump" between minutes, it should be a smooth transition. The sun yaw is currently based on your current local date and where the sun should rise and set based on the month.

Screenshots 9 am: https://gyazo.com/4ce467eedd173b0c3df7eef1bcddcbd5 12 pm: https://gyazo.com/e53c2ceff2a2fd8a6f0b21a532adef93 5 pm: https://gyazo.com/eb7ab14268d8fc8345cfc680071a5cbf Night time: https://gyazo.com/7a1fb323d7c2f04b25c2c6449abc47e9 11pm: https://gyazo.com/8224794d38d7323e06f11f8170d2b7e2

I am currently looking for help testing this in other environments and adding NIGHT specific environments to other areas.

allenkinzalow avatar Sep 17 '21 03:09 allenkinzalow

Interesting, Is this togglable? Can you also possibly record a GIF of the transition? Quite Curious on how it looks.

NataIynn avatar Sep 17 '21 03:09 NataIynn

Could this potentially be based on server time instead so all players have the same day/night cycle ?

luna-duclos avatar Sep 17 '21 11:09 luna-duclos

Interesting, Is this togglable? Can you also possibly record a GIF of the transition? Quite Curious on how it looks.

It is togglable, along with making it day-only. I'll try to get a time-lapse video done to show it off.

Could this potentially be based on server time instead so all players have the same day/night cycle ?

I think this would be a good option, but I personally like it tied to my local time so I think having both available is good. I've also considered looking into more of the lore of osrs to see if there is any mentions of the length of the day or time on Gielinor and possibly using that.

allenkinzalow avatar Sep 17 '21 13:09 allenkinzalow

I would say that it shouldn't be based on your local time (or rather, the time system it uses should be configurable).

Many people only play during very specific hours, so it would get very dull to see the exact same lighting every time you play.

geel9 avatar Sep 18 '21 15:09 geel9

n

As well as a way to make the days longer/shorter. It's also important that this doesn't affect areas in caves.

AustinGarrettR avatar Sep 19 '21 21:09 AustinGarrettR

I would say that it shouldn't be based on your local time (or rather, the time system it uses should be configurable).

Many people only play during very specific hours, so it would get very dull to see the exact same lighting every time you play.

That problem would occur whether it was based on local time or UTC. I'm adding options for Local, UTC, and Random.

As well as a way to make the days longer/shorter. It's also important that this doesn't affect areas in caves.

I have already started on the ability to set the amount of cycles per 24 hours 👍 As for the caves, this is built off of the existing lighting/shadows so there's no reason for that to happen.

allenkinzalow avatar Sep 19 '21 22:09 allenkinzalow

That problem would occur whether it was based on local time or UTC. I'm adding options for Local, UTC, and Random.

I think that adding an option to set a timezone ( local time + Timezone offset) for the day-night cycle to go off of would be quite nice. You could set the timezone to where there's still light if you only play during the night. This would be a nice way to stop yourself from grinding for too long into the night if the sunset in game came out to be 2-3 am your local time. Day-Night cycle is an awesome addition to the plugin. Glory to OpenSource!

Rienokitsune avatar Sep 20 '21 13:09 Rienokitsune

I suggest adding manual options so you can manually set it to day or night time without having it cycle.

ipkpjersi avatar Oct 28 '21 02:10 ipkpjersi

It would be nice if we add support for sun- and moonlight, so shadows can be calculated naturally over the entire day/night cycle (currently it just removes shadows once u hit a certain time).

dosier avatar Jan 20 '22 01:01 dosier

Looks very promising, it was a feature that I thought would be nice and I'm glad to see it's in development here. I wanted to suggest perhaps a setting to add artificial light sources like streetlamps around roads and such to light the world atmospherically. Could be quite an undertaking but I think the idea has merit. In any case, looking forward to this feature.

amastov avatar Feb 05 '23 11:02 amastov