Re-re-re-designing a Mission, Part 1

As I teased at the bottom of the last post, I’ve been redesigning and reimplementing what I call “the bookshelf mission”. My good friend and Spore art director Ocean Quigley tells me I shouldn’t call it “the bookshelf mission” because that doesn’t sound very cool and spy-like. If that bothers you, you can call it “the mission where you pick up the hidden microfiche1 and take it to another dead drop by various forms of subterfuge”. One great thing about working on spy games is that you can basically take any situation, regardless of how absurd, and wrap a spy fiction around it. I mean…

Truth be told, I’m just not worrying about the fiction right now; I’m completely focused on the core gameplay, and making it as deep and interesting as I possibly can, and I’m 100% confident that no matter where the design leads me, the results won’t be as absurd as Moonraker.

The old bookshelf mission mission was one of the more interesting missions in the SpyParty gameplay prototype, for a number of reasons. First, let me describe the mission, hopefully for the last time, since I just gutted it. :)

Here’s the current test level, called the ballroom:

Yes, it’s a box, with windows on two sides. In addition to ignoring the fiction, I’m also not worrying about level layouts very much yet! Every playtest you’ve read about in the press has been in this box. I’ve got the geometry for a couple more levels built, but haven’t needed to trot them out yet to keep things interesting, so they’re on the back burner for now.

Back to the bookshelves. You can see there are two of them in this level, one blue and one green. You can see some NPCs at the bookshelves, reading. I’m the woman in the plaid dress with the green triangle over her head. Don’t shoot me, I’m trying to explain something.

The NPC AI will occasionally decide to go to the bookshelves, take a book out, page through it for a bit, and then put it away, and go do something else. As the Spy, you can of course do the same thing.

The old bookshelf mission went like this:

  • Your goal is to move a book from one of the bookshelves to the other. You can choose while playing whether you move it from the blue to the green, or vice versa, and that’s part of the strategy, since they have different levels of occlusion due to location and nearby people traffic.
  • For this example, let’s say you start at the blue bookshelf.
  • You can pick up a book like the AIs, and you’ll sit there and read it.
  • While you’re reading it, you have two affordances2, you can Put the book away like the AI, or you can Pretend to put the book away, but actually hide it in your jacket.
  • If you put the book away, you look exactly like the AI when they put it away.
  • But, if you hide the book, the animation is a little different. This is a hard tell, which I’ll talk about at length in another post, but it basically means it’s something the AI will never do, so if the sniper sees this clearly, you’re made.
  • Once you’ve got the book hidden, you can go over to the green bookshelf. It’s not usually a good idea to beeline right from one bookshelf to another, because the NPCs rarely do that, so go talk to some people first, or look at some artwork.
  • This is where things got a little overly complex. At the green bookshelf, you can either Pick up another book, in which case you have a hidden book from the blue bookcase and a book from the green bookcase in your hands, or you can Fake pick up a book but really take the hidden book out, in which case you’ll have a book from blue in your hands and nothing hidden.
  • If you’re holding a book, then you have the option to put the book away.
  • But, if you picked up a green book, you could then Swap the held and hidden books, so you’d have the book from blue in your hands, and a hidden book from green.
  • Once the book from the blue bookcase is in your hands, whether it got there from a fake pickup and unhide, or swapping, if you put it away normally you’d accomplish the mission.

If you think that’s complicated to understand reading it here, you should have tried playing it. As I’ve said before, I’m wholeheartedly invested in the Blizzard Depth First, Accessibility Later development style, but man, you need people to be able to figure out how to put a damned book away while they’re playtesting your game. There is text displayed when an affordance is available, and one of them for this mission was “Fake Pick Up Book with Hidden and Hold It”. I can hardly parse that sitting here reading it, let alone when I’m worried somebody is going to shoot me in the head if I screw up.

It may have been a trainwreck from a learning standpoint, but the affordances were designed this way for a reason. The complexity was a direct result of the design goal that you always be able to “play it cool” if the sniper’s laser swept over you and he or she started paying attention to what you were doing at the bookcase. You always needed the option to do exactly what the NPCs would do at any moment (assuming you weren’t in the middle of playing a hide animation or whatever), and these affordances gave you that option, at the cost of clarity.

So, a redesign was in order, but…

