Monday, June 30, 2014

XBlaze Etc

So, I decided to try a visual novel out for my morning commute game, and I picked the most recent one: XBlaze. Or XBLA*ZE, whatever. It's by the BlazBlue folks, so I knew that it'd be full of grim dark grimness with grim grim darkness and one joke character.

What I didn't expect is that it would be the most stereotypical thing possible. Literally, it is impossible to cram any more stereotypicality into this game, because every character, every set, every story beat, and every plot point is the most stereotypical rehash of a common trope they could find. Every single character is a fetish stamped on tissue paper, every plot event would have been considered old and tired in 1989.

The format is easy to consume while standing with one hand on a train rail, so I've played it through a fair amount. Nothing has been even vaguely new or interesting.

See, the basic problem with XBlaze is actually the basic strength in BlazBlue.

Arc (the devs) are pretty good at throwing tons of polished stereotypes into a game. In BlazBlue, every character is a stereotype, but that's actually good in a fighting game. You have to know who someone is within 1.5 seconds in a fighting game. So you walk a narrow line: stereotypical enough to identify, but interesting enough to look at that people will remember them later. It's actually advantageous to not have any character development - so all the character "development" is actually just revealing the past to the players. That way the characters don't change over time, and everyone who plays the game will always face the same version of the same characters.

Moreover, a wide variety of instantly recognizable characters means everyone will find someone they are interested in playing. It's the "shotgun" method of character design: put a ton of instantly-recognizable characters in your game and let the player sort out which ones they like. If they dislike 80% of the characters, that's fine: they don't have to play them.

While that's good in a fighting game, that's awful in a visual novel.

Visual novels work in exactly the opposite manner. It's less important that a character be immediately identifiable, and more important that they evolve over the course of the story. Hidden backstories being revealed are common, but it's a way to make the characters behave differently. Since no two players are competing, it's not important for characters to be the same between multiple players.

The selection of characters is also less important, because a player cannot really choose to spend time with one character and ignore another. All the characters are always interwoven. Maybe in a dating sim a player can choose a particular favorite and it will matter, but in a typical visual novel you are always stuck with all the characters. If you only like one of the ten characters that you're stuck with, that's considered 9 fails rather a success.

Fundamentally, Arc took the same approach in their visual novel as their fighting game. They filled their story with a huge variety of instantly-recognizable stereotypes.

Unfortunately, none of them are even slightly interesting.

They attempted to make the characters evolve by applying the standard story for each standard stereotype. For example, the cute robot girl slowly learns human emotions and, I presume, will die while betraying her creators in favor of her new friends in the third act. Doubt I'll play long enough to know for sure, because the robot learning emotions is so painfully standard that it predates robots, and there's no spice in this particular dish.

The hope with XBlaze is that you will find at least one of the story lines to your taste, at least one of the characters. Unfortunately, that's not how stories work. That's how fights work, sure, but this is a story.

A story is much more cohesive. While a reader can technically ignore large parts of the story, that's a sign that a story has failed. Instead, each of the pieces of the story - whether a character, place, or event - needs to contribute to the core of the story.

In a fighting game the core of the game is the fighting. The characters, settings, and events all contribute to the feel of the fighting, giving it a strong flavor and unique texture.

In a visual novel the core of the game is the heart of the story. The characters, settings, and events need to contribute to that.

In XBlaze, the story is theoretically about a pacifist having his worldview challenged by harsh realities.

Having three different kinds of magic does not help the story any - it just allows you to have three different kinds of stereotypical magicians. This is a sacrifice made to enable more characters at the expense of the story.

Having a robot learning emotions could actually be a powerful echo of the story. The robot could go from being a militaristic, violent, order-following machine to being a dedicated pacifist at the same time that the pacifist main character is pushed into fighting. But instead of serving that end, the robot is simply allowed to trundle along their trope's default plot line regardless of the fact that it doesn't have even the slightest bit to do with the core storyline.

You have to balance your characters and how they relate to the core story in the same way that you would balance the character's fighting styles in the fighting game.

What I'm saying is that Arc has misunderstood what a visual novel is.

Friday, June 27, 2014

Context-Driven NPCs

Most NPCs are scripted with a lot of personality. They have character arcs and opinions and a backstory and a romance arc and all sorts of stuff to try and make them interesting.

The problem with these NPCs is that they are pretty oblivious to when they should actively express themselves, and relative to which people and things. If they are active, they tend to run roughshod over other dialog, current missions, and the player's current intentions. Even if they are just commenting in a small way (such as '-5: Lilliana doesn't like you helping magicians') it distracts from the player's intention and simply makes things muddy and awkward.

So most of the time, the NPCs are put into extremely passive roles. They are only allowed to express themselves when the player returns to base and actively seeks them out. This gives them explicit permission to activate and express themselves.

Unfortunately, it also limits how they can interact. They can't interact much with other NPCs, the world at large, or the ongoing central quest. All they can do is sit in a safe little spot and wait for the player to strike up a conversation. This is very awkward and forced at the best of times.

There have been a lot of NPCs I've wanted to spend time with, but these games don't allow you to do so. Sure, you can put them in your party, but they leave their personality back at base. Sometimes they will judge something you do, but rather than being interesting and fun, it blindsides you and leaves you feeling cheated or caged-in.

For example, almost all of the characters in all the Mass Effect games were interesting enough that I wanted to hang out with them. Mass Effect didn't let me. While I could go through their personal character arcs and learn their backstories, it was impossible to simply shoot the breeze. Mass Effect 3 was especially notable for this because many of the shipside conversations ended up being hanging out. You'd talk to Garrus and he'd take you on a drinking-and-skeet-shooting hangout. It was fun.

But it was only once.

I couldn't get Garrus to go drinking with me again. I couldn't get Solus to sing any more songs. I couldn't get Tali to geek out over random pieces of tech lying around in the various places I went. I couldn't get Liara to do psychic hang-outs. I couldn't go bar-fighting with Wrex. I could only march along the scripted course and reach the scripted destination. The only thing I had control over is which person I wanted to see half-naked for 3 seconds.

Even that was, of course, a one-off event.


The only times NPCs are active is when you are in one of their personal sidequests.

Sure, they are scripted to respond to events in their personal sidequest, but that's actually only a minor issue. It's easy to script general responses to general events in every kind of scenario. No, the reason they are active in their sidequests is because you have given them implicit permission to be active. By going on their personal mission, you have implicitly stated that you care about what they have to say, at least for the next hour or so.

There's nothing difficult about programming Tali to run up to every significant piece of tech randomly found in the game world, scan it, geek out over it, say random clips of dialog about it. That would have been very easy to program. But it also would have trampled my gameplay, and walking around would have become more like herding children than being on a mission.

The core issue is that Tali has no way to tell whether it is contextually appropriate for her to geek out over something. At any given moment, her running off to geek out could screw up my pre-combat arrangements, or talk over an important meeting, or just be incredibly socially inappropriate.

There are a lot of heuristics you could use to try and keep Tali's commentary reasonable, but the core problem isn't the exact timing or number of her outbursts. The problem is that the game devs can't read the player's mind. Even if you know exactly where all the enemies are and exactly where all the socially constrained areas are, you don't know what the player is thinking. If you were really there, you would: the player's body language and facial expression would give it away pretty quick. But you obviously can't read that through an XBox controller.

The solution is to create a way to give implicit consent.

Basically, you trigger the same kind of "consent to act" that is usually associated with loyalty sidequests.

You need to do this in a way that isn't annoying to the player, and the easiest way to do that is to use it to enhance immersion rather than detract from it. By spending time with Tali on your ship, a counter begins. For the next 30 minutes or so, Tali will be active, happily running around. Afterwards, the context fades and Tali reverts. You can prolong the context - or change it to an even more permissive context - by interacting with her out in the field. The interactions you have available to you depend on the context you've established.

If you've talked to Tali about her pilgrimage, most of your options will be related to that facet of her character - talking about whether something is suitable to send home, or can be learned from, or how it contrasts with home. If you've invited Tali out on a date, then most of your options will be related to that - and she'll spend less time geeking out over tech and more time considering whether you're having fun. And the context can be changed, if you can find the right opportunity.

You can revert faster by changing the context. You don't have to call an excitable Tali over and say "stop it! You're annoying!" Instead, you simply ask her whether she's ready for the mission. This painlessly changes the context from "Tali is important to me" to "Mission time!"

I propose we increase the number of times the player interacts with the NPC while decreasing the amount of time each interaction takes.

The intention is that the player will often "nudge" the NPC gently into a mode which suits the player's current mood and play intentions. As the situation changes, the nudges wear off or the player nudges in new ways. This constant low-level interaction allows the player to enjoy an NPC without getting sideswiped by annoyingly overactive NPCs.

A few things are required to make this work well, though.

One is that there needs to be a reward for active NPCs. For example, if Tali geeks out over a piece of tech, Tali should gain 5 XP or something. A small reward that makes you feel like they are either evolving or useful to you when let off their leash.

Another thing is that you still have tiered relationships.

When you first meet Tali or Garrus or Mordin, you can't simply go "OK let's date and get kissyface". I mean, it's a viable route, but you'll have to establish that kind of relationship by letting them be active while in less romantic contexts. But what kinds of relationships are viable with what ease will vary: Tali's romance route is tough because she will literally get sick if you even touch her. Liara, on the other hand, would probably be very easy to woo - not only does she start right off with a crush on you, but her species is not exactly puritanical.

Whatever relationship you aim for isn't a "final goal", and is instead a "fun place to be". Sometimes that's closer or further from where you start.


The last thing is "passive evolution" and "simple judging". Even when not active, the NPCs need to exist. The easiest way to do this is to have them gently react to the player's actions.

However, this is a trap you need to be careful of. In most games "react to the player's actions" translates to "judge her dialog tree choices". This is an obnoxious thing to try to do, because you can't read the player's mind and have no way of knowing why she chose that option. It's also obnoxious because the player often doesn't know it's coming, can't predict it, and can't easily fix the damage it causes. It's just not a great approach.

