cocolabs / odyssey

Minecraft Forge desert themed survival/adventure mod.
MIT License
0 stars 1 forks source link

Shorter day/night cycle #4

Closed matshou closed 4 years ago

matshou commented 4 years ago

The day/night cycle should be 6 hours long, split into four 11/2 hour blocks.

ghost commented 4 years ago

3 hr night/day time periods provides sufficient time to complete certain tasks.

ghost commented 4 years ago
Minecraft Time Real Time
1 second 0.25 seconds
1 minute 15 seconds
1 hour 15 minutes
1 day 6 hours
1 week 42 hours

Would you agree to reducing the time to a 4 hr day (real time)?; if so, below is a table listing those values.

(In this case each time block will simply be 1 rt hour.)

Minecraft Time Real Time
1 second 0.17 seconds
1 minute 10 seconds
1 hour 10 minutes
1 day 4 hours
1 week 28 hours
ghost commented 4 years ago

If for what ever reason the method that we use to extend the time messes with optifine/shaders; then we could use the following method (assuming 4hr rt day):

  1. After the first 0.83 seconds of the day (from 00:00), pause the time (e.g. set gamerule 'day/night cycle=true' to 'false').

  2. Then, wait 9.17 sec .

  3. Resume the time, then repeat 86,400 times over.

Explanation: In default Minecraft time (mt), 1 minute = 0.83 rt seconds;

We wait for that sun to move the default equivalent of 1 mt minute, then we pause the time and wait for our new mt minute to pass before resuming.

The sun won't move enough to notice in 0.83 seconds, so the pausing of time won't be an issue. The only issue that might arise is lag spikes from this activity; I'm quite unfamiliar, so I'm not sure.

matshou commented 4 years ago

Would you agree to reducing the time to a 4 hr day (real time)?

I am not sure, it would need to be play-tested to see what feels the best.

We wait for that sun to move the default equivalent of 1 mt minute, then we pause the time and wait for our new mt minute to pass before resuming.

The sun won't move enough to notice in 0.83 seconds, so the pausing of time won't be an issue. The only issue that might arise is lag spikes from this activity; I'm quite unfamiliar, so I'm not sure.

Performance is always a big concern when it comes to onTick events. I will take a look at the code and ask around in the community to see what are some good ideas on how to approach this, but I am confident we can avoid implementing a hacky solution such as that.

ghost commented 4 years ago

I've found five mods that change the length of the day/night cycle in some form. I've ordered them in their apparent usefulness/relevance to what we are trying to achieve. Compatibility is the greatest of my concerns regarding this.

https://www.curseforge.com/minecraft/mc-mods/extended-days https://www.curseforge.com/minecraft/mc-mods/opticmanager https://www.curseforge.com/minecraft/mc-mods/toomuchtime https://www.curseforge.com/minecraft/mc-mods/longer-days https://www.curseforge.com/minecraft/mc-mods/time-dilation

matshou commented 4 years ago

Thank you, I will take a look at them.

I will be developing this feature as part of a standalone library that users will have to download. This will allow others to use this functionality in their own mods without depending on our entire mod.

It will also drive some traffic to our mod as we can promote it on the lib CurseForge page.

matshou commented 4 years ago

This feature has been tested and works with my API. I just need to sort the API documentation and publish it on CurseForge, then I will push the code and create our first release.

matshou commented 4 years ago

Since I was having issues setting things up smoothly in the dev environment (even though I managed to get it working in the end) I decided to implement this feature without the API or library dependency that I originally planned to do. There was also fear that an external dependency might interfere with the mixin process and make it error-prone during MMD-Jam.

ghost commented 4 years ago

This is fine. ^