Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2   Go Down

Author Topic: Some discoveries related to maps  (Read 922 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5617
Some discoveries related to maps
« on: February 16, 2023, 01:07:21 AM »

The following applies in cases where a mission file does not specify a temperature, using by default the load.ini temperature value. Exactly how this might apply for missions where a temperature is specified has not been investigated.


In my BAT 4.0 game there is a folder named DEF-SKIES_#WAW3, containing map folders with the load.ini files. Fourteen of these load.ini's--a small fraction of the total--have a CLIMATE field in the WORLDPOS section. As an example:

[WORLDPOS]
CAMOUFLAGE = DESERT
MONTH=7
DECLIN = 24
PRESSURE    = 745
TEMPERATURE = 33
Climate = Arid


In looking over Atmosphere.class, I see 8 defined climate zones, with their own temperature offsets based on the month and time of day. If no CLIMATE entry exists in the load.ini, a 'default' set of offsets is used ("unspecified" in the list below, making for a 9th zone, in effect). If the map is in the southern hemisphere, the seasonal variation is effectively inverted by offsetting the month by 6.


There is an additional latitude based seasonal factor, applied linearly by latitude, with unity occurring at latitude 30. That is, on the equator there is no seasonal variation, at 30 degrees it's as set in the 'look-up table', at 60 degrees it's 2X the specified values, and at 90 degrees it's tripled.


For any map's load.ini, the temperature as set there is taken as the hottest sea level daytime temp typically in the 5th month. From this fiducial the actual sea level temp is calculated based on the month and time of day set in the mission.


Following is a list of the climate zones, and their seasonal and ToD temp ranges, as defined in Atmosphere.class.

Name: seasonal variation: diurnal variation

HumidSubtropical:  +8 to -10 [range = 18]:  0 to -12
Subtropics:  +4 to -5 [range = 9]:  0 to -12
TropicalRainforest:  0 to -3 [range = 3]:  0 to -9
TropicalSavannah:  +2 to -6 [range = 8]:  0 to -10
HumidContinental:  +7 to -13 [range = 20]:  0 to -10
Mediterranean:  +5 to -10 [range = 15]:  0 to -10
Subarctic:  +6.5 to -20 [range = 26.5]:  0 to -13
Arid:  +2 to -14 [range = 16]:  0 to -28
(unspecified):  +6 to -14 [range = 20]:  0 to -9


Any map having a DECLIN of <30 obviously does not make use of the seasonal variations, for the code nulls this to zero. But the diurnal variation does apply.

The very large diurnal range for "Arid" is due to the dry air cooling significantly under a clear night sky. Hot deserts can get to just about freezing.

A missing CLIMATE entry in load.ini uses values quite similar to the HumidContinental condition.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5617
Re: Some discoveries related to maps
« Reply #1 on: February 16, 2023, 01:32:45 AM »

I fixed an error in stating how the latitude variation is applied. I wrote that it was quantized to zero, unity, 2X and 3X, based on the latitude intervals of 30 degrees. The code actually applies the latitude scaling linearly, with no such coarse quantizing. Although the temp offset so derived is 'integerized' down to the nearest whole degree.  ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Dimlee

  • member
  • Offline Offline
  • Posts: 1000
Re: Some discoveries related to maps
« Reply #2 on: February 18, 2023, 01:49:58 PM »

There is no difference between the temperatures over the sea and over the land on the same map, or is there? In real life 5 to 15 degrees (C) difference at the sea level is common.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5617
Re: Some discoveries related to maps
« Reply #3 on: February 18, 2023, 03:26:12 PM »

I see nothing to indicate any difference would be established in air temperature over water versus over land.

This would be tricky to implement, because the temperature profile through the game atmosphere is established for all places everywhere in one calculation run, and to apply to all aircraft. (I've not determined how often this is updated, if at all after the first setting up.) Unlike as for, say, turbulence, which is continuously calculated for every plane individually.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Dimlee

  • member
  • Offline Offline
  • Posts: 1000
Re: Some discoveries related to maps
« Reply #4 on: February 20, 2023, 12:57:02 PM »

I see nothing to indicate any difference would be established in air temperature over water versus over land.

This would be tricky to implement, because the temperature profile through the game atmosphere is established for all places everywhere in one calculation run, and to apply to all aircraft. (I've not determined how often this is updated, if at all after the first setting up.) Unlike as for, say, turbulence, which is continuously calculated for every plane individually.

Noted, thanks. So, no chance to cool our engines just by escaping to the ocean...  :-X
Logged

fatty_finn

  • Modder
  • member
  • Offline Offline
  • Posts: 207
  • "no idea"
Re: Some discoveries related to maps
« Reply #5 on: February 28, 2023, 05:14:32 PM »

Thanks for this, WxTech.
Such information is meat & drink to me!
With regard to declination:
Living in the southern hemisphere, I have wondered:
does DEC differentiate, say, 35 north from 35 south?  e.g. to make January the hottest month instead of the coldest?
And to shift the paths of the sun & moon?
yours
f_f
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5617
Re: Some discoveries related to maps
« Reply #6 on: February 28, 2023, 05:34:33 PM »

Fatty,
Indeed, for negative DECLIN, meaning the southern hemisphere, the seasonal temperature variation is shifted appropriately. And the Sun and Moon paths are nominally tilted accordingly.

Now, I just wrote "nominally" because I've encountered some southern maps where the Sun did NOT behave properly. It's very weird, because some other southern maps--at least within the tropics--do behave correctly. I've not done a close analysis to determine why this should be so. At some point I want to nail this down.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5617
Re: Some discoveries related to maps
« Reply #7 on: February 28, 2023, 05:44:37 PM »

An annoying error I've ranted about in the past is this: The Sun is out of phase by a month! If you set, say, the month as 5 (May), the Sun's position is as for month 6 (June.) There are so many places where the date is handled among a number of classes that it gets brutal trying to rectify the whole goddamned mess.

It matters little at lower latitudes, where the length of day/night and the duration of twilight varies but little through the year. But at middle latitudes and higher the seasonal variation becomes quite pronounced, and the one month shift can make a big difference. At least for historical scenarios.

If I were a real programmer, with proper development tools, I would be able to chase this down. But I'm just a Java chimp.

And no one else is in the least interested in joining in fixing this.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Radoye

  • member
  • Offline Offline
  • Posts: 677
Re: Some discoveries related to maps
« Reply #8 on: February 28, 2023, 06:55:46 PM »

An annoying error I've ranted about in the past is this: The Sun is out of phase by a month! If you set, say, the month as 5 (May), the Sun's position is as for month 6 (June.)

Could it be that the calculations start from 0 rather than 1 as one would expect?
Logged
I'm an island, surrounded by a sea of idiots!

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5617
Re: Some discoveries related to maps
« Reply #9 on: February 28, 2023, 08:21:46 PM »

The 0 and 1 business is part of it. But it's not uniformly buggered, and the multifarious interconnections between the month variables scattered about through a number of classes make for a headache for me to keep track of as they propagate.

A couple years ago I did obtain a partial fix that was OK for quick missions. But there were remaining issues that needed dealing with in order for the date to be correct in all instances.

Below is the result of a search for "month" among all classes. The crucial classes are:

PlMission.class
EffClouds.class
LandConf.class
Landscape.class
Mission.class
GUIBriefingGeneric.class

And relying on the correct date is Sun.class and Atmosphere.class


Search "month" (78 hits in 10 files)
com\maddox\il2\builder\PlMission.java (31 hits)
   Line 1352:             gwindowdialogclient.addLabel(new GWindowLabel(gwindowdialogclient, 1.0F, 5F, f - 1.0F, 1.3F, Plugin.i18n("Month"), null));
   Line 1353:             gwindowdialogclient.addControl(wMonth = new GWindowComboControl(gwindowdialogclient, f, 5F, 5F) {
   Line 1358:                         getMonth();
   Line 1379:             wMonth.setEditable(false);
   Line 1380:             wMonth.hideList();
   Line 1381:             wMonth.list = new ArrayList(Arrays.asList(_monthKey));
   Line 1381:             wMonth.list = new ArrayList(Arrays.asList(_monthKey));
   Line 1451:                 wMonth.setSelected(month - 1, true, false);
   Line 1451:                 wMonth.setSelected(month - 1, true, false);
   Line 1599:         public void getMonth()
   Line 1601:             month = Integer.parseInt(wMonth.getValue());
   Line 1601:             month = Integer.parseInt(wMonth.getValue());
   Line 1602:             if(month != Mission.curMonth())
   Line 1602:             if(month != Mission.curMonth())
   Line 1604:                 Mission.setMonth(month);
   Line 1604:                 Mission.setMonth(month);
   Line 1605:                 World.land().setMonth(month);
   Line 1605:                 World.land().setMonth(month);
   Line 1681:         GWindowComboControl wMonth;
   Line 1828:         month = sectfile.get("SEASON", "Month", World.land().config.month, 1, 12);
   Line 1828:         month = sectfile.get("SEASON", "Month", World.land().config.month, 1, 12);
   Line 1828:         month = sectfile.get("SEASON", "Month", World.land().config.month, 1, 12);
   Line 1830:         Mission.setDate(year, month, day);
   Line 1831:         World.land().setMonth(month);
   Line 1831:         World.land().setMonth(month);
   Line 1909:         sectfile.lineAdd(j, "Month", "" + month);
   Line 1909:         sectfile.lineAdd(j, "Month", "" + month);
   Line 2649:         month = World.land().config.month;
   Line 2649:         month = World.land().config.month;
   Line 2977:     private int month;
   Line 2991:     private String _monthKey[] = {
com\maddox\il2\engine\Config.java (1 hit)
   Line 691:     public static final int EXPIRED_MONTH = 11;
com\maddox\il2\engine\EffClouds.java (1 hit)
   Line 61:         int j = Engine.land().config.month;
com\maddox\il2\engine\LandConf.java (6 hits)
   Line 22:         month = 6;
   Line 28:     public int getDefaultMonth(String s)
   Line 31:         return inifile.get("WORLDPOS", "MONTH", 6);
   Line 49:         month = inifile.get("WORLDPOS", "MONTH", 6);
   Line 49:         month = inifile.get("WORLDPOS", "MONTH", 6);
   Line 109:     public int month;
com\maddox\il2\engine\Landscape.java (11 hits)
   Line 43:     public void setMonth(int i)
   Line 45:         month = i;
   Line 476:             LoadMap(MapName, null, false, month, day);
   Line 484:         LoadMap(s, ai, flag, config.month, 15);
   Line 490:         month = i;
   Line 505:         World.Sun().setAstronomic(config.declin, month, day, World.getTimeofDay(), 0.0F);
   Line 507:             setAstronomic(config.declin, month, day, World.getTimeofDay(), World.Sun().moonPhase);
   Line 531:         float f1 = (float)Math.toRadians((config.month * 30 + 15) - 80);
   Line 562:             sun.setAstronomic(config.declin, month, day, World.getTimeofDay(), f);
   Line 563:             setAstronomic(config.declin, month, day, World.getTimeofDay(), sun.moonPhase);
   Line 799:     private int month;
com\maddox\il2\engine\MoonPhase.java (1 hit)
   Line 197:     private static final double SYN_MONTH = 29.530588680000001D;
com\maddox\il2\fm\AircraftState.java (1 hit)
   Line 1789:         int j = Mission.curMonth();
com\maddox\il2\fm\Atmosphere.java (12 hits)
   Line 61:         int i = Engine.land().config.month;
   Line 111:             i = Mission.curMonth();
   Line 294:             i = Mission.curMonth();
   Line 469:             i = Mission.curMonth();
   Line 648:             i = Mission.curMonth();
   Line 835:             i = Mission.curMonth();
   Line 1018:             i = Mission.curMonth();
   Line 1197:             i = Mission.curMonth();
   Line 1384:             i = Mission.curMonth();
   Line 1574:             i = Mission.curMonth();
   Line 1720:         System.out.println("Month = " + Mission.curMonth() + " , Hour = " + (int)Math.floor(World.getTimeofDay()));
   Line 1720:         System.out.println("Month = " + Mission.curMonth() + " , Hour = " + (int)Math.floor(World.getTimeofDay()));
com\maddox\il2\game\Mission.java (13 hits)
   Line 482:     public static int curMonth()
   Line 484:         return curMonth;
   Line 495:         curMonth = 0;
   Line 999:         int i1 = sectfile.get("SEASON", "Month", World.land().config.getDefaultMonth("maps/" + s), 1, 12);
   Line 999:         int i1 = sectfile.get("SEASON", "Month", World.land().config.getDefaultMonth("maps/" + s), 1, 12);
   Line 1101:         setMonth(j);
   Line 1114:     public static void setMonth(int i)
   Line 1120:         curMonth = i;
   Line 3608:         int k = curMonth();
   Line 3617:             int l1 = World.land().config.getDefaultMonth("maps/" + s);
   Line 3619:             int l = sectfile.get("SEASON", "Month", l1, 1, 12);
   Line 3632:             int i2 = World.land().config.getDefaultMonth("maps/" + s1);
   Line 3673:     private static int curMonth = 0;
com\maddox\il2\gui\GUIBriefingGeneric.java (1 hit)
   Line 2037:             Main.cur().currentMissionFile.lineAdd(i1, "Month", "" + k);
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

fatty_finn

  • Modder
  • member
  • Offline Offline
  • Posts: 207
  • "no idea"
Re: Some discoveries related to maps
« Reply #10 on: May 12, 2023, 03:28:49 AM »

WxTech:
thanks for your reply re southern hemisphere maps. 
I note you mention Lat 30 deg as a dividing line, of sorts.
I made a map [Tasman Sea] that goes from ~29 deg S  to  ~35 deg S.  I wonder how that would pan out?? Cant recall that I've checked it, at both extremes.

You may be a "java chimp" but your efforts on this topic are heroic ! keep up the great work!
yours
f_f
ps I'd offer to help out, but I'm a java aardvark!
Logged

vonofterdingen

  • Missioneer
  • member
  • Offline Offline
  • Posts: 1269
Re: Some discoveries related to maps
« Reply #11 on: May 12, 2023, 08:25:51 AM »

As far as I know there is no FMB field for entry of ambient temperature for a mission. Can we set temperature in mission files and if so how?
Logged
Pages: [1] 2   Go Up
 

Page created in 0.077 seconds with 24 queries.