Nov 18, 2017 - Ambisonic Music, Locomotion, Custom Blood Shader


This week started out pretty slow. I've been feeling a bit burnt out I suppose so I planned to spend time with friends. As is often the case, when I'm focusing my attention on other things I manage to get sparks of inspiration and creativity. This week it came in the form of 3 major milestones in my game dev education.

Ambisonic music

The first big accomplishment was a continuation of my failure to produce ambisonic audio from last week. After taking a few days off I felt inspired so I downloaded Reaper. I had already installed the AmbiX plugins and they were available right from the start. I also had 5 audio files, individual tracks from a music project I had worked on over a year ago, a stalled 360 degree video project. It took some trial and error to set up each track to take a mono or stereo audio file and output a 4-track ambisonic format. Then, there is the plugin you need to monitor the 3D audio in stereo (over headphones). And finally, rendering out the entire project to a 4-track file that can be used as ambisonic audio in Unity.

The music doesn't exactly fit the game but it's what I've got so it's in there. Maybe next week I'll have to set aside time to produce an original music track.

Locomotion

I finally set up locomotion for this game. It is basically set up to move at a constant velocity in all directions along the ground plane by tilting the left thumbstick in the direction you want to move.  The movement is relative to the direction the controller is pointing, I might have an option to use the headset direction. Since it's controlled via an analog thumbstick, you can control the speed by how far you tile the stick.

For rotation I chose a sort of awkward controller setup. You have to squeeze the palm trigger while tilting the thumb stick left or right. I have it set up to rotate quickly in 45 degree increments. I'm not sure if I like that, maybe I should set it to 90 degrees. I tried having it rotate smoothly but I started feeling sick whenever I spun around.

Custom Blood Shader

A nice surprise this week was writing my first Unity shader. It's pretty hacky and totally barebones. What I wanted was a way to leverage off the alpha channel in the color map to drive the specular component. It took some trial and error but it works satisfactorily. Now I need to spend time learning the right way to do it.

I've had the idea for a long time but never really dove into shaders because quite frankly, the shader language looks really strange. Coincidentally a new tutorial went up on the holistic3d Youtube channel which is an introduction to a new course about writing shaders. There was just enough information in the teaser video to inspire me to write it. And a couple hours of googling and searching the Unity docs resulted in what you see in this week's video.  Nice shiny blood splatter. I'd like to add some bump mapping and other noises to make it a little less glassy in appearance but for now I'm pretty happy with the results.

Miscellaneous tweaks

switched spherecasts to raycast for a slight performance boost
fixed crossed-wires of hand and head-based throw mechanics
tried a number of things to fix the dropped frames but haven't found the culprit
  - destroy enemies that fly outside of a limited radius
  - blood collisions limited to a single layer - tried but reverted back to "world"
  - dialed down Maximum Allowed Timestep and Maximum Particle Timestep (.0111111)
  - suspect object pooling enemies will help, but haven't implemented it yet
  - suspect audio is taxing the system but I can't see it in the Profiler window (still learning)



The AmbiX Ambisonic plugin suite and Reaper are the tools I used to create the ambisonic audio mix.

Here's the shader tutorial teaser video I was talking about:


This is the recording session of the sound track I'm using in the game. That's me on saxophone and drums. My friend Eric is on guitar and Novax CH8 guitar/bass hybrid. Eric's kids are cheering us on:


Here's a video I watched today that I thought was appropriate for this blog. It's about the making of Ball Wars, a game made in two days.


See you in one week!

Comments

Popular Posts