Posts in the Game Development category

XNA SpriteBatch Stalling every Second

Public Service Announcement:

If you're doing simple 2D sprite stuff in XNA, and every second or so, the GC is hitching, it's because of SpriteBatch. Every call to SpriteBatch creates a new object, which eventually needs to be GC'd. This will give you a stall every second or so, as the GC runs and tries to clean up.

Kind of sucks really. Ultimately, it means that if you want to get around this, you're going to need to write your own Sprite rendering code that allocates everything up front, and doesn't release anything until a level change, and recycles as much as possible. Not too hard - just build a quad, and write the appropriate code to render it. But it's a lot more work than just slotting it in, unfortunately.


What makes games fun?

It's an interesting question. A better one, though, might be... what makes play fun?

Bet you've not made one of these since you were a kid...

There's a lot of psychology being worked on right now on why games are fun, but some of it is common sense. Here's a quick laundry list I put together of what's fun and why.

  • Are you emotionally engaged?
    That's fun... or at least, it's engaging. It makes you feel something.
  • Are you narratively engaged?
    (Do you want to see what happens, or how the story ends?)
  • Are you physically engaged?
    Are you pressing buttons and getting feedback? Are the buttons consistent? Is there room to learn a new motor skill?
  • Are you learning?
    Learning is fun, provided that there is feedback and reward.
  • Are you projecting?
    Do you feel attached to the character you're interacting with? (eg. move your mouse to the top of the screen, and smack it there. You'll feel a little psychomotor feedback, as if the mouse is "sticking" on something. That's projection. It's what lets you feel the tip of a screw when you're using a screwdriver).
  • Are you learning new projection-related skills that are unlike things you do in everyday mundane life?
    eg. Rolling things up in Katamari Damacy, jumping 3 stories in Crackdown, dreaming about tetris blocks, creating Portals. You can tell if you're doing this right, because you'll look around your mundane everyday world, and think about how to do those things within it...
  • Is there direct feedback in the system? Are your actions connected directly to the actions you see on screen? Are the consequences mostly immediate (ties to physicality) or long term (ties to narrative).
  • Are you competing with another player, human or otherwise?
    Humans are competitive animals, and a lot of play in animals is to lay down the rules for territory and battle.
  • Are you collaborating with another player, human or otherwise?
    Humans are societal animals, and a lot of play in animals is to lay down the rules for cooperation and collaboration.
  • Does it provide a change in state for the player, preferably into a "flow" state? (eg. Rez/Geometry Wars/Zuma = Trance/Flow state)

Ultimately, a fun game requires:

  • Feedback - actions have consequences, preferably immediate (unless narrative)
  • Progressive induction - that is, start easy, get progressively harder. Challenge the player - but at a rate appropriate to them so that it causes frustration, but not too much.
  • Rewards - doing something cool must provide a reward.

Fun may or may not require:

  • Narrative engagement
  • Physical engagement
  • Emotional engagement
  • General learning
  • Competition
  • Collaboration
  • Projective learning
  • Induction into "flow" state

... but usually a fun game will require at least one or more of these ancillary categories to provide depth and engagement. The most powerful of these are Flow, Projective Learning, Competition and Emotional/Narrative engagement, in roughly that order. And they're also that difficult to attain, in that order. clip_image001

That's my take on it anyway.


Note that I'm only listing the dominant traits of these games. For example, Crackdown has a small narrative element, but it's really really small - certainly nothing compared to GTA4's storyline.

Panzer Dragoon Orta - a game which involves a lot of General Learning (to get the patterns right), Physical engagement, a smidge of Narrative engagement, and some gorgeous graphics

Physical engagement, General Learning, Induction into "flow" state

Physical engagement, General Learning, Competition & Collaboration, Projective Learning

Indigo Prophecy
Narrative engagement, Physical Engagement, Emotional engagement, General Learning

Narrative engagement, Emotional Engagement, Physical Engagement, General Learning, Projective Learning

Project Gotham Racing
Physical Engagement, General Learning, Projective Learning, Competition

The Suffering
Narrative Engagement, Physical Engagement, Emotional Engagement, General Learning

Physical Engagement, General Learning, Competition, Collaboration

Physical Engagment, Projective Learning (hugging the walls), Induction into "flow" state, General Learning

Rock Band
Physical Engagement, General Learning, Projective Learning, Collaboration

So what's the Upshot?

If you're designing a game, see if you're missing any of these elements, and try to figure out how to get them in. You don't need all of them, but most games will involve some kind of General Learning (ie. they're not totally random because that's unfair - even Minesweeper won't let you click on a bomb on your first move) by default. Identifying which elements of your game correspond to each of these categories can also help you to refine those experiences.


