Adventures with NPCs Redux: Matteo

Things have been moving forward lately with our NPC development, which has been a very gratifying experience. Watching a character go from a text description to a fully animated and speaking NPC model is something else. And as we move from one character to the next, incorporating each into the game, the whole project really starts to come to life. It sure as hell beats plugging away night after night on the nuances of text parsing.

It takes a lot of steps to go from point A to point B, and a number of people to make it happen, so I thought it might be interesting to review the procedure we went through for each NPC in the game. Vespers has six NPCs: five brothers and one village girl. This way, we can introduce each character while providing a little insight into our development process.

Matteo was the first character we tackled, mostly because he has the smallest part in the game. In the text version of the game, however, there are very few detailed descriptions of the characters, so we didn’t have a lot to go on initially. The one passage in the game that gives some background on his character (which, interestingly, was later removed for the final release) went as follows:

“Ah, Matteo. He was one of the first. Although he is a few years your senior, he remains obedient and helpful. He loves Saint Cuthbert’s, almost as much as you. The loss of the brothers has been especially hard for him. He was as much a father to them as any priest.”

So we began with an older, gentle, fatherly figure, and after some discussion with Jason Devlin (the author), we also decided on a person who is shorter and overweight. We presented this to N.R. Bharathae, our lead artist, who came up with his concept for Matteo.

Matteo concept sketch.

Once we had a good starting point, N.R. set to creating and revising the 3D model, and then applying the textures. We were going for a more realistic appearance to our models and, needless to say, we were very excited with the results.

The Matteo model.

The textures for Matteo's face.

While this was going on, I was also working hard on the voice recordings. After a long process of auditions, I went through the difficult tasks of preparing the scripts, setting up and performing the recording sessions, and then splicing and editing each of the lines into separate WAV and OGG files.

Fortunately, we were able to get a really talented actor, Alan Meyer, to do the voice work for Matteo. I asked each of our voice actors for a head shot, since I thought it would be cool to see each of them beside their final in-game NPC model. Here’s a shot of Alan alongside Matteo, along with a short bio he wrote.

Alan and Matteo. I can see the resemblance.

“As a voice actor, Alan Meyer enjoyed playing a role in Vespers tremendously. During his three decade acting career Alan has appeared in dozens of plays and films. He taught theater and video production classes at Bonneville High, in Ogden, Utah, for over fifteen years. His website Speakingpart.com features his voice acting demos and current resume.”

Finally, bringing him to life was our animator, Shawn Hall. Shawn was new to the Torque system of animation (as was I, of course), so it took us a little while to work out the kinks and the best workflow process. But once we were both comfortable with it, he was able to really breathe life into the model. It’s not easy to show here, but Shawn did a great job with a lot of the little details, including blinking, eyebrow movement, and even some lip sync. We ended up using mostly full body animations for Matteo (unlike some of the other NPCs), since we found little need for additional blend animations. (Shawn has since moved on from the project, but this was all the animation Matteo would need in the game.)

The final result, I think, is a great combination of writing, modeling, texturing, animating, and voice work, the combined work of a small group of really dedicated and talented people. Cue the brief video, for those interested (and sorry for the poor quality – if you watch it at 480p it’s slightly better):

Hopefully that gives you all some idea how we went through the process of developing Matteo from a character in an interactive fiction game into a 3D animated and speaking NPC model. Next time I’ll introduce Constantin, who presented a series of challenges of his own.

Be the first to like.
Posted in characters in games, Vespers | 1 Comment

Looking Back, Looking Ahead

We’ve been making some good progress lately on Cecilia, the last of the six NPCs to be implemented in the game, so I thought this would be a good opportunity to bring back the old NPC introductions. This was something I started a long time ago — well before starting this blog, back when I was blogging only on GarageGames. The idea was to write an introduction to each of the characters in the game, showing their development from concept drawing to a fully modeled, animated, and voice-acted 3D NPC. I got through the first two characters, Matteo and Constantin, fairly early on. But as animation problems surfaced (and resurfaced), work slowed down. I was able to get to Lucca and Ignatius eventually, but that was about it. I did finally get Drogo implemented after a long delay, but never did get around to his introduction.

At last, all six characters have been implemented, so I can complete that bit of unfinished business and give Drogo and Cecilia the introductions they’ve been pestering me about.

