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?

Err... A STATE RECORD.

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.

Unsuitable.

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

Companions

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.


Micromanagement
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.


Interconnectivity
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

Friday, June 06, 2014

Boring Gameplay vs Boring Game

So, over the past week I've created several prototypes, all of which were quite dull. I learned a lot!

Let's talk about boring gameplay. First things first:

Boring gameplay is not bad

There are many genres which rely on boring gameplay - oldschool RPGs, strategy games, train sims, life sims, etc. The moment-to-moment gameplay of these games is incredibly dull. Rather than boring gameplay making boring games, the gameplay simply turns transparent and moves the play density deeper into the world.

These genres have more action-oriented equivalents. Zelda games have action-packed fights, navigation challenges, and even observation challenges. In turn, the gameplay density lies closer to those experiences and Zelda games do not have much statistical complexity. They focus on an endless supply of interesting, unique places and encounters.

Without analyzing it too deeply, it's possible to fall anywhere on the spectrum. I think there's some kind of conservation of complexity, though: Elder Scrolls games have really mediocre action combined with mediocre statistics. I can't think of any game which has both good action and good statistics, perhaps simply because it'd be asking too much of the player to focus on so many things at once.

In the end, it seems to be all about the pacing system. In Zelda, players are paced by the layout of the level and the fluid, attrition-filled fights. In most RPGs, players are paced by the stats - how fast and flexibly you can level and improve gear. In an Elder Scrolls game, the player is paced a bit by each, but it's relatively flat in both cases.

Elder Scrolls games are interesting to analyze, because you can see them steadily drift more towards the action side. Each new game is a little more action-oriented, and the leveling/equipping becomes steadily less complex. They also allow the player to choose where on the spectrum to fall - a more statistically complex mage, or a less complex warrior.

The same holds true of tactical/strategy games. Something like Civ has transparent moment-to-moment play and extremely complex statistical play. Something like Starcraft has a bit of a balance, with much stronger moment-to-moment play but much less extensive statistical play.

The reason I started to think about this is because I created several very boring prototypes. My problem with the prototypes is that I hadn't properly thought of the early-game pacing mechanic. That is, I hadn't bothered to think of what the player would push against. Everything was either easy or impossible.

This got me thinking about diving games.

One of the big problem with games about being underwater is that being underwater is pretty dull. Most modern diving games try to fight this off by injecting action into the moment-by-moment play. OH A SHARK DAAAAMN!

But it never seems to work, because adding in moment-to-moment action doesn't actually provide a pacing mechanic. It just introduces an arbitrary challenge. It comes off as somewhere between annoying, dull, and petty.

What you need to think of, if you're creating a diving game, is what the player will push against. This is how they will express themself, how they will pace themself. It's not quite the same as progression: progression is often a gating mechanic, not a pacing mechanic. IE, the plot of an RPG is not the pacing mechanic, because the player cannot play around with it. The leveling is.

Let's assume a transparent diving mechanic. That is, the player never faces any real interface challenges. They are diving, and hopefully enjoying the experience, but they aren't fighting sharks or being swept around by difficult currents in real time.

Because the moment-to-moment play is transparent, there needs to be a deeper kind of play.

You might consider something like analyzing fish or searching for downed ships or chasing dolphins. While these are underwater activities, they do not allow a player to express themselves. It is difficult to play around with the concept of identifying a fish.

You might consider costume/avatar changes. While this is self-expression, it isn't pacing control because it has no feedback mechanism. The player cannot play around with it because there's not any real interactivity. It's just a bonus.

As I consider an underwater game, I'm starting to consider ways the player can express themself - a system that feeds back as time goes on.

Fundamentally, it's probably not about any particular area of the ocean. Our moment-to-moment gameplay is too transparent to make levels expressive, in the same way that interacting with a town is not a particularly expressive part of an RPG. But, on the other hand, the levels do have to have the kernels which lead to self-expression, as a town has shops and quests and things that make us feel like the world exists.

