Tuesday, June 14, 2011

Acknowledgements

People:


Ena M - http://behindtheveil.deviantart.com/
Ena is an amazing artist and she dashed off the character sprites in Platform Hack without breaking a sweat.

JoeRoh - http://seedroh.blogspot.com/
Joe came in at the 11th hour and saved my butt - adding polish to a ton of art assets, as well as some great playtest advice.  Joe is an aspiring game designer with his own blog as well.

Anna D - http://www.annadonlan.com/
Anna drew some phenomenal logos for both Daydalus Studio and Platform Hack.  She's also a talented photographer.

Visual:


Spiral Graphics Forest Tileset - http://blog.spiralgraphics.biz/2011/01/mystery-forest-tile-set.html
The tileset used in game was modified from a sample tileset found here.

Spriters Resource - http://www.spriters-resource.com/
Didn't directly use any of these assets, but the various animations in the spritesheets of classic games were big inspiration.

Steampunk Font - http://hannarb.deviantart.com/art/Steampunk-Font-148871949
Font used on the menus and popups.

Sound:

nosoap radio - http://www.nosoapradio.us/
Some great video game music available here, completly free.

bfxr - http://www.bfxr.net/
Generate 8-bit sounds in the browser, then save to WAV.

soundbible - http://soundbible.com/
Lots of public domain and "open source" sound files here to use.  Anything from gun shots to bird calls.


Code:

MRPAS - http://www.umbrarumregnum.net/downloads/mrpas
Algorithm used for the Fog of War in minimaps

Platformer Starter Kit - http://create.msdn.com/en-US/education/catalog/sample/platformer

Game State Management - http://create.msdn.com/en-US/education/catalog/sample/game_state_management

Particle Effects - http://create.msdn.com/en-US/education/catalog/sample/particle

Collision Detection with Rotation - http://create.msdn.com/en-US/education/catalog/tutorial/collision_2d_perpixel_transformed


Tools:

Audacity - http://audacity.sourceforge.net
Audacity is an open source sound editing suite.  It can be used to record and edit sound, and export to WAV or MP3.  I used this to record various sound effects, change the pitch or length of others, and noise.

Gimp - http://www.gimp.org/
Open source Photoshop.  Used to edit pretty much all visual assets in the game, from the sprites, in-game objects, HUD and background art.  The two biggest features are the ability to work with the Alpha (transparent) layer, and split images into Grids (which is essential for lining up textures in spritesheets / animations)

Camstudio - http://camstudio.org/
Similar to FRAPs, used to record video for playtests and trailer.

Platform Hack Post-Mortem

Things That Worked

Stick with the Design

A clear design for Platform hack was laid out at the beginning: a mash-up of Metroid (platform jumping, exploratory powerups) with dynamic world creation of Roguelikes. This was followed through from the start. It helped to not have to change genres or styles halfway through, and the core gameplay feels very similar to what I had in mind.

Prototype, Prototype, Prototype

Breaking the challenges of the game into smaller problems, and then getting those working in isolated environments was key. The main issues - grappling hook, double/wall jump, traps, melee / ranged combat, level design - were all handled in a "sandbox" project. This way I didn't have to worry about breaking the game to try out a new feature, I could hardcode physics constants or whatever until the feature worked how I wanted it. *then* port it over to the game project.

Don't Reinvent the Wheel

Platform Hack borrowed from a lot of great sources, both for code and art. The samples on App Hub were essential, especially the Platformer starter kit, which included the core code for tile-based levels, basic physics (jumping, gravity), sprite-based animation, and collision detection. Other samples were useful as well - Game State Management, Pixel-Based collision with rotation. For the sprites, I ended up using sample spritesheets and having my artist base all the animations (run, jump, attack, die) on those models.

Limit Features...For Now

The original plan for platform hack had dozens of procedurally generated levels, 4 huge boss fights, an overarching story, and a leveling system that let the player specialize in different types of powers. Those plans are still on the table for the final release, but about a month out from the deadline, I realized I wasn't going to hit all those marks, and set my sights for a much smaller goal - a stable game with polished art and gameplay. In the end, I was able to deliver by the deadline.

Things that Caused Problems


Collision Detection

Pixel based collision detection can make you want to tear your eyes out. When it doesn't work, it’s very hard to figure out why (you can't step into and iterate through the 10000 item color array to see a certain pixel isn't set to alpha), especially if you are using matrix math for rotation and translation. One thing I ended up doing was creating a TestPixel object, which would basically flip on if it was "collided" with. This let me see a path of where swords, bullets and enemies passed through. Unfortunately, this was very slow (1 fps) and didn't always work. At the end of the day, I removed most of the per-pixel collision, and only used it where absolutely necessary.

Procedural Level Generation

I created a project that would use the Angband algorithms to generate a map, and throw in various enemies, traps and platforms. However, I still had to manually go through the text files and make sure there were no inescapable dead ends or unreachable keys. The tough part of procedural level generation is making sure the "maze" can be beaten, once you start adding in locked doors. The early levels also needed additional manual intervention, to give the whole thing a bit more flow and gradually increase the learning curve. As soon as the player uncovers a new trick (jumping boots, grappling hook), you want to give them the opportunity to use it, which you have to manually design. this is why I'm thinking, even in the final game, the procedural levels will only end up being 50%. Stages where you uncover a new item, or fight a scripted boss fight, will need to be hand-crafted.

Loading Assets on Xbox

The scripted boss fight was fun to put together, but not the most elegant solution. The first build I ended up with dozens of 1500x1500 images that not only had to be loaded into Texture2D objects, but also read into Color arrays for pixel-based collision. Needless to say, this caused some OutOfMemory exceptions when attempted on the XBox. The solution was reduce the size of the image files (to 800 x 600), and then build a manifest loader that would reuse certain textures for various animation frames (the idle frame is used in almost every animation), and also only generate the Color[] on frames that needed collision.

Animation State Machines

This is something I'm still dealing with. Animation is one big state machine - trying to map both the player input + the world controls into a believable animation for the player to be in. For instance, if the player is swinging his sword and then jumps, do you continue to play the first ground swing animation? or switch over mid-swing to the jump-swing animation? What if you can't transition halfway between animations and have to start at the beginning? This "transition" issue was a headache to get right. In the end, I decided that animations must be played from start to finish, and you can't start a new action while you are in the middle of one (aka start shooting while rolling, roll while swinging, etc). Of course, the button press will usually still be registered once the animation is over and you'd start the new action immediately. The more complex your animation state machine, the harder this problem becomes.

Lessons Learned

Get It Working First

Work on the hard items early rather than low hanging fruit. You never know how long it will take to figure out an architecture problem (loading assets, collision detection, etc). But its usually more predictable how long it will take to import new art, or tweak small cosmetic bugs. Leave that polish for the end, get the hard stuff working as early as possible.

Art / Sound = Morale boost

It's a huge morale boost when you see your crappy programmer art "skinned" with graphics that look good.

80/20 rule

There's always that last 20 percent you want to get done.  But leave 20% of your time for pure polish, not dev.

Lots of builds / releases.

Don't leave stuff in an uncompelled / untested state at the end of the day. During crunch time, do a daily play test. make a list of everything wrong. fix what you can. increment the build number. repeat.

Make what you can / borrow what you can't.

I knew I'd never be able to make original music or draw convincing sprites, so I either found good assets online (free music) or got a friend to draw me sprites. Other stuff that was less important (sound effects, in-game items) I mocked up myself using various free tools.