Adding Weather to Missions - Part 1

Discussion regarding mapping and missions in here - we are talking FMB chaps. Perhaps you are building a mission for the server or for campaign? Talk to the experts - we always need people willing to muck in so don't be shy!

Moderators: Board of Directors, Command

User avatar
Bonkin
Posts: 2143
Joined: Sat Sep 08, 2012 6:47 pm
Location: East Yorkshire, England

Adding Weather to Missions - Part 1

Post by Bonkin » Wed Jul 26, 2017 12:19 am

Introduction
I’ve read a few comments about not being able to put weather into missions using the FMB and thought it was time I corrected a few of the preconceptions. Contrary to what some people may think, CoD does indeed have weather - and with some care this can be added into our missions. The truth of the matter is however that there are some bugs, complexities and limitations – so I figured it was nigh time to document what I’ve learnt in order that our mission makers can add some better weather into our campaign missions – and make aerial combat more of a challenge.

First off, for the disbelievers – some examples of clouds in game. This first one is a server test which was run in November last year. It involves different cloud formations and of varying thicknesses – and we had upwards of 30 people in the server if I recall correctly:


This one was during test – just me on my own.


And this was another on test on my own – with big thunder clouds:


Seen “The Struggle”? This was filmed “live” by a number of different players because a bug in the game won’t show big fluffy clouds on track replay. This next video was an early WIP version of that film (featuring a number of different scenes which ended up on the cutting room floor) – but it illustrates what can be done on the Server. Again, we had a lot of players in for this – and AI bombers as well. Note the clouds – especially when the Hurricanes are attacking the He111’s and the black smoke against the clouds:


Lastly, there was the “Big Navigation Challenge” event. In case you missed it, I included a full weather briefing with charts, AIRMET and METAR. See this post:
http://www.aircombatgroup.co.uk/forum/v ... f=5&t=7898

So, now that I’ve shown it can be done (without crashing the server) we’ll get into the detail of how. Firstly though, a summary of what can/can’t be done in the current v4.312 version of Cliffs of Dover:

What can be changed (safely):
1. Global (e.g. across the whole map) wind direction and strength.
2. Wind layers
3. Cloud position, height, amount (1-8 Octas) and density

What can be changed (with some issues, i.e. not recommended for campaign):
1. Cloud type and thickness

What can’t be changed:
1. Visibility
2. Temperature & Pressure
3. Precipitation
4. Overlapping cloud layers
5. Gusts/Wind Shear

Global Weather & Winds
The game engine measures heights (Z axis) from sea level and I believe it is using an atmospheric model based on ISA. If for example I calibrate the altimeter millibar setting to 1013 whilst on the ground the altimeter will always show the height of the airfield AMSL.

Rule No.1: Except for Wind, don’t try and use the FMB to edit weather. Add it to your mission file using a text editor like Notepad.

Wind will show up in the FMB but the editor is buggy (in the current version), and limits what you can do. If you choose Mission Parameters off of the View menu you can edit the wind. For this though, I’ll go through the sections of a typical mission .mis file to show what can be edited. So, starting from the top…

The first part of the mission file typically looks like this:

Code: Select all

[MAIN]
  MAP Land$English_Channel_1940
  BattleArea 8500 8500 350000 300000 10000
  TIME 12
  Army 0 nn
  Army 1 gb
  Army 2 de
  WeatherIndex 2
  CloudsHeight 1400
  BreezeActivity 2
  ThermalActivity 2
The weather settings here are the generic ones for across the whole map. The WeatherIndex can have values 0, 1 or 2, where 0 = Clear, 1 = Light Clouds, 2= Medium Clouds. The CloudsHeight parameter seems to relate to the base height of the clouds in meters and I believe is limited to between 500m and 1500m, e.g. changing it outside of these limits seems to have no effect. BreezeActivity and ThermalActivity do not seem to be implemented - certainly with the testing I’ve done anyway. They are an index between 0 and 10 – and should both be left untouched.

Straight after this section you can add any number of wind layers or “flows”. For the Navigation Challenge I set the following:

Code: Select all

[GlobalWind_0]
  Power 1.500 2.598 0.000
  BottomBound 0.00
  TopBound 2100.00
  GustPower 2
  GustAngle 0
[GlobalWind_1]
  Power 3.536 3.536 0.000
  BottomBound 2050.00
  TopBound 2900.00
  GustPower 5
  GustAngle 0
[GlobalWind_2]
  Power 5.657 5.657 0.000
  BottomBound 2850.00
  TopBound 9000.00
  GustPower 5
  GustAngle 0
Note the indexes (e.g. _1, _2 etc. this is zero based and they must be unique). I haven’t tested putting them in different orders (of height) – so for safe measures I would start from the ground up with GlobalWind_0 and then use GlobalWind_1 for the next band and so on.