In an RPG, the progression lies within the growth of the characters. However, we have nothing for our characters to grow relative to, not in any complex manner. There's no fights, so improving our stats and performing special moves is not important. Well, some stats can affect how we might explore, but it's not enough to really count as "expressive".

We could still use characters, but we'd have to change it from statistical growth to personal growth.

We can have both diving buddies and "surface" NPCs. Over time, you can do things to make them happier or better off, and they will come to like you more, their personalities might improve, and they might do interesting things. In order to properly link them to the world, they need to interact with it: these characters cannot simply be talking faces. Diving buddies might help you spot things or extend your air. Landlocked buddies might give you equipment, new locations, tend a reef, send you work, or clean up an area before you go diving. the line between landlocked and diving might be blurry, too.

That could actually be enough, as long as the method this happens is properly paced. That means it'd probably have to be largely done in-level. You might collect science samples, observations, pick up trash, scan/repair infrastructure, mark possible locations, and so on in a level, which would make specific people friendlier. Rather than simply being "friendlier" on some kind of flat scale, it's important for the player to be given options here, to allow them to express themself. So the player would probably spend these "friendship points" on some kind of upgrade tree that affects activities and reactions.

I also like the concept of front-loading it: promising people that you'll do X thing on this dive. If you accomplish it, you get more points. If you fail, you lose points. Choosing what to promise which people on any given dive is a great opportunity to self-express, and it can be done independently of the game's opinions on what a dive should be about.

You could add in a bunch of other things. Cash, sidequests, jobs, "bounties" to locate specific rare species, time limits, team coordination, revisiting locations that you have improved, etc. But I think that if you wanted to take this approach, the core element would definitely and obviously be the people around you.

There are other options. You could make upgrading your rig the pacing mechanic, for example. Or make the moment-to-moment play the focus. But I don't think that has as much punch.

Anyway, just thinking out loud.

Monday, June 02, 2014

Tiny Levels: How To

I was recently looking at some actual extreme environment bases - artic, subaquatic, orbital - and marveling at just how tiny they are. Video games have unrealistically massive levels, it's true, but reality has unrealistically tiny levels a lot of the time.

There are a wide variety of video games, but most video games have the gameplay as the constraint and the levels as the opportunity. IE, you can run around at X speed, jump Y height, have Z weapons, now here is a level to conquer with those constraints. Whether we're talking about PacMan or Battlefield or candy crush, that's how it is.

If you decide your whole game will take place in one tiny location like, say, six people living in a schoolbus for a month, that won't work. The level is too small and has to last too long: it cannot be the opportunity part of the game.

Instead, it becomes the constraints.

If we consider the level as constraints instead of opportunity, we can start to craft a game where a tiny level can work. But we can't have a game with no opportunity: we also need to create an opportunity system.

One option we have is to make the gameplay elements into opportunities rather than constraints, and allow the players to craft their own gameplay. For example, if your base is a deep-space probe scanning the skies and doing science, you can allow the player to create more interesting science experiments and analyze a stream of unique data using customized heuristics. The level would be your constraints: only so many computers, so much memory, so many telescopes. There would be a struggle to do more with the same resources.

Another option is to have two levels: a closed level and an open level. For example, you are on a tiny scout spacecraft landing on a new planet. You only have a small payload for samples and limited time for analysis, so you have to decide what you can analyze and/or bring back. The inside of the space ship is a level, but so is the exterior where you go hunting for samples.

My favorite is the "ratcheted constraint" system, where you build/improve your tiny space between missions. In this form, the tiny space is an opportunity between levels, as you expand it and modify it. Then you have to live with it as a constraint on the missions.

That's the way Gravity Grain will work.

Of course, in addition to simple statistical limits, confined tiny spaces also offer constraints in terms of useability. If there are multiple crew members in the same tiny space, they are going to run into issues with who is using what pieces, when. So if you're building your own tiny base, as it goes from miniscule to tiny and the number of crew increase, the challenges change. Good layout and scheduling becomes steadily more important...

Well, either way, I think it will be fun.