The Blog of Ryan Foss

It's a start!
podcast

Three Riker Picard

I made this last night for the IGDA Twin Cities Podcast Episode 9, titled Three Riker Picard.  Listen to it if you want to hear how this idea came to be.

Lady Killer T-Shirt Design

Check out “Three Wolf Moon” on Amazon if you don’t know what it is to see the inspiration for this work of art!

IGDA Twin Cities Podcast #8

We’ve published another IGDA Twin Cities podcast.  We had some recording problems, but its still full of interesting conversation.

E3 2011

I love E3, its so much fun to see happen.  A combination of what they say and how they say it.

It was a great subject for the IGDA Twin cities podcast, though I only said half of what’s on my mind.  We talk E3 at great length, covering everything from Microsoft’s Kinect boner, to Sony’s apology and Nintendo’s new console.  Check it out.

Podcasting, Episode 5

Perhaps we were a little crude, but it was fun.  We had a guest on too.  Check IGDATC.org to listen to the podcast, or check it out the on iTunes.

Another podcast published

Portal 2 consumes me… but I managed to find the time to record a IGDA Twin Cities Podcast and talk about Portal 2.

Check IGDATC.org or on iTunes to listen to the podcast.

Rolling Average Smoothing

At the IGDA Twin Cities meeting in March, the lead developer for Just Jam, Matt Heinzen, mentioned using rolling averages to do animation. This caught my attention, since it was a perfect phrase for a trick I have used a number of times in my programming. I thought I’d take a shot at explaining it here since I did a horrible job on the IGDATC Podcast.

A rolling average is also known as a moving average along with a few other cute names. Wikipedia does a good job explaining it in that Wikipedia way. You know, the equation way with complicated, but accurate, descriptions. I say a rolling average is just a way to take the average of a select part of data set. For example, in the last 7 days, I’ve averaged 0.6 cans of Mt. Dew a day. If, tomorrow, I don’t consume any Mt. Dew, my 7 day average will go down.

So how does this help in programming? For me, its usually a matter of convenience. You may have binary data and you want to smooth it out some for instance. To really smooth it out you may want to be aware of your time step, acceleration/deceleration, velocity, motion time, time into motion. Maybe even more. With a rolling average all you need is a target value.

Lets say you’ve got an arrow and you want to have it point somewhere. You don’t want to have super control over the animation of the arrow like I mention above, you simply want to tell it to point up or point down. However, it would be nice if the arrow rotation had some motion.

Let’s set up this example. There is an arrow pointing up, lets call that 0 degrees. Now at some moment you want to say point down, rotating 180 degrees. If all you do is say at one moment your 0 degrees, and the next moment your 180, there is no animation. Let’s use rolling average to smooth it out. All we need to know is the target rotation angle, which in this example is either 0 or 180, and the current angle. We need to pick a period, which in the Mt. Dew example was 7 days. In a typical game, and in most cases I’ve designed, they end up depending on the frame rate, lets not concern ourselves with that at the moment and pick a period of 10.

rolling average rotation = ((current angle) * 9 + (target angle) * 1) / 10

With that example, the first frame after the target angle is changed from 0 to 180, the rolling average will calculate it to be as follows.

rolling average rotation = ((0 degrees) * 9 + (180 degrees) * 1) / 10
rolling average rotation = 18 degrees

That is to say instead of it immediately snapping to 180 degrees, the first frame after its told to go to 180 degrees it rotates to 18 degrees. The next frame would look like this:

rolling average rotation = ((18 degrees) * 9 + (180 degrees) * 1) / 10
rolling average rotation = 34.2

And continuing on.

To help illustrate this I’ve made a little XNA program.  You can either download it and give it a try (no guarantees), or watch this video.

IGDA Twin Cities Podcast #2, Velcro

The second episode of the IGDATC poscast is published.  We talked about video games, mobile gaming devices, IGDA’s impact on the Twin Cities, last month’s meeting recap (Dead Space 2, Technical Artist Sandra Voelker) and upcoming events.

Check IGDATC.ORG to listen to the podcast, or check it out the on iTunes.

IGDA Twin Cities Podast Live on iTunes

I’m the host of the IGDA Twin Cities podcast and you can find it on iTunes now.  That is all.

IGDA Twin Cities Podcast Link on iTunes

I Host a Podcast

I’ve started podasting for the IGDA Twin Cities.  It’s a blast!  We should be publishing once a month.

You can check the IGDATC.ORG website for the podcast, or check it out the Podcast Link on iTunes