Archive for the 'Uncategorized' Category

Hello World

Saturday, February 28th, 2009

Seems like forever since I updated.

What have I been up to you ask? Well, getting married to my sweetheart mostly. I also got a new job and moved to the Seattle area (all of the above within about 2 weeks). The dust has finally settled a bit, so I’m here to tell you that I’m still alive and kicking, and now live within a stone’s throw of Microsoft (literally - assuming I can throw something across the street).

I’m working at Digini (now known as Blade Games) on Blade 3D. What is Blade 3D you ask? I imagine you would - I didn’t know what it was when I first looked at it.

Blade 3D is a game engine with a full-featured IDE, built with XNA and covered in awesome sauce. At first glance it looks like a level designer. Delve a bit deeper though and you’ll find the extensible component system and the scripting system (scripts are written in full C#, complete with IDE!) Don’t like touching code? No problem! You can do all the logic through the logic diagrams - just add nodes of functionality and connect them together.

Basically, it’s a game designer’s dream. You can edit a scene really easily, then add gameplay logic just as easily. Don’t have art? No problem! There’s a marketplace with lots of free art, and plenty of really nice assets at a cheap price.

I really suggest viewing the video tutorials on the site for more information about the product - they give a pretty thorough look at all the different features. There should also be a trial version coming along soon.

So what do I work on? Well, I just finished a long two months with the FBX SDK. If you’ve ever seen it, you’ll know how exhausting figuring it out can be. Not to mention it’s all in C++, which is a bear to fight with once you get really used to C#. After a long battle with the SDK though, I finally produced a very functional importer for FBX, Collada, 3DS and OBJ files. This replaces the outdated libraries we were using and gives us the ability to really spit-shine our art pipeline.

Aside from that, I’ve been working a bit on the logic diagrams system, as well as various other areas in the engine.

So that’s what I’ve been up to. I got married, employed, and moved late last year - all within a span of two weeks. It’s been pretty crazy, but completely awesome as well.

Ziggyware Fall 2008 Article Contest - Win an Xbox!

Monday, October 13th, 2008

Ziggyware is running an XNA Article Contest from now until November 30th. Write an article on an XNA topic and enter it in the contest and you could win! The prize is an Xbox 360 Elite!

I’ll definitely be entering! ;)

Read more about it at Ziggyware.

Interaction Design

Wednesday, September 3rd, 2008

Dodgeball

So, I woke up this morning excited to try out the new XBLA game, Pirates vs. Ninjas Dodgeball. As soon as I downloaded it and started the game, my fiancée said “hand me a controller, this looks like fun.” Now, there aren’t many games which pique her interest too, so I was even more excited. Ten minutes later, we gave up.

The bad thing is, I think I gave up before she did. What is a wonderful concept is made difficult by some of the controls. Our first 15 seconds with the game were like this: move around, do some more moving, try to find a ball, figure out why they’re on our side of the line, pause. The next few minutes were spent with an extremely complicated set of instructions for the controls, of which we gleamed that X threw the ball (or attacked), A jumped, B caught the ball (though we never got this to work), and Y did some sort of special attack if you had a meter full - which I couldn’t find.

Three minutes should be enough to tell you whether or not to get the game. It certainly was with Castle Crashers (which we’re playing through a second time now). But with PvNDB, something I’d waited for excitedly, I just can’t enjoy it like I’d like to. We played against easy difficulty AI, and got destroyed every time. Here’s a short list of issues I take with the game:

  • It’s hard to find the ball, then pick it up. The “pickup the ball” radius is too small.
  • It’s easy to target (well, not a specific opponent), but almost impossible to catch. B never seems to catch.
  • I had to read the instructions to figure out the controls, and even then I couldn’t do the cool stuff the computer was doing without another 10 minutes of reading. I shouldn’t have to read to enjoy the game.
  • It took a while to figure out how to select our team. Plus, when looking at characters, we kept tilting the stick ever slightly left or right, changing our team. Select teams, then characters. Not both at the same time.
  • Seriously, why can’t I just hold down X to charge a firey shot like the computer was doing?

And the list goes on. It looks like a phenomenal game, and I’m sure that with enough play time I could figure out the controls enough to enjoy it - but with so many other phenomenal games to play, I just don’t feel like devoting the time it’d take to learn the controls for this game. Especially when I’d then be that guy when I invited my friends over to play. And honestly, this game demands local play - 2v2 matches could be awesome.