"Simple judging" is probably a better answer. With this, the characters feel differently about the player inch by inch as the player performs various basic gameplay feats. Most of these should be positive, very few should be negative: hanging out for a long time should make you more friendly and accepting rather than less, even if that person is kind of annoying.

So Liara might respect you more each time you use a powerful psychic attack or kill a psychic in combat. Mordin would like you more each time you used a medpack. Garrus would like you more each time you sniped or used a grenade. Etc.

In a less restricted world, these could be applied to a wider variety of interactions, but I think that's enough talking about it.

That's my basic idea! Small, frequent context shifts under the player's control give the NPCs all the information they need to know about whether they can express themselves, and how.

To be honest, I have this whole big algorithm thing involving nodes and context pipes and crap, but I really don't think discussing a specific implementation will help this essay much.

So I'm done!

Monday, June 23, 2014

Animated Wrinkles in Affixed-Vert clothes

I've been thinking about wrinkles.

One of the problems I have with most clothes even in high-poly assets is that they don't wrinkle right. The wrinkles are typically painted on quite nicely, but if the character bends or moves they do not adapt. I don't know if this bothers anyone else, but it seriously bugs me, because that's a huge opportunity.

There are ways to make clothes have animated wrinkles. Let's cover some, remembering that we're talking about medium-poly game characters!

The first way is to have physics-enabled clothing. As the cloth moves, it is continually recalculated. This is quite expensive and is mostly useful for things like capes and hair rather than compression or twist wrinkles, because you would need a very high-density mesh and a lot of computations.

Another way I've used in the past is to "stutter-rig" the clothes. For example, your shirt might contain a lot of largely horizontal edge loops. Normally, you would smoothly weight them across the various spine bones. However, if you "stutter" them so each row is mapped slightly more or less to various bones, they don't move uniformly when you bend. The result is a cheap way to create compression or twist wrinkles, but the wrinkles are very low-density and have mediocre quality at best.

Another way I've used is to have a lot of skeletal bones specifically for clothing animations. For example, you might have a bone coming down off the front and the back of the knee. These bones would be animated in the standard walking animation to lag behind the lower leg in certain ways. Loose clothes could be partially bound to these bones, which would create a fairly realistic system of lagging behind as the leg moves, naturally creating flare. Unfortunately, these lags do not create wrinkles, and there is a lot of added work for animators and riggers.

Another way is to create shapekeys related to common wrinkle patterns, and drive them using driver bones. While the animations are still a bit annoying to create due to all the driver bones, the end result is deeper and more customizable than the skeletal animation system, because you can etch wrinkles into the cloth.

All of these approaches are mesh-centric. However, in medium-poly clothes, mesh wrinkles are not going to be very precise. This is why most artists paint them into the textures rather than onto the meshes. Or, perhaps, model them in a high-poly mesh, then bake it down to a medium-poly mesh. The end result is the same: the bumpmap or parallax map has wrinkle info.

The problem with this approach is that it isn't animated. If you bend forward, there are no compression wrinkles. If you twist, there are no twist wrinkles. Just whatever you etched into the base mesh.

One possible way to create animated wrinkles is to have four bumpmap textures for your mesh. One is the default, one contains compression wrinkles, one contains twist wrinkles clockwise, one counterclockwise. You can use the vert color channels to mix these in the shader, overlaying the type of wrinkle. Since the verts blend, your mesh will vary across its surface - certain parts compressed, certain parts twisted, and so on.

The hard part of this approach is how those colors get assigned. One method would be to use driving bones, but as with previous attempts, that would mean a lot of added bones and every animation would get more complex.

An easier way to do it would be to hijack the base bone animations. We can approximate when to use compression or twist by simply watching the bones. When the bones rotate on axis, that's a twist. When they rotate on joint, the surface in the path of their rotation gains compression wrinkles.

These can be calculated relatively easily and used to tint the verts. The computations may be fairly expensive, however, because every bone would need to be recalculated every frame, and in each frame we would have to write a new colors array to the mesh object, which is not exactly a fast process if my experiences mean much. Still, if we use distance from camera to disable that for anyone more than a few meters away, we could probably get away with it.

Now, that won't get you all forms of wrinkles. While it might end up looking pretty nice, it doesn't really embody loose clothing - just various kinds of tight clothing. No billows, basically.

Billows could be created in any of the mesh deforming methods explained above, but I'm not a fan of them because they require a lot of effort. There should be no effort involved: we know exactly what the clothing is shaped like and exactly what the body beneath is shaped like, so it should all be calculable.

Unlike most game engines, we do actually know those details - in a very precise way. The affixed-vert system adapts the clothes to fit on an ever-changing body. We know precisely how much space there is supposed to be, even if the underlying mesh has been deleted or changed to prevent pop-through. Moreover, we can also have a "looseness" setting in the prefab for the clothing.

This means we can adjust the exact position of the clothings' verts as we please, limited only by computation restrictions. But - here's the cool part - we can do that in the shader. Much like we use the RGB color channels to overlay the wrinkle bumpmaps, we can use the alpha color channel to cause billowing. Simply put, the more opaque the color, the more the vert is expanded along its normal.

This is a lot faster and less destructive than actually changing the value of the verts in the mesh. It also is not much slower than the technique we used for the wrinkles, since setting the colors is the same price whether they have an alpha channel or not.

The question then becomes "how do we set the alpha channel?"

In order to calculate compression wrinkles, we have to compute whether a vert has been "pressed" in the direction of a bone's movement. This is absolute, not time-based: if the arm bone is levered upwards and then holds there, we get the same compression wrinkles no matter how much time passes. But we only want compression wrinkles on the top of the arm, not on the bottom.

On the bottom, we want billows. Well, as much as the cloth allows.

So when we calculate the bone's levering, we'll be using a simple system of normals. If the vert normals align with the bone motion, the vert is compressed. If the vert normals oppose, it gets billowed. And, of course, there's a weighted blend between the two for verts that aren't perfectly aligned.

We could calculate the distance between the surface and the underlying logical body mesh to determine how much billowing we should allow, but it's actually not a great way to do it, because the cloth mesh is not created as loose as possible: it's created to look decent in normal situations, so it's pressed against the skin. Instead, we would benefit from using a "looseness" rating, either a cloth-wide rating or inherited from the alpha channel of the default mesh as painted in Blender (or whatever). In that way, certain parts of the clothing could be made to billow more or less.

But there is a value in the relation of the surface cloth to the underlying logical body. This is a bit complex, so bear with me.

When we calculate how to morph the cloth, we find the face our cloth vert would fall onto, and we move our cloth vert as far as those points have moved in the base body. So a fat person's belly pushes out considerably from the default mesh, and in turn our cloth does as well.

But since we understand the nature of the changes in the body, we can also react to those changes intelligently if we want to spend some time creating an algorithm to do so. In specific, we could create a much more adaptive kind of cloth mesh.

One of the big things clothes have never been able to do in games is get pushed and pulled like in reality. You can't roll up your sleeves in a game, because there's no concept of it. You might be able to switch to a "rolled up" variant mesh, but you can just arbitrarily roll them up.

Well, you can if we use a smart autorig adjust.

Let's say you want to push your sleeves up. Well, we know what face of the base mesh each vert of the sleeve defaults to. When moving the sleeve verts, we don't move them arbitrarily in real space. Instead, we march them along the body's surface, sliding along the face and folding over to the next one. We can do this very easily by projecting the vector of intended movement along the surface of the face, and recalculating that whenever we move to the next face. If that proves too expensive, we can simply move along the length of the relevant bone.

As the sleeve moves up, it will need to do two things. The first is that it'll need to rig itself properly. It can do this by inheriting bone weights from the body mesh below, rather than using its default bone weights. In this way a long sleeve, pushed up, would become a proper short sleeve and not still be bound to the forearm and wrist.

The second thing it'll need to do - and the reason I'm mentioning this concept here - is that it'll have to wrinkle.

I haven't worked out the best algorithm for wrinkling yet, but it's going to involve simply moving the verts along the base body's normals.

Anyway, that stuff is theoretical, but I know that I CAN do the color channel stuff. So I'll start there.

Friday, June 20, 2014

Play Echoes

I wrote this essay a while back. The basic idea is that you can save chunks of worldstate, then use those chunks flexibly in context-sensitive applications rather than having to use some kind of natural-language system or whatever.

Then I read this long essay by Ian Bogost about Darmok, the episode about those Star Trek aliens that talked only in references to old stories. He came up with the idea that they are actually talking about process - context-heavy processes stored as references to situations where such things played out before.

Then I read these tweets by Zach Gage, and things started to slowly congeal, like ideas sometimes do.

So, let's start at the end, then I'll describe why it is the way it is.

This is an open-world sci-fi RPG. You can make friends with any NPC, and they can join your team. But the universal translator is only capable of so much, and communication is difficult.

So you create and share memes.

You and Hjilsb are together, fighting against an onslaught of voracious, hopping fungi. Together you best the fungi.

In another game, Hjilsb might gain a "friendship point". Maybe she gains one here, too. But more importantly, in the quiet time later, Hjilsb is talking to others - or perhaps to you - and she does a flumpy hopping fungi impression, then goes "BLEAAAHHH" and fake-dies.

This is a nascent meme. It is a tiny piece of your relationship, your past. It is the part of that sequence of events that Hjilsb remembers most - her personality was most drawn to that particular thing. If she had a different personality, she might have re-enacted the back-to-the-wall gunfire moment, or the fungus dropping from the ceiling in their initial surprise attack, or the flat "whut?" look you gave each other when you first saw them, or the "click-click-" moment she ran out of ammo and you saved her.

These are not simply "oh, we had an event together" markers. They represent a specific start state, progression, and end state that struck that character as personally and emotionally important.

