Class hours: 10:05 – 2:45
Mr. Bohmann | wbohmann@ewsd.org
10:05 Today’s Notes & Attendance
Today is a Wacky Wednesday
- Call Backs: Ariel (Chemistry-12:25pm)
10:10 Game Teams… – Work Time to break – last chance….
This is a work session for Finnder and Wal-Martial Law game studios.
Deliverables
To be successful as a team, you need to know the deliverables:
- One Game Design Document
- A playable game (prototype is fine) Simmer.io or published as .exe file
- A Home Screen with Game Title
- Play Button that opens the game
- Credits Button that opens Credits Screen (credits list roles of all team members)
Today at 1pm:
- A representative will share the story of the team
- Process
- Successes
- Challenges
- Organizational Strategies
- Game Overview
- Sample Gameplay
10:50 Break
11:00 Lighting in Unity Continued…
ProTip: When baking lighting, change to GPU and set the environment samples down for faster bake times – which is good for testing
We can also make lights out of gameObject by making them emissive. An emissive material will emit light on to other game objects if (and only if) those game objects are static. To make an emissive material work, we have to bake (render the lightmaps) to the scene. Let’s try.
Volumes are a great way to add nice effects to your scene. We can create post processing effects globally or locally. In order to render the post-processing effects, we’ll need to enable post processing on our camera. Then we’ll create some volume effects either locally or globally depending on what your scene demands. Let’s look at some features. there too.
To add Post Processing, we’ll need to head over to the package manager and install. We’ll add a Post-Processing Layer to the Camera and add a Post Processing Volume game object to our scene. The camera will see the post processing.
Assignment: Using your Modeling skillsets with Blender or ProBuilder Tools, set up a static scene in Unity and create a nice rocky path illuminated. Use materials and lighting in Unity for your scene. Don’t forget the work we did with terrain tools. Remember those? You’ll have to add from the package manager. Render as a nice .jpg. Assignment is due on Monday, May 20th.
Light Flicker Code
using UnityEngine;
using System.Collections.Generic;
// Written by Steve Streeting 2017
// License: CC0 Public Domain http://creativecommons.org/publicdomain/zero/1.0/
/// <summary>
/// Component which will flicker a linked light while active by changing its
/// intensity between the min and max values given. The flickering can be
/// sharp or smoothed depending on the value of the smoothing parameter.
///
/// Just activate / deactivate this component as usual to pause / resume flicker
/// </summary>
public class LightFlickerEffect : MonoBehaviour
{
[Tooltip("External light to flicker; you can leave this null if you attach script to a light")]
public Light light;
[Tooltip("Minimum random light intensity")]
public float minIntensity = 0f;
[Tooltip("Maximum random light intensity")]
public float maxIntensity = 1f;
[Tooltip("How much to smooth out the randomness; lower values = sparks, higher = lantern")]
[Range(1, 50)]
public int smoothing = 5;
// Continuous average calculation via FIFO queue
// Saves us iterating every time we update, we just change by the delta
Queue<float> smoothQueue;
float lastSum = 0;
/// <summary>
/// Reset the randomness and start again. You usually don't need to call
/// this, deactivating/reactivating is usually fine but if you want a strict
/// restart you can do.
/// </summary>
public void Reset()
{
smoothQueue.Clear();
lastSum = 0;
}
void Start()
{
smoothQueue = new Queue<float>(smoothing);
// External or internal light?
if (light == null)
{
light = GetComponent<Light>();
}
}
void Update()
{
if (light == null)
return;
// pop off an item if too big
while (smoothQueue.Count >= smoothing)
{
lastSum -= smoothQueue.Dequeue();
}
// Generate random new item, calculate new average
float newVal = Random.Range(minIntensity, maxIntensity);
smoothQueue.Enqueue(newVal);
lastSum += newVal;
// Calculate new smoothed average
light.intensity = lastSum / (float)smoothQueue.Count;
}
}
11:55 Lunch
12:25 Independent Reading
12:50 Break
1:00 Game Team Showcase
A representative will share the story of the team
- Process
- Successes
- Challenges
- Organizational Strategies
- Game Overview
- Sample Gameplay
1:50 Dailies
Dailies can be placed in the CAWD2 Dailies Folder on the CAWD2 Public Folders drive