But the controls need to be really intuitive, and need to work well. With the difficulty selecting teams (expand the horizontal dead region to fix), the difficulty catching a ball (my fiancée said “I held B the whole time, why didn’t it catch it?”), and other general accessibility issues (the viewing angle is so low that it’s hard to move up and down to get the ball - graphics over gameplay in this case) - it’s just not that fun.

Your controls are how you present your game to the player. Make sure they’re simple, intuitive, and don’t require 10 minutes with a manual to learn. I don’t want to invite my friends over and say “here, read this manual while I make a snack” - I want to sit them down and play the game with them.

Shredding

The other XBLA release this week was Shred Nebula. It looks like a pretty fun game, and I had a decent time with it. But I just can’t understand why I can’t move the left stick to move my ship. After Geometry Wars and countless other top-down space SHMUPS, you’d think that left joystick = move would be a no-brainer. But in Shred Nebula, left stick turns, left trigger accelerates, left bumper is reverse thruster, and Y activates “hyper drive.” I can understand having a button to activate “abnormally fast” mode, but not to move. I can also understand moving in reverse…though it’s really awkward. (Note: I may have these controls wrong - but there are buttons for everything I mentioned)

Okay, so then you have right stick to gather things (can’t this be done automatically? It seems to be done automatically half the time anyway.), X to fire (I think), right bumper to shield, and B, A and Right Trigger do something too. Now, from a player who has access to all buttons while playing Halo (I wrap my index finger around to the front to access ABXY), I had problems with these controls. Most of them could have been solved by mapping movement to the left stick.

Interaction Design

All of these problems have to do with Interaction Design - one of the more important areas of Usability studies for game designers. Over years and years of playing games on consoles, we’ve developed expectations about which buttons do what on a controller when we’re presented with something on the screen. Left stick almost always moves. Be it a side-scroller, first person shooter, top-down SHMUP, or anything - moving the left stick always moves your character.

The rest varies a bit, but B is usually cancel (on account of being red), A usually does something like accept commands or jump, X is used for shooting and commands, Y is used for less-used features (on account of being farthest away from the right stick for the thumb - read up on Fitts’ Law). The triggers can be used, or the bumpers, but not usually at the same time (except by more advanced players).

In general, trying to keep games to about 5 different controls is best for games meant to be easily accessible, and up to 9 for more advanced games (or less-used functions). This is based on cognitive psychologist George A. Miller’s research, which determined that the human brain can deal with about 7, plus or minus 2, different choices at once. Past that things become confusing, or need to be broken up into smaller tasks.

PvNDB does this fine - there are 5 controls - move, throw, catch, jump and special. However, they don’t react as expected (B doesn’t always catch, X can be used for many different throws). Shred Nebula on the other hand uses almost all of the controls on the gamepad, but does so unintuitively - requiring a button press to move. Both games seem like excellent designs with great gameplay, but they’re rendered unenjoyable because of the controls - the way the player explores the gameplay.

The bottom line is, please do some reading on usability (and take a course or two if you can!). There’s plenty of good materials out there specifically related to computers and games (you’ll find a lot on website design, which can be helpful) - Donald Norman’s The Design of Everyday Things is one of the best out there. It talks about everyday things - a teapot, a microwave, etc. If you can understand why those might be hard to use though, you should certainly be able to understand why a controller with 17 buttons and two joysticks could be difficult to use if the software it’s controlling isn’t designed well.

Edit: To add some final notes - I know that asteroids has the “push button to move, turn to aim” style of play, and that the controls on PvNDB aren’t that bad - but I had some trouble enjoying both of these games this morning in the 10 minutes I gave each of them (due to controls), and I’ve been paying games for almost 20 years. While they’re both decent games, I feel like the controls are holding them back from being phenomenal - at least to me (and my fiancée - who has trouble with controls anyway).

Is this thing on?

Wednesday, July 30th, 2008

I’m not dead! Really! I’ve just been very busy during the last few months. Turns out that once you decide to get married, your life is taken over by wedding planning until you’re married (well, at least if you decide to have a really short engagement). Oh, and yah, I’m getting married!

So, in an attempt to keep my life somewhat normal while everything runs around crazy, I’m going to try getting this blog back in order. If you’re still out there watching, you deserve at least something for your patience, eh? I’m probably going to start it off with some simple tutorials on the engine I work on, FlatRedBall. The engine has really grown out of the “2.5D” that it started in and into a decent 3D engine - with some of my help of course ;)

Aside from that, I might as well share some awesome stuff I’ve seen/played lately:

