👍

Reminder - Keep Daily Backups

When working on a strategy game with a kit as big as the Complete Kit - always keep a working daily backup! Save yourself the trouble of rolling-back changes and losing work.

The City Building Complete Kit includes 3D weather effects to enhance the quality of your gameplay. Both clear weather, rain, and snow weather controls are included in the Scripts/SFX/RainSnow.cs script. These automatically cycle clear to rain 3 times, then clear to snow 3 times. Settings can be changed in the RainSnow.cs script.

361

(If you're interested in documentation about daytime and nighttime effects, click on the menu on the left to learn more)

Rain Effects

The City Building Complete Kit rotates between clear and rain weather effects. These are 3D effects overlayed on top of the 2D gameplay. Combined with ambient sound effects and the daytime / night time cycle makes for some amazing visuals.

742

Raining example. Click to view larger.

Snowing Effects

Snowing effects are included for winter season gameplay. Snowstorms begin with falling snow and then later end with the entire map covered in snow through the Coroutine called FadeSnowOnSprites.

736

Snow storm starting example. Click to view larger

Snow cycle finished

When the snow cycle has finished, the coroutine FadeSnowOnSprites in RainSnow.cs changes the terrain landscape.

726

Daytime after a snow cycle has finished, snow layer sprites are shown. Click to view larger.

Snowy landscape - nighttime moonlight example

754

Nighttime after a snow cycle has completed. Click to view larger

Script Reference

Inside RainSnow.cs you'll see the function SwitchClearRain(). This function initiates either rain or snow effects.

// located inside SwitchClearRain()

			//you can just erase this so the winter doesn't cycle and only rain cycles
			winterSwitchCounter++;

			if (winterSwitchCounter == 3) //rains 3 times, snows 3 times
			{
				isWinter = !isWinter;
				soundFX.isWinter = isWinter;
				winterSwitchCounter = 0;
				if(!isWinter)
				StartCoroutine("FadeSnowOnSprites");//turn winter off	
				ToggleTerrainSnow();
			}

Weather and day-night are connected, with 2 revolving ambient sound sources and fade in-out effects; the other 2 sound sources are music and menu "clicks"/in-game sounds. Snow and shadows are alpha - variable

Disable Rain and Snow Effects

Open the scenes/Game scene. In the Hierarchy you'll see AmbientController. Click this to open the Inspector.

210

Game scene hierarchy > GameManager > AmbientController. Click for larger image.

From the AmbientController Inspector, locate the Transition On checkbox under the Rain Snow (Script). Uncheck to disable the RainSnow.cs transitions.

319

Uncheck transition on in Inspector menu. Click for larger image.

void Start () 
	{
  // Checks if the transitionOn bool is set to true (checked)
		if(transitionOn)
		{
			color = rainVignete.color;			
			GetSnowTerrainMaterials();
			InvokeRepeating("Transition",transitionInterval*60,transitionInterval*60);
      //converts intervals to seconds instead of minutes
		}
	}

Change the Transition Times

Also on the Inspector menu you can change the transition interval (in minutes) to adjust how long the cycles last and how fast the transition speed (in minutes).

319

Update the transition speed on in Inspector menu. Click for larger image.

Disable Snow Cycles (But Keep Rain Cycles)

Disabling snow cycles but keeping the rain cycle is easy. Simply remove the following text from the SwitchClearRain() function in Scripts/SFX/RainSnow.cs

//you can just erase this so the winter doesn't cycle
			winterSwitchCounter++;

Here's an excerpt from the function where you'll find that line:

public void SwitchClearRain()
	{
		clearWeather = ! clearWeather;
		if (!clearWeather) 
		{			
			rainVignete.gameObject.SetActive (true);
      
			//you can just erase this so the winter doesn't cycle
			winterSwitchCounter++;
      
			if (winterSwitchCounter == 3) //rains 3 times, snows 3 times
			{
				isWinter = !isWinter;
				soundFX.isWinter = isWinter;
				winterSwitchCounter = 0;
				if(!isWinter)
				StartCoroutine("FadeSnowOnSprites");//turn winter off	
				ToggleTerrainSnow();
			}
      
   ....

By removing winterSwitchCounter++; you prevent the count from incrementing and triggering snow cycles for 3 times, which reverses after 3 more times because of the line isWinter = !isWinter;

Daytime and Nighttime Effects

To learn more about daytime and nighttime cycles in the City Building Complete Kit, please click on the menu on the left under Gameplay to learn more.