Stellar View

Stellar View

1M Downloads

[BUG] Moon phase unaligned with position in sky

Noobly-Walker opened this issue · 6 comments

commented

Pretty sure it should be a new moon here, not gibbous.
image

commented

I think I have an idea as to what could be the issue with the moon phases.

The assumption is that the moon orbits the earth every 8 days, with one phase per day.
image

However, the assumption is incorrect. It takes 8 days for the moon to go through a full cycle of phases. Assume for a moment, that on Day 0, 0° of the moon's orbit is "up", and the moon is in the correct phase for being at 0°. 8 days later, it will be back at 0°, as the moon's "year" is defined as being 8 days. But, the earth has moved. Earth is no longer at 0°, and is now at 30°. Thus, the moon is no longer in the correct phase for the angle it is in. Every orbit, the moon's phase grows more and more out of sync with its orbit.
image

The moon needs to be moving a bit faster than it currently is. I also recommend redefining Earth's year to be 13 of the moon's phase cycles (lunar year).
360 / (360/lengthOfPhaseCycle + Earth.angularVelocity) = Luna.angularVelocity
360 / (360 / 8 + 360 / 104) ≈ 7.4286

commented

i suppose my fix doesn't address other moons having phases, but the phases of Europa, Ganymede, Callisto, Io, and Titan aren't as important and noticeable as Luna, at least to me. There was an attempt to rotate Luna as well, so the lit side of it faces Sol, but giving Luna a rotation of 90° didn't seem to do anything.

commented

There are, on average, 12.37 full moons per year, so a year should be 99 days, not 96 or 104.

commented

Aw man, where did it go wrong this time?

commented

I recommend a complete phase overhaul. Move hasPhases() onto Planet instead of Moon.
Currently, everything that has a phase has the same phase, regardless of where it is in relation to Sol and Earth. This should be rectified.
Mercury, Venus, and Luna should be the only ones to have a full set of phases, appearing "full" when passing behind Sol, and "new" when in front of Sol.
Mars might perhaps appear "gibbous" or perhaps even "quarter", but never more than that. It is further from Sol than Earth, so we always see at least part of the Sol-facing part of the planet.
Jupiter, Saturn, Uranus, Neptune, and their moons would likely be full almost always. Saturn and Uranus may still have "phases", but saturn_phases.png and uranus_phases.png would just have the rings being viewed from different angles.

commented

That's cool 'n all, but there's still the fact that Moon phases change Minecraft mechanics, so I shouldn't just leave that out.

Well I guess I could leave Overworld moon as an exception and figure out what's wrong with it separately, while using your suggestion for the rest of things.