Tuesday, October 30, 2012

XNA

XNA is a set of development tools built to facilitate PC, Xbox 360, and Windows Phone 7 game development.  XNA is a free download.  It extends Microsoft's Visual Studio IDE which is also free.  XNA games are built in C# which is a language very similar to Java, so if you know that, there isn't much syntax to learn.  I've been playing with XNA for about two months now, and have made some (very) small games.  My experience thus far is limited, but with the amount I feel I've accomplished thus far during my brief time with the tools, XNA gets a gold star from me

So, how does XNA facilitate game development?  First, creating a new XNA project creates a Game class for the developer to work in.  This Game class includes class-level variables to help interface with the graphics card of the targeted platform and draw sprites (basically, any 2D or 3D image in a scene).  The Game class includes methods to create and initialize a game as well as a method for loading any content (images, models, sounds, effects, fonts, etc.) a game requires.  Most importantly however, the Game class manages what is known as the game loop.

The game loop is a set of methods that are called continuously while the game is running.  In XNA, this loop consists of only two methods: Update and Draw.  Draw is used to draw any element in the scene seen by the player while everything needed to run a game that isn't drawing takes place in Update.  Typical actions housed in Update include moving objects, checking for collisions, updating scores, and checking for end-game logic.  The bulk of the logic housed in Update involves polling for events.  Polling is what differentiates the way games execute from that way many other types of software applications execute.  Polling is also why the game loop is such a vital part of game development.

Outside of games, a typical application might prompt the user to take some action, and then wait.  Once the user performs the prompted action, the application is notified, and execution continues.  Games never wait.  They perform actions constantly, and actively ask the system whether or not certain events have taken place.  For instance, the game is not notified by the system when a player moves the mouse.  Instead, every time the game updates, the game polls the mouse for its current position, and then checks this current position against the position of the mouse from the previous update.  Computers are quick, so it's not uncommon for a game to call it's Update method, where much of the polling takes place, 60 or more times a second.

My first XNA project involved displaying two animated sprites that bounce around the screen.  Among other tasks, this project involved making or finding a sprite sheet, loading the sprite sheet into a Texture2D variable, and in Draw, cycling through the images on the sprite sheet to simulate motion.  On each call to my games Update method, I adjusted each sprite's position on the screen based on an initial direction.  In Update, I also polled the sprites for their current positions within the game's window so that I knew when a sprite's bounds overlapped the bounds of the window.  When I detected this overlapping, I simply changed the sprite's direction.  Changing direction this way made is appear as if the sprites were colliding with the game's window, and ensured that the sprites always remained in view.

For the curious, here's a link [coming soon] to an executable of my first XNA project (Windows only).  For someone with zero game programming experience prior to XNA, not counting Stencyl or Twine, I can tell you it's easy to pick up, and it takes very little to make yourself feel super accomplished.  Don't forget about the gold star!

By far, the most difficult part of this project for me was finding useable sprite sheets.  If you need sprites for a project, Spriters Resource is a great place to start.  Also, many of the sprite sheets you'll find online will not have consistent spacing between sprites which is pretty important when calculating which pixels of the sprite sheet to draw in-game each frame.  So, if you find a bunch of sprites, but need to assemble the sprite sheet yourself, Alferd's Sprite Sheet Unpacker is great.  It might save you some time.

Cheers,

Danny

Friday, October 26, 2012

Programming Advice

Do not ever leave the computer if your program does not run.

Andy Gavin, Naughty Dog Co-Founder

Cheers,

Danny

Wednesday, October 24, 2012

Renga

Renga is a game that makes me want to make games!

Full disclosure, I haven't played Renga.

I few days ago, some local developers who made the trek to IndieCade showed me a video they took of a game called Renga.  I've had a few days to think about what kind of experience Renga offers players based on what was shown me, and I still can't believe how unique that experience is.  Games have come a long way, but there are still a staggering number of directions no developers have even thought to face yet.  I love my blockbusters, but the holiday release schedule often makes the potential of this industry to create truly new experiences easy to overlook.  I'm thankful for games like Renga to remind me how exciting game development is right now.  There's nothing I want more than to have a hand in crafting a unique experience that contributes to this excitement.

So, what is Renga?

