Lefthanded Games Media Updates Video

Got My Eye On You

Header_Eyeball
A look at the programming behind a clingy eyeball

Super Mario 64. That mysterious floating eye hiding in the aptly named ‘Secret Room’ of Big Boo’s attic… ever watching. Following. Tracking. Well, until it got dizzy…

While said eye’s existence was never really explained in Mario’s narrative cannon it doesn’t mean that we don’t want to harken back to it as one of the many retro nods planned for Lobodestroyo. This feature, written up by our resident crazy cajun slash Programmer Matthew Williamson, goes into detail how we are adding some functionality to the Soothsayer’s tent which features a similarly nosey eyeball element as part of her eclectic design.

The Soothsayer’s tent features a mishmash of random artifacts, trinkets and assorted mumbo-jumbo. Once such element is her all-seeing eye advertisement that features a familiar-looking eyeball. This eye has an idle animation where in it darts about looking wildly at the world around it. When the player approaches, the eye will lock on to Mutt and follow him as he moves around the immediate vicinity of the tent. If the player is able to break it’s line-of-sight or run outside of its cone of vision, the eye loses Mutt and returns to its normal idle behavior.

This seemingly simple effect requires a few steps to accomplish which Matthew breaks down for you here:

A Closer Look:

In order to provide an immersive and interesting experience for our users sometimes we need to add subtle mechanics to our environment. in a non-intrusive manner but still, have some impact on our players. While some of these implementations at first “glance” seem simple they can prove to be quite challenging when it comes time to put the hands on the keyboard.

A quick “get it out the door” approach would involve rotating the eyeball directly. But is that how we actually look at things? Our viewballs that give us insight to our surroundings do not rotate on their own but instead rotate inside of our head due to some extra information received from the brain. We give it the desired direction. I will spare you on the science behind how the actual eyeball works because I just work here… 

We will create a target for the eyeball to “stare at” and animate that target. Based on if Mutt is close enough or not we will play our idle animation. Considerations are the actual position of that target. With that said we will be making a target for the eyeball to look at and then animate that target to give us a realistic looking programmer animated eyeball. Observe the following:

Eyeballs01

Yep, those numbers are all different. What this is showing is that based on how we parent that target those numbers will be very different meaning that if we animate it in a place not relative to the root object we will not get our desired result. The specifications for this implementation are that the eyeball be animated with respect to the tent so that is what we will use.

The Animation and Behaviors:

The first thing we will do is put on our animator hat and come up with an animation. I will be doing two different implementations on the movement of the eyeball based on what the video from the link demonstrated. The first half we will do a snap to the neutral position and make the curve “flat”. This will ensure we don’t smoothly guess our values in between before we save the position of our animation. The second half will use the smooth type of guessing. So let’s see what we get…

Behavior wise, what we will do to script the behavior of the eyeball is basically this:

Eyeballs02

Leave a Reply

Your email address will not be published. Required fields are marked *