Hjilsb remembers the start state of a goofy enemy, the progression of shooting it full of lead, and the end state of it goofily dying. If she had a different personality, she might remember a different tiny portion of the fight. As the events of the fight stream by, the personality filters for whichever events seem most interesting, and forgets the rest.

At time goes on, that goofy little "bleah!" might fade from use, only a momentary idiosyncrasy. But it could easily become useful.

Yeah, useful.

You can't talk to Hjilsb very well, and she can't talk to you very well. The mocking "bleah!" can potentially stand in for any situation where Hjilsb wants to say "let's kill these idiots". If she remembered the "click-click-" out of ammo thing, she might use that whenever she wants to tell you she's totally screwed. The back-to-the-wall blammies could be used to say "we can do this if we do it together".

Because the personality algorithm chose these events to remember, the personality algorithm knows what sort of situations echo it: the ones that have the same algorithmic response, or are predicted to.

You can use the memes yourself. Once you see the silly "bleah!" you can use it as an emote yourself. Hjilsb knows what the emote means to her, so she assumes you are talking about the same situation. You can use this not simply to establish camaraderie, but to actively change her thinking about a situation. After all, it's hard to be scared when your boss is making fun of the enemy.

There's no reason the "bleah!" emote can't be used to other NPCs as well, although it may not translate well into all personalities.

There's no reason the emotes can't be used on other PCs. There's no reason the emotes can't be used in constructed challenges or quest lines to specifically tint content so an NPC will judge it in a given way.

What's more, there's no reason that the "bleah!" emote has to continue to represent stupid jumping fungus.

Every time a similar situation comes up, Hjilsb won't create a similar emote. She already has a response to dumb-looking creatures getting shot, she doesn't need a new one. She just adds it to the mix, with a sly sideways glance at you and a "BLEAH!"

A new starting state, a new progression, and a new end state added in. Not just hopping fungus, but also purple wombats and big-eared mouse-mecha.

Why keep track? Why does it matter?

Because each progression adds more vibrancy and variation to the meme. If you decide to use the "bleah!" meme when constructing a quest line for your friends, the quest will vary from instance to instance, each time choosing a different flavor out of the giant roster of "bleah!" instances. Not necessarily different monsters or guns or whatever, but a different exact progression, or exact numerical value.

And if "bleah!" happens on a mission that another player is experiencing, his NPCs will use the "bleah!" emote, and it will spread to his game. Creating a shared reality, without any shared content. And when he goes to the forum, or records a YouTube video, "bleah!" will be there, too.


Now, what am I talking about?

Well, for starters, I'm not actually recommending that game design. It's a bit clunky. I just wanted to be clear what we're talking about.

The kind of... meme-like thing we're talking about is not exactly a process, nor is it solely a stored context, nor is it simply a feeling, nor is it a combination of all three. It's a bit complex.

We do this all the time. In GTA, you and a friend might be playing together. You leap a car off a riverbank and onto a boat. Your friend says "whoa!" and decides to one-up you. Soon you're trying to jump cars onto the wings of flying planes.

This is what gives an experience life. Not just that something happened, not just what you felt during a given moment, but how you refined that feeling and experience and time passes. Long after you've stopped playing GTA, you'll probably remember those epic jumps fondly. It's the same with scripted events: you play FFVI, you probably have strong memories of the opera. But these memories are not simply your memories. They have been tinted and reinterpreted many times, and the opera in FFVI has come to have a shared meaning among those that have played the game.

This sort of thing is becoming more and more common as YouTube and Let's Players grow in popularity. I have revisited games I disliked because I saw someone enjoying them, and since I was now "in on it", I was able to enjoy them the same way.

I don't have a good name for these bundles of shared, refined experiences. Something like "experiential clusters" would probably be accurate, but it's not very catchy. How about "play echoes"?

For now, I'll call them "play echoes". These are events that catch your eye, you have an emotional response to them, and in some manner merge this with other people's similar responses to similar events.

These vary wildly. For example, the strained puns of Dark Souls etchings are a kind of play echo. So is the deep hatred for Road To Hell. In Dark Souls, the etchings are shared in the game, through the game engine itself. But in Road To Hell, the derision is shared via the internet, with videos and posts laughing together, sharing the same judgments.

Play echoes can easily make or break a game. Sharing your game world with others can add a lot of depth as it attunes you to details you wouldn't have noticed, or would have judged in a less interesting way. But sharing can also pollute the experience, screwing up the sense of place, the level of loneliness, and the fundamental skill progression (you learn too much).

So, I have a few questions:

1) Can you create a game where players can create and share play echoes in a way which maximizes "making" the game and minimizes "breaking" the game?

2) If so, can you create a game where the game understands the concept of play echoes?

3) If so, can you create a game where the players can script new content, quests, and so on out of play echoes rather than painstakingly scripting and balancing everything?

Wednesday, June 18, 2014

Growing NPCs

I've been thinking about NPCs.

A while back I came up with a "chatter" system that allowed NPCs to remember chunky bits of worldstate, then allowed both them and the player to use those memories to talk about things.

The idea was simple: NPCs are normally scripted to do specific things to further the player's adventure. They have a specific role they are assigned. But that doesn't sit well with me. To me, the NPCs are the player's adventure.

The most powerful experiences I've had in open-world games were when someone was with me. Whether it was another player or a good NPC, it's a powerful experience. The important thing about an NPC, to me, is not the design or the personality. It's that the NPC feels like they are moving through the same space as me.

Chatting with an NPC at a home base is all well and good, but I don't need it. It's extraneous. The NPCs don't need to have a compelling backstory, or a secret they refuse to tell you. They don't need to have a loyalty mission. All they need to do is move with me.

Probably the most powerful NPCs in this regard are from Dragon Age, because they react to each other. Their reactions to me are pretty bad, but their reactions to each other are really good, creating a real personal dynamic to the party. It kept me playing even as the gameplay disintegrated and the story collapsed into mush.

When it comes to interacting with my specific movements through space, the characters fall flat. They do sometimes comment on the spaces we pass through, but always in a passive and passing way. They do occasionally act in response to my actions, but their responses tend to feel arbitrary and annoying because they tend to judge something without allowing any explanation.

For example, if I choose to help someone, my party members will judge that in a particular way no matter what I was thinking. This was a big issue in the Dragon Age games, because I would often find myself blindsided by a character's judgment. The reasons I decided to take a particular action were obviously not the reasons any of the devs thought anyone would, and it often took me quite a while to figure out why a character would be upset with that, or like it.

We can learn from smaller projects, though.

In the original Skyrim, the companions basically didn't exist as anything other that combat flunkies. They had almost no personality after being put into your team. But since then many companion mods have been added.

One of the most interesting to us today is the thief character, Arissa.

She follows many of the same patterns as a Dragon Age character, but she does those patterns much better. She has more active rather than passive location-triggered comments, and she can be released to explore a city on her own, which is very interesting. But those require a lot of custom content for relatively small payoff. Let's talk about her most effective advantage:

She will judge your actions similar to a Dragon Age character. But she does it in a way that doesn't have an opportunity for misunderstanding.

She doesn't judge you based on which quests you accept or that sort of thing. She judges you based on how awesome a thief you are. Sneak attacks, picking locks, and picking pockets will earn her friendship. Murdering friendlies will earn her distrust. This is really interesting, because it ends up painting a very powerful picture of her personality: she appreciates your ability to rob townsfolk blind while they sleep, but if you hurt them physically she'll get pretty upset.

Relatedly, she gives you a very clear progression. You are told when she appreciates or doesn't appreciate things, and once her opinion has changed enough it unlocks new features. A bit of appreciation and she'll carry things for you. More, and she'll let you equip her. More, and you can ask her for lockpicks. More, and you can ask her for poisons. And so on. While these seem minor, they are important rewards to guide players onto the path.

After about half an hour of Arissa as my (only) follower, I found something odd: I was changing my behavior for Arissa. I was pulling off unnecessary stealth kills and stealing things I didn't need specifically to impress her. I can't recall ever doing that for any other NPC - normally I would just choose the NPCs that get along with my play style.

When I was finally caught pickpocketing by a civilian, rather than kill the civilian to cancel the bounty like normal for a villain run, I actually paid my bounty (after giving all the illegal stuff to Arissa to carry).

This story of my adventures was very different from what it would have been with any other companion. An NPC had shaped my adventures in a very open, simple way. No quest lines. No ethical dropdown box. No trying to read my mind and getting it wrong. I had the adventure I was having, and an NPC was a big part of it.

Arissa was flexible enough to fit into my adventure. No matter where it took me, or what mods I had enabled, Arissa's simple preferences held up. She could participate in any setting, any scenario, any specific adventure.

This is the heart of what I'm trying to do with my new prototypes. Basically, I want the overarching megaplot to be a mod. I want people to be able to "mod in" any end-of-the-world storyline they want, and all the NPCs will function in that adventure without an issue.

I would like to expand the functionality of the NPCs. Although Arissa was good for the limits of the engine, she was basically stuck just judging things rather than participating in any kind of meaningful way. The line dividing her active systems (combat AI) and passive systems (judgments) was far too stark.

A more active character can be created, but you need to be careful to keep chaos under control. That means that the game's fundamental systems have to be built with this kind of active NPC in mind.

If Arissa (or Morrigan or whatever) takes loot that I was aiming for, or kills something I wanted to kill, or otherwise disrupts my immediate plans, they are suddenly annoying. The game needs to be built with their free action in mind.

Another problem is the number of NPCs. Arissa works well as the only NPC judging things, but if there were another three of her, each with their own values, it would become a mess. If you're going to have a lot of NPCs, you need a different approach.

In my game engine, the tentative plan right now is to only allow for one or two active companions. You might have many people willing to go with you or be in a dance party together, but they exist as part of the world when they aren't in your party. There are rewards for letting them continue their daily life uninterrupted, at least for decent stretches of time.

The other part of my plan is to have "plan triggers".