Renga is a cooperative game played with 100 players.  It's an abstract space strategy game where players must defend their collective mother ship from hostiles and gather the resources necessary for expansion.  Before play begins, each player is given a laser pointer.  This laser pointer acts as their ship in game.  Enemy ships have a number of nodes lining their perimeters.  To destroy an enemy, at least one laser pointer must occupy each of these nodes.  Larger enemies have a greater number of nodes.  The mother ship too is lined with nodes.  These nodes however, influence translation rather than destruction.  To move the mother ship away from danger, players must navigate their lasers to the node facing the desired direction of movement.  The more lasers in a node, the faster the mother ship will move in that direction.

Remember, there's 100 people playing this game at one time.  Who's harvesting resources?  Who's on defense?  Who's looking after the mother ship?  It's easy to see how this game works to foster teamwork through both spoken and unspoken communication between players.

I can't convey in any written form how excited I am that this game exists!  There's a lot about this game that has to shown to be appreciated.  In the video below, 100 people are playing, 200 more are watching.  Listen for the spoken direction.  Watch the cooperation.  Feel the joy!


Cheers,

Danny

Sunday, October 21, 2012

Thursday, October 18, 2012

Describing A Game's Aesthetics

Think of your favorite game.  Now, pretend you're telling a friend about that game.  Do your best to describe the game's aesthetics.  Before you start, stop thinking about graphics.  When I say aesthetics, I mean the emotional responses evoked in you as a player when you're interacting with the game's systems.  Try to describe that.  It helps to think out loud.  It's easy to recognize incomplete thoughts when you try to convert the generalities in your head into something more concrete.

Here are some words I've used to describe the "aesthetics" my favorite games in the past: fun, innovative, interesting, challenging, pretty.  What do these words say about the gameplay experience I'm trying to convey?  Absolutely nothing.  I think that's a problem.

Too often, people discuss games in generalities, never traveling beyond the surface of "fun."  I'm definitely one of those people.  Too often, I talk about games without saying anything meaningful - something that myself or those I talk to can take with them to help inform their next gameplay experience.  This is one area of my relationship with games I'd like to improve.  I know a language exists for discussing games in meaningful ways, a language for use by both developers and players.  Most people just don't speak it yet.

Thankfully, lots of people, including the people who wrote this paper, have been looking at this problem much longer than I have.  Some of their suggestions for better ways in which to describe player experiences, or the aesthetics of a game, include:
  • Sensation: Game as sense-pleasure
  • Fantasy: Game as make-believe
  • Narrative: Game as drama
  • Challenge: Game as obstacle course
  • Fellowship: Game as social framework
  • Discovery: Game as uncharted territory
  • Expression: Game as self-discovery
  • Submission: Game as pastime

They provide some great examples of this game vocabulary in action:
  • Charades: Fellowship, Expression, Challenge.
  • Quake: Challenge, Sensation, Competition, Fantasy.
  • The Sims: Discovery, Fantasy, Expression, Narrative.
  • Final Fantasy: Fantasy, Narrative, Expression, Discovery, Challenge, Submission.

As is shown above, games are not limited to pursuing one aesthetic goal while forfeiting inclusion of the others.  Rather, games pursue multiple aesthetic goals to varying degrees in order to best achieve the desired gameplay experience.

I encourage everyone to try this as an exercise: Using only the eight words listed above, describe the aesthetic experience of a game you've spent considerable time with.  It doesn't sound challenging, but I, personally, find it rather difficult.  I plan on writing up my conclusions and justifications for some of my attempts at game aesthetics breakdowns at some point, so expect that soonish.

Cheers,

Danny

Tuesday, October 16, 2012

Hours Of Behind-The-Scenes Game Talk

I've been following this blog: tiny Build Games.  tiny Build released one of my favorite launch trailers of all time for their game No Time to Explain.  Also, No Time to Explain is awesome.  Also, their new game looks fucking rad.  I love the blog, but I think I love their most recent post most.

Check it out!  Seriously.  If you're looking for enough quality game dev related content to last until 2013, stop searching.  I found it for you.  Well, tiny Build found it for you.  Here are some of the videos they link to:
  • Portal 2 Post-Mortem
  • How Fruit Ninja Happened
  • Extended Interview With Gabe Newell
  • How Bioshock Infinite Got Started
  • David Jaffe's PAX Keynote
  • Making Crash Bandicoot
  • Building The Bastion
  • Robert Khoo Talks About Running Penny Arcade
  • Super Metroid Analysis
  • AND SO MUCH MORE!!

I'm not linking to any of this awesome content directly.  Be kind, go to tiny Build.  Watch.  Watch everything.

Cheers,

Danny

Thursday, October 11, 2012

MDA

