My Photo

« November 2007 | Main | January 2008 »

December 28, 2007

Manager In A Strange Land: Theory of Drag, Part 1

Finally getting started on this, the text version of my talk at the IGDA leadership forum.  Just got my talk reviews back and there's a Love It Or Hate It thing going on.  Some of the Haters were particularly brutal, making the trolls who every now and then appear in the comments on the blog look like gentle friendly neighbors, and making me wonder if it really is "better to be ridiculed than ignored."  But at least they've gotten me motivated to get this stuff written down where I can debate it with text rather than voice.  Much more comfortable with text.

Schizoid is the first project where I've used the velocity-tracking scheduling method from Scrum / XP / Cohn's *Agile Estimating And Planning* - and, on one hand, I've got to say I have never so dramatically underestimated a project.  On the other hand, seeing our progress, from the beginning of the project, as a graph of work-remaining-to-be-done over time, and using that to estimate our velocity, has crystallized something for me.

The graph looks like this. 

Schedule_pic_3

This graph looks familiar - it looks a lot like the "bugs remamining" graph of a project that's well into QA.  And if you stare at it until your eyes glaze over, which I have done many times, you see a trendline that looks something like this:

Trendlinepic

The curve is also familiar.  It looks a lot like that long-tailed power law curve.  (We're not actually on a power law, thank God, otherwise we'd never cross zero, but it's a lot like that.)

And suddenly I realize - if I had used this method to track my many previous projects, I would almost always have seen this curve.  (Tony Hawk 2 for the Dreamcast the one exception, the only project I've scheduled that was a slam dunk, hit the scope we promised, hit the date we promised, hit the budget we promised, 90+ on gamerankings miracle.)

Because on all of these projects, we'd slip, and we'd push our ship date back proportional to the slip.  (We aren't committing that classic rookie mistake of sliding the ship date back one week for a one week slip - the ship date moves back proportionally.)  And yet - we slip again. And again.  How can this happen?  If we've factored in our velocity from those first slips, we should be golden.  Unless...

Velocity ain't constant.

This should have been obvious.  Every project I've worked on seemed like it was going great at first - and then:

"This isn't going great anymore.  We should stop adding features."

"This is going even worse.  We should cut features."

"This is going still worse.  We should transfer people from other teams."

And, finally - "We better crunch."

It's Fred Brooks' werewolf - project seems fine at first, turns into a monster at the end - the one against which there is no silver bullet.  But unlike a werewolf, the project doesn't turn on you overnight - it gets hairier and hairier as you go along.  Like Brooks says - "How does a project end up a year late?  One day at a time."

Once I discovered this I talked to a few others about it, and not just in our industry - this "diminishing returns" curve seems to be everywhere - it's not just because I shouldn't be scheduling.

So, how about your projects?  Is it only after you're well into production that you realize you're in trouble?  Do plateaus and long tails sound familiar?

Next post I'll talk about some of the causes of these "diminishing returns" projects, one of which is drag.

December 13, 2007

State Machine Hell

I know "all programs are state machines" and blah blah blah but isn't there something better than this recurring idiom:

void Update()
{
  switch( myState )
  {
    case DoingTheFirstThing:
       ...
    case DoingTheSecondThing:
       ...
    case DoingTheLastThing:
       ...
  }
}

To me, these state machines are spaghetti code:  even less readable than a function laced with gotos.  Taking each state and making it a class makes it even worse - now I have to go digging through half a dozen source files to figure out what the code does.  I've done both many times, of course, and always been mystified by my code later.

What's the alternative?  Threads?  Although the code reads cleaner it can't possibly worth the issues multithreading introduces.

I've got nothing, and I'm still grudgingly doing it as above.  Anyone?

December 11, 2007

How Much Planning - High Level Concepts?

Hmm, not many comments on that last post.  Guess it was just Too Damn Long.

Have a long build right now, so I'll respond to a comment.  Pag asks:

Don't you need planning for the higher level ideas though? Iterations work great for low-level features that can be implemented and tweaked relatively easily: controls, enemy AI, etc. But you can't really iterate on high-level concepts. Sid Meier's dinosaurs game died after a while and as I understand it, they still weren't sure if the game would be turn-based or real-time -- that can't have helped production.

Basically, how do you balance the need for a clear overarching vision and the need for flexibility during development?

Don't know anything about this dinosaurs game, but I'd think turn-based vs. real-time would be something you'd nail down in prototyping early on, while there's only a handful of guys on the team and your "dinosaurs" are still flat-shaded boxes - or maybe it's even in 2D and the dinosaurs are just X's and O's - or maybe you even make a board game and move toy dinosaurs around a hex map, faking the "realtime" somehow.  At this stage it's totally possible to iterate on various kinds of turn-based and realtime mechanics.  And at some point you make an informed decision about which you like best and prototype the next thing and eventually go into production.

The "more planning" alternative would be to have meetings, before any code is written (or boardgame mock-ups are created) to discuss why the game should be realtime or turn-based.  You can involve all the stakeholders.  Maybe publishers don't want the game to be turn-based for marketing reasons.  Maybe some of the designers are worried that griefers will ruin turn-based network play, or that it will be boring waiting for your turn.  And you write a document that says the game will be real-time, damn it, no matter what.  And you'll make that game.  Nevermind if you had a new take on turn-based that could have been really cool.  On the bright side, this process probably takes less time than iteration on that turn-based mockup.

This was a hypothetical example, but my real-life experience is that planning is the enemy of creativity.  None of my cool ideas would have gotten done if I'd had meetings discussing whether they were good ideas or not first.  (But maybe I'm just a bad salesman.) 

Oops, build finished a while ago, and I didn't really get to "vision."  Ok - started another build.

What is this Vision thing, anyway?  (An album by Sisters of Mercy, ha-ha.) Real-time vs. turn-based isn't necessarily under the umbrella of Vision.  It's quite possible whoever "owns" this game (whether it's the producer, director, designer, or--my favorite--a hive mind) couldn't care less whether it's real-time or turn-based, as long as whatever they end up with is fun.  Maybe all they care about are the dinosaurs.

On the other hand, maybe from the start, they had a cool idea for a turn-based game with dinosaurs.  "This game is all about turn-based dinosaurs!"  (For whatever reason.)  Well, that's just the box within which the team works and iterates, right?  And yeah, "turn-based" should be in the doc, with all the reasons why, and what that means to you - do I move all my units, then you move all of yours?  We switch-off?  You move while I fire?  Time limits?  Chess clock?  Some of this you care about, it's essential to your vision -  ("Absolutely you only move one dinosaur at a time.  That's final.")  And everything else you iterate on.

Where you get into problems is when the team doesn't share the vision.  Does more planning help here?  Maybe - you can hear them raise objections and maybe sell them on the vision or at least say, 'duly noted' and pull rank.  Does a doc help?  Maybe, if you can get them to read it.  I'll say I've definitely been there, and seen parts of games that I had strong feelings about go in directions I thought were simply wrong.  But the problem wasn't lack of planning or documentation - the problem was simply that I caved.

Note to self:  my builds really aren't long enough to work on blog posts.

And I don't know what happened with the formatting there...too lazy to edit the html.

December 09, 2007

Manager In A Strange Land: How Much Planning?

(For anyone awaiting my article on "Drag" and wondering why I took the time to write this instead...this is actually an article I wrote a while ago and never got around to posting.)

"A good plan, violently executed now, is better than a perfect plan next week." - Patton

“Plans are worthless, planning is indispensable.” — Eisenhower

Are these two quotes contradictory?  Eisenhower seems to want to continue planning (even though he knows he'll throw that plan away later) whereas Patton wants to quit planning today and do something.  When you think about the quotes long enough they become tautological.  "We should plan until our plan is good enough."  Duh.  But how long does it take to get to a good enough plan?  How do we recognize a good enough plan?  To be more precise, where's the crossover?  How do you know if that extra hour spent planning is going to save you an hour down the road?

Back in the waterfall days, we'd spend the first milestone on "the plan" - and the outcome of that would be the rest of our milestones.  (And we thought we had it good because it meant we didn't have to actually do anything real for the first milestone.)  It was actually pretty easy to justify this to the publisher.  (And it didn't seem to matter if it was a nine month project or an eighteen month one--never tried it for a twenty-four month or longer project--you'd get that first month to plan.)  Some of the least succesful projects I've worked on resulted from this:  Draconus and a Nascar racing game that never saw the light of day, to name two.  So, from my anecdotal evidence, a month of planning without coding is the wrong amount. 

Did we need more or less? 

The successful projects (these projects were only qualified successes, to be sure - I've only worked on one project that was an unqualified success - hit time, budget, scope, and 90%+ on gamerankings) I've worked on had a lot less.  Typically we couldn't wait to get started coding, and documents were often an afterthought to either explain what we'd already done or talk about where we'd go from there.

In *Agile Software Development With Scrum* they talk about how Scrum can be seen as a Kuhnian phenomenon.  I haven't the foggiest what they're talking about, but I do have a very vague, layman's knowledge of the Hegelian dialectic.  (Recently refreshed from watching the movie *Half Nelson*.)

People typically think of agile and Scrum as being the antithesis of Waterfall.  I disagree.  Rather, Waterfall is the antithesis of "dive in and code".  The thesis:  we should dive in there and start coding!  The antithesis:  we should plan every detail - we need to gather requirements and model in UML and flow charts and write all of our header files before we write the actual .c files and blah blah blah.  Synthesis:  Scrum - we should spend *two days* (one day on the project, one day on the first iteration) planning the project.  From then on, we should spend one or two days planning for each eighteen - nineteen coding.  (And on a project with more than ten people, we should spend one day planning the macroproject and then each subteam should spend a day on their dish.)  And we may want to stop and do a little side-planning here or there along the way - we'll see.  A plan, as far as Scrum is concerned, is a list of requirements with somewhere from a sentence to a paragraph describing each one - they fit on file cards.  Accompanied by wild-ass-guesses for how long each of these things are going to take.  And we'll probably forget a bunch, and that's okay.

Compared to some projects that consider themselves agile, that's actually a lot of planning.  To be honest, that is more planning than has gone into some of my "successful" projects.  Maybe those successful projects could have been even more successful.

It looks like Clinton Keith wants more planning these days.  What he proposes isn't a Gantt chart per se but it's damn close. I'm not crazy about Gantt charts. (Check it out; I spelled it right this time.) It looks to me like he's feeling the pull to Plan More.

And speaking of arguing for More Planning, we have Joel Spolsky

But I'm going to put my foot down and say, "No.  Enough planning."  I think Clinton's hearing the siren song of the Gantt chart because game development projects always suck, and you look for causes, and one cause, if you're not doing much planning, might be "we're not planning enough." Post hoc ergo propter hoc. But like Ken Schwaber says, you quickly hit very diminishing returns when you spend more time scheduling/planning - and we should just accept that we're going to be wildly inaccurate and get on with it.

As for Joel Spolsky, maybe spending two months designing makes sense for products like FogBugz and CityDesk...because iterating with on-paper design with those projects actually might make the designs better.  But, since games are more complex systems, and systems are notoriously unpredictable even to the seasoned designer, if you spend two months designing your game while I spend one day designing out of every ten coding, my final design is going to be six iterations better than my first design but your final design - well, it's practically a coin toss whether it's going to be better or worse than your first design.

Let's take some of the games I've worked on...

Die By The Sword - very little planning, though what first got me onboard with the project was seeing a map they'd made on paper for one of the combat arenas; back then I was sick of the cowboy mentality and wanted to see more BDUF;  of course, we rebooted the project partway through and turned it from a fighting game to an explore-a-dungeon-beating-things-up-along-the-way game, and that arena got thrown out.  In a way, though, we stumbled upon Cerny's method - taking almost a year to make that awesome first level, our "prototype / vertical-slice" - and doing lots of kleenex testing on the way there.  It slipped twice but was a great game.  (Sure, only 75 on gamerankings, but I'm convinced it would be higher if gamerankings existed when we shipped.  5 stars in Next Gen, for example!)

Draconus - Draconus was the closest I've come in my career to doing full waterfall.  We had a giant whiteboard in Pete's room with our UML diagrams.  We had big design documents that we argued about in long meetings.  We did research on state-of-the-art approaches before writing our highly abstract code.  Also one of the most troubled games of my career - the original publisher dropped it and another publisher picked it up but only wanted to give us nine months to finish - cancel the network play and the this and the that and the other thing, but do it for the Dreamcast instead of the PC.  All that BDUF thrown out. We were six months late, and only got 70 on gamerankings.

So, for Spider-Man 1, we backflipped.  Just get in there and make some levels, damn it!  More planning would have helped.

Spider-Man 2 had almost the right amount.  Could have used just a tad more.  In the beginning, we'd spend mornings designing while we spent afternoons coding - but it wasn't long before we were sketching a level on a napkin and then spending a month or two of implementation to make it as good as we could.  20 page design doc;  continually evolving table of what all the controls on the gamepad did;  map of the city...

And Spider-Man 3 I think had too much, though that's supposition because I wasn't around for most of the project.  Although it wasn't even close to full waterfall, in the early days we did a sort of waterfall with the individual levels - first described in text by the designer and then isometric concept art made by the concept artist and then a meeting in front of a lot of people where the designer presents and defends the design - and we'd typically find that the level they drew on paper was the level that got made and it would get kinda stuck that way.  One of the reasons we were doing more planning was because a cross-studio Activision consultant came by with the level design docs from Infinity Ward and said, "Look, here's how our best studio makes their game.  Why don't you do it like this?"  So we did.  Later I mentioned that we borrowed the "Infinity Ward method" to one of the Infinity Ward guys and he said, yeah, they don't do it that way anymore, because the junior designers would would keep making crappy levels and then the senior designers would ask why they weren't fun and the junior designers would say they just implemented what was in the doc.  (This was a couple years ago, so I don't know what Infinity Ward does now or did for CoD4.)

That's a key thing with game levels - you don't know how fun they are until you build them.  And if you make your sketch too detailed, if you make it more of a blueprint than a sketch, people are going to model that detail right into the level and there's going to be resistance to changing it later.

So - how much planning?  Here's what I think:

Small team, downloadable game, no need to hit a specific ship date:  almost none.

Console action game:  20-page design doc;  story outline first - script and game evolve simultaneously;  levels sketched (but not blueprinted!) right before they're built.  In the early days, split your time between planning and implementing.  In the later days, fall back to one day of planning for every ten - twenty implementing.

RPG:  more, but I don't know how much more, because I haven't made one since 1993.

MMORPG:  still more, but again I don't know.  Damion Schubert's the guy to go to for this.

December 04, 2007

More Previews

http://xbox360.ign.com/articles/839/839317p1.html

http://previews.teamxbox.com/xbox-360/1817/Schizoid/p1/

December 03, 2007

Preview

http://www.gamespot.com/xbox360/action/schizoid/news.html?sid=6183535&mode=recent

Have To Say *Something* About It...

Ignoring, for the moment, just how much money it'll make for everyone involved, it'll still dilute/weaken the Blizzard brand.

Mike Morhaime says that both Blizzard and Activision are committed to quality.  The thing is, Activision's idea of "Quality" is different than Blizzard's - Activision has a lower bar.

For one thing, if Activision was truly committed to quality they wouldn't do movie-license games - movie-license games, with their ironclad ship-dates, are the antithesis of quality.  When I was there, we did manage to make one good - but not great - one, and that was despite the terrain.

So now the Blizzard name is going to appear on Shrek 4?