A bug in the game means that even low winds (>5ms/s) can cause aircraft on the ground to weather cock into the wind. Players will have to be aware of this and put chocks in as soon as they spawn in. This can cause issues even with taxiing – but I’ve tested up to 6m/s and 90 degrees off of runway centreline and it has generally been fine but may take a bit of getting used to. Hopefully this will be fixed in future releases but for now it is recommended to keep winds low at ground level – but have a new wind layer about 10m above the highest airfield in use on the map – which you can derive from the status bar at the bottom of the FMB when you move your mouse cursor over a point, e.g. it gives you X, Y and Z (height) in meters.

Rule No.2: Keep winds at airfield level at or below a strength of 5m/s.

The Power parameter has three attributes – which are the X, Y and Z speeds in m/s. Z is always set to zero because oddly it is implemented – which means positive values will result in aircraft floating upwards like they are feathers.

Wind appears weird in Cliffs but this is only because it is implemented in the way it is applied in the code. In the FMB it is entered as where the wind is blowing TO – and if you think of a clock, the 3 O’clock position is the zero datum. From that point, travelling anti-clockwise is positive to the 9 O’clock position e.g. 0 to +180 degrees, whereas travelling clockwise is negative, e.g. 0 to -180 degrees.

In practice, when editing the mission file it is simple vectors and trigonometry. So if I want a 10kt SE wind that would be 10kt blowing to 315 degrees. This translates to a vector with magnitude of 5m/s, described by X = -3.536 and Y = +3.536, (when using Pythagoras).

For simplicity:
1kt = 0.5144m/s so…
A 5kt wind is 2.5m/s
A 10kt wind is 5m/s
A 15kt wind is 7.7m/s
A 20kt wind is 10.2m/s

Example:
Image

Looking at the other parameters, the BottomBound parameter is the base height in meters for the wind layer and the TopBound parameter is the ceiling height in meters for the wind layer. The BottomBound for the “next” wind layer must be 1m below the TopBound of the “previous” wind layer. Note, the FMB applies a 50m difference for some reason. The important thing to note is that if you omit to put this “overlap” in the higher wind layer won’t work. When flying in the game, it is possible to detect the transition between wind layers because the aircraft will have a little twitch.

The GustAngle parameter can be a value between -45 and +45 degrees. It does not appear to be implemented in v4.312.

The GustPower parameter also does not appear to be implemented in v4.312.

Example:
Here are the heights of popular RAF and Luftwaffe airfields:

Code: Select all

Audembert         42m
Biggin Hill      179m
Caffiers         112m
Calais Marck       2m
Canterbury        51m
Coquelles         13m
Croydon          101m
Eastchurch         7m
Gravesend         62m
Hawkinge         158m
Hydrequent        78m
Kenley           174m
Lympne           100m
Manston           44m
Marquise West     24m
Oye-Plage          2m
Pihen             96m
Rochester        130m
Saint-Inglevert  129m
Wissant           21m
If in our mission we had Biggin Hill, Kenley, Coquelles and Marquise West in use, the highest airfield would be Biggin with a height of 179m. If we want some strong low-level winds, to avoid the weather cocking bug [GlobalWind_0] should have a BottomBound of 0.00 and a TopBound of 189m (179 + 10). The Strength (Power) should be 5m/s or less. [GlobalWind_1] would have a BottomBound of 188m and whatever TopBound we wanted.

If you think there’s not much point adding winds, think again. Watch this next clip of wind effects and then imagine how much harder it is going to be to shoot that enemy down – and for Ground Controllers to get the RAF where they need to be. Note, I filmed this whilst testing for the Navigation Challenge. Things to look out for are the speed of the cloud shadows across the ground and the speed of the aircraft against the clouds/ground when its track changes with respect to the wind direction.



That could be enough for some simple changes to campaign missions – but we can also add cloud layers either up high or right down at ground level if we want. I’ll cover this in part 2.
Image

User avatar
Ginger
Wing Commander
Wing Commander
ACG Board
contributor
Posts: 3679
Joined: Tue Sep 01, 2015 9:43 pm
Location: The centre of the known universe Nottingham, England

Re: Adding Weather to Missions - Part 1

Post by Ginger » Wed Jul 26, 2017 7:42 am

:salute: Cracking Bonkin,and thanks for working it all out. When I get back to the Pc I will have a go.
Image
DEAD PILOTS DONT MAKE CLAIMS

Wiggy
Posts: 298
Joined: Sun Jan 24, 2016 10:55 pm

Re: Adding Weather to Missions - Part 1

Post by Wiggy » Wed Jul 26, 2017 10:48 am

Agreed, this is fantastic! Thanks for the efforts Bonkin and looking forward to implementing it. :nice: :D

:salute:

Bunny
Posts: 5431
Joined: Tue Jul 17, 2012 2:56 pm

Re: Adding Weather to Missions - Part 1

