This blog has moved. Visit Groundswell Games for the latest. Remember to update your bookmarks and RSS feeds.

Sunday, January 4, 2009

The bandwagon

Happy new year, everyone. It's time to come back from vacation mode and get serious again. That means getting back to the day job, working more regularly on game development, and, of course, blogging. Yeah, maybe I'll get in shape, too.

One thing is certain, though: I now have more money invested in my little venture. My lovely wife bought me an iPod touch for Christmas, and signed up for the Apple iPhone developer program. Plus, I bought a Unity iPhone Basic license, so I can use the coolest development environment to make games for the coolest gadget.

Yes, that's right, I took the plunge -- just like everybody else.

This is one of those times that I wish I were more of an early adopter. The iPhone development market is pretty well flooded now, and the bulk of new apps coming along are games. Every day that goes by will make it harder to score a big hit; there's so much noise out there. Thankfully, thousands of people buy iPhones every day, and all of them no doubt will buy a few apps as they go. As the market matures, there will be less money around for silly or pointless games, and quality will become more important.

What am I working on? Well, a few things. The first goal is likely to be a simple, cheap (or free) game that lets me test the waters a bit. I'm working on something with my brother as well, which has been in the works for several months. We've started adapting our progress for the iPhone, and it's going to be a challenge to get things running smoothly. I've also got another, grander idea in mind that could be really cool, if I can get something out there before someone beats me to it. So many possibilities...

Then, of course, there's SPUDZOOKA. I fully intend to adapt it for the iPhone, but I have quite a bit of work to do there. I did a quick run today to see how well it could just be ported over. Alas, not very well. Running it promptly crashed my iPod.

There are a lot of sacrifices that have to be made for a mobile device, and I'm just beginning to get my head around them. More on that later. Stay tuned -- this is going to be an interesting year. For now, back to dabbling.

Friday, November 28, 2008

Morph targets and a disembodied head

It's been a while since I posted something for you to play with.

Well, here you go.

A man's faceIt will take a minute to load (lots of stuff to calculate). Once it does, just play around with the sliders to customize the guy's face. You can click and drag on his face to turn him around. Cool, huh?

Unfortunately, I can't say that I whipped this up after Thanksgiving dinner. Actually I've been working on it for a week or so, trying out different methods of achieving what I wanted -- and some methods of getting nowhere close. Actually, this version is the most complex one I did. The fact that it works is reason enough to post it.

How it works
Now the thrilling explanation. One of the features that Unity lacks at the moment is the ability to handle morph targets (aka blend shapes) imported from 3D tools like Maya or Cheetah. So, the only way to implement them is to code a system by hand. After scouring the Unity forums, I found a script that would handle simple mesh morphs but didn't do anything as complex as multiple blended attributes.

Using the basics of that script, I manged to put together a system that works pretty well. Here's the basic flow of things:

  • To set everything up, I assign the base mesh (3D shape) in Unity, then create a list of attributes that I want to adjust. Each attribute has a reference mesh created by editing the original mesh to get the most extreme version of each facial attribute.
  • When the scene loads, it first stores several pieces of information (this is why it takes a while to load):
    • For each attribute (24 of them in this scene), it builds a list of vertices in the mesh that are affected by that attribute.
    • At the same time it builds a list of offset vectors for each vertex affected by each attribute. This information stores the maximum possible offset for each vertex per attribute. Lots of data building up here...
    • Then we build a list of which attributes affect each vertex. This is the converse of the first list above, and it's necessary to keep the code running smoothly.
  • After all that data has been stored, the default mesh loads along with a bunch of sliders to control the various attributes.
  • Each time a slider is adjusted, we calculate the proper amount to adjust each vertex affected by that attribute. This is done by using a weighted average of all the attributes affecting each vertex in question. By using a weighted average, we can combine attributes like the width and height of the eyes without getting conflicts (this part took me forever to figure out).
  • Once we have the right offset vectors, we adjust the affected vertices by those values and redraw the mesh. Voila!
Optimization
Because there's so much manipulation of individual vertices in this code, it was really hard to optimize. I spent almost the entire day trying to get it to run at an acceptable speed, and I still don't think it's good enough. The main problem is that when a vertex (or group of vertices) is affected by multiple attributes at once, the weighted average becomes harder to figure out and requires more processing juice. I attempted to store offset values rather than recalculating the average every time a vertex is affected, but I couldn't figure it out before dinner. This version runs well enough, so it will have to do.

Oh, and happy (late) Thanksgiving!

