Becoming Vincent

NameBecoming Vincent
Short DescriptionA Virtual Reality game about the early life of Vincent van Gogh for the Oculus Rift
CategoryClient Project
DateApr - July 2016 (~4 months)
EngineUnity
RoleGameplay Programmer
Team Size12

About

Becoming Vincent is a Virtual Reality project about the early life of Vincent van Gogh. This was a paid project done for NHTV BredaRegio West Brabant, and the Van Gogh Church. Below is a video of the VR game in action. The spoken text is in Dutch.

Programming

This game had a big team of artists, but I was the only programmer who worked on the game. Because of this, I programmed everything including the menus, movement, animation triggers etc. I also had to ensure the game ran well on the Oculus.

Animation Triggers

A significant amount of development time was spent on animation triggers. All of the moving objects in the game had to start and stop their animation at a very specific time. There were also other animation triggers such as sounds.

In the Event Timeline on the left are all the event triggers for Vincent van Gogh which are handled in the code. On the right is the editor for one of the selected events as well as the Animator for the entire character.

The artist who created the animation gave me a list of frames at which point specific things, such as step sounds & object triggers, should happen. I then added an event at that frame which called C# code to handle whatever had to happen.

Almost all of the code in the game is related to handling events from the events graph. Here are some of the methods called from the Vincent Animation Graph.

Animation Events
void startParents()
{
   father.GetComponent<Animator>().SetBool("shouldStart", true);
   mother.GetComponent<Animator>().SetBool("shouldStart", true);
}

void armTable()
{
    AudioSource.PlayClipAtPoint(armTableSound, vincent2Location.transform.position);
}

void openDoor()
{
    frontDoor.GetComponent<Animator>().SetTrigger("shouldOpen");

    AudioSource.PlayClipAtPoint(openDoorSound, doorLocation.transform.position);
    AudioSource.PlayClipAtPoint(doorOpenWind, doorLocation.transform.position);
}

void closeDoor()
{
    AudioSource.PlayClipAtPoint(closeDoorSound, doorLocation.transform.position);
}
    
void triggerFadeToBlack()
{
    GameObject.FindGameObjectWithTag("fadeBlack").GetComponent<FadeToBlack>().shouldFade = true;
}

 

The code itself is rather simple, but making sure all the actions and systems work well together was challenging.

Movement

Movement in a VR game is very important. If the movement speed is too high or you constantly change direction, people are likely to get motion sick. Another restraint of our game is that we were not going to use a controller because that’s not practical in a museum showcase.

The way we fixed all of those issues is by populating the scene with various blue nodes you could move to. When the player looks at a node for around a second, it would move to that location. This is done by raycasting from the center of the screen.

Target raycasting
int x = Screen.width / 2;
int y = Screen.height / 2;

Ray ray = cam.ScreenPointToRay(new Vector3(x, y));
RaycastHit hit;

if(Physics.Raycast(ray, out hit))
{
	if (hit.collider.gameObject.tag == "movementNode")
	{
		//update raycast timer for node
		hit.collider.gameObject.GetComponent<Node>().HasRayCast();
		
		//if not already moving
		if (!shouldMove)
		{
			//if it doesnt have a target yet, or is a new target
			if (!shouldTarget || (shouldTarget && hit.collider.gameObject != selectedNode))
			{
				//check if can move to
				bool isValidTarget = false;

				for (int i = 0; i < currentNode.GetComponent<Node>().nearbyNodes.Length; i++)
				{
					if (currentNode.GetComponent<Node>().nearbyNodes[i] == hit.collider.gameObject)
					{
						isValidTarget = true;
					}
				}

				if (isValidTarget)
				{
					//set targeting variables
					shouldTarget = true;
					targetMoveTimer = 0;

					selectedNode = hit.collider.gameObject;
					selectedNode.GetComponent<Node>().EnableHover();
				}
			}
		}
	}
}

 

Screenshots & More Information

  • Van Gogh Painting
    Van Gogh Painting
  • Van Gogh Walking to the Living Room
    Van Gogh Walking to the Living Room
  • The Van Gogh Church (in which the players are standing)
    The Van Gogh Church (in which the players are standing)
  • Van Gogh Talking with his Parents
    Van Gogh Talking with his Parents
  • Dramating Ending Part 1
    Dramating Ending Part 1
  • Dramating Ending Part 2
    Dramating Ending Part 2

 

For more information about Becoming Vincent and our team, take a look at this website.