The Disturbance in the Force was...

For those of you who I've not told in person what's going on yet... there was a huge disturbance in the force on July 11th for me. A shift sideways, if you will.

Death by... er... Death Star
The planet Alderaan. This is obviously an "after" pic.

I left Surreal Software.

That's a big huge enormous step for me... I'd been there for 3 and a half years, and because of that have worked with some of the most amazing people I've ever worked with. And I mean ever. These guys were awesome - almost like family. They honestly care about the people who work for them, and even though the company is getting quite large these days (its doubled in size since I started there), everyone there is a rockstar. That's rare.

Before you start wondering... no, I didn't leave because of the project I was working on, or problems with co-workers or anything else you might be imagining which is untoward. In fact, I'd have loved to have stayed and seen This Is Vegas all the way through to completion, because it's one of those projects which has the potential to just completely rock the gaming world. I've got faith that those guys will come out with an excellent game.

This Is Vegas: It's like someone took GTA 4 and gave it several large dirty martinis and a backstage pass to a Frank Sinatra concert

Nah, I left because working with your fiancee blows goats for both you and your fiancee. It removes that safety valve that everyone needs to vent about what's going on at work, because if you work together, often times you'll both be venting about the same thing - and from two different sides. Not good. That, and absence (even for a few hours each day) makes the heart grow fonder.

So where did I end up going? (And please, if your name is Andrew K, Pete I or Sean Ph, forgive me - I'm totally slammed right now, and this whole thing has been a bit of a roller-coaster. Emails are about to fly your way explaining what's going on).

The New Hotness...

XRK: You only think you've not heard of us because you've not been paying enough attention... yet

I've just started a new gig with the incredibly talented bunch X-Ray Kid Studios. Did you heard of Google Lively which hit beta about 3 weeks ago? Well, notice all that art and animation goodness? That's us.

I've come on board as Director of Engineering, which is a position I've been itching to sink my teeth into for a few years now.

We're working on our own IP right now. I can't tell you any more details, just please, rest assured that I've never seen a group of people so... well... synchronized. Everyone is on the same page as to what we want to create, and that's making the early stages mindblowingly smooth.

(BTW: I will be looking for at least 3 senior guys to join me on the team in the areas of general engine/tools tech, graphics and gameplay, and probably 2 or 3 mid to junior ones before the end of the year... although the details right now aren't fully figured out. If you know anyone in the games industry who's looking, let me know).

My Job So Far...

So far, over the past two weeks, I've been down to our Newport Beach offices in Orange County, California, and met the rest of the team in person. (All of whom are great... I spent a good part of my first week in complete and total utter fanboyish shell shock regarding the caliber and credentials some of the people I work with).

We get our offices up in Seattle on August 1st (X-Ray Kid North is the Video Game hub; X-Ray Kid South is the 2D/Animation/Cartoon/Comic Book/TV/Movie hub). The offices are right across the street from Surreal Software which is great (and means that I can still carpool to work), and literally right across the corridor from FXville - a group of mostly ex-Surreal Video Game FX and Character artists, whom I consider to be the absolute best in the business. (And if this all sounds rather incestuous and sparks your conspiracy theory neurons... that office complex is probably the best creative space for the price available right now).

I went to Gamefest 2008 last week and met up with some old friends, and made some new ones, did some networking, attended a number of talks, and discovered that - weirdly - about 75% of the attendees this year appeared to be Microsoft employees.

O Rly?

Meanwhile, the rest of my co-workers ended up at the San Diego Comicon. Unlike most people who go to the Comicon, they're the kind of people who actually go there and sign autographs and stuff, instead of lining up to get them. (Going to Comicon as superstars vs. listening to talks about how to compress data for streaming on the XBOX 360 at the exceptionally nerdy Gamefest 2008? I think they got the better end of the deal).

The embarassing thing tho? Last comic books I read was ... ok, well, strictly it was Absolute Watchmen. But before that? Er... that'd be my friend Aron Dittbrenner's one that he was working on. OK, so, anything commercial that anyone else would have read or heard of? Ummmm.. yeah... that'd be the Spiderman/Venom arc way back when. Like, 1985 or so. Before that, I did read my Uncle's entire Marvel comicbook collection which comprised of nearly everything Marvel published from about 1968 to about 1978. That was, I read it before my cousins decided they were coloring books and my aunt unfortunately didn't disavow them of this knowledge. God knows how much those would be worth today.

Which means that ... um... it's quite embarrassing to realize that nearly everyone I work with is a comic-book legend to those who follow them.

