Sunrise/sunset times?

ArmA 2 editing; configs, modeling, missions, textures, terrain etc.

Moderators: Lone Wolf, Snake Man

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Sunrise/sunset times?

Post by T_Rex » 2009-09-08 13:07:46

Hey Snake Man,

I noticed from the .hpps for Chernarus and Utes that there is a whole section that seems to control brightness and such. However, there is no apparent link between those values and times for sunrise/sunset. I was wondering if these times are something controllable via config, or if they are hardcoded somehow.

Thanks for any insight!
T
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Sunrise/sunset times?

Post by Snake Man » 2009-09-08 14:54:46

The sunset/sunrise is hard coded... to realism. As you know BIS did the stars and stuff, also tide and sun works realistically.

This is configured in terrain config, you setup where in the world is your terrain located, lat/lon coordinates. My 51km desert terrain has these configured:

Code: Select all

class CfgWorlds
{
	class PMC_Desert_Hardcore: Sara
	{
		latitude = 29;
		longitude = 47;
Partial config to only show where they are located.

I remember when I did the PMC Rugen config, it was pissing me off as it became so "dark" terrain after setting the values to central europe... for example compared to old OFP islands. For example I recall something that while it was perfectly sunny day in Malden/Everon at 1630hrs, it was almost dark in my terrain. Heh.

Anyways, hope that helps.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Sunrise/sunset times?

Post by T_Rex » 2009-09-08 15:16:56

Ok, you've confirmed what I first thought.

However, the configs for Utes and Chernarus place the lat/long at -45/30, which I believe is New Zealand (the northern island).

The NZ sunrise/sunset times can be found here:
http://www.rasnz.org.nz/SRSStimes.htm

But, in some testing, those don't match up for Utes. In January, they are ok, but by March/April, they are noticeably off.

Quick test - according to the RASNZ, sunrise on May 1, 2009, was at 7:07am. In-game, it appears more like 6:00am. (I think.)
Sic Semper tyrannosauro.

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Sunrise/sunset times?

Post by T_Rex » 2009-09-09 13:12:50

BTW, I've done some more looking, and I think the sunrise/sunset times correlate more with the Baltics than New Zealand. :) About 60N 30E (which is really more St. Petersburg) seems to line up pretty well.

It may be a bit of an inside joke - Belarus/Chernarus. :D
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Sunrise/sunset times?

Post by Snake Man » 2009-09-09 13:22:13

Not sure what you're saying, but I don't think BIS has hardcoded any Chernarus settings for ArmA 2, I would bet that the same day cycle code is on ArmA engine too.

Please keep us updated if you do some more investigating for this.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Sunrise/sunset times?

Post by T_Rex » 2009-09-09 13:49:25

hehe

I'm not sure what I'm saying, either, really. :D

Well, I can tell you that from my basic testing, the long/lat values don't correspond to that long/lat SR/SS times.

I think the key is the config that seems to refer to the brightness/rgb values has additional data points. (Kinda reminds me of F4 flight model data.) :)

Code: Select all

   sunrise[] = {0,
    { 
     { 0.7,0.45,0.45 },"5.16+(-4)" },
    { 
     { 0.07,0.09,0.12 },"4.0+(-4)" },
    { 
     { 0.6,0.47,0.25 },"4.66+(-4)" },
    { 
     { 0.1,0.09,0.1 },"4.3+(-4)" },
    { 
     { 0.5,0.4,0.4 },"6.49+(-4)" },
    { 
     { 0.88,0.51,0.24 },"8.39+(-4)" },1};
There's 6 values (somehow related to the 12 months?) and I think the numbers before the (-4) represent some sort of baseline from which the sunrise time is derived. In my testing, the summer sunrise is as early as ~0400.

But, what's strange is there's no apparent sunset time? It is almost as if the values just swing from deep night to noon like a pendulum every day.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Sunrise/sunset times?

Post by Snake Man » 2009-09-09 15:02:33

What sort of tests have you done?

Like for example one location test on the equator, does the times match then? one test for north pole etc, then in between and so on.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Sunrise/sunset times?

Post by T_Rex » 2009-09-09 15:09:56

Nothing that extensive. :)

On Utes, I've figured out the SR/SS times for the whole year (mostly). (Utes and Chernarus have the same data.) Then tried to figure out where in the globe it corresponds to.

I'm not sure how to do the island-pbo-ing stuff to see if the long/lat stuff changes make a difference.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Sunrise/sunset times?

Post by Snake Man » 2009-09-09 16:30:08

Thats easy, here is quick rough untested version (really, untested, from top of my head).

Code: Select all

class CfgPatches
{
	class coordinate_test
	{
		units[] = {};
		weapons[] = {};
		worlds[] = {};
		requiredAddons[] = {};
		requiredVersion = 1;
	};
};

class CfgWorlds
{
	class CAWorld;
	class Chernarus : CAWorld
	{
<coordinates here>
};
};
Like said, very rough, dunno actually (out of top of my head) if that caworld thing worked, anyways you get the idea and can figure out rest yourself(?).
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Sunrise/sunset times?

Post by T_Rex » 2009-09-09 16:58:31

Ah, right!

That will overwrite whatever the existing cfg entries are?

Will try that - maybe over the weekend. :)
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Sunrise/sunset times?

Post by Snake Man » 2009-09-09 17:26:28

Yeah just type in there the new values and they are used. If you got any problems making the config, let me know and I'll do some tests and make sure it works and paste it here then.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Sunrise/sunset times?

Post by T_Rex » 2009-09-09 17:35:05

Just pbo that config (with the stuff I want to add) and put it in the \testing\addons folder, eh?

I may try that technique and fiddle with the values for the sun, too. :)
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Sunrise/sunset times?

Post by Snake Man » 2009-09-09 17:58:56

Yes any mod dir will do fine.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Who is online

Users browsing this forum: ClaudeBot [Bot] and 0 guests