Instead of just doing those two, and because the earlier introductions were just so damn long ago, I thought it would be a good idea to bring back the entire set and start from the beginning again, with Matteo. Then, at last, we can have all six presented in sequence, as originally planned.

Some of the information is a bit outdated, and as such I may do a wee bit of editing, but for the most part I’ll just present the older ones as is before finally getting to the recent ones. It’s just one way to introduce each of the characters while providing a little bit of insight into our development process.

I hope you’ll enjoy it!

Be the first to like.
Posted in characters in games, Vespers | Leave a comment

End of March Vespers Update (or, How To Drop A Girl)

March comes, March goes. Lion, lamb, all the usual stuff.

March is always a busy month, what with GDC and sundry work-related conferences and travels. And this year, of course, there was PAX East. Man, how I wanted to be there for that. It was, by still rare accounts, an amazing show of force by the IF community, and from what I can tell a great time was had by all. It sounds like there was a groundswell of new or renewed interest in IF, which can only be a Good Thing. And, of course, GET LAMP. I can’t help but feel like I missed a significant event in IF and the opportunity to meet some great folks, but at the same time I am excited that it occurred and grateful that there are those who could make something like that happen.

Making things happen is a good theme to maintain, so let’s do that.

The last of the six NPCs we are bringing to life is Cecilia, the girl who suddenly appears at the monastery and…well, you either know what happens next or you don’t, and that’s not about to change now. There’s a reason I had saved her for last, though, and it’s not because she’s the easiest.

The main problem with Cecilia is that she doesn’t conform to the usual NPC implementation pattern. For most NPCs, each Act (mostly) consists of a simple set of idle animations and an extended set of conversation animations. The character typically stays in one location (Matteo in the tower, Constantin in his room, etc.), doing his own thing, and responding to the occasional player question. Pretty straightforward.

Cecilia, of course, makes things far more difficult and challenging. (I could mention at this point that this is partly why we made her a redhead, but I know far better than to do that.)

The main reason is that there is a portion of Act I where Cecilia acts like an object rather than an NPC per se. Without giving too much away, the idea is that, after she collapses at the front door, the player is supposed to pick her up and carry her to the locutory to be placed on the bed there. That means I have to implement her in two additional forms that are different than the usual NPC: as an inventory object (so she shows up in the visual inventory while being carried), and as an object that Torque calls a “ShapeBaseImage” – an object that mounts to the player and is displayed as part of the HUD in first-person mode, the same way a gun would appear in the camera view in an FPS game.

Cool, but what happens when you hit the "fire" button?

Neither of these is particularly challenging, though; just time consuming, and the implementation requires special code coordination to make sure it handles each of those correctly.

The real challenge occurs when you consider that, while being carried, she should be handled just like any other inventory object. Which means she should be able to be dropped at any time.

Dropping creates all kind of issues in a 3D first-person game. When you drop something, where do you drop it? In front of the player? Directly at the player’s feet? Do you want to show the object falling to the ground, or just make it appear on the ground immediately? What happens if the player is standing right in front of another object, and there is no room to drop it? What if the player is standing directly in front of a wall? What if the player wants to drop the object on the bed, but isn’t facing the bed at that time?

A closeup of Cecilia as "inventory object". It's dehumanizing, I know.

Another part of the equation is that NPC objects have collision boxes, just like the Player’s object has. So when you drop the girl, her collision box immediately interacts with the player’s collision box, causing all kinds of havoc. That requires all sorts of workarounds to make sure the collision boxes don’t interact, but that, in turn, tends to complicate other matters.

On top of that, rather than just teleporting her static body immediately to the ground near the player (or the bed), I’d like to give the whole process a bit of life by including an animation that shows her hitting the surface and coming to rest in her idle position. That means timing the whole process of dropping, starting the animation, and hitting the floor.

So in the end, we’ve taken the relatively simple process in IF of dropping an inventory item and proceeded to make it horrendously complicated. Go team!

More on Cecilia to come.

Be the first to like.
Posted in 3D/if, interactive fiction, Vespers | 5 Comments

iPad Games They’d Love To See

Spotted on CrunchGear.com:

From the web site:

Planetfall – One of the original Infocom classics. Listen: the iPad has a usable keyboard and can support external keyboards. Why not slap together an Infocom pack for $2 and sell some imagination to these whippersnappers. Who’s with me?”