Back in July, out of the sunshine, in front of my computer, I read a paper.  Apparently, while reading, I was taking notes.  If you stopped by today looking for some free advice, affix your eyes to this next bit: Write things down!

I don't enjoy assuming, but I do it lots, so let's assume you, dear reader, and I share a process.  Specifically, a reading process.  Here's your cycle:
  • Finish reading something you think is important.
  • Mentally reflect on the piece's supposed importance for a moment - two moments if that's how long it takes your browser to load up the four to nine Web pages you've already managed to navigate to since you finished reading the important thing.
  • Read something else.
  • Forget all that came before the current thing.
  • Repeat.

So many interesting thoughts get lost this way!  Not this time though.  I read a paper I found useful, took some notes, and managed to find those notes months later before someone tossed them into a recycling bin.  Cool.

With only a bit more ado, here are some interesting things:

MDA: A Formal Approach to Game Design and Game Research
Robin Hunicke, Marc LeBlanc, Robert Zubek

First off, MDA stands for mechanics, dynamics, and aesthetics.  Mechanics describes the particular components of the game, at the level of data representation and algorithms.  Dynamics describes the run-time behavior of the mechanics acting on the player inputs and each others' outputs over time.  Aesthetics describes the desirable emotional responses evoked in the player, when he/she interacts with the game system.  MDA is a formal approach to understanding games - one which attempts to bridge the gap between game design and development, game criticism, and technical game research.

Games are consumable goods.  Inevitably, games are purchased, used and eventually cast away.  Unlike other entertainment products however, the ways in which games are consumed is largely unpredictable - the events and outcomes that occur during gameplay are unknown at the time a game's development is finished.

Partly due to their unpredictable nature, the authors argue that games more represent artifacts, things not viewed as inherent elements but as products of human conception, than media.  To help convince yourself of this, think back to any story you've ever told about a game you played.  These kinds of stories are seldom about the polygons and algorithms the game presents you, the player, but rather about how you interpret this content in the moment and later relive and reshape the experience inside your own head.  As such, the behaviors of a game, rather than the media, represent a game's content.

Interesting, interesting.

The authors had a lot more to say, specifically about productive ways to discuss the aesthetics of a game.  Remember, aesthetics refer to an emotional response from the player while engaged in a game.  It's a great read.  Click the paper title above for a PDF download.

There's more I want to say.  I'll WRITE some more things down in a future post.  Also, Raph Koster talked positively about this framework during the talk he gave to the Omaha Game Developers Association.  I remember his mention of MDA because I WROTE it down.  I'm serious about how important I think the writing process is.

Carry a trustworthy pen with you always.

Cheers,

Danny

Tuesday, October 9, 2012

Four Phases

This is the second part of something.  Here's part I.

Lay Track - Phase I

At the start of your turn, your team should have three track cards laying face-up in your factory.  During this phase, you and your teammate move one or more track cards from your factory onto the game grid.  A track card can be placed onto any tile of the game grid that is not already occupied by a cart or a pit card.  This mean that teams have the option to lay track cards on top of existing track cards.  Any orientation of the track card is allowed so long as the track card occupies only one tile.

At the start of the game, teams can only lay one track card per turn.  The number of track cards a team is allowed to lay per turn can be increased if teams achieve specific objectives during play:
  • For two track cards per turn: One of your team's carts (not the gold cart) must move at least three spaces in a single turn.
  • For three track cards per turn: One of your team's carts (not the gold cart) must move at least five spaces in a single turn.  See phase III for details on cart movement.

When laying down track cards, a team must lay down all allotted track cards.  This means if your team has earned the ability to lay down three track cards per turn, you must lay down all three track cards every turn (not one or two).  This phase ends once you and your teammate has laid all of your allotted track cards.

Pull Lever - Phase II

During this phase, you and your teammate must decide which of the colored tiles (green, orange, fuchsia) to place the switch on.  This decision plays a critical part during the next phase of play.

Move Mine Carts - Phase III
  • For the first turn of the game, your mine carts will be positioned inside your towns.
  • To move a cart out of a town and onto the board, the cart must "hop" onto a track that has made a connection to the town.  The image below shows three track cards that have made a connection to a red town.  Note: This cart can only hop onto the green colored track if the switch had been placed on the green tile during the previous phase.

A Town And Some Tracks

  • Once a track has been hopped onto, your cart follows the path created by connecting tracks until no more track exists to follow.
  • When a junction is encountered, the cart must follow the track colored the same as the tile the switch occupies.  The switch should have been placed during the previous phase.