GemCraft: a tower defense game with a twist - your “towers” hold gems, which actually do the attacking. They can be upgraded and moved around, and as you level up later on you can use your new skills to go play old levels (without being bored to tears). You can also respec your skill point distribution at any time for free - which is really nice. I recommend it as a study of how to create a game where your character can get stronger without previous areas being any less boring to play (and without “leveling up” previous areas to match your new character).

Team Fortress 2: I know, I caught the boat late. If you haven’t played this yet, go get it off Steam! If you have, and you’re reading my site, you must be some sort of developer, in which case you should read about the rendering methods used in TF2 here and here.

Final Fantasy Tactics A2: Final Fantasy Tactics really drew me in back in the Playstation days, and I’ve played it quite a few times since. I also played all the way through FFTA (the first Final Fantasy I actually finished). So getting this was a no-brainer. Now that I have it, I really appreciate all the variety they’ve added to the game. I also really appreciate how the game is broken into “quests” which each take about 10 to 30 minutes to complete. With the amount of running around I’ve been doing lately, it’s really nice to be able to pull out a game that I can play for 15 minutes or so when I have to wait for something.

Rock Band: I always hated rhythm/music games - there was only ever one song on DDR I was good at, and it was in a very specific arcade version that was in a city I didn’t live in. Other than that, I was horrible. My first experience with Guitar Hero wasn’t that great either - they started me on Medium and I did horrible. However, my fiancée started talking about liking it (she played it with some of her friends), and always on the lookout for new games to play with her, I picked up both Guitar Hero 3 and Rock Band. That was it - we played all the way through Guitar Hero 3, and I still have groups of people over all the time to play Rock Band. It’s a lot of fun to play with friends - and it’s a game that a group of people can really enjoy playing (without having to really be any good at games). Just don’t make people feel bad if they start on easy - it’s not the hardest of hardcore games after all.

So that’s a pretty good list of games that’ve been holding my attention lately. There’s a few others, and I’m always on the lookout for good co-op games I can play with my fiancée (know of any?). Of course there’s also Shizoid - I tried the demo with my best man, then we played it all afternoon. I’ve also played it quite a bit with my fiancée - the one-stick controls are really easy for anyone to pick up. Unfortunately, the difficulty really ramps up around the checkerboard stages.

Oh, and look at my wrist, I’ve gotta go.

Edit: One final note: I’m going to try upgrading to the newest version of Wordpress soon - I’ve used it on another site and it’s much nicer. So a little downtime in the next day or so is to be expected.

Edit(again): Alright, that was relatively painless - only lost the categories for a while. I’ve updated to the newest version of Wordpress. Let me know if anything is broken.

Particle Life Source

Tuesday, May 13th, 2008

Much later than anticipated, here is the source code for my screen saver, Particle Life - and a short discussion of some techniques used to make the screen saver. I used GPU processing, pre-rendered depth blurring, and some fun camera tricks.

Particle Life Source Code

GPU Processing

You’ll see this in PositionsEffect.fx. Basically, I pre-generate a velocities texture with random noise, and pre-generate a positions texture with incremental depths for particles (to ensure a good distribution of particles) and random x/y values (with the camera’s frustum). Then every frame I sample both position and velocity, add the two together (multiplying the velocity by the elapsed time) and write the new values to the positions texture.

Now, here’s where I could use vertex texture fetching, but I wanted something that’d work on shader model 2.0 (and my laptop), so I did something simpler. The position texture is stored as a HalfVector4. Every frame, I dump this straight into an array and then push it into a vertex buffer of HalfVector4 vertices. Since I’m using point sprites, that’s all I need to do. It’s not the most efficient piece of code (the dump sure isn’t nice), but it works.

Pre-rendered Depth Blurring

I wanted particles to look blurry as they became more distant. However, with alpha-blended particles, I can’t quite do this in a post-processing step. I’d have to basically blur the texture whenever I rendered particles by taking several sample taps on the texture for each pixel. The fill rate would become horrible.

Life Particles

So, I took the easier route. Instead of doing all that work on the GPU just to get particles to blur, I just built the mipmaps in the texture by hand. If you open up part.dds, you’ll notice that each successive mipmap is not only smaller, but blurrier. Since the mipmaps are automatically blended when I sample the texture, that does the blurring for me for free.

Camera Work

One of the important things to take from this sample is that sometimes there’s ways you can “cheat” without being caught by the end-user, and save a lot of processing power in the meantime. One more example of this is how the particles are “culled”. Nothing exists outside of the camera’s viewing frustum. There’s no reason for it to - it’s not visible to the user, and it’d just waste processing power if we dealt with it. So when a particle leaves the camera’s frustum, it’s wrapped around to the other side.