In order to not disrupt your plan, all the NPCs really have to do is understand what your plan is. Also, if they understand what the plan is, they can be "moving through space with you" much more effectively, participating in your adventure much more clearly.

So, when you walk into town, click to tell your party to ask around for rumors but not get in trouble. Click a different button to tell them to stay close and on alert. Click a different button to tell them to go straight to the inn, or wander as they see fit, or stay hidden... all associated with you saying something, and them saying something back.

I'm thinking you can even expand this to targeted actions. Control-click to tell a party member to execute the plan there - whether it's talking to those people, stealing those things, blowing away those monsters... sort of like turn-based controls, but much vaguer and faster to trigger. More like saying "There!" rather than "attack goblin B with your fireball spell".

I've also been thinking about a lot of alternatives to the concept of "you". A big part of the problem with open-world games is that the player avatar is a specific person and therefore everything has to revolve around this one person. This one person has to be friends with everyone, know everything, act in a specific way...

To me, that only works for a small game. If an open-world game is going to be longer than a few hours, I think they would benefit from being able to switch avatars. To that end, I've been considering a variety of avatar-switching ideas.

Right now, my favorite is that you are some kind of ghost or godling. You have your own presence, but you can't really do anything without possessing a willing host. As time passes, hosts get steadily more burned out and you have to stop possessing them to allow them to recover. So you'd have a "primary" NPC that you are probably directly controlling most of the time, and one or two secondaries that act with you.

This would allow for a much wider variety of experiences without crowding in too many characters at once.

Well, nothing is set in stone. These are just my thoughts.

Tuesday, June 17, 2014

I Still Hate Bioshock: Infinite and Gamer Culture

Maybe it's because I had such a terrible commute this morning, but I can't get Bioshock: Infinite out of my head. More accurately, the response to it.

The end of last year was a rough time for gamers, because the inevitable "best of" lists came down the line like bullets from a gatling cannon. We discovered, to our horror, that the reviewers and critics we respected had listed some truly loathsome games as their favorites.

Bioshock: Infinite and Tomb Raider were the big ones for me. I hated both those games with a deep and abiding resentment that soured my opinion of anyone that liked them. Both were horrific.

Tomb Raider was openly horrific, like Hotline Miami. I could vaguely accept people liking those games, because ultraviolence, torture, and extremely boring depictions of human sadism are accepted parts of gamer culture. Getting upset with people liking Tomb Raider is like getting upset at people liking JRPGs or League of Legends. I can separate myself from that and say "well, it's just not a genre I like".

There are people who insist Tomb Raider is not an ultraviolent sadistic torturefest, but there are people who insist League of Legends is an inviting game and JRPGs are intense.

What I can't really get over, even now, is Bioshock: Infinite.

See, BI was created specifically to pander to straight white males ages 18-40, but it was created with a slightly new kind of pandering.

I grew up with games pandering to my demographic using violence and tits and manly-man growling. I was saturated in it, to the point where I didn't even really notice it any more.

BI tried to pander with obfuscated science-fiction storylines.

Sorry, Levine, I'm a connoisseur. I grew up on the very best science fiction. I remember my first viewings of Akira and Ghost in the Shell: both times I thought "oh, a good take on a standard story".

I was actively repulsed by the shallow plodding storyline in BI because it was so sub-par. When I read all the accolades about how amazing the story was, I was confused. The story was the weakest part of the game. Not just the big notes, but also the small ones. There were only a few story beats I liked, and even then they were usually screwed up in the last second by an overly heavy pandering hand.

Searching for other people who hated the story, I was struck that nearly all of them were not straight white males age 18-40.

They called out the story for a number of other problems. Racism, sexism, classism, and more. While the game attempted to make a racist, sexist, classist setting for the purpose of calling out those flaws, it ended up also BEING racist, sexist, and classist underneath that.

I thought this was all very interesting, and I learned a lot.

But that's because I had an "in". I already thought the game was crap, and I was hunting for people with the same opinion. When I found out that they had the same opinion for different reasons, I was able to sympathize and see their approach without feeling defensive, much like when you find someone likes the same band as you, but has a different favorite album.

Unfortunately, 99% of game reviewers and critics are straight while men age 18-40. And they were pandered to.

They loved this game because it touched them in all the spots they liked to be touched. It made them feel smart and mysterious and ruggedly awesome all at the same time. They loved it.

And when they heard these voices talking about how awful it was, they got defensive. They never actually listened to what the detractors were saying.

Many of them went into "full offensive defense" mode, like Jim Sterling. However, apparently Jim's first encounter with the detractors was with the people who hated the ultra-violent nature of the game, because he (and many others imitating him) defended themselves against that complaint with all the vigor they could muster. IE, they made fun of anyone who thought it was too violent.

Maybe it's because people who thought it was too violent were safe targets, as compared to women, people of color, and people struggling to earn enough to eat. Whether consciously or subconsciously, those targets were ignored like they didn't exist and had never said anything. Instead, it was "make fun of the namby-pambies that don't like violence" mode.

Any time I saw someone do this - and I saw it a lot - it really broke my heart. It showed just how exclusionary the gaming community was. Jim Sterling was probably the center of this, which is why I keep bringing him up.

See, Jim used to be a real toxic guy. However, when I started watching him last year I found he had really turned it around. He wasn't perfect, but he was a much better person and much more aware of misogyny and racism than before. I was sort of holding him up as an example of how "bro gamers" could become more culturally aware. He was a crack in the armor of exclusionary gaming culture, a path forward.

And then he held aloft a pandering example of exclusion as his best game of 2013. The crack in the armor was patched.

To me, the message was clear: gamer culture doesn't need to be inclusive. It can just get older.

I'm writing this so late not to dig up old wounds, but because I wasn't sure until now that I was really affected as deeply as I thought. But six months have passed, and I'm still upset.

Once I started pulling at these threads, my investment in "gamer culture" unraveled. For six months I've been completely unable to enjoy any major game, because all I can see is exclusionary bullshit. Even indie games often feel exclusionary.

I didn't make any conscious decision to not enjoy 99% of games any more. I just found that I could suddenly smell bullshit, and everything stank.

Although I can't speak for them, I can't help but think that this must be how basically everyone who isn't a straight white male age 18-40 feels about games. And I have to say: it's pretty bad. That there are gamers from outside that demographic amazes me. They have a level of tolerance and endurance I cannot even imagine, to enjoy something that stinks this badly.

I can't do it.

Games stink too much.

Monday, June 16, 2014

People Organizing Themselves

This isn't a game design post.

There's been a growing stream of news about people organizing themselves. It's becoming more and more easy. Things like AirBnB and Uber are one example. People organizing to evade import taxes and tariffs are another example. The new tone of socially-aware political protests are a third example.

But even you, personally, have probably noticed how easy it is to organize people. When each side has a smartphone, messages and internet maps make it very easy for any two people to quickly negotiate a time and place to meet. Even if you don't want to meet up, talking via messages allows for easy, asynchronous, searchable communication. It's easier and easier to communicate.

Most of the organizations arising in this space are "trust brokers" - their job is to insure that the people communicating are both trustworthy. Like all middlemen, I expect these organizations to be replaced by something a lot flatter and more public, but it'll be a while before that happens.

Anyway, anyone with a smart phone is exercising powers that used to be held only by corporations, governments, and the extremely rich. Buying from abroad used to be limited to those categories - companies would buy or manufacture abroad, then ship it home. "Globalization", we called it. Governments stepped in to regulate it, some more than others. But individuals were not usually very carefully regulated.

If person A wanted to buy jeans from America, person A would have to fly to America, buy them, and fly home. Obviously a huge expense and waste of time. Instead, person A would buy jeans from a company that specialized in importing jeans. And they would pay the middlemen and the government to do so.

Now, however, person A can buy jeans via person B, who happens to already be in America and wouldn't mind doing your shopping for you. This is a literal middleman - not an organization, but a specific person. You don't even have to know them - they have a 5-star rating from everyone that's come before, so you can trust them to get the job done.

This may sound pretty familiar, because its not exactly a new idea. People have been noticing this kind of thing growing for quite a while. But I want to talk about the cultures surrounding it in a bit more depth, because I have Opinions.

Let's state the idea clearly:

Ad-hoc cooperation is the future.

It's a carefully chosen phrase, because there is a lot of political chaff floating around. If I say "individuals will create the new economy", it won't go across right. Even though it technically means what I'm trying to say, it is already associated with a particular political group - the Libertarians - and therefore people will naturally think of Libertarian philosophies.

So, let's be clear: this is not a Libertarian thing. This is not about independence, but interdependence. It is not about supply and demand, markets, or abusively externalizing your costs. In fact, it's basically the opposite of those things.

We're talking about arranging to cooperate in a limited fashion so fluidly that everyone stops thinking "I'm going to do this" and starts thinking "we're going to do this". It's not about an economy or brokering of trust, because that implies some kind of buying and selling of trust. It's about sharing resources and skills so fluidly it's almost unconscious.

If I were to create a science fiction setting around this idea, I'd have to be careful. It would be too easy to simply treat things as a hive mind.

But I'm actually talking about the reverse of a hive mind! I'm talking about a frothing mix of very diverse people naturally finding others that are complementary. Others that are interested in doing the same things, or whose activities perfectly line up with the activities you need. This is not a method to make people all the same: it is a method to leverage the fact that there are so many different people.

Because that's what's happening. Humanity is diverse, and growing more so.

Our ability to connect through the noise and chaos and distance is growing even faster.

Friday, June 13, 2014

Chattering Questlines

A bit ago I posted a theoretical framework for doing constructive open-world RPGs. If you didn't read that, this post won't make much sense.

One of the things that makes open world RPGs so enticing is that everywhere you go feels interesting. The characters always have something going on in their lives and quests to hand out.

