E2150 - Weather: Difference between revisions

From InsideEARTH
Content added Content deleted
(Created page with "The weather in Earth 2150 is dynamic and can actively influence the gameplay. Various weather effects can happen due to being scripted by gamemode/campaign designers, console commands, or player actions (LC's Weather control Center). The weather effects available in the game are as follows: snow, rain, wind, thunderstorm and meteor rain. Thunderstorm usually happen along with rains (although it is possible to have a thunderstorm without a rain). == Snow == == Rain == ==...")
 
Tags: Mobile edit Mobile web edit
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
The weather in Earth 2150 is dynamic and can actively influence the gameplay. Various weather effects can happen due to being scripted by gamemode/campaign designers, console commands, or player actions (LC's Weather control Center). The weather effects available in the game are as follows: snow, rain, wind, thunderstorm and meteor rain. Thunderstorm usually happen along with rains (although it is possible to have a thunderstorm without a rain).
The weather in Earth 2150 is dynamic and can actively influence the gameplay. Various weather effects can happen due to being scripted by gamemode/campaign designers, console commands, or player actions ([[E2150 - Lunar Corporation - LC|LC]]'s Weather Control Center). The weather effects available in the game are as follows: snow, rain, wind, thunderstorm and meteor rain. Thunderstorm usually happen along with rains (although it is possible to have a thunderstorm without a rain).

== Day and night cycle ==
The time of the day in game is dynamic and there are days and nights, just like in real life. Those cycles are not just visual feature, as they affect gameplay - the vision at night is limited and it is harder to spot enemy structures/units (unless they have lights turned on), obviously the [[E2150 - Solar efficiency|LC solar power]] is affected, and additionally, the [[E2150 - Temperature|temperature]] changes during day and night.

The entire in-game 24h can be divided into 4 phases:
* dawn (06:40 AM - 09:00 AM)
* day (09:00 AM - 05:00 PM)
* twilight (05:00 PM - 07:45 PM)
* night (07:45 PM - 06:40 AM)

You may notice that the night is longer than the day and the actual ratio is 9:7. The entire 24h period is ~819s of real time ~= 13,65 minutes.

== Clouds ==
Although not visible, the clouds are there and they actually matter. The game calculates clouds on the sky, that come along with weather effects such as rain or snow. Those clouds later affect [[E2150 - Solar efficiency|solar efficiency]] of LC's solar power plants.


== Snow ==
== Snow ==
Snow is an effect that can reduce sight range of an object within its range, by 1. Sight range is calculated in 4x4 square areas so it virtually reduces sight range by 4 tiles - same as the night does.

Weather control center needs to be charged at 50% to cast this effect, what takes 7,5 minutes. The effect lasts in range of 30 tiles, for 2m10s, with 1m40s at full intensity.
== Rain ==
== Rain ==
Rain is an effect that can reduce movement speed of all units in its area. Being in the area of rains effect, doubles the time a unit needs to move by 1 square, which is the same penalty as a unit may get if moving at night with lights off. Thus a unit with lights off, at night and in rain will move 3x slower.

Weather control center needs to be charged at 50% to cast this effect, what takes 7,5 minutes. The effect lasts in range of 30 tiles, for 2m10s, with 1m40s at full intensity.
== Wind ==
== Wind ==
Wind is a global effect that affects the movement speed of all air units. If strong enough (12 m/s or more), it triples the time an air unit needs to move by 1 square. It can also prevent a landed unit from taking off, although it doesn't affect resupplying ammo when the suppliers are seemingly landing for ammo in supply centers' docking bays. Taking all possible penalties into account, an air unit without lights, at night, rain and wind, would move 5x slower. Wind has a global range (works on entire level). If it is created by WCC, its direction is determined by the vector between WCC building and click location. Multiple wind effects stack, so two WCCs could create 2 wind effects in opposite direction, which would effectively void the wind effect. The stacked wind speed is capped at 15 m/s. Wind can also move clouds, shifting weather effects, although it is not too significant.

Weather control center needs to be charged at 50% to cast this effect, what takes 7,5 minutes. The effect lasts for 1m30s, with 1m at full intensity.

== Thunderstorm ==
== Thunderstorm ==
[[File:Rainstorm.png|thumb|Rainstorm over a player's base]]
Thunderstorm spawns lightnings on the area, that damage and destroy units and buildings. The lightnings are more likely to hit targets that are placed higher, what can make it worth to build structures in the vicinity of higher terrain. Unless spawned with console command, thunderstorms always come with rain effect.
Thunderstorm spawns lightnings on the area, that damage and destroy units and buildings. The lightnings are more likely to hit targets that are placed higher, what can make it worth to build structures in the vicinity of higher terrain. Unless spawned with console command, thunderstorms always come with rain effect.
=== Technical data ===
==== Parameters ====
The effect is parameterized in the following way:
* '''x,y''' - epicenter location
* '''range''' - range of the effect, value gets clamped to 1-127 range
* '''upTime''' - time (in ticks) it takes to get the effect to the full intensity, min 1
* '''constTime''' - time (in ticks) in which the effect operates at full intensity, min 1
* '''downTime''' - time (in ticks) it takes for the effect to fade out, min 1
* '''intensity''' - clamped to 1-10 range
* '''power''' - determines the strength of the spawned lightnings, clamped to 1-10 range
* '''unknown parameter''' - it is not possible to set it, so the game always takes the default value, which is not recognized yet


Weather control center needs to be charged at 100% to cast this effect, what takes 15 minutes. The effect lasts in range of 30 tiles, for 1m30s, with 1m at full intensity.
==== Create conditions ====
* with ''Weather.AddStorm(x, y, range, upTime, constTime, downTime, intensity, power)'' command - it is the only way to spawn Thunderstorm without the rain
* with ''Weather.AddRainStorm(x, y, range, upTime, constTime, downTime, rainIntensity, stormIntensity, stormPower)'' command, that spawns both Rain and Thunderstorm
* with ''Storm(x, y, range, upTime, constTime, downTime, rainIntensity, stormIntensity, stormPower)'' function call from within EarthC scripts
* with '''Weather Control Center'''. This spawns both rain and thunderstorm effects with the following parameters:
** x, y - as selected by the player
** range - 30
** upTime - 300 ticks = 15 seconds
** constTime - 1200 ticks = 60 seconds
** downTime - 300 ticks = 15 seconds
** intensity - 2
** power - 5
** rain intensity is at the maximum value of 10


For technical details, see a [[E2150 - Weather - Technical data|dedicated site]].
==== Single lightning spawn algorithm ====
# Get random location in effect's range
# Get random hit offset range (an area to search for lightning interceptors)
# Alter hit location to make the lightning hit the highest point in the vicinity
# Randomize spawned lightning type, affected by the ''power'' parameter
# Spawn lightning


== Meteor rain ==
===== Finding the random "initial location" =====
[[File:Shower.png|thumb|Meteor rain over a player's base]]
The game calculates a random distance (''r1'', within 0-''range'') and a random angle ''alpha'' (0-255, where 256 == 2*PI rad). With the use of ''sin'' and ''cos'' functions of ''alpha'', multiplied by the ''r1'' value, the game calculates offset (''x1'', ''y1'') from the epicenter. After applying the offset to the ''x'' and ''y'' parameters, we will get a point (''x2'', ''y2''). This point is the initial hit location. If the location is outside of the level, the lightning won't spawn. There is no difference for the lightning to spawn in the accessible or the inaccessible area of the map (the level "margin"), so casting rainstorm near the edge of the level will result with fewer lightnings spawned and/or fewer lightnings hitting relevant area. You may also notice that '''lightnings are more likely to hit nearby the epicenter''', rather than on the further distances.
Meteors are another destructive weather effect, which similarly to thunderstorm hits multiple targets at the area it happens. Meteors are stronger however, since they don't get intercepted by higher elements, they deal AOE damage and cannot be canceled with Weather Control Center.


Weather control center needs to be charged at 100% to cast this effect, what takes 15 minutes. The effect lasts in range of 30 tiles, for 1m30s, with 1m at full intensity.
===== Altering hit location by nearby high elements =====
The hit location is altered in the following way: We take a random number ''r2'' within the range of 4-8. The way this number gets randomized isn't that simple - there is a 1/3 chance that the number will be in <4-6> range, and 2/3 chance that the number will be within <6-8> range. This makes value 6 the most probable (33%), followed by 7 and 8 (both 22%), with 4 and 5 being the least probable (both 11%). The game iterates all terrain squares with square area bounded by ''x2 - r2'', ''y2 - r2'', ''x2 + r2'', ''y2 + r2'' and searches for the highest spot. This establishes the final hit location.


For technical details, see a [[E2150 - Weather - Technical data|dedicated site]].
===== Type of spawned lightning =====
There are multiple kinds of lightnings, that are defined in game parameters, thus their count and properties can be different among game versions and mods. By default there are 5 of them, each subsequent one being stronger than the previous one (this should always be made that way). The way the lightning is being chosen is a little bit complicated. There are 20 "spawn factors" for each of the ''power'' parameter levels. Those values (taken randomly 1-20) are in range of 0-10, with 0 pointing to the weakest lightning, and 10 pointing to the strongest. The index of the lightning (0 to ''numOfLightningTypes - ''1) is calculated as follows: ''spawnFactor * (numOfLightningTypes - 1) / 10''. Below is the table of "Spawn factors":
[[File:SpawnFactors.png]]


== Clearing effects ==
Example: We have 5 lightning types in parameters, a thunderstorm with ''power'' = 5 and we randomized (1-20) the 17th factor. From the table above we get value '''3'''. The index of the lightning type is ''3 * (5 - 1) / 10 = 12 / 10 = 1''. This results in spawning the second (first has index = 0) lightning type from the parameters.
All weather effects end after a certain period of time. Some effects (rain, thunderstorm and snow) can also be cancelled by either ''Weather.RemoveCloud(x,&nbsp;y)'' console command, or WCC action. The effect cancellation applies to a single effect with the longest remaining time, among those that affect the selected location. In case of rainstorms, cancellation cancels both rain and thunderstorm. The cancellation pushes the event to the "fade out" phase, or in case it is already there, reduces the remaining time by half.


Weather control center needs to be charged at 100% to cast this effect, what takes 15 minutes.
Taking above into account, the default WCC's lightning (5 types in parameters, power = 5) has 5% chance of spawning lightning type 3/5, 15% chance of spawning lightning type 2/5, and 80% chance to spawn the weakest lightning of type 1/5.

==== Effect intensity ====
'''TODO:''' ''the rate at which the lightnings spawn, the way the intensity parameter affects it. The progression of intensity at "up" and "down" phases.''

== Meteor rain ==

Latest revision as of 10:02, 9 December 2023

The weather in Earth 2150 is dynamic and can actively influence the gameplay. Various weather effects can happen due to being scripted by gamemode/campaign designers, console commands, or player actions (LC's Weather Control Center). The weather effects available in the game are as follows: snow, rain, wind, thunderstorm and meteor rain. Thunderstorm usually happen along with rains (although it is possible to have a thunderstorm without a rain).

Day and night cycle

The time of the day in game is dynamic and there are days and nights, just like in real life. Those cycles are not just visual feature, as they affect gameplay - the vision at night is limited and it is harder to spot enemy structures/units (unless they have lights turned on), obviously the LC solar power is affected, and additionally, the temperature changes during day and night.

The entire in-game 24h can be divided into 4 phases:

  • dawn (06:40 AM - 09:00 AM)
  • day (09:00 AM - 05:00 PM)
  • twilight (05:00 PM - 07:45 PM)
  • night (07:45 PM - 06:40 AM)

You may notice that the night is longer than the day and the actual ratio is 9:7. The entire 24h period is ~819s of real time ~= 13,65 minutes.

Clouds

Although not visible, the clouds are there and they actually matter. The game calculates clouds on the sky, that come along with weather effects such as rain or snow. Those clouds later affect solar efficiency of LC's solar power plants.

Snow

Snow is an effect that can reduce sight range of an object within its range, by 1. Sight range is calculated in 4x4 square areas so it virtually reduces sight range by 4 tiles - same as the night does.

Weather control center needs to be charged at 50% to cast this effect, what takes 7,5 minutes. The effect lasts in range of 30 tiles, for 2m10s, with 1m40s at full intensity.

Rain

Rain is an effect that can reduce movement speed of all units in its area. Being in the area of rains effect, doubles the time a unit needs to move by 1 square, which is the same penalty as a unit may get if moving at night with lights off. Thus a unit with lights off, at night and in rain will move 3x slower.

Weather control center needs to be charged at 50% to cast this effect, what takes 7,5 minutes. The effect lasts in range of 30 tiles, for 2m10s, with 1m40s at full intensity.

Wind

Wind is a global effect that affects the movement speed of all air units. If strong enough (12 m/s or more), it triples the time an air unit needs to move by 1 square. It can also prevent a landed unit from taking off, although it doesn't affect resupplying ammo when the suppliers are seemingly landing for ammo in supply centers' docking bays. Taking all possible penalties into account, an air unit without lights, at night, rain and wind, would move 5x slower. Wind has a global range (works on entire level). If it is created by WCC, its direction is determined by the vector between WCC building and click location. Multiple wind effects stack, so two WCCs could create 2 wind effects in opposite direction, which would effectively void the wind effect. The stacked wind speed is capped at 15 m/s. Wind can also move clouds, shifting weather effects, although it is not too significant.

Weather control center needs to be charged at 50% to cast this effect, what takes 7,5 minutes. The effect lasts for 1m30s, with 1m at full intensity.

Thunderstorm

Rainstorm over a player's base

Thunderstorm spawns lightnings on the area, that damage and destroy units and buildings. The lightnings are more likely to hit targets that are placed higher, what can make it worth to build structures in the vicinity of higher terrain. Unless spawned with console command, thunderstorms always come with rain effect.

Weather control center needs to be charged at 100% to cast this effect, what takes 15 minutes. The effect lasts in range of 30 tiles, for 1m30s, with 1m at full intensity.

For technical details, see a dedicated site.

Meteor rain

Meteor rain over a player's base

Meteors are another destructive weather effect, which similarly to thunderstorm hits multiple targets at the area it happens. Meteors are stronger however, since they don't get intercepted by higher elements, they deal AOE damage and cannot be canceled with Weather Control Center.

Weather control center needs to be charged at 100% to cast this effect, what takes 15 minutes. The effect lasts in range of 30 tiles, for 1m30s, with 1m at full intensity.

For technical details, see a dedicated site.

Clearing effects

All weather effects end after a certain period of time. Some effects (rain, thunderstorm and snow) can also be cancelled by either Weather.RemoveCloud(x, y) console command, or WCC action. The effect cancellation applies to a single effect with the longest remaining time, among those that affect the selected location. In case of rainstorms, cancellation cancels both rain and thunderstorm. The cancellation pushes the event to the "fade out" phase, or in case it is already there, reduces the remaining time by half.

Weather control center needs to be charged at 100% to cast this effect, what takes 15 minutes.