Thursday, April 19, 2012

Final Project


Our final project is online at:

http://www.prism.gatech.edu/~ksheffield3/LCC_2730_FINAL_PROJECT_QUIDDITCH/WebPlayer/WebPlayer.html

As far as my role in the final project, I was the main scripter and also the assembler. I wrote the scripts for broom movement, snitch movement, hand reaching, winning and losing, scene navigation, and GUI creation. I put all of the assets into scenes, put the intro scene into the main project from a different project, as well as tweaking cameras and objects to increase playabilitiy and feel. I controlled a lot of the camera's and lighting. I set up all collisions and triggers. These were my scripts:

Snitch Movement:


using UnityEngine;
using System.Collections;

public class SnitchMove : MonoBehaviour
{
public int speed = 5;

public int height;

public Vector3 centerOfBase;
public float a;
public float b;

private Vector3 move;
private float durationCounter;

void Start()
{
do
{
durationCounter = Random.value * 3;
move = Random.insideUnitSphere.normalized * speed * durationCounter;
}while(!Validate());
}

void Update()
{
if(durationCounter > 0)
{
transform.Translate(move*Time.deltaTime);
durationCounter -= Time.deltaTime;
}
if(durationCounter <= 0)
{
do
{
durationCounter = Random.value * 3;
move = Random.insideUnitSphere.normalized * speed * durationCounter;
}while(!Validate());

}
}

bool Validate()
{
float yPos = transform.position.y + durationCounter * move.y;
if(yPos < centerOfBase.y || yPos > centerOfBase.y + height)
{
return false;
}
float A = transform.position.z + durationCounter * move.z - centerOfBase.z;
float B = transform.position.x + durationCounter * move.x - centerOfBase.x;
return( (Mathf.Pow(A, 2)/Mathf.Pow(a, 2)) + (Mathf.Pow(B, 2)/Mathf.Pow(b, 2)) <= 1 );
}

void OnTriggerEnter(Collider obj)
{
if(obj.gameObject.name == "Hand" && GameObject.Find ("Player").GetComponent<ReachHand>().IsReaching())
{
gameObject.GetComponent<MeshCollider>().isTrigger = false;
GameObject.Find("Player").GetComponent<BroomstickMove>().enabled = false;
gameObject.GetComponent<TrailRenderer>().enabled = false;
gameObject.transform.parent = GameObject.Find("Hand").transform;
GameObject.Find("Player").GetComponent<ReachHand>().Win();
enabled = false;
}
}
}

Broomstick Movement



using UnityEngine;
using System.Collections;

public class BroomstickMove : MonoBehaviour
{
public float speed = 20;
public float accelerationModifier = 80;

public int pitchSensitivity = 2;
public int rollSensitivity = 5;
public int yawSensitivity = 3;

void Start()
{

}

void Update()
{
transform.Translate(Vector3.forward*speed*Time.deltaTime);
CheckForInput();
}

void CheckForInput()
{
if(Input.GetKey("a"))
{
transform.Rotate(0,-pitchSensitivity,0);
}
if(Input.GetKey("d"))
{
transform.Rotate(0,pitchSensitivity,0);
}
if(Input.GetKey("q"))
{
transform.Rotate(0,0,yawSensitivity);
}
if(Input.GetKey("e"))
{
transform.Rotate(0,0,-yawSensitivity);
}
if(Input.GetKey("w"))
{
transform.Rotate(rollSensitivity,0,0);
}
if(Input.GetKey("s"))
{
transform.Rotate(-rollSensitivity,0,0);
}
if(Input.GetKeyDown("space"))
{
speed += accelerationModifier;
}
if(Input.GetKeyUp("space"))
{
speed -= accelerationModifier;
}
if(Input.GetKeyUp("r"))
{
gameObject.GetComponent<ReachHand>().Reach(Vector3.left);
}
}
}

Reach Hand Out and Grab Snitch