EDIT: I posted a new version of the file after getting some serious optimization help from Jamie. It still takes a while to start up (but not as long), and it runs considerably faster once it loads. My code now also morphs the normals as well as the vertex positions, which I had overlooked before.

Tuesday, November 18, 2008

Untold fortunes await

This is the kind of article I don't need to read. It puts crazy thoughts in my head. The article relates the stunning success of a young fellow who developed an iPhone game over the course of four months, put it on the App Store, and made $250,000 in the first two months. Now he's quit is day job, started a company and employs several people. He's living the dream.

The article does point out (a little slowly) that untold fortunes aren't exactly guaranteed. I don't have any serious notions about creating an overnight sensation--though it would be pretty cool. In fact, being the realist that I am, I can think of three big reasons why my path probably won't match his:

  • He designed a puzzle game. Puzzle games have very broad appeal and are great to play for five minutes at a time.
  • He made a game that required minimal art assets (just a few triangles that can flip over). This fact alone probably saved him months of development time.
  • His game was available at the launch of the App Store. This is the big one. The number of games available on the App Store has grown ridiculously fast over the last few months. The difficulty of cutting through the clutter increases with every game that gets added.
I'm not trying to say that puzzle games are easy to make. It's a space that will get crowded really fast, and few have the right addictive qualities. I'm also not that interested in making them. For some reason that will probably doom my game development career before it begins, want to make games that have some element of character and space to them.

The real point probably is that, while there's real money to be made in iPhone gaming, it's going to get harder all the time to get people's attention. But with a great idea and a lot of polish, it just might be possible to create something really special. Success might also take quite a few failures.

Thursday, November 13, 2008

More clout for iPhone gaming

Saw this article about the fact that several game industry heavyweights are throwing their ... weight ... behind iPhone gaming. There's one EA exec that has gotten quite a bit of press the last week or so for saying that Nintendo and Sony should be scared of the possibilities for Apple-based mobile gaming.

The fact that the iPhone isn't a dedicated gaming device doesn't seem to be a problem for these folks -- nor should it be. In fact, the idea that you can carry one device around to occupy every odd minute of your life seems quite appealing to people.

I've been reading about some of the technical limitations of the iPhone, and it definitely seems possible to overcome them. I'm trying to think of it like a retro game development exercise. I'll just pretend I'm developing for the original Playstation or N64.

In case you're wondering, I'm not actively developing for the iPhone, yet. I'm hoping in the next couple of months I'll be up and running. My brother and I are working on a game right now that we're planning to port over, and I have another idea for a game that could be really cool, if I can pull it off. SPUDZOOKA is on the list, too. It might be a good one to practice on, since the game is pretty much done. I would want to add some new levels, though (how long have I been saying that?).

Monday, November 10, 2008

A confession of loyalty betrayed

I have always been an Apple fan. (That's not the confession.)

It wasn't long ago that such a statement would cause listeners' eyes to roll uncontrollably. Often this reflex was accompanied by a sharp exhale of breath that most people would mistake for an impatient sigh laced with sarcasm. Lifelong Apple fans like myself, however, have always been able to recognize the true emotion behind those reactions: jealousy.

Don't bother to deny it -- denial is just part of the friendly game we all play. It's ok; I understand. Now that Apple's cool and Microsoft isn't, I do like saying that I knew that from the beginning, and I told you so, and Mac OS 6 beats Windows 3.1 any day.

All these things are self-evident, and my gloating undoubtedly suits a Mac user admirably. Nevertheless, there is one little problem: I love my Xbox 360.

Maybe it's the allure of hi-def gaming. Or the number of games that appeal to my taste more than the PS3. Or maybe it's the promise of a true all-in-one media center in my living room (not that I've downloaded any TV shows or movies through Xbox Live, yet).

I don't know the reason, but I find, strangely, that I'm excited by the impending arrival of the New Xbox Experience on Nov. 19. Not just a little excited, either -- I'm excited like Steve Jobs is giving a keynote at WWDC. How did this happen?

But there are plenty of things to be excited about, right? I will be able to:

  • Create a Wii-worthy avatar to replace my stupid gamer picture
  • Navigate through thousands of downloadable goodies much faster
  • Stream Netflix movies straight to my TV
  • Some of the Netflix movies are even hi-def
Sure, mostly I'll just be playing games like I always did, but there's something about the new wrapper that has me giddy as a schoolboy. The Netflix streaming itself is pretty awesome, so maybe that's the reason. Netflix is way cooler than Microsoft anyway.

If anybody's interested, here's a review of the New Xbox Experience from Ars Technica.