Once people learned the state machine, it was actually a good mission with many interesting characteristics I wanted to preserve. For example, it was the only mission that took place across space in the level instead of at a point. It was two-part, with tells at either end, which made it hard for the Spy, but rewarding when you pulled it off. The Spy got to choose the order, so the Sniper was never sure which bookshelf to be watching for late in the match. It had a nice version of David Sirlin’s yomi layer concept, in that since it was hard, Snipers would assume Spies would not choose it. Of course, this made Spies choose it. It had fixed known locations where it would happen, so it could be camped, but while camping it, the Sniper was not looking elsewhere. Etc.

Yikes, it’s 4:23am. Okay, more on this redesign tomorrow…

  1. Has anyone under 35 even heard of microfiche? []
  2. Affordance is a fancy design word for thing you can do. []

Lost in the 4th Dimension…

Most indie game developers I know do “indie game work days”, where one or more people will get together at somebody’s house or a coffee shop to work on their individual games in parallel.  Some people call this “co-working”, I guess.

Today, Marc ten Bosch is over at my place, and is working on new levels for Miegakure, his mind bending “puzzle-platformer in four dimensions”.  This is what it looks like to try to design 4D puzzles:

Okay, back to redesigning my bookcase mission.

SpyParty E3 “Competitive” Analysis

I’m not an economist, so I could be completely wrong here, but I don’t think games (or works in any art and entertainment form, whether film, music, books, whatever) really compete against each other in the usual sense of the term “compete”. Yes, if you ship on the exact same day as a big hit, you’re hosed, but in general, I don’t think even games as similar as Halo and Gears of War compete in the same way Honda and Toyota compete. Ignoring the hardcore fanboy zealots, if you buy and enjoy Halo, you’ll probably buy and enjoy Gears, and vice versa. My guess is the overlap between the owners of those two games is pretty high. Here is an article about purchase intent for the two games, which says slightly over 50% of the people who buy one intend to buy the other1.

By contrast, few people buy more than one car every few years, so if somebody is in the market for a car, the auto companies really are competing for that one sale.

With games, I think the most important thing is to make the game you feel passionate about making, and not worry too much about what other developers are doing.

That said, it is still important to keep abreast of what’s going on in the industry, and to keep tabs on what games have come out or are coming out that are related to yours in some way. It’s good for inspiration, motivation, and education.

I went to E3 this year with a list of spy games, mystery games, and games that looked like they could have some subtle social interactions to check out, and here’s how it went:

  • Assassin’s Creed Brotherhood, Wanted Mode Multiplayer
    I felt like Ubisoft’s ACB was the most important game for me to check out, and I got to play it for a while on the show floor. I had heard about the “Wanted” multiplayer mode before I went to E3, and how it was similar to The Ship, an older game on Steam that’s been mentioned whenever people talk about SpyParty
    . Here’s a good video explaining the Wanted mode:


    Like The Ship, it’s basically the old college campus game, Assassin, where each player has a known target, but doesn’t know who has them as a target. Both are much more symmetric than SpyParty, in that everyone is basically playing the same game. As you can see in the video, there’s not actually a lot of “hiding in plain sight” or “acting normal” going on, especially since there’s a giant radar on the screen, you can climb all over buildings but the NPCs don’t, and you have various super powers. In my playtests, it tended to degenerate into running around, climbing on things, and trying to get quick kills. The game ships in November, so I’ll be interested to see if they change the mode at all by then. I hope they remove the radar, and tune it so people actually try to blend in more and it becomes more about behavior. If they do that, there will be some useful lessons to learn from watching it in the wild.
  • Guilty Party
    This Disney game for the Wii has a few content-oriented things in common with SpyParty, including the settings and characters, not to mention the name similarity, so I thought I’d check it out. Here is a brief video of the developers talking about it:

    http://www.youtube.com/watch?v=FKC_HoxdUz4


    The game has quite nice stylized art direction and characters, but the gameplay itself is pretty much pure deductive reasoning, kind of like the board games Clue(do) or Guess Who?. You gather explicit clues to narrow down the suspects until you can prove somebody’s the guilty party. I want to have some deductive reasoning aspects to the Sniper side of SpyParty, because the practice of narrowing down your suspects is fulfilling and interesting and helps you focus your attention, but I want the majority of the game on the Sniper side to be about perception, observing subtle human behavior, and making decisions with incomplete information. I don’t want you to be able to brute force figure out who the Spy is by deduction.
  • The Agency
    This is a Sony Online Entertainment “FPS MMO”. Besides the spy fiction theme, there’s not a lot of overlap here, and even the theme is pretty different, with The Agency being some kind of future scifi spy world. The game is mostly a First Person Shooter with some persistent RPG elements. Here’s an interview where they talk about the various aspects of the game they were showing at E3, and it’s mostly shooter stuff. This video talks a bit about some less shootery things, but it’s all in cutscenes in the video, so it’s hard to see whether they’ve got that stuff working in gameplay. They’re also doing some sort of more casual Facebooky thing to go along with it, and here’s the trailer for that. Edit: although, this ballroom image looks interesting.