So how do I know if the particle has left the view? Well, I could do a bunch of nasty math involving rotation, tilt, field of view, etc. Or I can just align the camera straight down the Z axis. Then I know that there is a linear relationship between the particle’s Z position and the width and height of the camera plane at that Z. This is the tangent of the field of view. So I just set that as a variable in the shader (or variables in this case: FieldWidthFactor and FieldHeightFactor in PositionsEffect.fx). Now I don’t even have to do any transformations of the particle positions.

One final note

GTA IV Depth of Field

You might recognize this, it’s from Grand Theft Auto IV (image from gtanet.com). If you’ve played the game, you’ll probably have noticed how short the full-detail draw-distance is. After a couple blocks, cars turn into headlight circles (a simple circle to show headlights) and everything becomes really blurry. My theory is that, to help with memory streaming and file sizes, a lot of the intermediate mip-maps in textures have been cut out. That way the full-detail texture maps only have to be loaded when you’re close to an object, but it can still have some definition if it’s in the background. However, due to either space or processing constraints, they couldn’t show too far away, so a post-processing effect adds some grainy blur for distant objects, helping to hide the low-resolution textures.

That’s in no way the official word on things, just my guess - but it’d be a good example of how you sometimes can make clever use of graphics tricks to keep your asset size and processing requirements low while still maintaining good visual quality.

XNA 3.0: MP3/WMA/WAV support!

Wednesday, May 7th, 2008

So, I was a little disappointed about the XNA 3.0 CTP when I read about it. It looked like the only big feature was Zune support (being without a Zune, or any friends who have a Zune, I have quite the lack of interest in developing for it). However, after a little prodding, it looks like with Zune support comes much better media support, including the ability to import and process MP3, WMA and WAV files without going through XACT! They seem to be converted to WMA files, which is fine by me, though the options available for compression are pretty simple still.

I made an example project which shows how to process and load an MP3 song in your program:

Download the Example!

It’s pretty trivially easy, but there’s really no how-to that I could find that explains this. The big thing is the MediaPlayer class, which lets you do a lot of different things with Song classes. Check it out in the documentation for the XNA 3.0 CTP.

And of course, you’ll need the XNA 3.0 Community Technical Preview to compile and run this example.

Now, if they add FriendGamer.CurrentTitle by the next release, I’ll be happy!

Feed Fixed!

Friday, February 29th, 2008

Looks like when I switched some stuff on my server, I nuked the feed! I fixed it, and hopefully you’re all getting this post as well as my last one! (I’m not dead yet!)

Enjoy this screenshot of my in-development screen saver at huge resolution (not giant yet - haven’t got to test it on 1080p yet):

Giant Screenshot

Site Maintenance

Wednesday, January 23rd, 2008

My site will be down for a few days while I update some stuff. So if you’re watching my site - fear not, I’ll be back!

edit: Looks like it didn’t take long to fix up! Let me know if you encounter any broken links!

Depth of Field Tutorial

Saturday, January 5th, 2008

I’ve submitted a new tutorial to Ziggyware about creating a Depth of Field effect. It includes a lot of information about Gaussian Blurring as well. Check it out at Ziggyware. And If you like it, vote for it in the Ziggyware Holiday Contest.

Back, with a threading tutorial!

Wednesday, October 3rd, 2007

Alright, so long story short - I didn’t slip off the earth, just found a new cave to inhabit. About the time of Gamefest my University Advisor contacted me and informed me that there had been some mistakes in my scheduling, and instead of having graduated in May, I still had 5 credits left to complete! Imagine my dismay! So I pulled things together pretty quickly and managed to work it out so I can complete those credits by using XNA more - lucky me!

First of all - I’m now helping out on the FlatRedBall engine. It’s a 2.5D engine - meaning it renders 2D objects in 3D space. It’s got tons of great features - collision detection, particle systems, great debugging tools, a wide range of graphical options, and now, post-processing. Go check it out!

Second, I’m rebuilding Dream Sower. Our first version was wonderful, but needed something extra to take it over the top. I’ve got a lot of feedback on it, and I’m rewriting some of the low-level code to get it ready for reimplementation. I really really really need an artist, so if you have services you could offer (or know someone who can), please let me know! I’m decent with 3D art, but I’d much rather have a game that has more than programmer art!

Third, and last for today (may we meet again soon!) - I’ve written an article on multi-threading using XNA for Ziggyware’s XNA Article Contest. It has some good information on writing a background loader, teaches you about some common pitfalls in multi-threading, and I even threw in a managed thread class I developed for my game. Let me know what you think of it, and if you like it a lot, go vote for it!

That’s all for now!