Carol’s Garden

Carol loves her garden. Every year it seems we discover something new left by the past.

The first year we were here we thought we would have to plant Irises in the back garden. They magically appeared anyway in the spring.

Then we discovered white Hydrangeas in the back. The builder planted several types of Hydrangea on the front, but the back ones were leftovers from the past.

Tulips. Day Lilies. Miraculously I saw American Sweet Pea flowers that are as delicate and beautiful as Orchids.

We planted a Japanese Red Princess Maple. We planted Cherry bushes. A Lilac. Last year we planted two types of Ginkgo tree. We put in a vegetable garden in a risen wooden bed. We put in Dusty Roses and tall Blueberry bushes. This year, a trio of white Birch. The kind we know and love from Newfoundland.

And a very kind neighbor gave us a piece of heavy slate, 22″ x 12″, which we thought we would use as a door step of some kind. Instead I used it behind the Roses to hide a bit of a blemish in the concrete wall of our neighbor.

But that slate got me thinking.

So I decided to surprise Carol with a cool thing. But I couldn’t keep it secret. And I wanted her opinion on it. So I told her. I’m going to make a stencil, stick it to the slate, spray paint letters and a graphic, and then use my Dremel to grind into the letters to form a relief slate stone to mark her garden.

So I thought I would document the progress here.

First, I took some photos of her favorite Hydrangeas.

I used Inkscape, a cool vector art program to sketch out some Hydrange flowers.

Then I put her name in Garamond Bold, on curves around them.

The plan is to use my Cricut to cut the above graphic as a paint stencil, lay it down onto the slate and spray-paint the slate, which will give me black lettering. Then I will use grinding wheels to cut into the slate and make a relief of this image.

The plan is to add my own stems (the stencil wasn’t necessary for that) and those little bulbs that fill in the spaces around the Hydrangea flowers, by hand, with the Dremel.

This is partly what the finished idea should look like, using Photoshop Emboss tools. It’s not complete of course, as the aforementioned stems and bulbs aren’t shown here.

MOCK-UP ONLY:

I will keep you all posted as I progress.


Soooo, I haven’t updated my blog in many months, and today I’m sitting here with some time on my hands, and earlier in the week I decided to go through my Dropbox Camera Uploads and separate out my photos by year so I could be better organized.

Going through them I realized how much I had done this past year, and figured it’s time to update some things. So blog posts incoming! Be warned.

Starting with this overdue update on Carol’s Garden slate stone progress.

It’s done. It’s out in the garden now. Here are some pics of the work in progress:

First etching after spray-painting the stencil in light black to get the outlines: Some of the darker black are actually spots of water from spray-washing it, that have not yet dried. The darker gray is spray paint.

Then filling out the first name: It looks very white here because the dust is still there.

Main design nearing completion:

Here it is, probably almost finished. You can see some of the black spraypaint where my stencil was not stuck down firmly enough, but I believe that will fade with time.

HÜVER Powerups and Friends

POWERUPS

The last real game feature, other than saving the game, was Powerups.

These are floating objects that give gifts if you collide with them.

The Powerups appear randomly over random buildings, and have a lifespan. During the lifespan, the color of the Powerup fades, until you can barely see it. But as long as it is there, you can still hit it.

Each has a cylindrical timer gauge. This starts at the height of the Powerup capsule, and begins to shrink. When it becomes a flat disc, the Powerup disappears.

The gauge will let you know how much longer the Powerup will be around, so if you see a distant one with a short cylinder, don’t bother, it may be gone by the time you get there.

Currently I have 3 kinds of Powerup:

  1. Shekyls (cash)
  2. Fuel
  3. Repairs

Each Powerup type has 4 intensities. The lowest gives out the lowest payoff, while the highest, the most.

Each one has the icon of the type of Powerup, and rotates at a faster speed, the more valuable the reward.

Each has its own collection sound when you successfully collect its reward, and the sound volume is louder for more valuable rewards.

When a Powerup is created, you see a flash of same-colored light, and a ring. This is to let you know when one is created nearby. When it disappears, it goes out in a flash of light to let you know it has gone.