Post by Bunny » Wed Jul 26, 2017 11:01 am

Sterling write-up - that's got to form the basis of a bug report surely! You do realise you're probably the leading expert on Cliffs of Dover weather!

“It is a mistake to think you can solve any major problems just with potatoes I-16s.” - Douglas Adams


Image

SOW Reddog
Posts: 106
Joined: Mon Feb 23, 2015 3:43 pm

Re: Adding Weather to Missions - Part 1

Post by SOW Reddog » Wed Jul 26, 2017 1:29 pm

I'm not sure you're right about the cloud height. I'd need to look at my code for SoW, but we've certainly seen cloud much higher than 1500m. However I think the main bug was via the UI that meant it couldn't be set higher than that. Other than that good job. Wish you'd done it 2 yrs ago before I went through the weather generator code for SoW.

User avatar
Bonkin
Posts: 2143
Joined: Sat Sep 08, 2012 6:47 pm
Location: East Yorkshire, England

Re: Adding Weather to Missions - Part 1

Post by Bonkin » Wed Jul 26, 2017 7:41 pm

SOW Reddog wrote:I'm not sure you're right about the cloud height. I'd need to look at my code for SoW, but we've certainly seen cloud much higher than 1500m. However I think the main bug was via the UI that meant it couldn't be set higher than that. Other than that good job. Wish you'd done it 2 yrs ago before I went through the weather generator code for SoW.
I'll have another look at it - but this is the setting for Global clouds. If you add local weather it can go much higher.

Can you elaborate a bit more on what you mean by going through the weather generator code? The one thing I've not really dabbled with is scripting - so if this is what you mean it would be good if you could share. :nice:
Image

Redeye
Posts: 1487
Joined: Fri Sep 27, 2013 2:50 pm
Location: Haugesund, Norway

Re: Adding Weather to Missions - Part 1

Post by Redeye » Wed Jul 26, 2017 8:10 pm

These shots look terrific! Would love to see more clouds in line with these in our missions!

SOW Reddog
Posts: 106
Joined: Mon Feb 23, 2015 3:43 pm

Re: Adding Weather to Missions - Part 1

Post by SOW Reddog » Thu Jul 27, 2017 8:54 am

Bonkin wrote:
SOW Reddog wrote:I'm not sure you're right about the cloud height. I'd need to look at my code for SoW, but we've certainly seen cloud much higher than 1500m. However I think the main bug was via the UI that meant it couldn't be set higher than that. Other than that good job. Wish you'd done it 2 yrs ago before I went through the weather generator code for SoW.
I'll have another look at it - but this is the setting for Global clouds. If you add local weather it can go much higher.

Can you elaborate a bit more on what you mean by going through the weather generator code? The one thing I've not really dabbled with is scripting - so if this is what you mean it would be good if you could share. :nice:
Ah. It could have been local, but doesn't that involve a weather front? I stopped using those due to complaints of disappearing glass etc.

I will dig my code out. Basically each SoW phase had predetermined weather conditions generated, with some basic RNG chances of weather changes. Of course we couldn't get "socked in" or have a rain front move through because of Clodisms. The mission file was generated on the fly for each phase, picking up relevant detail from the database.

LuftAsher
Posts: 2933
Joined: Tue Jan 06, 2015 2:51 am
Location: Melbourne, Australia

Re: Adding Weather to Missions - Part 1

Post by LuftAsher » Thu Jul 27, 2017 9:19 am

SOW Reddog wrote:
Bonkin wrote:
SOW Reddog wrote:I'm not sure you're right about the cloud height. I'd need to look at my code for SoW, but we've certainly seen cloud much higher than 1500m. However I think the main bug was via the UI that meant it couldn't be set higher than that. Other than that good job. Wish you'd done it 2 yrs ago before I went through the weather generator code for SoW.
I'll have another look at it - but this is the setting for Global clouds. If you add local weather it can go much higher.

Can you elaborate a bit more on what you mean by going through the weather generator code? The one thing I've not really dabbled with is scripting - so if this is what you mean it would be good if you could share. :nice:
Ah. It could have been local, but doesn't that involve a weather front? I stopped using those due to complaints of disappearing glass etc.

I will dig my code out. Basically each SoW phase had predetermined weather conditions generated, with some basic RNG chances of weather changes. Of course we couldn't get "socked in" or have a rain front move through because of Clodisms. The mission file was generated on the fly for each phase, picking up relevant detail from the database.
Still waiting on my hug btw

SOW Reddog
Posts: 106
Joined: Mon Feb 23, 2015 3:43 pm

Re: Adding Weather to Missions - Part 1

Post by SOW Reddog » Thu Jul 27, 2017 2:30 pm

Eh? What for. Besides, not really into your style of homo man love, you'll have to do it yourself. Something I suspect you're pretty familiar with.

Post Reply