For example, you might walk into an early-game village and a woman would desperately ask you to help her find her missing daughter, who snuck off to Gooooooblin Mountain. It's a pretty typical early-game quest, and can really set the tone for the rest of the game. It can also become interesting or fun. For example, it could turn out that the daughter is a full-grown warrior who can definitely fend for herself, or that the child was in danger but the mother was a ghost, or that there was no child and it's a bandit trick. The quest can also be "chained" - find the child, and she explains she was sneaking out to tend to a wounded griffon, and now you have all sorts of options about whether/how you want to help, often gated by stats and skills.

How would you create this sort of situation in my chatter engine?

Well, first you would define the two NPCs and their relationship. Then put them in the locations they need to be. You'd want to disable nav on the child so she doesn't go home, obviously.

The mother doesn't magically know that the child went to Gooooooooblin Mountain. To inform her of this, you would need to create a state record. This is exactly the same as a conversation tidbit. It is exactly the equivalent of the child literally saying "I am on Goooooooblin Mountain". You stick it into the parent's head.

Even with absolutely no additional logic, the adventurer would likely hear this lady talk about her daughter being on Goooooblin Mountain, because it hasn't been talked about yet and unexplored "gossip" (state records in mental inventory) has a higher priority than "conversation" (state records arising from personal state).

But without logic, the mother would come off as not particularly caring. It's very important that our NPCs appear to care.

A child is a "good" item, your own child doubly so. Goooooblin Mountain is a bad item. It doesn't take much effort to figure out that the mother should be worried: a good thing stuck in a bad thing?! That's something you care about regardless of your personality!

But more logic is useful both in making things more lifelike and in allowing the parent to express her personality. The most basic piece of logic that would apply here is the relative power levels of the child and Goooooblin Mountain. A child might have a power level of 1 or so, while Goooooblin Mountain might have a 4 or 5. Alternately, if the child is actually a grown-up warrior, they might have a power level of 20 or 30.

The exact reaction depends both on the relationship and the personality of the mother. If we presume the mother is a worry-wart, then she might imagine Goooooblin Mountain to be 10x more dangerous than it actually is, which would mean she would be worried about her fully-grown warrior daughter. On the other hand, if the mother is of a proud warrior bloodline and has a colder, prouder personality, she could underestimate the danger by 10x, meaning she wouldn't be worried much even about her young daughter. In both of this cases, it might be more of a "could you please check up on my daughter?" rather than "OH MY GOD MY DAUGHTER IS DOOOOOOOOMED"

You'd need some generative text, but I don't think that's hugely difficult if you set your standards a bit low.

Any way you slice it, we didn't exactly program in a "quest" quest. We simply set the stage for a quest to emerge by putting specific people in specific places and making them worry about each other.

We could extend the quest in the same manner. Add in an injured friendly griffon on the Gooooblin Mountain. Set up a relationship between it and the daughter, as well as the daughter knowing its location. Add in some Goooooblins surrounding the griffon's hidey-hole. Now you can decide - is the daughter trying to find a way to the griffon through the goblins (place her outside) or is she stranded with the griffon (place her inside) or captured by the goblins or any number of other options.

But... how can you set it up so that she is actively trying to reach and care for the griffon?


State records don't have to be past tense, as I brushed on in the prior essay. "I am trying to feed the griffon" is a perfectly valid state record. You can think of it as an AI directive, but it's actually more flexible to think of it as "I fed the griffon" with a future timestamp. By putting it in the future, the character's rudimentary AI will naturally realize that she has to reach the griffon with food in order to achieve it.

This can lead to unexpected results. For example, if you forget to equip her with food, she won't be trying to reach the griffon. She'll be trying to find griffon chow.

The goblins are another issue here. Obviously, the goblins and the griffon know about each other and aren't on friendly terms, so you can establish their relationship as "a standoff", meaning that they'll attack as soon as something changes the balance of power. The goblins are probably treated as a "group mind" rather than individually tracked.

If we leave the child without knowledge of the goblins, it could prove a nasty surprise for everyone involved. Adding the goblins to the child's concept of the universe is easy enough, of course. The question is: what are her reactions?

Again, this is a time for personality to shine through. The exact power level of the child and the goblins is crystal clear - the question is whether the child is panicked, worried, unconcerned, etc.

However, personality actually does more than modify perceived power levels up and down. Personality also controls whether you'd request help.

Depending on the child's personality, she may require quite a bit of coaxing to let you rescue her - or she may recruit the injured griffon and launch an offensive the moment you get close enough for detailed simulation to start.

Basically, personality serves a few purposes.

The first is how risk-averse someone is. Or, perhaps, what situations they are risk-averse in.

The second is how they look for solutions. And this is not a weighting mechanic: each personality forms plans according to its own custom algorithms. Heroes, for example, form basic confrontation plans and only include known party members as participants. Conniving characters will form plans that involve sacrificing your neighbor for your own survival. Neither side is capable of coming up with the other's plans.

This is actually a method to simplify the AI requirements, as well as make them modular enough to upgrade or mod as the game proceeds. The only "core" AI is things like navigation and basic combat. Even in combat, a lot of the choices might be made by personality-specific scripts rather than an overall AI. Which makes party member personality important.

In the end, the biggest advantage to this approach is that it makes NPCs very predictable if you happen to know everything they know. This means you can "script" the environment using NPC personalities. The mother asks you to chase her daughter because the mother has a personality that asks others for help as its primary plan of action. The child needs to be coaxed into allowing you to rescue her because she has a personality that is scared of strangers. This same applies to conniving thieves, drunken louts, corrupt aristocrats, and so on: the AI is deterministic.


The last important thing to explain is obsessive NPCs.

In most open-world games, NPCs tend to be concerned with one specific thing. For example, there's the guy that just tends the clock tower. The lady who is obsessed with fireball magic. The dork obsessed with bragging about his bloodline. Someone pretending to be the Great Hero. Etc, etc.

These are accomplished using two methods in tandem.

The first method is to embed a few states in their head as "permanent future". Once the child feeds the griffon, the future state changes to "I fed the griffon" - a past state. However, if we want a lady to continually obsess over fireball magic, we embed "I cast fireball" in her future. We can embed something that is impossible for her to obtain on her own, or we can embed something that will continue to be in the future regardless of however many times you accomplish it, or we can create nested futures, where when that one goes away it reveals another, more difficult one behind it.

The second method is to use "fake states". These are states which are lies. They do not reflect reality. For example, "Aaron is the Great Hero". It's a valid thing to say, but it is wrong: Aaron is not the Great Hero. These are a bit difficult to use and implement, as it requires a contagious counterfactual state and a certain amount of anger when the lie is revealed.

Well, that's more than I need for the prototype, so I'll leave that on the backburner.

Okay! That's it!

Thursday, June 12, 2014

Clothes are Expensive

Now that I'm seriously considering a fantasy or scifi open-world RPG, even a small one, I need to face the dire truth:

Clothes are reaaaaaaally expensive. They take a reaaaaaally huge amount of modeling effort. I can buy content from the asset store for the houses and the dinnerware and the weapons and stuff, but none of the asset store character model packs hold up to my requirements. So I need to talk clothes.

This essay will be me talking to myself about the technical challenges and possible solutions. Stop reading if you are easily bored by technical details.

Right now, the biggest thing I cannot abide in an open-world game is everyone having the same body type. It was never acceptable to me, and now that Unity handles shapekeys so easily, there's not much technical reason to stop people from having a wide variety of body types based off a single mesh. I have modeled those kinds of bodies, and I'm confident I can create a base mesh or two to support a wide variety of bodies in my game.

The problem is the clothes.

Right now, there are two common methods of doing clothes.

One is mesh overlay: the underlying body mesh (the "naked" mesh) still exists, the mesh of the cloth is physically "on top". This is a somewhat rare approach for "core" clothes like shirts, although it's common for things like capes and hair.A big reason it's not popular is that the clothes tend to clip through the underlying body mesh, giving you 'pop-through'. Even if you increase the amount of empty space between the clothing and the body(giving it a weird, floaty look) you still have to painstakingly massage everything until the weights and positions are absolutely ideal.

The issue is that mesh overlay systems only really work if you have one body type. Every shapekey slider the base body has must be replicated into the overlay mesh, and each must be massaged both independently and in tandem to make sure there's no pop-through. This is an extremely difficult and time-consuming activity. Even if all you do is bone scaling, it will affect the overlay clothes differently and things will go south.


The other method is mesh replacement. The base mesh is chopped into pieces, and the pieces are deleted and replaced by costume elements as needed. If you put on a shirt, your torso mesh is deleted and the shirt mesh is put in its place. This is the most common way to do costumes in games.

However, if you have shapekeys, every costume element has to respond to those shapekeys in the right way. While this isn't as strenuous as mesh overlays, it is still time-consuming, and you need to be careful to keep seams intact. This is particularly difficult to do in Blender, since deleting verts makes shapekeys go haywire - you can't simply copy over the seams and keep them properly shapekeying.

If I had to choose one of these methods, obviously I'd choose the mesh replacement method. But neither is suitable for my needs. Here are some much rarer options.

Cloned mesh: Clothes are made out of verts cloned off the main body. This is a common "my first shirt" modeling trick, but it works poorly because the topology of a shirt is not going to be the same as the topology of a chest.

Mesh morphs: Instead of the shapekeys being limited to changing your body type, they also change the clothes you appear to wear: the "short sleeve" morph pops sleeves out of your arms - perhaps they were hidden on the interior of the mesh. Then your "clothes" consist of addons like buttons, collars, belts, and so on - the core shape is embedded into the shape keys.

While it's an interesting idea, it's quite limited and annoying to actually use. It'd be easier to do mesh replacement.

Smart Mesh Replacement: Just like mesh replacement, but minimize the number of meshes you have to build by making the replacement mesh have custom shapekeys to alter its appearance. In this way you can make the exact cut or fit vary, giving you a much wider variety of clothes out of a single, smarter mesh. However, it has all the flaws of the mesh replacement system.

Shrinkwrap Overlay: Model your clothes larger than the beefiest, heaviest version of your character model. When equipped in-game, shrink-wrap the clothes to fit whatever underlying body is in use.