It also creates a metallic sound when created, which will give you an idea how far away new ones are, because of the volumetric sound which fades with distance.

FRIENDS

A week or so ago I put out the call on facebook for any of my friends and family who wanted their voice in my game to submit sound clips which I would put in.

HÜVER is an homage to a beloved Commodore 64 game, Space Taxi.

In it, you fly a taxi around a maze-like level, with a number of landing pads. A passenger appears at a random pad and yells “Hey, taxi!” (One of the first games for the Commodore 64 that used digitized voice clips.)

You fly to the passenger, land, and he climbs aboard and tells you where he wants to go, “Pad four please!” Then you take him to pad 4 and he gets off. Another passenger appears randomly, and so on.

But since my game is more of a touch-the-pads-in-order game, you don’t actually pick up a passenger on a pad, you just go to the next pad. “Hey taxi!” seemed less useful.

But I thought of a way to use it anyway.

Currently when a new pad is ready, you will hear one of my friends say “Pad Four Please” depending on the pad, from 1 to 9.

The initial fare is decided based on your distance to the target pad. And the fare begins to count down immediately. The longer you take to get there, the less fare you earn, so you are incentivized to get there as fast as you can.

So I decided that when you reach half of the initial fare, the same friend who called you now says “Hey taxi!” as in “What’s keeping you!?”

PLAY ME

This is a link to a ZIP file with the latest playable game – 64Meg.

PLEASE NOTE: THERE ARE A COUPLE OF BUGS OF COURSE.

Mainly, resetting the game (setting you back to default state) doesn’t appear to work in a build, yet it works perfectly in Editor. I tried two approaches, and both fail on a build, work in Editor.

So if you want to restart your game, find the file at this path and delete it.

C:\Users\<username>\AppData\LocalLow\Huver\Rolling Ball Physics Tutorial A\Huver_SaveGame.json.

(It’s called Rolling Ball Physics Tutorial because that’s how this project started out – as a learning exercise, rolling a ball around, painting floor tiles.)

You need only a PC that can play Unity games (and you can set the quality, so a slower PC with a bad video card can still play) and a USB XBOX 360 controller like the one that you see in the starting screen.

Unzip this file somewhere, and you should just be able to go to the unzipped directory and click on Huver.exe

I added Game Saving/Loading. It meant saving a LOT of variables, and the easiest way for me to do that is to make a variable object and save its entire set of properties to a JSON file. I wrote a Save method that pushed every relevant variable into a single object, and saved that object to a JSON.

Loading does the opposite. Loads the JSON and moves a bunch of variables around to where they belong.

Other than that, it is a perfectly playable game, and I think fun.

 

HÜVER Audio

I was scared of audio.

I didn’t quite know how to handle the many sounds I would want in HÜVER.

So I started with simple events. I discovered in Unity I could put an AudioSource on an object and script that object to PlayOneShot(sound, volume) and that worked well.

I set up an AudioSource, then made some AudioClip variables, and went searching for sounds. I found a lot of sounds by poking through the directories on my computer. I listened to a lot of standard Windows event sounds, and some bizarrely that showed up in the OpenOffice directory structure.

I used a few of those.

But I also found a site called freesound.org. I signed up and found some collision sounds, and some other interesting sounds to begin with.

Landing Pads

I started with the Taxi Landing Pads. I knew I wanted those to hum, so you knew they were active, and with stereo sound, you could determine where they were, at least which direction and how far away, from the sounds you hear in stereo.

So I attached a looping hum to an AudioSource on the light beam itself. That way, when the beam is activated by the game, the sound starts up automatically, and goes away when you land on it, since that removes the beam.

UI Panels

Then I tackled the UI panel. A sound when you begin a shift. Simple enough. Worked fine.

Then I wanted a sound for every selection in the Purchase UI. Every time you pulled the joystick to change shopping options, a sound would fire. That also worked well enough, except the hacky way I did my UI meant it was on an Update() loop and I had to check for it firing once, and then not allow it to fire again until you change options. Again, no big deal.

And a sound of warning if you tried to select an unaffordable upgrade option.

And a sound for a successful purchase.

Fuel Gauge

Then I wanted the fuel gauge to alert you when it was getting low on fuel.