The three games I wanted to see but that weren’t anywhere on the show floor or even behind closed doors (that I could determine) were:

  • Bloody Good Time
    This is the spiritual sequel to The Ship, by some of the same developers. Ubisoft bought or absorbed some or all of Outerlight, the developers of The Ship, and they’re working on Bloody Good Time for XBLA. From the sounds of it via ESRB filings, it’s going even farther away from the subtle social stuff, which is too bad, but it will be interesting to see when it’s finished.
  • Agent
    Very little is known about this Rockstar game, but there’s a bit of info out there. The fact that they’re calling it “the ultimate action game” implies it’s not going for the subtle stuff, but who knows. I’m assuming it will it be Grand Theft Espionage like Red Dead Redemption was Grand Theft Western, which could be pretty cool, but very different from SpyParty, but we’ll have to wait and see!
  • Hitman
    No sign of Hitman 5 that I could find. Some news has come out since then, but nothing very interesting yet.

One of the more interesting games I heard about at E3 was described to me by my friend and colleague Eric Zimmerman. He told me about playing Love’s Labor’s Lost at Come Out and Play 2010, which was a live action game with a lot of subtle behavioral interactions and hidden information.

Anyway, that’s it for the SpyParty-centric E3 roundup. My review of E3 in general is:  “wow, that’s a lot of shooters.”

Post a comment or send me email if you know anything more about the games above, or any other games I should be keeping an eye on.

  1. I wonder if there are numbers out there about actual purchases rather than intent. []

Full Body IK Solver in a Day

I am finally nearing the end of the list I made almost two months ago to get picking up and interacting with objects working in SpyParty. Here is is again:

  1. Add an event track to the animation system so the animations can tell the AI when the object should be attached.
  2. Make an animation for picking up the object and have it fire an attachment event.
  3. Add non-character dynamic items as a concept to the code.
  4. Add a simple attachment system to the character AI and rendering code.
  5. Write a quick full body IK system so the character doesn’t have to align with the item exactly.
  6. Hook it all up.

Steps 3 and 4 were discussed in this post.

In the original post, Step 5 had this footnote:

“This is a step that might give some people pause, but I’ve written so many IK solvers over the years that I figure I can whip this out in a day or so. Famous last words.”

Well, I managed to get a full body IK solver mostly working on Sunday. Admittedly, it was a 12 hour day, but still, not bad if I do say so myself.

Briefly, IK stands for Inverse Kinematics. Kinematics is the study of how things move through time and space. Taking the simple example of your arm, Forward Kinematics is about how your hand moves when you change the joint angles at your shoulder and your elbow. You might rotate your elbow by 30 degrees, and figuring out where your hand ends up is a Forward Kinematics problem. As you might imagine, it’s somewhat difficult to pick up objects if you have to manually specify the shoulder and elbow angles to move the hand towards the object. Worse, if you change the shoulder angle, obviously the elbow angle has to change to keep the hand in the same place, since your arm is hierarchical.

Inverse Kinematics is the solution to this problem. Where FK says, “given the joint angles, where is the hand?”, IK inverts that and says, “given the desired hand position and orientation, what are the joint angles to get there?” There is some more math involved in solving IK problems compared to FK problems, but it allows you to control the arm from the hand and the shoulder and elbow joints figure themselves out.

One interesting point is that the FK problem always has a solution: for any joint angles at your shoulder and elbow, your hand will end up somewhere. By contrast, the IK problem doesn’t always have a solution: if I ask the IK solver what joint angles will put your hand on the moon, it had better give back either “none” or something reasonable like angles that point your hand towards the moon.

So, that’s the Kinematics lesson for today, let’s get to the examples. Remember, all of this art is temporary prototype placeholder artwork!

First, here’s a video of a character interacting with a statue in SpyParty, where the character is aligned with the statue in the same way the animation was created, so it all lines up nicely:

Now, since there’s no IK in the game yet, here’s what happens if you don’t align exactly right:

The statue still attaches to the character’s hand, due to Step 4 above, it’s just that the hand isn’t aligned with the statue correctly. So, when the attachment event fires in the animation, the code detaches the statue from the pedestal and attaches it to the hand in the wrong place1.

And finally, after Sunday, here’s a video of the IK working in the SpyParty contentviewer, which is a simple little application for testing animations and models and whatnot. It’s way easier to make changes in the contentviewer and then move the code into the game than it is to make changes in the game with AI running and all that other stuff.