This one's important, so let's talk about it in detail.

The shrinkwrap solution is fun because it allows for arbitrarily layered clothes and will usually adapt pretty easily to completely new meshes. The problem is the same as with all shrinkwrap solutions: pop-through. Say you have a a face on your body mesh's shoulder that is completely horizontal, but the clothes have a seam down that point and two slightly tilted-down faces running out from the seam. The shrink wrap will end up with the edges of the body face popping through the centers of the tilted-down clothes faces.

Normally you'd pad it to avoid this - a few millimeters of spacing. This may be possible, but it's an ugly and weird-looking approach to have the clothes "float". The higher the density of the overlay mesh, the less spacing you need, at least as long as the bone weighting lined up. But, this being an open-world RPG, we don't want absurdly detailed clothes.

A number of shrinkwrapping algorithms exist to minimize pop-through. For example, there's a "vertex locking" shrink wrap which attaches itself to nearby verts when possible. This really minimizes pop-through, and also comes with the advantage of easily allowing you to reweight the bone weights on the overlay.

Well, that sort of thing is possible, but it does lead me to a simpler question: if we're going to snap to verts, why not do that from the beginning?

Affixed-Vert: In this version, you create your new model (whether overlay or replacement) with your default, no-shape-keys-activated model in mind. Then you actually copy in the no-shape-keys-activated model. If you are doing an overlay, delete the faces. If you're doing a replacement, only delete the faces you don't want to show. This requires no shape keys.

In the game engine, someone equips your clothes.

1) A map is created mapping the verts of your clothes mesh to the verts of the base body mesh in the places they are identical.
2) A map is created of all the unmatched verts, linking them to their nearest matched vert.
3) A delta is taken of the in-game character's vert positions as compared to the original base body mesh.
4) All the verts in the clothes mesh are moved by that amount, as the maps indicate.
5) All verts with no faces are deleted (cleanup).
6) The modified mesh is either overlayed or replaces the character's mesh, as indicated by the settings.

While it will probably work, it has a few issues I can see.

The first is that it requires a specific body mesh. This solution does not work with arbitrary body meshes as the shrinkwrap solution would. However, it might not be hard to create variants for new body types.

The second issue is that shape keys frequently distort the normals of a mesh. For example, a fat man's belly distorts a cloth mesh substantially. It creates rolls and folds that don't exist in a skinny man's model. Care would need to be taken to intelligently handle this chaos when mapping the clothes.

The third is that layered clothing might be very tough. Well, it's tough anyway, so I guess we're okay.

It also has a few advantages I can see.

One is that, while it doesn't need to have the body's morphs, it can have its own morphs. This would allow for the clothing to intelligently adjust itself according to whatever parameters you wanted. In addition to a slider for something like sleeve length or neckline, you could have a slider for "too big" or "too small" or "in freefall" or "gravity is forward". This would really only work if you were doing replacement instead of overlay, but it would be pretty neat.

Another is that we could easily introduce super-cheap clothing physics. Since we know what verts on the custom cloth are affixed to what verts on the underlying body, we know how much space there is between them. Using this value, we can introduce physics-like wobble as the character moves. Aggressive movement such as jumping could be done by shrinking the distance on distant ones, and increasing the distance on closer ones... or we could use a shapekey, as mentioned.

The key to this content is making it easy for modders to create custom content for the game. And I can't think of any way to make it easier: copy the part of the base model you need, slap your custom model on top, and you're ready to go. No need for painstaking massages. If you want to allow modders to create new bodies, release your clothes models without the body models mixed in, and they can mix in their body models easy as pie.

There are probably other ways to handle this, but I can't think of anything else that seems more promising. If anyone out there has better ideas, let me know.

Wednesday, June 11, 2014

NPC Growth and Personality

Most open-world games give you the option to either ignore or hurt an NPC. Some, like Skyrim, give you more complex variations and gameplay within that spectrum. But very few games allow you to be constructive, to help random NPCs.

I came up with a way to do it. Originally, this was a way to make a science fiction setting work for an open-world game. The concept I'm about to describe started off as sci-fi Facebook. But it's easier to explain in a fantasy setting.

Fundamentally, it's a conversation engine overhaul. When you talk to an NPC, the things they say are stored forever in your memory. If you want, you can scroll back and see all the things they've said. You can also tag favorites, to keep from drowning in ancient conversations.

This means they have to say more than a few canned lines. And they do: each thing they say is a state reveal.

Behind the scenes, an engine is introduced to make NPCs more complete. When you create a house for an NPC, rather than specifying a wooden table covered in wooden plates, you would specify a spot for a "small table". The engine would fill in which small table goes there based on the NPC's affluence rating, location, personality, and/or culture. The stock game might just have a bad and a good small table, making the choice pretty easy. But subsequent mods could add in more tables, including some that only appeal to specific personalities or are regional specialties. The mod just registers the new tables into the item list and they are automatically in rotation.

This is also advantageous since it means any NPC can move into any home and it'll become theirs without any scripting required. If a weird foreign NPC moves in, they'll automatically buy or craft weird foreign furniture and clothing.

The NPCs obviously have some stats to drive this engine. They have affluence, relationships to other NPCs (who may be their caretakers/dependents), specific jobs, a personality, a mood, an optional home culture or second set of stats for a secret or seasonal lifestyle.

The player cannot simply see these stats. Instead, they are revealed through the conversation tidbits. Each conversation tidbit is about a specific in-world condition that reflects a specific NPC state.

For example, Anna might say "Have you seen my new horse? I love this horse!"

The in-world state here is "Anna bought a (valuable) horse". The NPC state behind it is "Anna has an affluence of 120".

The moment Anna says it, you can reply with various social niceties and try to become slightly better friends with Anna. But this chatter is just social lubricant. This is not why the system is powerful or useful.

The system is powerful and useful because "Anna bought a (valuable) horse" is concrete.

You can refer to that concrete statement and pull out the pieces of it by simple context. Pick it out of the list and bring it up in conversation with a party member. Point to it and say "do this". The party member knows you want them to buy a good horse.

But you could say "steal this", and the party member would know you want them to steal that specific horse. Say "steal one of these", and the part member knows you just want them to steal any decent horse they can find. Go up to Anna and say "I want this", and negotiate a price for her horse.

You can even manually redirect the context: "this lady..." or "this place..." and now you're talking about Anna and her stable, rather than the horse buying.

All of this works because the game not only keeps track of the state of things in-world, but also the state as it was when the statement is made. Anna has a horse, and she once said she bought that horse.

This knowledge might be valuable to you if you want to butter Alice up - giving her a nice saddle for her horse, or carrots to feed it, or a book on horse grooming. That value comes not from the statement itself, but from the stable world state of her having a horse. If her horse gets stolen, she might not be so happy to get a book on horse grooming, though.

The knowledge is also valuable as a kind of verb to talk to others with, allowing the player to rack up a huge number of in-world contexts to talk about without needing a natural-language parser or worrying about spelling. Moreover, mods will fluidly join ranks without any issue at all. Not only could Anna easily buy a dragonette instead of a horse, she also could easily talk about gablonging the zuzufrass. And now you can tell your followers to gablong things, or get you some damn zuzufrass already!

This system is highly extensible in every direction.

For example, the game can take regular snapshots of your adventures. Fight an orc? The snapshot camera saves pictures of each blow, and the context of each snapshot is saved along with it. Any time in the next hour or so, peruse your snapshots and save the ones you like. The rest stay on schedule for deletion. You can use this to put together war stories. You can also use it to talk to NPCs about these things - for example, if your wizard friendly-fired an ally, a picture was taken of it. Hold up the picture in your mind, and now you're talking about the friendly fire incident. Tell him not to do it, and his battle AI will become more reserved about that sort of thing.

You could take this MUCH further. For example, you could "imagine" things by playing through areas with god mode turned on. Use these memories to talk to your allies, plan out an attack, or explain some bizarre flight of fancy you had. Of course, you'll need to know a lot about an area before you can imagine your way through it...

You can build new locations and NPCs by simply using these snapshots. Examine a bowl. Now you can create that bowl in your creative mode area. Anna bought a horse? Substitute a local NPC for Anna. Now that person bought the horse (and is assigned the same 120 affluence). Substitute a dragon for the horse.

You can quickly create relationships, sidequests, and worries as long as you've talked to other NPCs with similar relationships, sidequests, and worries. Someone once said "wolves are constantly harassing our town"? Substitute in giant frog-lizards for the wolves, and you've got a piece of scenario for your custom town.

The only big problem I see is drowning in commentary. I think you'd need a categorized favorites section, for your most referred-to items. After all, you'll hear tens of thousands of lines of dialog, especially since you'll be more interested in conversing than ever before. You'll also need a way to simply refer to people, places, and items without context - IE, the ability to pick giant frog-lizards out of a list of enemies rather than having to find another conversation that mentioned them.

One of the things that may not be clear so far is that this is a constructive system.

It doesn't just let you refer to thing X more easily. It gives you a grip on the underlying social and economic engines that govern the NPCs lives.

Maybe you start to feel for a miner with a daughter, struggling hard every day to earn just enough to eat. There are a few ways to improve his state.

One way is to give him loot. This will temporarily raise his affluence level. But affluence will always trend towards the base affluence of their job, so you'd have to give him a lot, or come by and give him more fairly often.

Another way is to improve his skills. Training could be one of the basic actions you could take, and if you improved his skills (socially, economically, or miningerally) he would get promoted, increasing his affluence.

Another way is to improve the mine's base output, since a rising tide lifts all boats. You could do this by killing the annoying monsters inside. You could do this by repairing doors and rails and shafts. These are physical activities that do not require the use of the chatter front end.

But you could also use the chatter front end to improve the mine's output. You could do this by searching the mine for overlooked rich veins, saving the snapshot of you finding one, and then telling him about it. Alternately, maybe you learned a trick to more efficient mining from another miner. You can refer to that conversation and transfer that knowledge to the miners here.