using UnityEngine;
using System.Collections;

public class ReachHand : MonoBehaviour
{
public GameObject hand;
public float maxDuration = 2;
public float speed = 2;
private Vector3 direction;
private bool reaching = false;
private float durationCounter = 0;
private bool win = false;
void Start()
{
}
void Update()
{
if(reaching)
{
hand.transform.Translate(speed * direction * Time.deltaTime);
durationCounter += Time.deltaTime;
if(durationCounter >= maxDuration)
{
reaching = false;
}
}
else if(!reaching && durationCounter > 0)
{
hand.transform.Translate(speed * -direction * Time.deltaTime);
durationCounter -= Time.deltaTime;
}
if(durationCounter <= 0 && win)
{
Application.LoadLevel("WinScreen");
}
}
public void Reach(Vector3 direction)
{
if(!reaching && durationCounter <= 0)
{
reaching = true;
this.direction = direction;
}
}
public bool IsReaching()
{
return (durationCounter > 0);
}
public void Win()
{
maxDuration = durationCounter;
win = true;
}
}

Lose If You Collide with Terrain

using UnityEngine;
using System.Collections;

public class CollideTerrain : MonoBehaviour
{

void Start()
{
}
void Update()
{
}
void OnTriggerEnter(Collider obj)
{
if(obj.gameObject.name == "BroomCollide")
{
Application.LoadLevel("LoseScreen");
}
}
}

A Couple GUI Scripts

using UnityEngine;
using System.Collections;

public class PlayAgain : MonoBehaviour
{
public string buttonText;
void Start()
{
}
void Update()
{
}
void OnGUI()
{
Rect buttonRect1 = new Rect(Screen.width / 3, 7 * Screen.height / 9, Screen.width / 3, Screen.height / 9);
GUIContent buttonContent1 = new GUIContent(buttonText);
if(GUI.Button(buttonRect1, buttonContent1))
{
Application.LoadLevel("StartScreen");
}
}
}

using UnityEngine;
using System.Collections;

public class ToIntro : MonoBehaviour
{
void Start()
{
}
void Update()
{
}
void OnGUI()
{
Rect buttonRect1 = new Rect(Screen.width / 3, 2 * Screen.height / 7, Screen.width / 3, Screen.height / 7);
GUIContent buttonContent1 = new GUIContent("Start");
if(GUI.Button(buttonRect1, buttonContent1))
{
Application.LoadLevel("IntroScreen");
}
Rect buttonRect2 = new Rect(Screen.width / 3, 4 * Screen.height / 7, Screen.width / 3, Screen.height / 7);
GUIContent buttonContent2 = new GUIContent("Instructions");
if(GUI.Button(buttonRect2, buttonContent2))
{
Application.LoadLevel("InstructionScreen");
}
}
}

using UnityEngine;
using System.Collections;

public class BackToMenu : MonoBehaviour
{
void Start()
{
}
void Update()
{
}
void OnGUI()
{
Rect buttonRect1 = new Rect(Screen.width / 3, 13 * Screen.height / 15, Screen.width / 3, Screen.height / 15);
GUIContent buttonContent1 = new GUIContent("Back");
if(GUI.Button(buttonRect1, buttonContent1))
{
Application.LoadLevel("StartScreen");
}
}
}

All of my scripts were written in C#. I had a few issues that required major debug time. The bigger one is that trigger's are bugged in unity, and don't work quite the way they're supposed to. This was an issue when I tried to use a cylinder as the bounding box for my snitch. Upon realizing there was not easy fix to the bug, I changed my code completely to be done mathematically. Additionally, I hit a bug where two mesh colliders won't collide, so used some creative collider use to compensate. I think I played a major role in this project and that it came out very well.


Tuesday, April 10, 2012

Readings and Project Progress

Readings


