Showing posts with label game design. Show all posts
Showing posts with label game design. Show all posts

Saturday, 13 February 2021

VOID: Documentation and Process


VOID started with a bunch of 3D scans. This was the first scan I made whilst waiting at the corner of the void deck for a taxi. The funny thing about this scan was that you got quite a good view of whatever I was looking at, but there's a empty void behind my two legs, where the scanner couldn't reach, which makes it look like sootmark traces in the aftermath of an explosion. There are numerous 3D scanning apps available for iPad Pro and it is easy to export the data as an textured OBJ or glTF/glb and the file can be quickly imported into Unity.

Gameplay images from VOID

These days I spend quite a lot of time waiting for taxis to take me and Beano between places. The timing is such that I frequently end up commuting at daybreak or at night, catching glimpses of dimly lit buildings and sleepy carparks through the darkness. The two destinations I frequent (my house and my parents') are incidentally both what you might consider somewhat complicated places to get to, so there are many opportunities for a grab or taxi driver to become lost or give up the will to find me in the midst of all the one way road systems. So... there is a lot of waiting, during which I've ended up scanning void decks, mining it for material...

Void deck waiting area

When Shih Yun first invited me to show something at OTHERWORLDS, I had several other experiments and drafts that I thought of showing, which I realised over time to be unnecessarily complicated. A good game is not a collage. A game does not necesssarily get better from having more elements in it. I realised that I liked my growing collection of Void Deck scans... and I wanted to make something out of all of them.

HDB Scans from Veerasamy Road

The only weird thing about doing this is that after staring at it in a dream-like state within my game for so long, it is kinda weird to still walk through the same corridors on an everyday basis.
An obvious reference for the work is "In the Night Garden", a show that Beano has been watching a lot of. Some years ago I remember once attending a lecture in the basement of RCA. The details of this lecture eludes me except that the visiting speaker was a new sleep deprived father who had watched a whole lot of "In the Night Garden" recently with their toddler. He apparently had some near-religious epiphany with regards to the philosophical meaning behind "In the Night Garden" and I only have the merest impression that he had meticulously tied it up with an elaborate history of design or critical design or radical italian design pedagogy from the 1970s or whatever it is that RCA design students get lectured to about (and that I was impressed with the mental leaps of the lecture). It thus seems typical that now in my own sleep deprivation of caring for the Bean, I do not recall that useful gem that this forgotten speaker had wished to impress upon us, that rare and useful tidbit that he had gleaned from the watching of "In the Night Garden".

A Screenshot from "In the Night Garden"

Now as I am watching and rewatching pixelated copies of In the Night Garden via youtube on an old and heavily bumpered ipad, I am only left with questions. WHY IS IGGLE PIGGLE ALONE IN A BOAT AT NIGHT? WHERE IS HE SAILING TO? IS THE NIGHT GARDEN THE FEVER DREAM OF AN IGGLE PIGGLE LOST AT SEA? IS IGGLE PIGGLE ALRIGHT? WHERE EXACTLY IS THE NIGHT GARDEN?

Another reference for this work is a scene from another children's show - Steven Universe. Years back I used to catch bits of it and I remember thinking that it was way too childish for me (I probably even said something like "I dont know what people see in it!!!". But when I was on maternity leave I somehow ended up binge watching seasons of it all at one go in the middle of the night. It was when I watched this episode that I was suddenly SOLD on the show, because seeing a nightmare version of the city made me realise that they had done such a good job of painting Beach City to me in the previous episodes. They needed audiences to have built up a good mental map of Beach City before hitting us with a nightmare version of it - otherwise the episode would not have any impact. It is funny that I almost feel kinda nostalgic rewatching old episodes of Steven Universe, because the show now gives me a feeling of Beano being really tiny. I suppose this is the video version of "song that happens to be playing in the background during a defining period of your life". I really love the thoughtful, gentle way in which the show handles topics such as mental health, parenting, and relationships - and I guess I envisioned it being a beautiful cartoon for Beano to enjoy watching with me, one day in the future...

"Rose's Room" (Season 1 Episode 19)

In this episode, Steven discovers that his mother's magical room can fulfill any wish he asks for. After asking it for a bunch of silly things, he is hungry and decides to go get a donut from the shop in Beach City, and he thinks he has stepped out of the room to get a donut, but actually Rose's room has generated a parallel Beach City. Everyone is speaking funny and he runs to the water's edge where he finds the waves are not working properly. Finally after a terrifying time in the city, he realises it is a dream when he tries to eat his donut and it poofs.

Enough of the back story, here is the work!


VOID IN THE CAVE

Shao from DUDE.SG combined all our works into the CAVE setup for the exhibition at Gillman Barracks - a 3 screen kinect based interactive virtual environment! The boat was self-propelling, but it would turn according to the direction of the user's body.
Due to safe distancing measures, the gallery could only accomodate a fixed number of people at one time, so queues outside built up to insane levels. Whilst the show was incredibly short, I heard that there were about 600-700 people who came through each day, so at least we know that many people got to try it!


PRODUCTION NOTES

A few notes here on issues I encountered along the way:

Water in the Boat - Convex Hull

So I wanted to get a boat floating on a sea. I didn't reinvent the sea, no, if you must ask. I did this version with Crest, an existing ocean renderer system for Unity 2019.4.8 and later. A real boat actually displaces the water, so at first when my boat was in the water the ocean rendered into my boat. The fix is to add a convex hull (take the shape of your box and create a shape which is the smallest solid closed convex shape of itself) and then use a script to disable the rendering of the water where the convex hull is located inside the boat. No more water inside boat.

Resolution

One thing I’ve blithely not comprehended before was that on a MacBook with Retina display, the pixel density is twice that of the norm, therefore instead of 72dpi it is actually 144 dpi, meaning for every 1px there is actually now 4px (2px x 2px), hence when I take screenshots/screencaptures that do not account for the embedded dpi setting of 144dpi, they will come out twice as big. A crucial issue when trying to screencapture my game as a gameplay video…

Colour / Dropped Frames / Understanding Unity Profiler

Monosnap is the trusty screenshot app I've used for several years now. Using it meant that I never had to really think about how I really wanted to compress things, because I just trusted it to quickly crop and compress things for me (whether image or video). However, most of what I've been screenshotting with it so far have been things like annotations of images and lectures, for which colour is not much of a big deal. Well, my lazy days are ending. Using it to capture a gameplay video this time around showed me that maybe I need a better long-term solution for gameplay screencapture (possibly even an internal game recorder?) because (1) there is something going on with the colour (probably to do with conversion from 10 bit colour to 8 bit colour, which flatten my subtle purples to black), and (2) there is also something going on with dropped frames, which I am guessing is possibly my macbook pro's gpu being not up to the task of, so it all points to (3) that I probably need to watch more tutorials on how to properly use the Unity profiler to improve the performance of my game... ¯\_(ツ)_/¯




COMING SOON: VOID IN VR?

Saturday, 30 December 2017

Blender & Unity: Manually Rigging Blender Humanoid Characters for use with Unity Mecanim


I'm definitely no character animator by trade, but there comes a time when you end up with a Unity project that somehow requires it. There are obviously many automatic rigging methods available (Blender does actually have an auto-Rigging system called Rigify for biped humanoids) and you could even try to download other rigs made by other people and plonk them into your scene, but I found that so many of the rigs including the rigify one seems to involve so many complicated bones you don't need, so you end up having to sift through the bones, deleting so many unwanted bones, renaming bones, perhaps even having the impression of the impossibility of rigging up them bones.

Although it may seem terrifying at the beginning (I'm not an animator or rigging specialist!), I found that surprisingly, it is not that difficult to manually rig up all your bones if what you have is a very simple humanoid character. You just need to be orderly and to stick with the admittedly tedious bone naming process. (Although our character is blobby, we're sticking with a humanoid as we're going to use it with the Kinect to sync it with the movement of the human user, and our human user is going to return a humanoid set of values that we'll need to rig up our character to...)



According to the Unity Blog's post on Mecanim Humanoid:

"The skeleton rig must respect a standard hierarchy to be compatible with our Humanoid Rig. The skeleton may have any number of in-between bones between humanoid bones, but it must respect the following pattern:"
Hips – Upper Leg – Lower Leg – Foot – Toes
Hips – Spine – Chest – Neck – Head
Chest – Shoulder – Arm – Forearm – Hand
Hand – Proximal – Intermediate – Distal



This is the list of all the bones you need (I found it useful to copy and paste in these names directly)

head
neck
collarbone.L
collarbone.R
upperArm.L
upperArm.R
lowerArm.L
lowerArm.R
hand.L
hand.R
chest
abdomen
hips
upperLeg.L
upperLeg.R
lowerLeg.L
lowerLeg.R
foot.L
foot.R
toes.L
toes.R

Optional: eye.L and eye.R

For starters: Ensure that your character model is positioned at origin and that its pivot point is also at origin (0,0,0). Make sure you reset the scale to 1 just in case (Ctrl+A, Select Scale). The hip bone is the key bone in all this, so start by creating one big bone starting from the bottom of hip to top of the chest. Hit Space and start typing "Subdivide Multi" (Armature) and give it 2 cuts so you get 3 bones. These will form the hips, abdomen and chest bone.



After you've done the main spine bones, you can turn on x-axis mirror.



- Select the ball on top of the bottom bone (hips bone). Make sure Options>Armature option>X-Axis Mirror is selected, then press Shift-E to extrude mirrored bones. When you're in mirror mode, every time you create a new bone, you'll have a second one mirrored on the other side of the X-Axis. Remember that you'll have to rename BOTH bones later on - if you are facing your model face-on, also remember that L is actually to the right and R is to the left, and name it accordingly.

- Arrange the leg bone into position (you may need uncheck "Connected" in order to let the leg bone go into the right position). Reposition the leg bones away from the hip. Subdivide Multi (1 cut) this leg bone into two bones, forming upperLeg and lowerLeg.

- Shift-E to extrude two more foot and toe bones, and also add in the collarbone, arms and neck+head bone. Do make sure you keep it all in a standing T-pose (as if the character is standing in the shape of the letter t).

- Ensure that all of your bones are renamed correctly as per the list. If there is an L bone there must always be a R bone.

- Go into Object Mode and Select first the character and then Shift select the armature. Press Ctrl+P and select Set Parent To - Armature Deform - With automatic weights. Your computer might lag for a second before its all connected up.



From there, you're in the home stretch. Export your Blender model in FBX format and then import it into Unity, and in Unity set the rig to humanoid (instead of generic) and at the bottom of that, hit Apply.

Let the wild rigging begin!



See also:
Animate Anything with Mecanim