A Junction

  • If the color of the tile the switch occupies is not present on the junction track card, the card follows the black track by default.
  • When your cart reaches the end of the path it is traveling, your cart comes to a rest on the tile containing the last piece of track that was part of the path.  A cart should never occupy a tile on the game grid where track has not been laid.

Sample Movement - Before & After

  • On your next turn, your cart will begin on the length of track your cart came to rest on during the previous turn.
  • If a path exists for your mine cart to travel on, your cart must move this phase.  This rule includes the case of moving your cart out of your town and onto the game grid.
  • Each team controls two carts.  These carts are labeled "1" and "2."  The order that a team moves carts is important.  First, the "1" cart moves.  Next, the "2" cart moves.  Finally, the gold cart moves.

Special notes on cart movement:
  • The edges of the game grid wrap on all four sides.  The simplest way to grasp this concept is to think of the game Pac-Man.  In Pac-Man, when a player leads Pac-Man off one side of the screen, he emerges from the opposite side of the screen.  The same concept applies here.

Wrapping - Before & After

  • Carts cannot pass through each other.  If the path of one cart is blocked by another cart, the moving cart will come to a halt on the tile before the collision world occur.

Blocking - Before & After

  • If your cart begins phase III on a colored section of a junction track, the position of the switch (green, orange, fuchsia) does not affect your cart's ability to move off this length of track onto a connecting path.
  
Discard/Draw - Phase IV

During this phase, discard all remaining track cards (if any) in your team's factory.  Draw three new track cards from the deck, and place these new cards face-up in your team's factory.

Play now passes to the opposing team.

Cheers,

Danny

Thursday, October 4, 2012

Mine Cart Mayhem

Last week, I posted about my first prototype for a race game I spent some time working on.  After its first playtest, I threw that prototype into a pot with some additional playtests and a plethora of unremarkable art skills, and a game started brewing.  It's been a few weeks, and I need the counter space, so I'm going to go ahead and serve this game up whether it's ready or not.  Here's the first part of a write-up detailing what's in the pot.

This is going to be wordy, and I can't promise it'll be entertaining.  I want to better my ability to convey game mechanics through text.  It's an exercise I've done a few times before, and each of those times sucker slapped me in the face with a surprising amount of challenge.  It's hard.  I want to improve.

So, if you're not feeling this, this isn't for you.  This is for me.  Thanks for understanding.


Mine Cart Mayhem - A Race Game

The year is 1893.  You live in a small Colorado town that didn't exist before the Colorado Silver Boom.  For 14 years, your town prospered.  Then, with little warning, the boom ended.  Most towns in the area have been abandoned.  Your own town is a shell of its former self.  Lining your town's borders, miles of crisscrossing railroad tracks lie in disarray.  Once used to shuttle precious metals, now they exist to rust.  Your town is poor, but worse than that, your fellow townspeople have grown despondent.

Hope looms on the horizon, however!  Word has just come in that a golden mine cart has been spotted a few miles outside of town, resting on some of the out-of-service tracks.  Where did it come from?  An eccentric philanthropist, perhaps.  Who knows?  Not you!  No more time for questions!  Bringing this golden mine cart back to your town could be just what the townspeople need to lift spirits that have been falling for years.

The objective:
You and your teammate must lay down track and build a path that will lead the golden mine cart from the abandoned tracks to the open arms of your town's people.  Securing this treasure will bring pride and prosperity back to your town.  Hurry though!  It seems the golden glimmer has caught some hungry eyes from a neighboring town.  It's a race to see who can guide the golden mine cart back to their town first.  It's a game of gold and wits!  The race is on!

Game components:
  • 1 game board
  • 2 red mine cart game pieces
  • 2 blue mine cart game pieces
  • 1 gold mine cart game piece
  • 1 track switch game piece
  • Game cards (track cards and pit cards)

The Game Board

The Game Pieces

The Card Types

Setup:

Lay the game board out flat on a hard surface.  Pick a location where each of the four players can sit along a different edge of the game board.  A small, four-sided table is ideal.

From this point on, all mine cart game pieces will be referred to as follows: color + "cart".  For instance, "gold cart" references the golden mine cart game piece while "red cart" references one of the red mine cart game pieces.  The track switch game piece will be referred to as the "switch."

Place the gold cart on the center tile of the game grid.  This center tile is the only tile with tracks printed on it.