As you can see, the new IK system still needs a ton of tuning, but that was the result after the 12 hours and it felt pretty good. I think I’ll spend another day on the core math to tune it a bit, and then I need to put the IK code into the game and do Step 6 to hook it all up.

I’m doing IK a little differently than most games do, using learning from my work on Spore. Most games use IK to simply pull the hand towards the object when the animation says to use IK, but what we did on Spore was a little different, and I think, better. Instead of IKing the hand to the object, I warp the whole animation as the IK blends in, so the torso bends and all the little stylistic tangential movements still show up, only now they’re aimed towards the object rather than just straight ahead. I’m going to post more detail about this technique once I get it cleaned up, but you can read the super-detailed technical description of the Spore IK solver in the SIGGRAPH paper we wrote about the technology if you want to know more now.

Edit: You can actually see the results of the animation warping in that video, because the left hand is not being IK’d directly to its hardpoint at all, the only thing changing its position is the space warping, and you can see it’s in the neighborhood of the other hardpoint even without an IK fixup. This is one of the huge advantages of this method, it preserves the animator’s source poses as much as possible, so the IK itself is only used to polish up the pose for the new configuration. This is the blend of sampling and synthesis I’ve talked about before in lectures, where you want to augment the animator’s work with the computer’s work, not replace one with the other.

  1. When you’re making a video game, you really do have to create the basic laws of the universe, and then implement them; it’s kind of mind boggling that anything actually works. :) []

object.h is dead, long live object.h!

Ugh, sorry for the lack of updates, I feel like I’ve been clawing my way through a giant pile of manure and have barely gotten my head out into the air.

If you recall, my current task on SpyParty has been to get the folks at the party to be able to pick things up, like books, magazines, martinis, cigarettes, top secret plans for a nuclear device, etc.  Well, steps 3 and 4 on that task were the following:

3.  Add non-character dynamic items as a concept to the code.
4.  Add a simple attachment system to the character AI and rendering code.

Oh boy.  These look pretty simple, but since I’ve been 100% focused on getting the gameplay prototyped, the actual game code had gotten a little, shall we say, funky smelling.  It was never very clean, having started from the Indie Game Jam 3 engine source code, which was not in great shape itself, but my singular focus on getting gameplay in without regard to how I got it in has made matters worse.

It became clear that I needed to clean things up before I could move forward.  My friend and executive producer at Maxis, Lucy Bradshaw, used to bristle whenever a programmer would mention the word “refactoring” because it had a perfect trifecta of badness1, but it was time.  I couldn’t figure out how to attach an object to another object in the old system without hacks even more heinous than I was willing to attempt.

This kind of task gets to the heart of the “game object system” issue.  I’ve got a good powerpoint by Doug Church on my site on the topic, and I’m going to write more about my new system soon, but I wanted to at least post something to indicate that I’m not dead.

Briefly, I choose a fairly simple component based object system architecture.  There are really two basic options when you’re doing object systems:  inheritance-based and component-based.  I’ll have much more to say about this later after I’ve used it for a bit and worked out the kinks, but for my usage I thought components were the way to go.  These terms are pretty loose; they don’t necessarily directly correspond to C++ (or whatever) definitions when you use them in this general way.

The other thing I am finally starting to test out is my new namespace-centric coding style I’ve been simmering on for the past 5 years.  I’ll also write more about that soon as well.  I’ve been styleless for a long time, after becoming dissatisfied with my previous programming style, and not seeing any others I really liked.

The final thing I wanted to mention was that even after 20 years of programming, I still need constant reminders to figure out ways to keep changes small.  I started writing the new object system and porting all the code over to it in one big change, and after bogging down in that for days and days, I finally rolled back to the old object system and figured out a way to incrementally change over.  It’s more hacked code in the interim with the two object systems fighting for attention, but having a compiling and working piece of software you can test incrementally is so important it’s hard to overstate.  I had two object.h’s in the project for a few days (the old one renamed to _object.h), but it let me move things over piecemeal and keep testing, and I was finally able to delete the old object.h last night.

Also, source code control is your friend and it saved me when I realized I’d bitten off more than I could chew in one bite during the refactor.  I currently use Subversion and have for years, but have been thinking about switching to Mercurial or Bazaar.  I wish these distributed systems dealt with large binary files like those found in games better, though.

  1. 1) refactoring takes a long time, 2) it adds bugs to the code, 3) even when it works perfectly, it has no visible improvement on the game []