Laurel
The Laurel reading talked about computer programming and interaction, and how they were a form of performance. I don't really agree with this. I feel as if Laurel uses too broad a definition for performance, which allows for this claim to be made. Laurel also oversimplifies the ideas of programming. If programmers were actors, why then wouldn't you also consider actors to include writers, painters, or even athletes? The argument seems like a bit of a stretch..

Phelan
Phelan discusses the validity of performance in still art in the narrative of the observers. With all due respect to Phelan, this concept is a stretch. While some pieces of still art may inspire greater conversation than others, simply inspiring conversation is not enough to validate performance. If I were to have a conversation with a peer about chocolate, chocolate wouldn't become a performance. The concept is ridiculous.

Progress


So far I have adjust and implemented my flight script for the broomstick and made significant progress in the snitch move script.

Thursday, March 29, 2012

Open Design

My open design project is a game that can be played at:

http://www.prism.gatech.edu/~mrubin8/FlightGame/WebPlayer.html

The game represents the life lesson "Don't let money distract you from your goals."

The scripts will be used in our final project which will be a quiditch game.

Tuesday, March 27, 2012

Reading #8

The Burrill reading discussed performance in its relation to digital media. While it talked about a few different themes and questions related to the subject, the one I found most interesting was the question, "Is the player in a video game the audience or the performer?" An argument could certainly be made for both cases. The player is the audience because he is the one the game is designed to entertain. However he is also the performer since in many ways he controls the plot and interaction of the game. While story events may be similar regardless (or may not be), the player is the one that physically explores the narrative space. In my opinion, the user is always going to be a degree of both the performer and the audience. However, the more control the player has and the more freedom they have exploring the narrative space, the more agency they obtain and the more they become the performer.

The Chapter 5 Ryan reading discussed the influence of user interaction on narrative. He discussed New Media and the way it has transformed the role of the user in his or her own entertainment. New media users help build the narrative space around them through action and decision. The reading concluded by discussing ways that agency should be limited in certain cases where media wants to hold complexity in characters (as opposed to making the character an empty shell that exists only to reflect the user).

Thursday, March 8, 2012

Unity Scene

My unity scene can be found at:

http://www.prism.gatech.edu/~mrubin8/WebPlayer.html

It is in the format of a playthrough. The controls are as follows:

W - Move Forward
S - Move Backward
A - Move Left
D - Move Right
Move Mouse - Look Around
E - Interact
Space Bar - Jump

The web player renders fairly slowly (at least on my computer). Apologies if objects flicker strangely, this is an affordance of the web player and not the project. Additionally, the web player does not really show the flashlight effect I have implemented. I will be trying to get the .exe format working for the next checkpoint, so that these implementations will show correctly.

Other things I plan on adding by the next checkpoint:

-Cut scenes
-Sound
-Better item control (ball will roll when user runs into it, objects will become static once put on table)
-Completion conditions met when all items are brought to table

Tuesday, March 6, 2012

Reading #7

Manovich talks about the 5 principles of New Media: Numerical Representation, Modularity, Automation, Variability, and Transcoding. He talks about the role that these play in differentiating New Media from Old Media, and the way that these generate a more immersive experience.

Bjork's article talks about an app she made, that is a prime example of New Media. It not only plays music, but uses it to generate a visual component, combining the audio and visual components of the media device. Not only is the app cool, but it makes you feel like you're more a part of the music than if you were to just listen to it.

Tuesday, February 28, 2012

Mise-en-scene Assignment

The scene is dimly lit. The walls are grayish in color, probably concrete. A hard-looking bed lies in the middle of the room, with a man laying in it. The left side of the bed has an endtable with a strange-looking alarm clock on it. On the right is a coat rack with a lab coat on it.

The room is pretty baron, except for a few things against the walls. On one wall of the room is a table with an elaborate chemical apparatus on it filled with a bubbling green liquid. On another wall is a staircase going up to the surface. Finally, another wall has a bookshelf, seemingly disorganized and filled with old, dusty books.