You can also use the chatter front end to try and get him promoted by appealing to (or bribing) his boss. Or you could use the chatter front end to relay business opportunities from other people that provide mining supplies or require ore. Or you could convince random people to go and work at the mine, since newcomers will have less seniority and the miner can't help but get promoted.

Now, if I had said "I'm going to build a front end that will let you do all this stuff", you probably would have shook your head. It sounds like a lot. But since I started with how it works, hopefully you can see that those opportunities arise naturally. They literally require no extra work, as long as people can express their needs and opportunities.

Moreover, because the framework behind the NPCs is both simple and flexible, an NPC can also be pushed to radically change their position in the world. You could convince the miner to come with you, not via some kind of quest chain or scripted event, but because you are capable of saying "come with me" and the miner is capable of considering how viable that seems. It'd just be a matter of comparing affluence and danger in his current job vs affluence and danger in your offer, weighted by how much he respects you.

It'd also be pretty easy to let you become an economic juggernaut. If you flat-out bought the mining company, it'd require very little extra content to let you run it as you prefer.

The only sticky point is the scripted quests. Well, those are awkward in Skyrim, too. The hope is that most of the quests won't be scripted, but will arise naturally from the state of the NPCs in the game.

The miner is an example of that: just by encountering him or his child it is clear that he's in a not-so-great situation. The quest to fix things up naturally arises as the miner generates lines of dialog about his state, explaining who he works for, how much he loves his daughter, how concerned he is about their drafty shack, etc.

By setting up the town in a tense arrangement, things should line up to create a situation that feels similar to a set of town sidequests in any other game.


I hope everything I said was clear. What do you think?

Tuesday, June 10, 2014

The Moddable Game

Since I first played my first computer game on the Apple II, I've always wanted to tweak what I'm playing. I am in favor of tweaking to the point where every game I've ever made was about letting the players tweak the game.

So it's an understatement to say that I'm in favor of mods.

I'd like to talk about what makes a game moddable.

First off, there's the engine's capacity to be modded. Some games are built to import mods freely, like Kerbal and Skyrim. Others can be forced into it, like World of Warcraft. Others are nearly impossible to mod, either due to technical constraints or anti-mod policing.

Next there is the popularity of the game. The more popular a game is, the more people will want to mod it. There are some super mod-friendly indie games out there that nobody has really heard of, and in turn they have few mods. Skyrim isn't actually hugely mod-friendly on its own, but it was so popular that the mod community built tools to MAKE it mod-friendly.

Lastly, there's also the fundamental design of the game.

I was thinking about this the other day. I was wishing for a version of Mass Effect that had a mod library as large as the one for Skyrim.

To make it clear, I've got 50+ mods for Skyrim downloaded, around 2 dozen installed, and there are hundreds more that I never bothered with. This is about the same numbers as Kerbal, although recently Kerbal's modding community has been gutted. In both cases, there are mod managers which make installing and uninstalling mods as simple as a double-click. And the mods are often very deep, such as changing out the entire animation system, or making combat work completely differently... or adding 30+ fully voiced new NPCs, or 100+ new locations.

The Mass Effect games do have some mods, but nowhere near that volume or depth. Mostly they're about making Mass Effect look better, or tweaking costumes. As far as I know, there are no mods to completely change the combat system, or let you play as a new species, or replace the Normandy with a Spanish galleon.

This is a shame. I really am looking for a moddable personal science fiction game.

There are loads of moddable impersonal scifi games, starting with Kerbal. But I want the close-in RPG experience, where you live in a world and you can mod the things that are in that world. Mass Effect is one of the few that seems like it'd qualify.

Why aren't Mass Effect games very moddable? Well, partly it's due to the technical and cultural constraints. But I think a bigger part of it is the fundamental design of the game. Mass Effect's basic design has two major flaws that make it difficult to mod.

The first is that the statistical and character growth side of things are too basic. A lot of mods in other games make extensive use of "peripheral" skill sets, but Mass Effect is laser-focused on pitched combat and solely pitched combat. Everything else isn't simply mediocre, it's missing entirely. Nobody feels annoyed by the mediocre crafting system in Mass Effect because there isn't one. Nobody is annoyed by the stealth system because there isn't one. Gameplay-wise, Mass Effect is very small and tight, which makes it hard to mod.

In addition, the world is also designed a bit annoyingly.

In theory, a sci fi game should be dirt-easy to add new content into. You can just stick a whole new planet in, it'll just appear on the star map easy as you please. No scuffling needed.

Unfortunately, Mass Effect isn't a game where you can freely wander the universe. It just feels that way because of the atmosphere.

Mass Effect feels very open and immersive, but it isn't. You are on rails the whole time, it just lets you take a few of the stops in a different order if you like. The world is very tightly designed so that nothing really distracts you from your quest - occasional sidequests have the exact same gameplay and do not affect how you approach later missions in the slightest.

Skyrim, on the other hand, lets you pretty much do whatever you want once you get past the epic(ally self-indulgent) opening sequence. You can pick flowers, hunt bears, map out lost ruins, raid dungeons, learn magic, craft weapons, enchant things, learn alchemy, go to college, find companions, buy a house, raise a family... the main quest will wait patiently.

A huge part of this is that Skyrim is full of STUFF.

I don't mean locations, although that's part of it. I mean STUFF. Every inch of Skyrim is crawling with pointlessness. Outside, there are harvestable plants, interesting gullies, ruins to track down, lakes to swim in, overlooks to look over... and inside, there are not only people (and children!) but also plates, apples, beds, cooking pots, complex dinners, crops, books, lamps, shops with stuff all over them - all interactive.

Contrast this to Mass Effect. Shepard has no interest in day-to-day life. She is physically incapable of showing any interest towards day-to-day life, because she literally cannot interact with day-to-day things. Every book and plate is part of the background, nobody ever eats. There are few things to interact with, and they are universally either text tidbits or guns. There are beautiful places to go, but Shepard cannot enjoy them: she physically cannot jump in the water or pluck a flower.

The Normandy makes this even worse. The Normandy is incapable of enjoying itself as you travel. Shepard can at least find a beautiful spot and gaze at it, or chat with a random NPC. But the Normandy glides through empty space without any variation or life.

What can a modder do to spruce up these experiences? A modder could create new locations, but they would be just as hollow. As with all locations in Mass Effect, they would exist solely as either combat zones or exposition zones. Shepard will always be a military captain with no other life. She physically cannot be a trader, a thief, a cook.

Hence, no mods.

Well, few mods.

I'm looking for that category of sci fi game - the close third- or first-person space RPG - that is as moddable as Skyrim. I would buy extra copies.

Monday, June 09, 2014


I played a lot of Skyrim in the past few days, with loads of mods put in. So I'd like to talk about companions.

When I first tried to play Skyrim the week it came out, it was a mess. I didn't get very far, but I did get far enough to obtain my first party member, a knight-style character. I liked her design and voicework quite a bit, and I clearly remember thinking "oh! She might make this game a lot more fun!"

Unfortunately, the personality hinted at in her design and snippets of dialog never really came out. A few hours of mutely fighting at my side like a robot, and I realized she was going to be just as empty as a make-your-own character from back in the days of AD&D RPGs. Then I stopped playing.

Similarly, in Dragon's Dogma you can make your own party member. I was excited by this, because it gave me options as to voice and personality and stuff. I remember clearly thinking "oh, this is going to be so cool! I get to build the dynamic between the main character and their sworn companion, Frodo-and-Sam style!"

Like Skyrim, this was a hollow promise. As anyone who's played the unpatched original version of Dragon's Dogma knows, the pawns (NPC party members) only have a few voice clips. They all comment on the same things in the same ways, just with a different voice actor. None of them interact with the main character in any meaningful sense, they just randomly state trivia and gameplay hints. Their personalities do matter in combat, at least to some extent, although it's a bit hard to tell because combat is so chaotic... but combat is also the part of the game where I don't really care about people's personalities as long as they get their job done.

Even in my super-modded ultra-dense-content version of Skyrim, the companions are only a bit better - they're about at the level of Dragon's Dogma pawns, now. But these aren't characters I created: a scripted, set character should have a lot more personality because you know everything about them, their place in the world, how they would react to things...


I think maybe we should consider if we can make characters interesting.

When we old farts think about interesting NPCs, most of the time we'll fall back to Baldur's Gate or Planescape: Torment. "Go for the eyes, Boo! RrrAAAAAH!"

Even though few of them were as interesting as Minsk, even the totally stereotypical characters had a lot of personality. They expressed this personality because they were tightly related to the world: they had scripted lines of dialog to comment on a variety of scripted plot events, and they could fall back on general comments based on their alignment.

Modern Star Wars and Mass Effect games have normally gone the opposite direction. Few of the characters have much to say about the events that happen on the various worlds you visit, but instead you can talk to them and they have a fairly deep and unlockable personal story. I think this is a bad way to do it simply because it relies on a horrible dialog system and an unrealistic way of interacting.

Dragon Age games have a bit of both approaches, often confusingly and stiltedly so. However, they have one additional brilliant detail: the characters on your team interact with each other randomly as you wander around. This is the one thing Dragon Age did better than anyone else.

The problem with all of these games is that the NPCs are scripted in advance. They have a giant table of everything they could possibly encounter, all the situations. If something comes up that's not in the list, they fall back on extremely bland commentary that actually makes them less believable rather than more. It's actually even worse than that: few people want to interact with the NPCs in the exact way that the developers assumed, but since the NPCs are stuck with the dev assumptions, you are forced into specific routes.

Mostly, this is forced onto the devs because they need voice-acted characters. If they have to have specific audio clips, they need to specify all the audio clips. We're going to assume that we can ignore that restriction.

With that in mind, how can we make characters that feel deep and interesting throughout the game? Can we create a character-centric RPG, one where the plot is less important? Imagine an open-world game where it was literally open-world: not only could you go anywhere, but there's not even any plot-on-rails to confine you. The important things in this world are you and your companions.