Jeff Matsuda gets his Batman on

Best thing about this job so far? Everyone's huge on collaboration, so I get to dabble with my more creative side instead of just pushing da onez and zeroez.

This week, I'm back down in the Irvine area, meeting up with potential Engine partners for a console game. *cracks knuckles* Time to get stuck in! (Although getting up at 4am for a flight... meh... goes with the territory).

Big leagues. Small massively agile company. This is going to be fun.

I'm planning on interviewing the guys I work with for either my blog or the X-Ray Kid website soon, so you can get a taste of what we're all about (the usual disclaimer: if I have time). More news as it happens. Keep 'em peeled.


How to Build Team Morale and Cohesion by Goofing Off

The Surreal Gameplay Programming Team's Friday Meeting, July 2006. From Left to Right; John Cuyle, Lance Dyson, Matt Lauritzen, Joe "The Robot" Sola. Sola's Mom could not be reached for comment.

So just how do you get a team together, keep them working together, keep tensions low during high-crunch periods of time, and just generally make sure they rock the house?

I've got a secret little trick that I figured out while I was managing the Gameplay Programming team at Surreal. (Actually, I discovered some of this while managing the Tools Team, but I refined and codified it when I moved to Gameplay).

We moved to an Agile project management method (kind of based on Scrum) at Surreal in October 2005. Now, people have varying thoughts as to whether or not it was successful or not - but that's for another post - but the upshot of it was that we ended up having two Gameplay team stand-up meetings a week.

One of the things I did early on after moving to the Gameplay team - given that we had two meetings a week - was to look at exactly what those meetings were doing for the team. It ends up that really, the meetings had several purposes:

  1. To update the status of the team for Production, which we were already tracking in another way anyway.
  2. To update the team and keep them apprised of what each other were doing. Kind of a forced exchange of information.
  3. To provide an opportunity for people to exchange information and ideas.

Now, 1) we were already doing via email, and 2) was good, but kind of out of scope for a 15 minute stand-up meeting (it'd expand the meeting for one). 3) seemed like a great thing to me, but needed more flexibility.

By this point I was already doing 1 on 1's with each team member, once a week; these were working well, and mainly I was using them to allow for private conversation about things that were bugging each team member, and to resolve inter-personnel issues, find out what was blocking them and so on.

And of course, Summer hit. And we were in crunch. Again. (We crunched all the way through the previous summer on Suffering: Ties That Bind... I was working 14 hours days on weekdays, and 8 hour days - sometimes longer - on weekends for three months).

Now, Summer in Seattle is a gorgeous time. After spending all winter under oppressive gray skies, everything flips and Seattle becomes one of the most gorgeous places on the planet.

I'd be damned if I was going to miss it again. So I decided to start a new practice.

Summer at Golden Gardens in Seattle - Seriously, it's what makes the rain worthwhile.

The Friday Gameplay Team Meeting

The Friday Gameplay Team Meeting was something I instituted at Surreal, and it works great for keeping your team together, focused and happy. It's now an institution at Surreal - even though I've not managed that team for over a year, which shows some of its staying power.

Instead of two Scrum meetings a week, I cut it down to one formal meeting, and one informal meeting (where I'd take notes if necessary; later we modified this so that notes weren't necessary at these meetings - I'll cover that later). The informal meeting was at 2pm on Friday afternoon, downstairs on the grass field outside the building. (The grass field no longer exists; which is ok, because we're no longer at that building). People were encouraged to bring beer (Friday at Surreal is Beer & Pizza friday). The meeting itself? 30 to 60 minutes long.

Over time, the meetings evolved to include a short soccer kickaround during the summer and early fall. These stopped at the new building because there's no field nearby, so we just meet out on the deck which overlooks the Puget Sound. The beer's still there though.

People swap notes and kick around ideas (and, I guess, soccer balls). They talk about the movies they're going to see, what's cool on TV, cool games they're playing (including ours), maybe a bit of what they're working on, and life in general. There's lots of joking around, a little bit of teasing, and usually very animated conversation. Some people (with nasty bad habits... er... like me) smoke.

It all seems very much like just an organized excuse to goof off. That's because it is. But if you dig a little deeper and look under the hood, there's some very specific reasons why I do it this way.

The Inner Structure Of The Goof-Off Meeting

This isn't actually a Gameplay team meeting - but it's what one looks like in the new building (it's held right here on the deck, and usually there's that many people there. And the two people on the left (Darci Morales, Surreal Producer, back to the camera, Matt Lauritzen, Gameplay Programmer Extraordinaire, in shades) are usually there too. This photo is actually from the Surreal 2007 4th of July BBQ on the deck at work, where we got fantastic views of the fireworks show.

There are several key reasons for holding a meeting this way.

1. It Gets People Away From Their Coworkers

Games development is a pretty high stress environment, and I wanted to make sure that my team had a place that was safely away from potentially prying ears and eyes of their coworkers, so that they could feel comfortable discussing anything they wanted to - including the things that other people in the company are doing that are bugging them.

This is normally a 1 on 1 subject, but this also allows the whole team to voice what's derailing them - without fear of retribution. (And if you institute something like this, it's important that there will not be retribution. Handle the problem there and then by explaining the other side of the issue - as their manager you should understand the other side of the issue; if you don't, you're not doing your job - or by promising them that you'll look into it. Don't bear grudges. Don't throw blame. Don't be quick to judge. If people are bitching about something, there's something to it).

2. It Gives Them An Opportunity To Vent

Related to #1... unlike regular meetings, this meeting - and I told my team this going into it, and repeated it regularly - is meant to be a "stitch and bitch". And yes, they should. It's healthy. But keep it in check, and address misconceptions where you can.

For example, one issue that comes up regularly near the ends of projects is the fact that programmers don't like getting bugs filed against them for content issues. They hate having to help Designers fix content that (they feel) should have been set up correctly in the first place. The job of the lead in this situation is to remind them that hey - guess what - designers aren't programmers. Part of your job as a programmer on a game team is to help the designers get their job done - and occasionally, that means holding their hands. Because god knows, they get to deal with our bugs all the time ;-)

3. It's Not An Office Or A Conference Room

There's a mental gear shift that happens when you get a team out of the office. This is why Marketing & Sales guys get to have expensive off-site retreats in ski lodges all the time. Well, no one pays for the geeks to ever do that (or if they do it's rare, or reserved for upper management), so this is the closest thing you can do without having to explain it to the Finance guys.

