Wednesday, June 22, 2016

Technical Stuff

Last essay I posted about how we might think of using the power of a linear RPG in a nonlinear way: we can use predefined arcs to strongly seed random content. I got a fair number of people saying "how?", which is not surprising because my explanation was "It's easy... (There, I just cut twenty pages from this essay.)"

Well, here are those twenty pages.

We need to generate random content as the player explores, but the issue is that we're not really trying to create "a random dungeon". Each content chunk that unfolds is huge and bombastic, in linear-RPG fashion. We don't enter a random level of a dungeon: we go to a whole new star system with a bunch of plot events woven into it.

This is both easier and harder. It's easier because this part is so much easier than generating random dungeons. It's harder because we do, eventually, have to generate random dungeons.

The heuristic for generating content is simple: while it can be largely random, it needs to "make sense" to the player.

One method of doing this is keyword filtering. So all the pieces we use (factions, types of places, scripted NPCs, events) have plus and minus keywords.

For example, a toxic jungle planet might have +colonize, +toxin. This means the planet generates those keywords.

By filtering to keep things matching keywords, we can link the planet to subsequent (or prior) pieces of content. When placing something on the planet, we would choose something that hits at least one of those keywords - for example, a new colony. It has the keywords +colonize, +economy, -monsters, -toxin.

The new colony matches the colonize keyword and conflicts with the toxin keyword, both of which are considered good things from a storytelling perspective. So we know that any quest lines involving the colony can "spread" to the wilderness of the planet either in alliance (+colonize) or conflict (!toxin), which allows us to generate minor sidequests such as "Go find toxin samples" or "go help our scouts look for more colonizable locations".

Creating a big list of such sidequests is pretty straightforward, and can use dangling dialog fragments that get hooked into whatever faction is involved. It doesn't much matter whether the colony is full of humans or elves or quarians - anyone can say "go find toxin samples" and have their combat units seeded into a generic map.