Rather than trying to design perfect characters to push you into a heroic tale, we're going to assume the characters are flawed. Generally likeable or good, but quite flawed. You need flaws to get a grip on a character: a character without flaws is just a setpiece.

Let's put aside the methods discussed earlier and talk about a few additional methods of making a character matter to the player. Most of these hinge on the concept of a "mood", which a medium- to long-term personality change characters adopt when faced by a situation their personality cares about. Also keep in mind that this is all just theoretical crap.

Pushy persistence
A character needs to push into the player's line of sight. A character that quietly does their job is invisible. Therefore, our characters have to have things outside of combat that matter enough that the player wants to pay attention.

I've chosen to use moods for this. Moods are caused by a variety of situations, most of which the player can plan to either avoid or cause if they are diligent. For example, a particular character might be particularly unhappy when they get badly injured. The player can keep them to the back, or have them retreat when lightly injured to prevent the mood from forming.

Characters that enter a mood will pester the player, making it clear that (A) they exist, (B) they are now in a mood, and (C) what their personality is. This is better than simply saying "character X is now in mood Y", because it pushes the character's character into the player's face.

In addition, not all characters get along. Their personalities (modified by mood or not) may be incompatible, in which case they may actually cause more mood problems, and there will be a lot of complaining to the player. Characters that synergize well will push each other into good moods, which offer statistical bonuses instead of penalties.

Moods need to be tended by interacting with that character. Not "talking to", but "interacting with". Talking might work for some minor moods, but otherwise you'll need to spend game-time doing something they find interesting, or going someplace they can relax or have fun. This also serves to push the character into the player's conscious again.

This system needs to be tweaked to keep it from getting out of hand, obviously.

That brings us nicely to the concept of micromanagement. Now that the character is pushing themselves onto the player in some way, we need to make the player want to push onto the character. We do this by rewarding micromanagement, at least sometimes.

For us, micromanagement is all about mood alteration. Moods are not integers: a mood has a specific rank and within that rank it can be steadily degraded or enhanced until the next rank is reached. This is often time-locked, too: a mood cannot change more than one rank per day/week/whatever. By micromanaging, you can steadily degrade or enhance various moods, including moods that will permanently alter how the character behaves towards the player.

In our approach, we have specific kinds of micromanagement. None of these are required, they're just ways the player can choose to interact with the characters in nonstandard ways. These would be most valuable in attempting to "rehabilitate" problematic characters: heroic and good-natured characters probably won't need you to push this persistently.

1) AI overriding. Our characters take a variety of actions automatically, varying by personality type. This might include spending their personal cash in a town, equipping gear, grabbing/equipping loot, scouting ahead, separating from the group temporarily, eating foods, casting noncombat spells, and so on. The player can tweak these behaviors, enabling, disabling, or requiring an ask. This kind of micromanagement is not intended to optimize performance, since the default behaviors are not very wasteful. Instead, these actions have small but cumulatively important effects on moods, and the player can use them to help with that.

2) Social pestering. The social AI in the game has several modes it enters depending on the perceived social situation, and that's made visible to the player by their animations. By staying near/far from a character or avoiding/looking in their eyes, you can force the social AI into specific modes. It takes time for the system to enter a new mode, so you don't have to continually stare: just once every minute or two will work. Specific moods grow or diminish steadily in specific social modes - for example, a gregarious bard and a scared child both want to be in a close social mode, while the annoyed magician would prefer you to keep your distance.

3) Action pestering. By keeping the character busy with specific action requests, you can prevent them from taking any mood-caused actions of their own. While this may not improve their mood much, it will keep them from doing anything destructive or giving anyone else a bad mood.

Personality Leveling
Why stick to stats? When a mood ends (good or bad), the character gets growth points. Spend these in a growth tree like the new FF games - except you're altering their personality and behaviors bit by bit instead of their combat capabilities. Change what causes moods, or what moods do, or how they behave while in moods. Moderate their more annoyingly severe reactions. Maybe unlock a romance branch!

If you've played the original Valkyrie Profile, you probably know the basic idea.

It's not just about player-centric interactions. Party members should also relate to each other. And maybe to non-party NPCs, or the world in general!

There are a lot of relationships characters can form with each other under the guidance of the player. Sure, hooking up romantically is a few of those options, but there's a lot more potential hidden away in there. Mentors, rivals, bromances, etc. In relationship to non-party NPCs and places, you have things like sponsorship, fondness, patriotism, etc.

Some kinds of relationships will cancel or cause certain moods as long as the characters are together. In this way you can set up your party to never drop into a bad set of moods by carefully balancing out their relationships with their personalities to cover the most common problems. Perhaps you could even set up a party party, where everyone's always in a great mood. This is also really the only way to have characters with badly conflicting personalities on the same team.

Other kinds of relationships set up opportunities, where you can rapidly create or deflate a mood by having that character interact in that way. This is normally the kind of relationship you would have with places or people not in the party, since it is action-based rather than presence-based.

Other kinds of relationships set up statistical bonuses. A flow of cash, mana, willpower, or even new equipment. These are both in-party and out-party.

The problem with interconnectivity is that once a party grows stagnant, it also grows stagnant. So if we're going to rely on this, we need to also shake up the party fairly often. Which leads us to...

Scope changes
Characters shouldn't always stay in your party!

While it's probably not a good practice to arbitrarily snatch characters away, there are often good opportunities for characters to do something on their own. Stay behind to help a town rebuild, take a particularly wealthy caravan on a trading run, oversee a castle's construction, and so on.

These are often things that would be side quests, so what I would recommend is that when you encounter a side quest, you can either accept, refuse, or send someone off to help them!

Characters that are away send regular missives to keep in touch and remind the player that they exist. More than that, though, it's important that the player continues to have some amount of interactivity with those characters. Therefore, over the course of the mission, there should be several opportunities for things to go differently, and the missives should ask what they should do.

Some of these might be choosing between various rewards - "They offered me a lightning sword or fleetstep shoes. Which do you think is better?" Some of them might be about choosing between long-term and short-term - "Do we want 5 gold per day from now on, or 500 gold lump sum?" Some might be about choosing between personal gain and the world - "I can take this 500 gold, or I can put it back into the orphanage." Some might be about choosing two different world options - "Do we want to build an orphanage or a library?" Some might be about taking care of things automatically or manually - "We found a den of thieves. Do you want us to handle them, or will you stop by and do it with me?" Some might be mood-based - "I can do this better, but it's going to put me in a real bad mood."

The other ways
While I'm not going to talk about them again, there's also the already-pioneered methods: character-world interaction, character-player interaction, and character-character interaction.

There are also a huge number of other things you can consider, such as a character attempting to learn what the player likes and adapting their behavior accordingly. I'm sure there are others.


Now, this is obviously all theoretical. Just throwing ideas against the wall. Let's consider feasibility anyway.

The first and maybe biggest barrier to this is the concept of voiced NPCs. When you have specific lines you need actors to read, you need to specify all the lines in advance. So we have three options: we can either try and cram all the variety of things we need to support this system into a few hundred lines of dialog, we can throw away the concept of voiced characters, or we can use computer-generated voices. If you're a small team, voiced characters probably aren't on the menu anyway (pricey!), so you can throw it away. CG voices are not very convincing yet, so that's only viable if your setting is some kind of future robot setting.

Even if we assume we have no voiced lines, we still need have these characters able to say the variety of things they need to say. This is not too big an issue with general commentary - just a few dozen lines of dialog per character, customized with embedded variables to make them address the situation properly. The problem is the specific commentary.

See, if Anna and Bob are characters in our game, Anna and Bob have no problem saying that they don't like your approach to a particular ethical situation or complaining about getting hurt. They don't even have any difficulty expressing love for each other or squabbling or any of that. But that's when it's Anna and Bob.

If it's "Anna the court magician for the loyalists" and "Bob the miner who joined the rebellion", well, now you have a lot more information. You have to come up with something immersive. Something where Anna and Bob can squabble over specific in-world things such as loyalists vs the rebellion, and hoity-toity mages vs blue-collar miners.

I think the only way to do this is via a faction system, where various factions are established as having various relationships to each other, and these automatically reflect onto the characters that are part of the faction. However, this is difficult to phrase in-game because everyone needs to have their own way of talking. It's tough, but I think the only thing we can do is give every faction lines of dialog that are full of embedded variables that are replaced by snippets of a particular character's dialog library.

For example, the miners might have the phrase "%amplifiedAddress% %optionalExclamation% %targetFactionMembers% should try getting your hands dirty %rareTimespan%". This would translate to something like "Maybe you mages should try getting your hands dirty once in a while" or "You fucking magicians should try getting your hands dirty sometime!"

This kind of thing is very annoying to write, but it's the only thing I can think of that would be modular enough to support characters and factions added in later. The relationships are what matter, not usually the specific target faction. The miner's don't have a mage-specific line they use, it's a line they use for any group they think is hoity-toity.

And if Bob has a hilarious accent, he can use a combination of token overrides and text replacement to get a more personalized result.

Modability is a huge concern for me. I want players to be able to drop in new content.

I don't really want players to launch the game and make 6 unique characters as they see fit. I'd much rather that all the NPCs be carefully built to be fully world-immersive. Players that really want to add NPCs can do so, but it is a lot more work (mostly dialog library writing, and perhaps personality level-up tweaking). In exchange, it's a much better result.

Since we're talking blue-sky design, I also want players to be able to add factions, places, spells, weapons, activities - anything that could conceivably be added to the game. While many things should relate to a character's specific in-world connections, we also want them to react to things that didn't exist when they were written. If Anna hates "dark sorcery" and later "necromancy" is added as a separate group, all the modder has to do is say that necromancy defaults to dark sorcery. Now Anna hates necromancy and will use the same dialog lines.

Well, all of this is just hot air. I don't have an RPG in the works. I'm just going on and on and on and on and