Tuesday, April 24, 2018

Dr Seuss-ish procedural tree generator in Unity

Here are some screenshots from a personal prototype I created last year, to explore problem sets around procedural asset generation. The question I was trying to solve for myself was what kinds of rule sets would create consistently pleasing but still diverse assets.

The result was a rather fun Dr Seuss style plant generator. Here are some screenshots of the kinds of things it produces. Everything about these assets is created from scratch in Unity - meshes, textures, even the color design.

I might do a more in-depth write up of some of the methods I used later, but for now enjoy the pretty pictures!




















Minez

Minez! was a prototype game I made to see what would happen if a game's central mechanism was built around audio clues rather than visuals.



You are the captain of a small U-Boat who is sent into an underwater mine field to find an accidentally triggered mine. The mine emits sonar pings at regular intervals, and you need to find it using only the cues from the audio before it explodes.

I threw in a defusing puzzle as well that was basically a game of Simon, which isn't included it in the video below since it isn't really relevant to the problem I wanted to explore.

I found the experiment very compelling - the emphasis on listening rather than looking seemed to increase the sense of being there, and the tension.

tem·po·rar·y

Another Unity project, this is my contribution to the genre of "serious games"; it feels rather relevant to me today, so I am finally posting some footage from it.

Make sure that you have the sound on, it is a big part of this piece.





Eyetastic!




This is from a small Flash project I made some years ago. I wanted to create some really nice eye motion for looking at the mouse pointer, where the pupil properly stops moving at the rim of the eye and a pair of eyes doesn't go crazy cross eyed when the mouse is between the eyes. Then I went a little crazy with the arrangement, and the result is satisfyingly psychedelic :)



Here is the source code for the eye motion:

package {
import flash.display.MovieClip;
import flash.events.Event;

public class Eye extends MovieClip {

public var eyeball:Eyeball;
public var eyeballMask:EyeballMask;
public var pupil:Pupil;
public var maxDistance;

public function Eye():void {
eyeball.mask = eyeballMask;
pupil.mask = eyeballMask;
eyeballMask.alpha = 0;
maxDistance = 156;
addEventListener(Event.ENTER_FRAME, followMouse);
}

function followMouse(e:Event):void {
// calculate mouse offset
var distx:Number = mouseX - eyeball.x;
var disty:Number = mouseY - eyeball.y;
var dist:Number = Math.sqrt(distx*distx + disty*disty);
//if the pupil is within the confines of the eyeball
//translate it towards the mouse at a set fraction
if (dist < maxDistance) {
pupil.x = distx / 7;
pupil.y = disty / 7;
}
//if the pupil is at the edge of the eyeball
//translate it along the radius of the eyeball
else {
var angleA:Number = Math.atan2(distx, disty);
var angleB:Number = (180*(Math.PI/180)) - ((90*(Math.PI/180)+angleA));
disty = maxDistance * Math.cos(angleA);
distx = maxDistance * Math.cos(angleB);
pupil.x = distx / 7;
pupil.y = disty / 7;
}
}
}
}