Lines, both black and colored, printed on the game grid and game cards are called tracks (see "The Card Types" image above).  When tracks on adjacent tile connect, a path is formed (more on this later).

Place the switch on any of the three colored tiles (green, orange, fuchsia) found on the game board next to the game grid.  Your color selection at this point is not important as you will be given the opportunity to move the switch during your first turn of play.

The remaining four carts get placed on the four towns, one cart per town.  The colors of the town must match the color of the cart placed onto it.  For instance, a red cart cannot be placed on a blue town.

Remove the four pit cards from the deck of game cards.  Pit cards have a black hole printed on their faces.  Shuffle the deck of track cards, and then lay the deck face-down on the game board on top of the space labeled "deck."

Next, each player takes one pit card and places it onto an empty tile of the game grid.  The only restriction on placing these pit cards is that pit cards may not be placed on the four tile surrounding the tile the gold cart occupies.  The tiles marked with red X's in the image below cannot have pit cards placed on them.

Nope!

Make sure your game grid contains four pits before proceeding.

Each team draws three cards from the deck and lays them face-up on the their factory spaces.  Factory spaces are the spaces with images of factories printed on them.  There are six factory spaces - three for each team.  The factory spaces attached to your team's town is your team's factory.

Order of play:

The game is played with four players separated into two teams of two players each.  The red team controls the two red carts, and the blue team controls the two blue carts.  Teammates share control over their carts and track cards.  Teammates are expected to communicate each turn and come to an agreement on the optimal moves to make.

To determine the order of play, all players must reveal their middle names.  Play starts with the team whose player has the most embarrassing name as determined by consensus.  Players who choose not to reveal their middle name automatically forfeit the chance for their team to move first.  If a starting team cannot be determined with the aforementioned middle name shenanigans, players must play a rote (read: not very fun) game of rock, paper, scissors to determine the order of play.

What does a turn look like?

Each turn is separated into four distinct phases:
  • Lay track
  • Pull lever
  • Move mine carts
  • Discard/draw

These phases will be described in detail in a future post.

Wordy.  I warned you.

Cheers,

Danny

Tuesday, October 2, 2012

Things You've Learned

I listen to a lot of podcasts.  Walking - /Filmcast.  Homework - Idle Thumbs.  Cooking - Latest in Paleo.  Working - Rebel FM.  It's a long list.  You can tell a lot about a person solely from the podcasts they subscribe to.  I always seem to have earbuds in.  If there isn't anybody around for me to talk to, I'd rather not sit in silence.

Anyway, I recently went on a podcast downloading spree.  Doing so, I felt like I imagine I would if everything at Toys R Us were free - me with a cart running down the aisles grabbing four of everything, second guessing myself on the way out the door, dumping the cart, filling it again exclusively with Nerf guns and LEGOs, shooting Nerf darts at cars on my drive home.  When my download queue emptied, I ended up with a library full of guided conversations about game development and unguided conversations about current happenings in the game industry.  I was grabbing blind, but I may have pulled out a winner: The Game Engine.  Tagline: A podcast about game development by developers, for developers.  I haven't dug too deep yet, so I have no idea which studios these guys work for, but from listening to the episode, it's obvious at least a few of the hosts/guests are indie developers.

I caught up with the cast on its one year anniversary.  Here, the five developers each shared three things they've learned over the past six months about making games.  Some of the things that were said hit me harder than I thought any of it could, so I'm going to sling it back into the ether in hopes that it connects with someone else.

In an indie game studio, change is the only constant.  Be prepared to wear a lot of hats.

Game development is like steering a car crash.

Make games for yourself.

Remember why you do what you love and pick your path wisely.

Choose values, not goals.  Choose directions, not objectives.

It is vitally important to teach yourself how to switch between your left and right brains, between regimentation and stream of consciousness.

Being young is the opportunity to drop everything and hold on to the one thing you want.

Values are discovered through process of elimination.  These values are the last things you will let go of when everything else is gone.

As a young person, you don't know your limits, so don't impose limits on yourself for what you want.

Maintaining a presence is a lot of work.  Realize what energy you have, and what in your life subtracts from this energy.

For the curious, here are some other podcasts I frequent:

Moment of irrelevance: No idea why, but I can't help but imagine all who podcast sipping something from a mug while recording.  I like to imagine these mugs are filled with hot chocolate.  Hot chocolate seems like an exemplary beverage to build a conversation around.

Relevant: I'm young and trying to find that one thing I want.  Maybe game development is it.

Cheers,

Danny