Not bad, at least it’s good to see some people interested in seeing classic IF on the new device. Of course, it would have made sense to mention the fact that IF already exists on the iPhone platform (see iPhone Frotz) with an inexhaustable supply of excellent pieces, but I’m okay with that.

Be the first to like.
Posted in interactive fiction | 5 Comments

Long Flights Are Good For Something

One thing long flights are good for is addressing old issues that you’ve always meant to fix but never really got around to. So when I found myself on a three-and-a-half hour flight yesterday, I decided it was time to tackle an old parser syntax issue that has been nagging at me for some time.

My goal with the parser has always been to make it as robust as possible, even if much of the functionality isn’t necessarily used in Vespers — I’d hate to have to add functionality after the fact, like for a future game. So the idea was to develop the parser to provide at least the typical performance one might expect from a TADS or Inform game. Most of the early months of development were spent on engineering the parser, and it was quite the battle. Hard to say for sure, but I’d say I got about 85% of the way there.

One of the missing pieces was being able to parse a command using the syntax VERB CREATURE NOUN. For instance, SHOW CECILIA THE KEYS.

The easier form of the syntax is VERB NOUN ‘TO’ CREATURE, as in SHOW THE KEYS TO CECILIA. The presence of the preposition (TO) helpfully divides the two tokens in the command. The way I implemented the parser, after first parsing and removing the verb, I scan the remainder of the command until I hit either a preposition or the end of the command; the words collected from that scan compose the token. In the example above, THE KEYS would make up the token that comes before the preposition TO; everything after the preposition (CECILIA) makes up the following token. Then I would proceed to figure out what objects the two tokens were referring to.

The problem occurs when there is no preposition, but I’m expecting two consecutive nouns. So if the command is SHOW CECILIA THE KEYS, the parser would grab the entire phrase CECILIA THE KEYS as a single token. Actually, I automatically remove all occurrences of the definite article THE, so the token would really be CECILIA KEYS, which would be handled the same way as something like GOLD KEYS or SHINY KEYS. So the parser would look for an object called CECILIA KEYS, and then proceed to throw up.

Fixing that to allow the alternative syntax was something I always knew was important and would have to be done, although there aren’t many game verbs that require this syntax. Off the top of my head, I can think of SHOW, GIVE, and FEED, although I know there are more. On top of that, it doesn’t really come up much in Vespers, except for a couple of times. But it’s a good example of a syntax that people often use, and in a text game the parser should really be able to handle it gracefully since, without it, the error message is unlikely to be helpful (“You don’t see any such thing.” Say what?). Then, naturally, people will point fingers and say “See? This is why we don’t have text games anymore.”

I knew it was going to be a challenge, mostly because the parser code is a large, unwieldy beast, and on top of that, I haven’t really looked at it closely for a good long time. Enter the three-and-a-half hour long flight, and we have a golden opportunity to reorient, refamiliarize, and figure this thing out.

As it turns out, the whole thing needed a grand total of three lines of code.

The way I handled it before, if I was trying to match a NOUN in the syntax and I had a token consisting of a bunch of words from the command to match it to, I would find the closest match and count how many words in the command were matched. If there were leftover words that weren’t part of the match, that meant something was wrong and the syntax shouldn’t match — so I aborted that syntax and moved on to the next one. So in the case of the command SHOW CECILIA THE KEYS, the token would be CECILIA KEYS, and I’d be able to match CECILIA with the word KEYS left over. The leftover word would cause the syntax to fail, and we’d move on to try the next syntax for the verb.

Since I already had the code in place to count the number of words in the token that were matched, all I needed to do was reset the number of words in the token to the number of words that were matched. So in the CECILIA KEYS example, the number of words in the token is 2, but the number of words matched is only 1. So I tell the parser that the correct number of words in the token is actually 1 (not 2), and the remainder of the token is kept for the next round of token matching. Add in a quick check to see if the next syntax word is a NOUN or HELD object, and that’s all I needed to add.

%nextSynWord = %syntaxWord[%currentSynWordNum+1];
if ((%nextSynWord $= "noun") || (%nextSynWord $= "held")) {
%nouns = %nouns - %numMatchWords;
}

That left plenty of time to watch “Fantastic Mr. Fox”, too. Nice flick.

Be the first to like.
Posted in interactive fiction, text in games, Vespers | 1 Comment