I knew what I really wanted was a warning as you pass from one color threshold to another, with a dire warning once you were in the red, with perhaps a constant warning in that dangerous range.

So I got my daughter to record some sound samples:

“Fuel Yellow”, “Fuel Orange”, “Warning! Fuel Low!” and “Fuel Full”.

I put some reverb on those and put them right in the game, placing firing code whenever the gas gauge ranged within those color changes, and also having to make sure they didn’t fire off multiple times within those slim ranges, since this was also on an Update() loop.

Once you enter into the red, you get a constant pinging of warning, which gets faster and faster the lower your fuel level drops, emphasizing the urgency of the situation.

And suddenly I had a game with sound!

There are a few others, almost all of which are event-fired.

Collisions

I wanted to have some great impact sounds for when the taxi hit buildings and other things. First, the game really only considers two kinds of collision for the taxi: Airship and Other. If it hits an airship, I want the Tip amount to go down, but I didn’t think it fair to damage the car since you can collide with an airship without being able to see it, if it’s coming from behind, or in an area not in your viewport.

So no damage. But now it makes a very satisfying object-hitting-rubber-balloon sound. And the intensity of the collision directly drives volume, so the harder you hit it, the louder the sound.

But for buildings, I wanted to have graded sounds for the intensity of impact. Volume wasn’t going to be enough.

So I created an array of 10 sounds ranging from a tiny bump. to metal hit, to glass breaking, to a collossal crash. And it fires perfeclty!

Powerups

Then I added Powerups. Floating things in the city that give you bonus items if you collide with them.

I wanted those to make an arcade-like bling sound when you hit them. That was also very easy.

So what was left?

Taxi

Man, I was intimidated.

I didn’t know how to drive sound on the taxi, when the engines are controlled by four joystick axes, and a button for Turbo.

I didn’t want a lot of complex code, firing looping sounds at given volumes and pitches (yes, you can alter pitch!). I didn’t want to be checking to see if one sound was playing in order to play another.

But then it hit me.

I can put a unique AudioSource on the taxi for each joystick axis!

So I found a nice jet engine sound and looped it (freesound.org to the rescue) and then I remembered last summer cleaning off our plastic deck Adriondack chairs with a hose on tight beam, and the sound was awesome! I vowed to record it and use it for my engine noises. So I did.

Finding smooth loops was hard, but I managed.

But first, the main power. That’s the UP/DOWN thrust. I wanted a jet engine sound for that so I used the freesound.org jet engine sound I found.

But how to trigger it?

So it turns out the AudioSource can be told to play on start, and to loop. Perfect.

I determined I didn’t have to have any complex code to start and stop the audio whenever I change joystick intensity. Instead, I simply alter the volume and pitch based on the joystick’s position, making sure there was a constant low volume in the cases where I wanted the engines running when there was no joystick input at all (freefall) but when the stick was engaged, it would ramp up the volume and pitch to make it sound like the engines were working harder.

And it worked! Like a charm!

So then it was an easy step to add an AudioSource for FORWARD/BACKWARD sound, and for that one I used one of the loops I made by cleaning my deck chairs. Pitch and volume is controlled by forward/backward joystick amount. I easily adjust the pitch ranges by code values until I got something I liked

Same for TURN. I was able to easily do the same for Turning.

Then I added STRAFE, which uses the same sound as Turn (since they technically use the same engines) but at a different pitch, so you can hear the difference.

TURBO simply multiplies the pitch and volume a bit so it seems more intense when Turbo is engaged. Turbo is boolean, so it’s a simple yes or no to that pitch alteration.

And now, dammit, I have a complete sounding game!

Crashing

But oh… what about when you crash? Or run out of fuel?

One simple addition to the LoseControl() method, and I called PlayOneShot(losingControl, volume) and it plays a nice sound of a jet engine winding down. At the same time, I reduce the volume of the other four AudioSources to 0.

And it sounds amazing! You run out of fuel and you get the engine winding down to 0 as you fall through the sky.

NOW it’s done.

Sure, I want to tweak the sounds themselves, or even replace some, and adjust the pitches and volumes, but that’s all data.