View Full Version : Moon Phases
Figger1
06-10-2019, 10:38 PM
According to actual moon phases, the phases of New Moon, First Quarter, Full Moon, and Last Quarter, they each last for only 1 day. But for probable reasons for werewolves and mushroom farming, you have changed those phases to last 3 days for each. So that makes each of the other phases last 4 days each: Waxing Crescent, Waxing Gibbous, Waning Crescent and Waning Gibbous. But it is good to know of these changes.
The delay from a moon phase of a cycle to the next is 27 days and a little less than 8h. Therefore, these duration must vary, or the game would quickly run out of sync. So, it's more complicated than that. :)
Citan
06-11-2019, 01:30 AM
We calculate the real-world New Moon and Full Moon dates, then make those three days long by starting one day before and ending one day after the real-world date. Then we divide all the remaining days between the other phases.
I've tried to calculate the in-game moon phases based on your explanation, but it looks like I'm still missing something.
If we apply it to this week, we have (all times are local EST):
New moon was Monday, June 3rd, 06:01
Full moon will be Monday, June 17th, 04:30
I assume the phase estimate is performed for time 00:00 of the day, so the "first" IRL day of new moon (when it's New Moon at 00:00) is June 4th, hence the days for New Moon were Monday, Tuesday and Wednesday (3rd to 5th).
Similarly, the "first" IRL day of Full Moon is Tuesday 18th, and therefore in-game Full Moon days will be from Monday 17th to Wednesday 19th.
This gives us from June 6th to 16th, included, for the other 3 phases. That's 11 days, so 3 2/3rd days = 3 days and 16 hours per phase. We then have:
Waxing Crescent Moon starts after New Moon and lasts 3 days 16 hours, so 4 days, from June 6th to 9th included.
First-Quarter Moon starts 3 days 16 hours after New Moon and lasts 3 days 16 hours, so from June 10th to 13th included.
Waxing Gibbous Moon starts 7 days 8 hours after New Moon and lasts until Full Moon, from June 14th to 16th.
Total 4 + 4 + 3 = 11 days as expected.
Except today is June 12th and the game is telling me this is Waxing Gibbous Moon, 4 more days to Full. What did I miss?
Citan
06-12-2019, 10:54 PM
I guess I'm mis-remembering it. Here are some illuminating comments from the code. It uses a public-domain bit of code I found (and can't find online anymore, the links are dead...) that "determines the fraction of the moon's disk that is illuminated at a given time", and also tells if the moon is waxing or waning, for a given Julian date. (Presumably at midnight, but I don't really know. The formula uses a bunch of hard-coded constants that only work at the date-level.) It's based on calculations by Jean Meeus, I think this book https://www.amazon.com/Astronomical-Algorithms-Jean-Meeus/dp/0943396611. I honestly don't understand any of the moon math. :)
Using that code, my code just divvies the dates up, assigning a moon phase to each date.
// we want the "full moon" to be EXACTLY 3 days. So we find the
// most full day, and declare that day to be full, as well as the day
// before and after it.
// We do the same for the "new moon" and the two quarter-moons, also exactly 3 days.
// the dates that don't have phases yet are the "leftover" phases.
// Their length varies between 3 and 5 days depending on the month
The "leftover" phases are WaxingCrescentMoon, WaxingGibbousMoon, WaningGibbousMoon, and WaningCrescentMoon.
Thank you for this most accurate explanation. I expect all calculations of main phases of the moon to give the same result, approximately. So it should be possible now to know every in-game phase of the moon in advance.
SausageJavelins
06-21-2019, 12:08 PM
Oh my gourd, I've been meaning to ask this but apparently I was beaten to the punch! I suspected certain phases were longer but could not determine the logic.
This will help immensely with the accuracy of my calculations. Thanks!
Figger1
07-01-2019, 06:14 PM
I never really looked at how the moon phases worked and science behind it. There is a 'Sidereal orbit' that is a complete 360 degrees around the earth which takes 27.322 days. There is also a 'Synodic Orbit' which is an orbit around the earth and have the moon between the earth and the sun to have a new moon, which takes 29.5 days. Since the earth is moving in an orbit around the sun, the moon has to orbit more than 360 degrees in order to have a new moon. So the Synodic orbit is the one used for the phases of the moon. A new moon is when the moon is perfect between the sun and earth and after about a month in time, the earth is in a different angle/position to the sun, so the moon must travel a little further to be perfectly between the sun and earth.
Lyramis
07-01-2019, 09:17 PM
For those of you who don't care about calculations, this calendar follows in-game moon cycles exactly. I've been using it for over a year and have never grown the wrong mushrooms!
https://www.calendar-12.com/moon_calendar/2019/july
This month, however, is a little odd with the 4 days of full moon on the calendar. P:G will have waning gibbous on the 18th, not another full moon.
I've updated my Windows app (https://github.com/dlebansais/PgMoon/releases) to follow this algorithm more closely. It's still not perfect, unfortunately, but I gave my best shot.
Madmatx
08-10-2019, 10:03 AM
When mushroom farming I just looked here (https://www.moongiant.com/calendar/) and accounted for the day before and after the main 4 phases and have never had a problem.
*** Oh if you click on a day it shows you if it's waxing or waning crescent or gibbous.
I guess I'm mis-remembering it. Here are some illuminating comments from the code. It uses a public-domain bit of code I found (and can't find online anymore, the links are dead...) that "determines the fraction of the moon's disk that is illuminated at a given time", and also tells if the moon is waxing or waning, for a given Julian date. (Presumably at midnight, but I don't really know. The formula uses a bunch of hard-coded constants that only work at the date-level.) It's based on calculations by Jean Meeus, I think this book https://www.amazon.com/Astronomical-Algorithms-Jean-Meeus/dp/0943396611. I honestly don't understand any of the moon math. :)
Using that code, my code just divvies the dates up, assigning a moon phase to each date.
// we want the "full moon" to be EXACTLY 3 days. So we find the
// most full day, and declare that day to be full, as well as the day
// before and after it.
// We do the same for the "new moon" and the two quarter-moons, also exactly 3 days.
// the dates that don't have phases yet are the "leftover" phases.
// Their length varies between 3 and 5 days depending on the month
The "leftover" phases are WaxingCrescentMoon, WaxingGibbousMoon, WaningGibbousMoon, and WaningCrescentMoon.
Is there any chance you'd consider wrapping that in a leap-year-aware date range loop and post the results for the next several years as a text file? Then we have an authoritative, simple answer, and all you have to do is never ever change any code that might affect it ever again, forever? What could go wrong?
Daguin
08-16-2019, 02:54 PM
I've updated my Windows app (https://github.com/dlebansais/PgMoon/releases) to follow this algorithm more closely. It's still not perfect, unfortunately, by I gave my best shot.
Thanks for continuing support with new versions. :cool:
SausageJavelins
08-17-2019, 09:13 AM
Thanks for continuing support with new versions. :cool:
I will update mine soon as well. Right now box timers are the focus but proper phase calculation is next.
You all can use Niph's app for phase calculation in the meantime!
alleryn
09-30-2020, 06:43 AM
This has a chart of the moon phase dates for a hundred years: http://astropixels.com/ephemeris/moon/phases2001gmt.html
Then it's +/- 1 day around the full/new/first q/last q, and fill inbetween. Thinking about adding this to the wiki. (Would just need to do the data entry for the dates each month and a bit of #expr (https://forum.projectgorgon.com/usertag.php?do=list&action=hash&hash=expr) (math and syntax)).
Here also is some general info on why the synodic month varies (so why a simple "Seconds elapsed since some fixed time / Period of synodic month" model isn't sufficient): http://astropixels.com/ephemeris/moon/synodicmonth2001.html
Edit:
Proof of concept at
http://wiki.projectgorgon.com/wiki/User:Alleryn/Sandbox/MoonPhase
This should chart the PG moon phases for today and the next 3 days, until the next full moon on Oct. 31, 2020.
Powered by vBulletin® Version 4.2.3 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.