When you're out of the office, you can let your guard down, and let politics go by the wayside a little. You can be more objective about your work, and you can be more creative because you're removed from the issue. The creativity part is a big one - it gets your team's juices flowing.

The moment the conversation turns to the game you're working on - and it will, because most of the team spends nearly every waking moment working on it or thinking about it; you just can't turn that kind of passion off - you're going to get a torrent of ideas that will blow you away.

Take a notepad with you - there's gold in there.

4. It's a Friday

Yep, you knew it was coming. Part of the idea of goofing off is to goof off. Just a little bit. It's Friday, people are already thinking about the weekend anyway. This just codifies it as something that's okay to do.

Why would you want people to goof off during work hours?

This is a team that's going to go through hell and back for you. They're going to put off doing their taxes, their laundry, and their utility bills because they're at work at 9pm on a Saturday night trying to get the game out for its next milestone. They need to work together as a cohesive unit. Everyone needs to know what everyone else is working one. You need to know who's stressed out the most, and who's got a low workload - and this is a way of letting that work auto-balance itself. People will and do offer to help each other out during these meetings. But they'll only do that if they trust, respect and are friends with each other. (You can of course force it yourself and shuffle the workload for them, and you should do that as well, but this way they all feel like they're all in it together).

Think of it like being in the military. You're the Sergeant of your platoon. They're your men. What does a platoon do during downtime? They hang out. They build camaraderie. They become friends, and turn into a close-knit, well oiled fighting machine. And that's all you can ask from a team - have that, and you've got the best team in the world.

But you're not in the military, so they're going to go home after work. So do it at work instead. And give them a place to relax while at work - seeing each other day in day out, it's something your team needs. It's therapeutic.

Equipment List

What do you need for a successful Friday Meeting like this?

  • At the very least, the lead should have a notepad & pen for taking notes of issues that come up, and ideas the team generates.
  • Beer (and nonalcoholic beverages)
  • A Soccer Ball if you've got somewhere to play.
  • Your Producer. Make sure your producer gets invited to these meetings - your producer is not the enemy, and as long as you've told them why the meeting is structured the way it is, they should see the benefits. It'll make them a part of the team as well.


The Friday Meeting (or Goof Off Meeting) is an excellent tool for building team morale and cohesion. It's also great for getting information on the team's status in a way that isn't formalized, allowing you to fix problems before they become real issues.

It's now a part of Surreal tradition (at least for the Gameplay team), and has been successful enough that when programmers move to other teams, it's one of the things they miss the most about the team. That's ok - we let them come along to the meeting as well if they have time. In my ideal world all of the teams would have one meeting a week that was like this - it really does help.

Next time I'll talk about team morale, and I'll explain how I try to show the team that I appreciate their efforts.