Discussion:
Definition of moon phases (start date of NH full moon)
(too old to reply)
Janis Papanagnou
2022-11-07 17:24:31 UTC
Permalink
In Nethack the moon phases are quantified in eight phases, each
phase covering three or four days.

These days real full moon is around Tuesday, 2022-11-08, 12:00.
Having (in Nethack) a period of three days for full moon now my
expectation would be that the Nethack phase would start one day
before real full moon and end one day after real full moon.

(Note: I'm in a central EU time zone but the question is still
valid if we assume, say, UTC+6 or UTC-6.)

If I start NH-343 or Slashem now I don't get the "You're lucky"
full moon message.

Is Nethack's three-days lasting full moon _starting_ at real
full moon (and ending three day after real full moon), or am I
missing something?

Janis
Pat Rankin
2022-11-08 19:37:39 UTC
Permalink
Post by Janis Papanagnou
Is Nethack's three-days lasting full moon _starting_ at real
full moon (and ending three day after real full moon), or am I
missing something?
The relevant code is phase_of_the_moon() in hacklib.c.
Good luck making any sense out of it. I can't claim that
I comprehend it (aside from the pointless optimization
of '(X) & 7' instead of '(X) % 8' as the final step to yield
0..7 for the eight divisions of the month).

It uses integer arithmetic, making it more complicated
and conceivably introducing drift cause by accumulated
round-off error.
Janis Papanagnou
2022-11-08 21:08:36 UTC
Permalink
Post by Pat Rankin
Post by Janis Papanagnou
Is Nethack's three-days lasting full moon _starting_ at real
full moon (and ending three day after real full moon), or am I
missing something?
The relevant code is phase_of_the_moon() in hacklib.c.
Good luck making any sense out of it.
I already inspected that code some years ago. _Analytically_
I also cannot derive anything from that formula.

I had also used a Javascript transcription of that formula
for http://random.gridbug.de/moonphase.html and added a "-1"
correction factor for "Nethack mode" (a click on the header
text toggles modes).

_Empirically_ I did notice last midnight that Nethack claims
new moon _today_. So it *seems* that the day when new moon
is defined in Real Life will start Nethack's new moon phase.
Post by Pat Rankin
I can't claim that
I comprehend it (aside from the pointless optimization
of '(X) & 7' instead of '(X) % 8' as the final step to yield
0..7 for the eight divisions of the month).
I wouldn't even consider that an optimization; it was, maybe,
5 decades ago. :-)
Post by Pat Rankin
It uses integer arithmetic, making it more complicated
and conceivably introducing drift cause by accumulated
round-off error.
I assumed the formula to be correct and was just wondering
about the placement of the 3-4 days interval around the Real
Life new moon.

I also cannot tell anything about wobbling drifts (if any)
or other drifts.

Janis

Loading...