Feature #32153

ArmA2 Moon phases should be in sync with real world Moon phases

Added by dead about 3 years ago. Updated about 2 years ago.

Status:Assigned Start date:05/29/2012
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Game physics
Target version:-
Affected ArmA II version:1.60.87580 First affected ArmA II version:
Reproduced by another DH user:No Single / Multi Player?:Both
I am using some Mods:No BIForumURL:
I am using:CO (OA+A2) NGUrl:
Reproducible for you:No WIKIurl:
Related to content of DLC:

Description

Obs:
The moon's phases are different to the real world. In 2008 it's out by about 5 days at least, in 1944 it's out by about 10 days at least.

Happens in ArmA 2 CO 1.60.87580 with PMC & BAF running. And with betas up to and including 93160.
This bug may be older than that, but I didn't notice it until 1.60.87580.

Also in Iron Front Liberation 1944 version 1.60.0000. So it looks like an engine problem rather than a mod thing.

Repro:
  1. Open mission Editor in Utes (or wherever).
  2. Set date to Oct 14th 2008 (this is the nearest date of a full moon from the default date) and time to 23:20 (should see the moon in the sky by then).
  3. Set weather to clear.
  4. Place player unit.
  5. Preview mission — look at the moon, it's only about half full.
  6. Set date to Oct 9th 2008, Preview the mission. The moon is full.

This can also be done in the invasion '44 mod/IronFront by setting it to 6th June 1944. No full moon. Set to 15th June, and the moon is full in both.

Exp:
The moon's phases should be on the same dates as the real thing. Timing of moon rise/set may differ according to timezones/geography, but the moon is full at the same moment everywhere on Earth.

Date & Universal time of moon phases 2001-2025:
http://eclipse.gsfc.nasa.gov/phase/phase2001gmt.html

2008 Oct 14 20:03

Date & Universal time of moon phases 1901-2000:
http://eclipse.gsfc.nasa.gov/phase/phases1901.html

1944 Jun 6 18:58

Notes:
The disparity gets worse in invasion 44 mod and Iron Front Liberation. D-Day would have kicked off on the night of the 15th of June 1944 in the current Armaverse.


Related issues

related to ARMA2 Community Issue Tracker - Feature #26940: New script command: moonphase Assigned 12/08/2011
related to ARMA2 Community Issue Tracker - Feature #26941: new commands: sunrise, sunset Assigned 12/08/2011

History

Updated by Qazdar about 3 years ago

Well,you really need to be very curious to notice that :D

Just for fun,this ticket reminds me of "remove rabbits from takistan" :D

Updated by dead about 3 years ago

Hehe, Yeah -- I know this is seriously obsessive compulsive disorder of me, and I should probably get out more often. ;)
To be honest, the only reason I noticed this was because I wanted to do a D-Day airborne scenario, and there was no full moon on the 5th-6th of June 1944, so it was way too dark to fight. That set me off on an ArmA and wikipedia journey of discovery... leading to this post.

It's the nit-pickiest glitch ever, I'm sure, but I figure they obviously put a lot of work in to getting the moon to have phases at all, so it seems a bit of a waste of all that effort to not have them match up to the real thing. And as they're now working on ArmA 3, someone should tell them it's broken, so they can fix it, if they've got time and it's not too tricky.

I'm glad to say I'm not the first to notice — ruebe spotted it before me — and this code (from ruebe's own RUBE library, called fn_moonphase.sqf) might help the devs:

/*
   Author:
    r¸be

   Description:
    calculates the moonphase on a given date, valid for 20th and 21th
    centuries, so perfect for our useage...
    based on:

     some Basic code by Roger W. Sinnot from Sky & Telescope magazine, 
     March 1985

     (see http://www.ben-daglish.net/moon.shtml)

    -> well, this does not correlate with ingame moonphases :(
       bleahhh :/

   Parameter(s):
    _this: date (array [year, month, day, ...] or as returned by `date`)

   Returns:
    integer 

    returns the phase day; 0 to 29, where 
      0 = new moon, 
     15 = full moon
*/

private ["_year", "_month", "_day"];

_year = _this select 0;
_month = _this select 1;
_day = _this select 2;

private ["_julianDayNumber"];

// [year, month, day] => julian day number
//  (TODO: make global function once used elsewhere!)
_julianDayNumber = {
   private [
      "_year", "_month", "_day",
      "_jy", "_jm", "_ja", "_jul" 
   ];
   _year = _this select 0;
   _month = _this select 1;
   _day = _this select 2;

   if (_year < 0) then { _year = _year + 1; };

   _jy = _year;
   _jm = _month + 1;

   if (_month <= 2) then
   {
      _jy = _jy - 1;
      _jm = _jm + 12;
   };

   _jul = (floor (365.25 * _jy)) + (floor (30.6001 * _jm)) + _day + 1720995;

   if (_day + (31 * (_month + (12 * _year))) >= (15+31*(10+12*1582))) then
   {
      _ja = floor (0.01 * _jy);
      _jul = _jul + 2 - _ja + (floor (0.25 * _ja));
   };

   _jul
};

private ["_n", "_t", "_t2", "_as", "_am", "_xtra", "_i", "_j1", "_jd", "_armaErr"];

_n = floor (12.37 * (_year - 1900 + ((1.0 * _month - 0.5)/12)));
_t = _n / 1236.85;
_t2 = _t * _t;
_as = 359.2242 + 29.105356 * _n;
_am = 306.0253 + 385.816918 * _n + 0.010730 * _t2;
_xtra = 0.75933 + 1.53058868 * _n + ((0.0001178) - (0.000000155) * _t) * _t2;
_xtra = _xtra + (0.1734 - 0.000393 * _t) * (sin  _as) - 0.4068 * (sin _am);

_i = 0;
if (_xtra > 0) then
{
   _i = floor _xtra;
} else
{
   _i = ceil (_xtra - 1);
};

_armaErr = 0;//6;

_j1 = [_year, _month, _day] call _julianDayNumber;
_jd = (2415020 + 28 * _n) + _i;

((_j1 - _jd + 30 + _armaErr) % 30)

Updated by ruebe about 3 years ago

Also see (and vote for):
Feature #26940: New script command: moonphase

...and maybe also:
Feature #26941: new commands: sunrise, sunset

As long as there would be a native command returning the moonphase,
it wouldn't matter too much if it doesn't correlate to the real world
moonphase.

On the other hand, a correct model would be certainly preferred.

Updated by Fireball about 3 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from ArmA2 Moon phases are out of phase with real world Moon phases to ArmA2 Moon phases should be in sync with real world Moon phases
  • Description updated (diff)
  • Status changed from New to Assigned

Yeah, to be honest, I'm not sure if real life moon phases pacing was even intended in first place. Without any base of decision, I assume it's never meant to be in sync, and will turn this into a feature ticket.

Also available in: Atom PDF