The key to this operation is that now there are more keywords in play. The planet alone only had two: colonize and toxin. Now we have economy and monsters as well, and can place elements that match any of those. This can be used for "large" pieces of content (an orbital trade station that has the +economy tag) or "small" content (a sidequest where a batch of monsters is discovered, but it's just a sidequest).

You can see how this creates a web.

Moreover, we've just been talking about places, but each place has to be inhabited by at least one faction, which grows the keywords even further. If it's a quarian colony, that's radically different from a human colony, and that will be reflected in the keywords in play, which in turn will change the sidequests you'll discover.

The quarian keywords are pretty complex, with tags like "+life-support" and "+scrounge". These keywords are unlikely to match very many big places, but they will generate sidequests such as "the life support is offline!" and "scrounge us up some stuff". They may also generate NPCs involved with those keywords, or sub-maps such as garbage depots and life support facilities.

These submaps and quests would feel random and arbitrary if linked into a human colony, since the humans exist to talk about underdog newcomers struggling to integrate. But those missions are core to the quarian experience, so it'd feel pretty good and suitable no matter the exact situation.

Subquests can involve just one place, but in general we'll want to create threads. We should engineer our subquests to do just that by having keyword-driven subquests that involve multiple places, probably all linked by the same keyword, although often inverted (IE, a +monsters and a -monsters location: monsters flood from one place to the other.)

Simple example: the quarians might have a life support problem at their on-world colony, but if there's also a quarian ship in orbit, they both have that keyword. We can use a two-site variant on the mission, perhaps "we need life support components from the ship" or "both have life support failing for the same reason" or even "the ship's life support is failing and we'll need to bring the crew to the colony as it explodes!"

(There's no reason a sidequest can't alter a location, either by destroying it, changing it to a different location, adding/removing keywords, etc. We just need to mark those quests with suitable dialog tidbits to make the player aware that they're about to Change Things and give them an option to back off for a while.)

By bringing multiple sites into a sidequest, we create a reason for players to move. Backtracking sometimes has a bad connotation, but in this case it's absolutely vital to provide a sense of place, a sense that things exist in the same world. Because of this, our sidequests should often have "feelers" written into them - for example, a human on the trading station above the planet might say "the colonists on the planet have been ordering a lot of toxin filters, but we're totally out..."

These can be opportunistic optional elements. IE, the sidequest is (1 +life-support location) with a bunch of keyword feelers for luring the player in, like (+economy: "Totally out of those toxin filters") and (+cutting-edge: "Our filters aren't compatible with their old junk...") None of the feelers is necessary: you can simply trigger the mission by vising the location. But they link the location to the rest of the universe and make it feel real.

That's the simplest secret: linking the random elements together to make them feel real. Whether that's by having missions that span several locations/factions or having a mission that simply gets mentioned in other places.

When generating content, it's also helpful to generate depth-first instead of breadth-first. That is, rather than generating each planet of the solar system, then generating the things on each planet, you should instead start with the most important planet, generate a location on it, generate sublocations for that location, generate a new location, etc. Then generate the next planet when that planet's filled up, etc.

The reason for that is the keyword density. If you generate all the planets without any subelements, each generated planet is only going to "read" the early planet keywords and the star system's base keywords. IE, things like "radiation" and "inhabitable", but not things like "scrounge" or "economy".

By generating the densest areas first, you allow the outlying locations to support them. By the time we get around to generating the moons of the gas giant, we have a big list of keywords. Populating the moon, we'll be able to filter for matches against existing content, giving us moon bases that support the overall arc of the core content. IE, we'll have a moon base related to economy or life-support or whatever, rather than just a random generic moon base.

Visiting that moon base will show us a small selection of sidequests related to the specifics of the base (+economy: "Get two corporations to play nice together", +economy: "pirate attacks are interfering-->moon base destroyed"), but also a bevy of feelers reaching out to content in other places ("The colonists keep ordering toxin filters, we're out of them!", "I've heard there's monsters on the planet, big things." "Man, did you hear about the derelict they found in the asteroid belt?!")

Well, there are a lot more details involved in actually implementing that system, such as determining what kinds of content can exist within what kinds of content, how to cram actual maps into those spaces, how to convert maps from combat mazes into walkable areas and back, etc. But hopefully you have the basic idea: it's all about keywords and piggybacking those keywords to connect objects.

I hope you get that, because we're going to kick it up a few notches.

One thing worth remembering is that we're fundamentally a linear RPG. The area the player can kick around in is targeted to a specific tactical situation, with specific ideal levels and equipment. The player will kick around that area as long as they want, and only let the game move forward when they want to allow it.

A lot of events and missions have outcomes that matter, at least a little. These things should be clearly marked so that the player doesn't accidentally stomp on their own stomping ground. For example, if the "failing life support" mission will result in the ship being lost, be sure that the mission start trigger gives the player an opportunity to back off.

But more than that, outcomes frequently trigger new missions.

This is important, because we want to present a specific (medium-low) sidequest density. It's possible to generate an infinite number of sidequests, especially when we have three factions in a location and the result is 15 different keywords. So... we lock some of the sidequests to keep the number the player is faced with under control.

The key here is that some sidequests have a notable outcome - for example, exploding the ship, or introducing a new keyword. These are good excuses to scuttle the existing sidequests and introduce the next batch. This can be due to the passage of time... or due to direct causality in the case of introducing a new keyword, even if the "new" keyword already exists.

For example, you go to the quarian colony. You fight monsters (+monsters), settle a zoning dispute (+colonize), and scavenge up mining rig parts (+scrounge). But when you decide to tackle the life support sidequest, you get a subtle warning, since you get the option to back out before you start. When you start, it turns out to also be affecting the ship above and, by the end, the ship has exploded and the crew has joined the colony (--> add +colonize). Scrap the leftover sidequests and introduce the next set.

Although the +colonize keyword already existed, now that it has be re-added, it's relatively easy to mark any new +colonize missions as resulting from that disaster, as described by dialog fragments in the disastrous mission. IE "We've been stranded down here, and it's been tough to keep things together..." then transition over to the new mission's dialog "... my child has gone missing, please find her!" Even if the dialog is a bit disjointed, it creates a sense of continuity.

This sense of forward progress is pretty tangible and fun, but even more important, it allows us to create a core arc for the entire content pack.

As I mentioned in the previous essay, your various main characters will represent core arcs. You may also have other core arcs that aren't character-centric, although you might not need them.

These arcs contain batches of content that get slotted into new content opportunistically. These create keywords before the content is even created to begin with, and that means the content will likely be created with those keywords matched in.

For example, Tali's working her way up her "quarian destiny" arc, and this particular event is about examining a new habitable world and seeing if it's suitable for quarians (and finding out it isn't). In addition to a bunch of specific content (maps, conversations, etc) it comes with keywords: +inhabitable, +toxic.

Well, we create the star system. Those keywords mean nothing to a star. We start to create the first planet.

We automatically filter for existing keywords, and we come up with a list of planets that are either inhabitable, toxic, or both. If we create a planet that is inhabitable and toxic, the quarian arc is confirmed and immediately slotted in, with any locations in the arc being instantly established as if they were randomly generated. This will, in turn, drive the rest of the system to create compatible elements and a web of missions that are properly themed.

If there never is a location with a suitable combination of +inhabitable, +toxic, the arc is left on the back burner and it'll try again later, maybe next content chunk.

We can afford to be laid-back about it because we probably have 4 or 5 arcs vying for our attention, and at least one of them is likely to find a suitable setup. We can even program the arcs to have flexible sub-events that can happen if we don't fill the main event, although the autogenerated events are probably fine.

The big advantage of arc events is when they get really involved and dominate the content. For example, near the end of Tali's arc, we have a dedicated location where we fight across a geth carrier group, and then after that another dedicated location where we go to Tali's homeworld and do all that stuff about hacking the geth and then fending them off, etc. While other random content may be wedged into the cracks, the majority of those locations are set in stone, and the progression should feel very consciously-chosen and solid.

One way to duplicate that feel is to have action setpieces - missions that end in epic encounters.

Many locations can have setpieces designed into them, and the setpieces can have a variety of zesty encounters programmed into them. Quests can opportunistically dump you into these setpieces for the finale, and they can be populated by the proper factions as required.

For example, a mining base might have maps for mines, refineries, corporate barracks, and a cargo dock. Each of those maps have setpieces: an underground rail system, an area full of conveyors and pouring molten stone, endless rows of destructable beds and tables, or a cargo ship desperately trying to take off.

Action finales are programmed into those locations, not into the missions that are climaxing. The underground rails normally feature track-switch puzzles, but in an action finale, it's a race through the dark while fighting off other cars. The refineries normally have the machine area blocked off, but in the action finale it's a battle across the conveyors while molten rocks splashes everywhere. The barracks normally feature a maze of flimsy-walled rooms, but in the finale it's about soldiers (or monsters, whatever) smashing down those thin walls and sending cheap furniture flying into heaps. The cargo area normally has a cargo ship sitting in it, but during the finale its turrets are firing and exhaust ports belching as it strains against the docking clamps...

Because these events are flexible, they can either be graded by impressiveness or have their impressiveness scaled to match the requirements. Every time a mission in a content chunk has a finale, the next finale should try to be one step up.

So if our first significant mission ends up in the cargo dock, the ship might be belching smoke and asking for permission to launch, but not actually doing anything substantial. But if it's the tenth significant mission, it'll be firing turrets, blazing the main engines, belching exhaust, and pulling around the docking clamp arms in dangerous sweeping patterns, maybe even on a timer.

Although there's no fundamental connection between the quests that cause the rising action, the fact that the rising action is rising should be enough to carry the content.

The question is: what's the transition to the next content? What's the final boss?

This would probably have to depend on your game, but my instinct is that there is a bank of generic content arcs, represented by a councilmember's interest in the location. Assuming there's no core character arc, a random councilmember arc is brought into play and serves the same purpose. These arcs are suitably generic, but always culminate in a final battle of some kind - for example, "exterminate the pirates in this region" or "find out if there really is an gene-smuggling going on" or even the innocuous-sounding "lay the foundation for a trade agreement".

Anyway, that's the bulk of the technical stuff I skipped over.

Let's see, the only things I can think of that I skipped are the specifics of the player's experience in each major content chunk.

Remember that this is a linear RPG and that grinding is a thing: make sure there are plenty of permanent enemy maps the player can grind on.

Also remember that missions can only take control away from the player when the player volunteers for it... but that they shouldn't feel shy about doing that once the player does! I gave an example about an exploding ship, but the same holds true for missions that split the party or force the player to crash-land for a while or blow up a world they used to visit or whatever.

The two biggest times the player volunteers are A) when they defeat the end boss and B) when they set course for the new star system. Therefore, the first mission of a content chunk and the last moments of a content chunk should take control away most aggressively, to show the coolest things and make the most important changes.

Monday, June 20, 2016

Nonlinear RPGs

Linear RPGs and open-world RPGs are not the same.

Linear RPGs allow the player to chew on things for as long as they like, then poke the sleepy plot into delivering the next big chunk of content. This has a lot of pros and cons.

From the dev's perspective, the pros are powerful. Since the content is gated and carefully scripted, the dev knows exactly who the player is playing, exactly who is in their party, exactly how strong they are, exactly where the plot is, exactly what they've seen and haven't seen. No matter how long the player spends on the Shining Plains, they can't buy anything better than a cutlass and a fireball spell.

In addition, the player has a very crisp trigger. They know how to poke the plot into action: fight the boss, cross the monster bridge, say "I'm ready" to the queen. This action is always very obvious and voluntary, and the player will trigger it when they are ready to experience the next content chunk.

These two things combined allow the devs to make sweeping content chunks. When you cross the monster bridge or fight the boss, things change. There's cutscenes. You're fighting your way out of a dungeon. One of your party members leaves, another one arrives. The world is blown up and there's no way back to where you started...

It can be precise and moving, because you know exactly what the player is doing and who they have with them. It can be big and bombastic because the player explicitly volunteered to go through it.

Open-world RPGs don't have these advantages, because the majority of the world is already available from the start. A player moving from point A to point C isn't really "volunteering" to experience a big plot event at point B. Hell, you don't even know who they are or who's in their party, not when you're creating the content.

Because of this, open-world RPGs typically have hundreds of tiny threads of content instead of large content drops. They also adapt the combat challenges by level-scaling.

Both of these leave the experience bland and featureless in comparison to a linear RPG with its more nuanced challenge curve and bombastic, personalized plot events.

Linear RPGs have downsides, too. The big, obvious one is that their appeal is limited. If you don't like the shoes you're stuck in or the way the plot is going, well, that's too bad. If you want to start over, you'll have to go back through the same shit again, there's no fast way to move through those chapters aside from being more efficient with grinding.

There have been open-world CRPGs since before "CRPG" was a term, but they only came into their own when computers became strong enough to convincingly render the world and its responses to you. This became a more reliable method of drawing the player in than the limited appeal of a carefully-written linear storyline.

Big, splashy, personalized stories were left on the cutting room floor... but I think it's a mistake to assume they're gone for good. Not only is there power in the stories they tell, there's power in the fundamental pacing of a linear RPG. The way the content unfolds is really strong.

What if we could come up with a new RPG subgenre that keeps that power but adopts the freedoms of an open-world approach?

I call it "nonlinear" RPGs.

Imagine if we were going to write Mass Effect as a nonlinear RPG instead of a linear one. The characters and stories would feel the same, but they would silently adapt to the player's choices. Not just "paragon vs renegade": wildly veering so that even the basic setups could be avoided or inverted. Maybe you play a smooth talker with a good record, and you convince the council to take immediate action against the Reapers and the traitorous Spectre. Maybe you play Han Solo, and just buy a crappy ship on your own and fly off to have carefree space adventures.

If it was an open-world game, these would be viable. You have that level of variability in the recent Fallouts, for example. But Fallout doesn't have the heavy "WHAM chew chew chew WHAM" feel of a linear RPG - it's more like wading through vanilla pudding.

In order to make stories adapt to your choices, you have to write variations for every choice the player can make. If you have one big story (like a linear RPG), the cost spirals out of control very quickly. So open-world RPGs use lots of tiny, independent stories. It gives the player feedback and tells them the game accepts the way they're playing their character, but because they're small and have so little effect on the game world, you can write their variants cheaply.

Fortunately, linear RPGs don't need that responsiveness nearly as much. The linear RPG already knows how you're playing your character: they provided it.

But... that's where we need to go to find the kernel of what comes next.

If we want a linear RPG to let the player play a wide variety of characters in a wide variety of ways, we need to have the game respond to those variations.

A linear RPG's "gateways" are always crystal clear. A boss. A bridge. A queen's speech. The player trips them whenever they decide they want to, and the game moves forward.

It's easy to create random events. It's even easy to chain them and thread them so you have repeating villains or escalating challenges. It's easy to make random maps and random subquests. (There, I just cut twenty pages from this essay.)

But what isn't easy is to make the experiences adapt to the player's choices and hit hard without being annoying.

Killing off a character or blowing up a place or putting you in a long dungeon sequence is really, really annoying if it isn't done well. It's not about build-up or epicness: it's about suitability.

In a linear RPG, the characters and places and factions all exist to tell a story. Each one represents a major arc or a piece of an arc in the fundamental pattern of the game.

In Mass Effect, Tali's character represents the attempt to take back your future from the mistakes of your parents. Garrus represents the failings of The System to deal with things, and the lure to work outside it. Wrex represents the struggle to provide a future for people that actively seem to not want one. And Liara represents blue nerd ladies that want to have sex with you.

OK, not every character is equally interesting, but they all have arcs that thread through the games and give you a gateway into the beating heart of the story line. The planets, too, represent tiny pieces of those arcs, allowing the arcs to exist in the game world concretely, instead of as a talking head. Factions like the Spectres and the Council also push the plot arcs along in a powerful, immersive way and create a multi-planet threat to hook things together.

And this is our method.

We aren't generating storylines. We are generating random content, sure, but it's anchored into the characters, factions, and scripted plot events that are the best our universe has to offer. Our random content offers a foundation, a stage for those core ideas to dance on.

One of the issues of open-world games is that the player can choose to be anyone, and it's very hard for the game to figure out what the player's self-image is. Thus the frolicking, daisy-picking assassins in Elder Scrolls games. The game tries to guess which plot arcs will be interesting to you by placing them in places those kinds of characters are likely to go.

But our games have a party, and our party members embody specific plot arcs.

If I'm interested in how the system fails us and what happens when we work outside it, I take Garrus. If I'm interested in the fate of the ancients, I take Liara. If I'm interested in struggling to build a future for people that don't want your help, I take Wrex. Not as a conscious choice, but because I am drawn to their characters right from the start.

Of course, the party structure of existing Mass Effect games wouldn't work, since you basically have everyone all the time and nobody ever leaves or comes back.

It's easy enough to replace that structure with one where the player only has a crew of three or four, and they frequently leave to go on some arc-related personal mission you can't help with. (Of course, you'll meet up with them later when the next piece of the arc comes around...)

This means our arcs have to be written with a bit of flexibility. While the core arc has a specific chain of events (for example, Mordin's plot involves rescuing a research victim, helping her, then distributing a fix), it should also contain a number of background events suitable for A) seeing Mordin repeatedly and getting to know him even if you don't trigger his join event, B) filling out random content with evocative situations (his commenting on the evil bug monsters, for example), and C) Mordin's background work after he's joined and then left and then is kicking around waiting to join again.

With these elements in place, the player would "naturally" be attracted to the local NPCs that seem the most interesting. Which will, of course, be arc characters suitable for adding to the party. Once the party is filled up (with maybe one spare), the others are too busy with their personal situation to join your team right now.

Don't choose to take Liara? Well, Liara will also show up in other space stations or on other planets, chatting about how she's chasing down a new lead on an old ruin. She may even have a small sidequest for you. And, if any of your party members leave for a while, you'll suddenly find she's pretty easy to recruit!

Now that your party is known, the next time you trigger a major content burp (fly to a contested star system, argue with the council, defeat a boss, etc) it'll be laced with the next arc events for your party of characters.

Not tiny drips and drabs, either: the next content batch is a big, bombastic event. A whole new set of planets, characters leaving and arriving, crashing your ship and fighting through a jungle...

This is also easy to mod. You can introduce additional characters with their own arcs pretty easily. Although the character arcs don't really overlap, they do exist in the same space: Mordin's arc introduces a mad science lab where genetic monsters are running amok, but it's inside a planet dedicated to Tali's next big arc element, where she's investigating the whole planet for suitability as a home world. Other elements are also laced in. Some are minor arc elements, some are completely random, but all can be laced together using a simple keyword system and a bunch of NPCs or audio tapes referring to other places. Those can easily be generated randomly.

Right now, we think of RPGs as either a world to play in or as monolithic stories. Instead, we might think of them as a bunch of opportunistic stories that piggyback on characters, factions, and places to assemble their setpieces.

... anyway, I cut about fifteen pages out of this long-ass essay. Hopefully it's not too hard to read.

Thursday, June 09, 2016

A Scaffold That Grinds Away

Last essay I talked about grinding. I did that to set up this essay, in which we talk about "writing" for open world games, especially RPGs.

In classic oldschool RPGs, there's a whirl of four kinds of gameplay, but each kind is very dull. Talking to folks, exploring maps, managing powerups, and fighting: individually, each of these elements is weak. Even combined, they're pretty weak.

A lot of RPGs have tried to become more interesting by changing out one or two of those elements for more interesting variants. That never seems to work. Why?

Look, RPGs are about the grind. There's no way around it. Even when you decide to stop grinding and fight a boss, you're still doing the exact same play, just with a different goal.

And that's the secret.

The power of an RPG isn't in the gameplay, it's in the pacing. You can grind as you like, and then when you're done grinding, you can easily prod the sleepy storyline into feeding you the next bit of content, the new grist for your grinder. New monsters, new target numbers, new setting, new people, new party dynamics.

All our effort has been spent on more realistic characters, lusher settings, better gameplay, adaptive music... but we've never really talked about new ways to feed the player.

We need to talk about grist.

How to make it, how and when to feed it to the player, how to tell how well they're absorbing it.

The term "roguelike" comes to mind. The computer generates the dungeons, and you walk endlessly through them. That is a roguelike's "grist": the neverending parade of dungeons. At first glance, you may think that's a linear RPG's grist, too. Maybe even an open-world RPG's grist. But it's not.

An RPG lives or dies based on the experience of spending time in that world. If we think like that, we can see that our grist isn't dungeons or random quests or generated characters: our grist is experiences in the world.

These are the things the game feeds us as we move forward in linear RPGs. A new town, new people, new plot elements, new character dynamics, new monsters, new world map, new dungeon, new background music, new spells, new equipment, new boss at a new level.

The difficulty is that grist has a flavor. If you deploy this stuff randomly, the player will get a mouthful of garbage. Arranging plots and characters and places and dungeons and monsters and bosses can't be done randomly. It has to be done sensibly.

I think there are three simple ways to choose sensible grist.

One is content packs. If you go to an icy place, you get an icy town, icy people, icy monsters, icy plots... the downside is: the more you do this, the less replayability and variation there is.

Two is arcs. By creating a progression across several grist packs, you can build a sense of permanence. IE, being chased by an imperial task force across three planets will give each planet's grist pack a connection to your experience, even though the planets are individually quite random.

Three is player response grist.

This one is important.

A big part of my enjoyment of old RPGs is having an "understanding" of how the major party members and NPCs "felt" about any given thing. The canon responses were limited, but I would fill in the gaps on my own. Essentially, I could write fan-fiction in my head as I played the game, imagining the characters responding to the random crap the game threw in my way. "Oh man, are you kidding? Another group of ten zombies?" grumps Lucca. "I will handle this group," Robo bleeps.

These stupid internal vignettes were a big part of how I enjoyed these games. My personal response as a player could be mirrored into the game world by the characters, discussed and properly contextualized.

I don't know how many players are like this, but it's important to me, so I'd like to talk about how to let the game help me do those things.

Dragon Age is an example of how to do this explicitly. The characters will frequently comment on random happenings, they banter among themselves, it feels very organic. However, in the end, this actually limits how freely I can shape the story of these characters.

None of the characters can have bad days, because their banter clearly shows them not having a bad day. None of them can have romantic relationships with each other, since their banter shatters that idea, too. None of them can become jealous, angry, happy, sad. None of them can find something interesting, or repellent, or confusing, unless the devs programmed them to.

Back in ye old days, the characters were unchanging, but they were blurry little pixel people who said maybe three lines outside of their personal arc events. You could imagine them doing or feeling anything you like, because they were too small and blurry to prove you wrong.

As our tech improved, we brought the characters into focus, but we left them as unchanging marionettes, simply increasing the number of personal arc events. When I drag Liara and Garrus around a starship for an hour, they never have any opinions or emotions, never feel anything, and I can see it very clearly due to the high quality of their modeling and voice acting.

Sure, games like Dragon Age try to get around this by filling the game with more voice acting and emotions, scripted by the devs. But that works against my enjoyment in many situations. I can't evolve the story as I grind the gameplay, because the devs don't know which direction I'm trying to take it.

There is a way to improve this situation. A surprisingly straightforward way.

We can see it in relatively mainstream games like Fire Emblem. Fire Emblem's devs don't know what sort of people we'll want to hook up with what sort of people, but they give us a mechanic where people that talk to each other in battle will advance their personal arcs. Not everyone has an arc with everyone, but it still allows the game to reflect the player's storytelling impulses.

As an even more mainstream game, we could use the recent Saints' Row or GTA games, where you can always just call people up on your phone to hang out with them. While they don't have programmed emotions while they hang out with you, you can drag them around into pretty diverse situations and they'll react interestingly - both due to their personality and due to their screwy AI that makes them freak out at random moments.

It's not hard to imagine scaling this up by offering more methods to guide the NPCs to behave in specific ways, either long-term or short-term, to reflect the player's personal story.

For example, a version of the GTA framework where the two people you call over will have an event together after they've left, and you'll get notified of the new social situation. A quick text with a picture of the two of them standing on top of a boat, for example. The event can be determined by how much money you made while they were following you around, or how much adrenaline you spawned, or how much damage they took, or where it left off...

Or let them get drunk or high as you pass them various inventory items. Or you can bring up something from their past by showing them a photo or taking them to their old house. Or you could just let the player freaking select how they want the NPCs to feel from a menu.

Wedding this kind of shaping into the grist of an RPG should allow-

Oh, yeah, grist. We're still talking about grist.

The player selects how the characters evolve. That can easily be limited so the characters stay "in character" and/or lined up for their long-term arc. Even with that limitation it's a powerful way to let the player trigger tasty grist.

When the player pushes a character to act in a particular way, why not have that character drag in a bunch of other content based on that? You get the berserker drunk and leave him stumbling around the rooftops, you're going to have a story event where he's caused trouble. It's a good excuse to introduce local law enforcement, a rich person whose roof got broke, people chatting about the weird, shadowy figure which must have been a werewolf stalking through the city at night, and several options as to how to break your buddy out of jail.

This is "piecemeal" content. It can be injected into almost any setting. If the town is big enough to drunkenly jump from roof to roof, it's big enough to support the subplot. It doesn't mean anything in the long run, although the NPCs you introduce here might recur later in other contexts. You can just throw it in and have fun.

Of course, the subplot should have variable long-term results - change the opinion of the town, change your karma rating, etc, who knows.

Fundamentally, this kind of random content is not too hard. Certainly not as hard as generating a good dungeon for a roguelike. The difficulty lies in making sure the actions the player can choose in order to reflect their personal take on the story can spawn these events without seeming overly random.

All of the moments that introduce grist in existing RPGs are already like this. You get new grist when you step on a trigger, and normally you can tell what is a trigger and what isn't. We're talking about the same exact situation, except that the content we introduce is generated instead of scripted.

The challenge is whether we can make that generated content "flow" from the player's situation. That applies for this piecemeal personal response content, but it also applies for arc content and content packs.


Well, in the end, I'd like to talk about how to set up the grist properly.

In my mind, we can radically improve RPG design by spitting grist in based on content pack chunks, arcs through multiple chunks, and introducing grist based on the actions of the player... as measured by actions we allow specifically to let the player choose how they want characters to develop.

What do you think?

Monday, June 06, 2016

Worlds, Characters, and Grind

I used to love "the grind" in games. When you take your party out into a dungeon and level up, fight random enemies, search for more treasure chests, buy the next weapon upgrade. Other people liked platforming, or shooting games, or racing games. I liked grinding.

Well, entering the Tower of Doom and fighting 8000 orcs isn't that much different from replaying a few levels of Super Mario, or running through a Doom chapter, or racing for a cup in some racing game. They're all just play within well-understood constraints, right?

But "the grind" has a very bad reputation. It's not fun.

Is it? Isn't it? It was when I was a kid. Actually, going back and playing FFVI, I still enjoy grinding. What's up? Why does it suck so much to grind in MMORPGs and other modern games?

What did I like about grinding? Why do I like grinding throughout FFI, but only in the first part of FFVI? What do Gau and Strago have to do with making grinding fun again?

Let's be clear: I like to grind because I like having a reason to spend time in that world with those people.

Modern games don't do that.


Right now we're coming out of a rut. For decades we've focused on silent and/or customizable characters, and now people have started to realize that marketing (both to consumers and to publishers) is much more effective if you can center it around energetic characters that resonate.

We used to market games based on visuals, gameplay, or plot. Now we market them based on characters. There's nothing wrong with that, but why do I not like grinding in any of these games? They have colorful, interesting characters in lush worlds, so what's up?

Well, I like having a reason to spend time in that world with those people.

I like having a reason to spend time.

Modern games don't give me a reason, and don't let me spend time.


The easiest example for me is FFVI. In the first half of FFVI, I loved grinding. Hanging out with Terra and Sabin and Locke and the other guy... Fred? Whatever. That was great! The world was beautiful, the music was grand, the characters were fun! I really loved their reaction when you first use magic in a fight: the game patiently waits for you to use magic, it doesn't just force the scene in wherever. It's damn near perfect.

How about the "reason" and the "spend time"?

Well, in a linear RPG, the "reason" is easy. There's a meat gate. You're stuck here until you can beat the meat gate, so you grind until you can.

The "spend time" is also easy: you measure your progress not in absolute power gains, but in gains relative to the meat gate. You're not "level 6", you're "two levels below where you need to be". How high we set the bar varies based on the player, but in the end you can't get around the meat wall. You have to grind through it.

You have a reason to be here (you're just stuck here) and you have a way to measure the passing of grind-time (your power relative to the meat gate).

The Kefka blows up the world, and you can go anywhere.

I didn't like this part as much for grinding. For non-grinding play, it was intense, and I appreciate that. But I couldn't spend much time in this world. Ironically, once the world opened-up, things got more goal-focused. While the goals were very well-written, they aren't very long and don't require grinding.

You can still grind, of course - kill baddies, gain levels. But there's no easy way to engage with the world or measure your progress - it turns into bland statistical grinding instead of being stuck somewhere intense making progress against a particular challenge.

I had no reason to grind, and no way to really measure time.

This changed when I remember Gau and Strago, two characters I'd written off as "annoying to use". These are characters that give you a reason to grind, and a way to measure grind progress. Not perfectly, but better than nothing. Plus, the music on the veldt is amaaaaaaaazing.

And, just like that, grinding became fun again. I had a reason (improving Gau and Strago's unique abilities) and a way to measure time (The list filling in) in that world with those people.


Open-world is not a curse. I love open-world games. I loved them back in the day, with Fallout and Wasteland. I love them now. And I can grind in open worlds, too. The process is a bit different, because instead of grinding "in place", I grind while exploring.

It's dangerous to equate the two kinds of grinding, because the first half of the sentence is different.

I like having a reason to spend time in that world with those people.

In a linear game, the reason is simply the meat wall before you can move forward, and the time is marked by your progress towards defeating it.

In an open game, the player needs reasons and something to mark time. Normally, the setup lets the player choose their reasons and the reasons have some kind of really clear progress built in, or at least can have some kind of progress put in as a limiter.

For example, in Skyrim I might choose to run vaguely towards the next town while grinding any encounters or dungeons I happen to stumble across. I'm grinding my character's chosen class - throwing fireballs, firing arrows, sneaking, stabbing, etc. Now, normally, grinding a class is incredibly dull, because your progress is measured in fractions of a percent of how far the class can go.

I mean, moving from 10 swordplay to 11 swordplay out of 100+ possible points isn't very interesting.

But Skyrim has a few fun ways to measure time. First, when you level up, you get a perk. The perks require you to have a specific stat. So if I want a big damage boost, I need to get to 15 swordplay and have a perk ready to spend on it. Going from 10 to 11 when your goal is 15 is very measurable progress! The chunkiness of the leveling also makes it more interesting than if you just get the damage boost at 15: you've got to weigh when you'll get a level, if you should save the perk, etc.

Another way to measure time is movement across the map. I'm theoretically going to the next town, but there's all sorts of random crap just off the road to lure me aside. That's great. I can see how far I've come, how far I have to go, and I can decide how quickly I want to get there and what detours I want to take.

I can also just strike out in any random direction, but since the map has major destinations and limits built in, I'll eventually reach a natural "stopping" point where I can reassess my goals and methods.

A lot of people don't like Skyrim, probably because this is the primary gameplay. Everything works like this. Want to be a thief? Well, measure how many people in the city you haven't robbed yet, how many buildings you haven't burgled, how much stuff is in this room, how much is worth taking. You have a goal and a way to measure the time you're spending on achieving it.

This seems to be a powerful way to build open world games, given that Skyrim is still popular. Lots of people don't like it, but lots of people still play it even after all this time.

What do you folks think? Are you the same way? Do you have different ways of playing?

Well, what I really want to talk about is how to make characters in that sort of setting, how to create an interactive world, how to make the player avatar act in deep and interesting ways without forcing a particular character onto the player, how to set up NPCs so they have character arcs that react to the player's activities in an open world, and so on.

But, uh, maybe that should wait.

Friday, May 20, 2016

Ghostbusters Review

Since so many people have decided not to review the new Ghostbusters movie, I have decided to fill that gap! Here is my review.

The movie has definitely suffered from its inheritance: like most eighties megahits, the sequels drown under the weight of greedy hands. Forty writers and two hundred producers means the movie was destined to be a patchwork. The question is: how nice is this patchwork?

Well, it's clear that the (editor/DP/sound guys/caterers) did a stellar job, but everyone else on the crew clearly struggled under the deluge of conflicting orders. It was difficult to watch without quipping, given my long experience mocking B movies.

I did enjoy the cast, each distinct both visually and in character. I was especially blown away by (McCarthy/Wiig/McKinnon/Jones), as she managed to actually say the script's driveling with a straight face.

As the movie wore on, it became clear that my biggest problem was not the confused writing or meddlesome production: it was the (racism/sexism/homophobia/objectivist politics). Despite the progressive tint the casting gave this movie, in the end it was poisoned by the same weird old crap that poisons nearly every big-label reboot.

In the end, is the movie good or bad?

I would put this movie substantially above the Transformers reboot (which was unwatchable if you speak English). I would even put it above the Star Trek reboot, as the camera work didn't make me physically ill and the writing didn't actively betray the ideals of the original.

Yes, if I see this movie, it will definitely be in the top 3 new releases I saw this year.

No matter how I order them.

Thursday, May 19, 2016

Tech Economies in The Galactic Line

(This is an essay about a specific, in-development game.)

In most space games, you have science and money. You discover gravitic sensors, now everyone in your space nation has access to them, and you can slap them onto ships as fast as your money allows.

In The Galactic Line, it's a bit different. Every colony has a tech economy, basically a bunch of different economies stacked up. Each one represents a specific level of technology.

You never "research computers" or "research gravitic sensors". If you have an economy capable of producing them, you are producing them. If not, you aren't. To simplify this, individual technologies are clumped into "tech tiers" - you don't track 10,000 different specific production lines, you just have a few "economies" that produce that tier.

This gives us a lot of potential play.

Let's say you start a game as 1960s Earth. The planet has a tech level 0 economy of 100. This represents all the mining, smelting, truck-building, pipe-laying, glass-making, food-growing, etc. The earth economy is more complex than that, of course, especially because the planet is divided against itself. But that 100 represents it.

When we decide to build a space station (say, the ISS) or a space ship (say, a moon landing mission), we assemble it out of ship components using the construction system. Each component has a cost attached to it. So we build a small crew cabin (0.5 T0), the solar panels (0.2 T0 each), the cooling system (0.2 T0), the docking elements (0.1 T0), scanners and comm rigs (0.3 T0), medical chamber (0.2 T0) etc, etc. At the end of it, we have a final cost, something like 3.5 T0.

So our T0 economy drops from 100 to 96.5. If we wanted to, we could have built a much larger station and ground our economy to a halt funding it, but that's generally not a great idea. This also reduces the number of gainfully employed people - a bunch of people now have jobs as advertising execs, instead.

What's the point? Building space ships and space stations actually harms your economy! Why would you build them?

Well, the space station has a number of missions it can take. For example, monitoring the astronauts for medical changes due to micrograv, radiation exposure, and so on. This mission arises from and is enabled by our medical chamber. This mission, if successful, teaches Earth to make more advanced medicines. Functionally, it exchanges 5 T0 economy for 1 T1 economy.

If you spend some time and take that mission ten times in a row, you'll end up with 46.5 T0 economy and 10 T1 economy.

The T1 economy represents computers, phones, lasers, industrial robots, plastics, particle accelerators, magnets, and so on. We are now capable of building a much more advanced space station, if we want, or maybe a new ship.

Of course, losing that much T0 is pretty bad. We probably wouldn't want to just have that one mission running over and over. Mix in a few Earth-scanning sensors - their missions help to bolster T0 economies by finding new resources, monitoring dangerous weather or pollutants, providing phone/TV signal relays, and so on. Each of these is also a mission which has specific constraints and difficulties.

So we might provide signal relays. This is a relatively easy, short mission. So we cycle those while we do our medical research, and in the end we have 100 T0 and 5 T1.

I'm simplifying the actual gameplay process, because we're discussing the back end. In terms of the player experience, these missions are similar to the "day jobs" in The Sims. While they affect the world, the real purpose is to give your crew something important to do while they live their lives. So the explanation I just gave is very similar to having a house in the sims and saying "this guy works a day job as a cop to earn cash for the house, this guy is trying to be a musician."

The missions have limits on how strong they can make the local economy. If you're trying to increase the T1 economy, then the difficulty is based on the current T1 economy. Same with the T0 economy and improving it. Higher difficulties not only increase the amount of effort required to complete the mission, but also increases the chance of failure when you do finish the mission. Every time we repeat our medical study, it takes longer and is more likely to fail. Basically, there's an upper limit on how effective these techniques can be.

There are a lot of things that can increase these limits. More people and more medical bays will make the missions go by faster. Adjunct missions can increase your chance of success - for example, a computer core can have a mission to correlate and organize the data, a residential hub can have a mission to account for secondary variables, etc. These also take people and facilities, so you'll need larger and larger space stations. Of course, more expensive facilities have less difficult missions: the T1 medical facility has a lower-difficulty version of the T0 medical bay research.

This is like in The Sims, how your jobs pay more but require more skill as you rank up.

But the scaling isn't linear, and it doesn't makes sense to simply build bigger and bigger stations. Instead, colonization is an impetus.

That crappy T0 medical bay might not be able to get your homeworld above a T1 economy of 10, but it could get fifty asteroid bases up to a T1 economy of 10. Since they all belong to Earth, Earth's local T1 economy might only be 10, but it has a total T1 economy of 510 thanks to 50 asteroid bases. This is like if your Sims houses could share their bank accounts with each other.

"But", you say "that's at least 50 space stations. And if we want more efficiency, we'll have to build hundreds of ever-more-expensive space stations-"

Yeah. Did I mention that The Galactic Line is mostly a space ship game?

Build one expensive space ship, send it to each asteroid in turn, bring their T2 economies up. Or their T1 economies to 50. Whatever you need. And the whole time, the people on the ship have lives and look out the window at the asteroid below and chat with whoever is on the asteroid, talking about how mnamnamumblemna and moomumblemoomum.

Space ships have a lot more capabilities than that, too, because a lot of missions are only available in specific situations. For example, building to T3 economies is really rough. The easiest way to do it is to analyze space wedgies. But space wedgies are temperamental. You might be able to find one or two permanent ones and build colonies nearby, but usually you'll want to send out a well-equipped science ship when a temporary space wedgie pops up. They do the mission, return to a planet for the finale, and that colony gets some T3 economy even though it's nowhere near a space wedgie.

Now, this is the simple version. In practice, there are many things I could do to make things more complex and interesting. But don't you think it's already complex and interesting enough?

Thursday, May 12, 2016

Stellaris' Uncomfortable Spotlights

Let's talk about sci fi, about 4X games, about Stellaris.

In my lifetime I have played a staggering number of 4X games. I even created 4X board games when I was a kid. It's a genre close to my heart, because I like building things and I like science fiction.

Most game genres have slowly matured. They have gone from simplistic simulations to more complex offerings that integrate many layers of player choice and interactive narratives. First person shooters started at Doom but matured into Mass Effect 3 and Just Cause 4. Sure, not everyone wants the added complexity of a cinematic universe, complex skills, construction, leveling, etc. But many people do, and those people have found these new games more rewarding and interesting than the "flat" old games.

4X games haven't done that. They're pretty much the same as they were with Masters of Orion, just with snazzier graphics. Stellaris is just another one in the chain, struggling to make its mark but refusing to step away from genre conventions that were outdated twenty years ago.

I'm not saying Stellaris is bad. Like many retro shooters, there is a place for oldschool games. The genre was invented to serve an itch, and the itch hasn't faded. But there are many of us that play 4X games because they are just vaguely close to what we want, like people that played Doom but wanted Mass Effect.

So let me creep up on the subject. Don't want to scare it off.

I knew I wouldn't like Stellaris too much, because all the marketing is about space battles. When it comes to 4X games, the space battles part is always weak. At first glance, it's odd how much focus these games always put on combat, since it funnels you into playing a warring species even if A) you don't want to and B) that makes no sense.

But the combat in these games plays two major roles, and the devs usually don't want to figure out a better way to accomplish those two roles, so they just keep combat in.

The obvious role is "meat gate". Other species, raiders, and passive alien hazards are all blockades that prevent you from just running roughshod over the whole galaxy. By forcing you to fight, the devs force you to spend time and resources on a navy. This means that non-warlike species don't have an overwhelming economic advantage - they still need to spend a lot of resources on their navy, even though it's not part of what they care about. This economic wall is a negative feedback loop that means star nations will expand at a similar rate regardless of their approach, which is a cheap and easy way to balance the game.

If you've played Stellaris, you probably already understand what I mean. There are a lot of random monsters, especially around high-value stars/black holes. These keep you cut off, force you to move slowly and settle for low-value stars. Eventually, you will need to use an expensive navy to fight those monsters. The earlier you do so, the more economic reward you get for having access to the high-value star and the more the science reward matters. It all balances out.

The other big role of combat is "storytelling". Humans are really great at weaving stories out of a few clear data points, and there's nothing clearer than a fight. We build a story in our head of our struggles against the Klarthians or whatever. This story keeps us connected to the situation, invests us in the universe. It gives the game punch.

It's easy to test this theory out: just play Stellaris after typing "invincible" into the console. You'll see how quickly the game falls apart. The pace and punch are gone, and it's just not very fun to play.

But I'm not holding that against Stellaris: every 4X game is like that. Stellaris has a few cool features to try and keep the game focused even in those situations, such as districts and such. But Stellaris is interesting because they accidentally stepped into my world, accidentally created a shadow of the game I actually want to play. A post-4X genre.

So, I settled on a big desert world named Dnar.

After a short while, my species evidently decided a desert world was a pain in the ass so, without asking (and without me having access to the tech) they genetically engineered themselves and called themselves "post-humans". Fine, neat!

This began what was obviously a scripted arc where tensions grew and then war bloomed between the standard humans and the post-humans. This is a really neat idea, meatily supported by the detailed population system, which allows for subcultures and subspecies to be clearly marked on the world maps. It was hampered by the way I didn't really get any options, couldn't really do anything. With every new event, the only option I had was "that's concerning".

Well, that was a bit disappointing, but it's a neat idea, right?

Here's the monkey wrench.

See, turns out Dnar wasn't an uninhabited world. There was a subterranean species and, after a short while, they joined me on the surface. Some kind of slug thing.

Then all the baseline humans left. The post-humans were suited to the desert environment, and the human-humans weren't, so all the human-humans just... left. Dnar was populated by post-humans and slug monsters only.

Still the scripted arc continued. The humans sabotaged the post-humans. The post-humans clashed with the humans.

But there were no humans. Everyone on Dnar was post-human or slug monster.

And there's the highlight.

This is real sci fi. This is where you let me shape the stories of whole populations, this is the story of people and places under the pressures of technology.

Of course it's all scripted and the script falls flat. It would have to: the setting is too diverse and chaotic to simply use a canned script.

But... you could use an algorithm.

The way the universe of Stellaris is set up, you know exactly what populations on what planets are what species, how happy they are, how strong their cultural drift is, and so on.

It would be possible to write an algorithm for how these species behave, how their events spool out.

The post-humans are considered travesties by the general population? But there's no general population on Gnar. The post-humans would have no outlet for that. Instead, it'd be about how they get along with the slug-monsters, with the human governor. How they emigrate.

Do they drift away from the core culture? Do they start to talk about succeeding from the empire? How does the governor deal with that? The president? The slug monsters?

To me, trying to govern that world, massage that situation is 100x as interesting as sticking pins in a map.

Now, that isn't to say that sticking pins in a map is bad, or even off the table. Sticking pins in a map is a great way to feel like you're part of the universe, a great way to manage your overall resources and the flow of your civilization. But the challenges and opportunities and complexities of a galactic empire stem from the isolation of space, the chaos of technology being adopted willy-nilly, the wealth and poverty to be found at each new colony...

That's the 4X game I want to play. One where you struggle to keep your empire intact. Not against the threat of war or random monsters from space, but from the simple threat of people under the pressure of technology. There's a huge space for this kind of game.