Thursday, January 28, 2016

Programmable NPCs

I love programming games. In theory.

In practice, programming games are too esoteric, too separated from anything that feels meaty and fun. In the real world, the "programming" games I love run without any programming at all, and I wedge programming in for extra fun. Kerbal, Space Engineers, and so on: all work fine with no complex staging or programming.

I've been analyzing the concept. Thinking a lot. I think what we need is a way to allow the player to program easily and freely, but more than that, to smoothly slide in and out of non-programming, full-programming, and simple scripting elements.

What do I mean?

Imagine a game like Minecraft or Medieval Engineers, except that you have an unlimited number of NPCs to help you out. The idea is that they can help you build, operate, and maintain your world. You can create villages and so on and so forth. But the implementation is more open-ended: these aren't people with set jobs. They're state machines.

There are a few ways to let players program NPCs. Since AI is complex and depends on wrangling thousands of inputs, most of those methods revolve around picking big chunks of functionality. This NPC is a guard. This NPC is a farmer. This NPC lives here. This NPC lives there.

Let's turn that around a bit. The big difficulty is the huge number of inputs. NPCs need to analyze the terrain, their resources, threats and opportunities, their tiered goals, pre-established schedules, the weather, their equipment, alert/damage states... programming for all these things is why AI is normally supplied by the dev rather than given to the player to fuss with.

But what if we stop thinking of an NPC as an independent agent? What if the NPC is considered as part of the player, augmenting the player's capabilities?

Overlord was a good example of this, allowing you to point and send off your minions in a very easy, fluid way. However, those NPCs are a bit too simplistic and the gameplay was not constructive. Is it possible to do something like this, but with radically more complex, programmable NPCs?

One challenge is how the player interacts with the world. For example, in Minecraft you can build a house, it's very constructive. But building the house is very low-constraint: you rapidly plonk down voxels in any configuration you want, and you can even have a physically impossible floating house without difficulty. Having assistants wouldn't help in this situation, because there's not really any pattern for the NPCs to work on. They can't tell what you intend to build based on what you have built so far, so they can't help.

We could exchange the player's actions and require NPCs to execute them. For example, the player just puts down virtual blueprint voxels and the NPCs have to do the work. But this isn't any better at making complex, programmable NPCs, it just makes the game slower and the player unable to directly affect the world, both of which are bad.

Instead, what if we designed our creative systems specifically to have patterns? Then, when the player starts to create, the NPCs would be able to predict what the player is doing and build as well.

For example, if you build a road, you probably want to build another segment of road one road-segment along the path.

The road example is an easy, clear example. Let's say you dress an NPC up in road-worker costume and link them to you. Now they follow you and read your activities as their input. When you build a section of road, they read your vector and the position of the road, and move one unit further in that direction and build another segment.

Now you have augmented your power. When you build a road, two road segments get built.

You can extend this. What if you link another 50 road workers to yourself? Well... they still only try to build one block along, so you still only have two blocks of road per one block you build.

One way to fix this is to have them move N blocks ahead instead of 1, and then specify each individually. However, a more interesting option is to simply daisy-chain. The NPC's activities are also readable as inputs, so you make the second worker link to the first worker instead of you. And the third worker links to the second, and so on. Now, when you build a road segment, each worker moves along in a chain of single steps, and you can break the chain by simply unlinking the Nth worker.

This works great, especially since there's an obvious physical representation of who is linked to who: a line. The workers form a line. All linked to you, they cluster in your wake as a chaotic mishmash. But daisy-chained, they stretch behind you like a conga line.

Of course, this is really wasteful. In reality you only need one worker, as long as you're patient.

See, like any Turing machine, our workers have an input stack - a "tape" to read. When we linked them to us, we simply put ourselves in the first spot on that tape. We can add themselves as additional entries on the tape, and tweak the road-builder state to move to the next input on the tape.

This means that we build a road segment. This triggers them to build a road segment and also move their input tape, making themselves their own input. Since they just built a road, this triggers them to build a road and move their input tape... it's not an infinite loop because the tape eventually wraps back around to using us as an input.

This works, but the worker will have to complete each segment before moving on to the next, which might be too slow for your taste. It's already a relatively interesting space, with tradeoffs built right in. We're touching on the concept of parallel processing, Turing machines, IO...

Roads are an easy example, easy to use as a demonstration. But they are fundamentally pretty straightforward. While you might like a wider road, or a road that curves, it's pretty "flat" and there's no real constraints on it.

So let's talk about walls.

Rather than the physics-free voxel walls of Minecraft, what if our walls have physical presence, and roofing is actually a challenge? Sort of like Medieval Engineers?

If we we want to build a three-high wall, it's not just plonk-plonk-plonk. We need to have the resources lying around nearby. We need to build a scaffold so we can reach the upper wall areas. We need to lift the resources up the scaffold. The player can do these steps on their own, manually, but it makes sense to use NPCs to help.

For example, you build a wall, and then NPCs are set up to build a scaffold, lift resources up the scaffold, build a wall, build another scaffold, lift resources... you can do this with daisy-chaining, input cycling, or a combination of the two.

To use only one worker, you would equip the worker with gear/clothes representing scaffold-building, wall-building, and resource-toting. You would make yourself the first notch in his input tape, then himself. The order of the states is determined by the order you equip the gear, so the last one on would be the scaffold-building equipment - say, a hat. He sees you build a wall, builds a scaffold - then moves the input tape (to target himself) and switches to the next state - hauling. He saw himself build a scaffold, so he now hauls materials and switches to the next state - wall-building. He saw himself haul materials, so he builds a wall, then loops back to the first state - scaffold-building. He saw himself build a wall, so he builds a scaffold, etc, etc.

This kind of dependency simply makes the world more annoying rather than more complex, but it's a good example of the concept. In reality, the constraints I would want to introduce would be more than mindless busywork.

For example, if you want to build a 20m-high wall, the wall material will tip over under its own weight. So you have to shore it up. You could simply build it thicker, but a clever designer will instead build it banded - some areas have large windows to lighten the wall, and others have flying buttresses and thicker columns. How about supporting the tall wall with scaffolding, knowing it will fall over when the scaffolding is removed... and then putting in crossbeams before removing the scaffolding?

Multiphase and open-pattern construction are powerful features. Not only do they make programming the NPCs more interesting, they also make the world more interesting to inhabit. A skilled player will come up with interesting ways to build taller, wider, deeper, more interesting structures. Another skilled player will come up with a way to build hundreds of miles of structure, although perhaps not as impressive per meter. Yet another player will build something that isn't technically challenging, but feels real and inhabited because the NPCs are programmed to live life convincingly instead of build walls convincingly.

I've left out some details. For example, location flags/vectors are pretty important, and I didn't mention them at all. I didn't talk about how to build or edit gear to perfectly suit your needs. I didn't talk about the idea of maybe building ships, or setting it in space. I didn't talk about harvesting and transporting materials.

But I think I talked about enough. What do you think?

I think the concreteness of allowing the player to physically build things makes the game easy to get into. Combined with easy basic state editing, the player can ease into the idea of telling a wall builder or stack of road workers to follow along and help them. The more complex powers of NPCs with multiple states, state tweaking, recursive NPCs - those can be left for the people who actually want to do them.

Moreover, this makes for a truly excellent semi-shared world. Import a wall crew from your friend Alice, she's programmed them to build that 80m-high megawall wherever you plant a blue flag. Import a city from your buddy Barry. Import a ship - no, a whole shipping lane - from your half-cousin Chip. It can be done automatically, manually, or half-automatically (for example, an in-world "for hire" bulletin board).

That's what I envision.

Monday, January 25, 2016

Construction Genre

So, I just backed another "survival construction" game on Kickstarter. "Survive a crash landing on an alien planet and build-"

Beautiful game. BAD GENRE.

Since Minecraft came out, the "survival construction" genre has been booming. Unfortunately, it's a terrible genre, since it's at war with itself. Minecraft's success is not a sign that it is well-designed, it's just a sign that it had great timing and positioning.

Here's the heart of the problem: "survival" is a specific and shallow objective. Games which are about surviving require the game devs to constantly introduce new threats to you. Most games are about surviving, and the game devs spend a huge amount of effort on introducing those threats. That's the basic idea of "levels", after all.

Open-ended construction is fundamentally a player-driven kind of play. Trying to offer well-paced survival challenges to a player that is doing things at their own pace is very difficult, especially since so much of the player's resources will revolve around the specific things they've built and the specific way they've built them.

For example, in Minecraft, a player might build a wonderful base that is immune to creepers, but when you introduce those block-grabbing Endermen, it's a crapshoot. Some players, especially those that know what's coming, will have bases that don't get affected much at all. But other players, while their base is 100% proof against spiders and creepers, will collapse if even a few blocks are removed - torches go out, gaps for spiders and creepers are introduced...

This is nearly impossible to calibrate. Games where survival is key keep the calibration easy by not allowing the player to have different resources than the devs expect. You have access to X, Y, and Z guns. You have health, your speed is exactly this fast, you can see exactly this far. Because the devs know what you've got, they can present you with challenges. When the players build everything as they like, the devs have no idea what you've got!

Obviously, you can try to limit the player. But that's the opposite of what I would recommend. I like giving the player more freedom.

Letting the player construct whatever they want is really the heart of the construction genre. I don't mean constraint-free, I just mean letting the player create in the direction they want. Every player will approach the situation differently, and that's great.

But how do you create a compelling framework for this "construction" genre?

If you ask a normal dev, you'd hear two basic ideas. 1) Tiered resources: drive the player to find more useful resources in more dangerous places. 2) Phased challenges: introduce enemies, weather, and events on a schedule such that the player has to react to them.

These are good starts, but they're inherently "survivally". Let's look at a different way of thinking about it: optional constraints and challenges.

Kerbal is a good example of this. Putting aside the weird career mode they bunged in recently, there's no in-universe reason to go to any particular planet. But the fact that the planets exist is enough to make you want to go. Moreover, you can plan any kind of mission to the planet that you want, with any number of stages.

You don't simply decide to "go to Juul". You decide what kind of ship will go, manned or unmanned, what science stuff to include, whether it's a round trip or one way, what kind of landings you plan to try, whether to set up a permanent station in the area, whether to use a Kerbal-orbiting station to construct the ship and refuel before setting out, whether you want to take it slow or rush to Juul, whether you want to slingshot off the Mun or off of another planet on the way to Juul... and if you start including mods, the number of options goes up dramatically. How about an airship permanently stationed in Juul's atmosphere?

This freedom allows people to construct as they please. While it may not appeal to all players, I don't think the construction genre needs to appeal to everyone any more than the first person shooter genre does.

The way Kerbal is constructed is very clever, but there are a lot of things to learn from other games. For example, Space Engineers offers an options menu where every constraint is toggleable and tweakable. This includes things like inventory size, sure, but also things like whether there are days and how long they are. This complexity allows players to develop for radically different environments without actually having radically different environments in the game world. It also allows players to change those options during play, allowing them to develop in one set of constraints, then switch over to test or "play out" in another set of constraints, something made easier by blueprints which can be pasted into or built in other worlds.

This is a powerful concept: you can create a ship in "creative mode" with no enemies or materials requirements, then switch over to a hostile, limited world to test your ship. You can then copy it and go into a friend's server and paste it in and have a battle royale or a work together as a team...

This isn't a completed implementation. It's not very fluid, switching modes or transferring constructed content is a huge pain, and the multiplayer functionality is so bad it's actually hilarious. But it's easy to see the beginnings of a genre there.

And it's not a "survival construction" genre where you crash on a planet and have to build your own base to survive. That's just one vaguely-implemented scenario. The power of the game comes from the unfettered construction the player is allowed. Players will accept challenges and constraints just for the fun of it, and they'll come up with objectives and complex multi-phase missions that you never would have thought of and certainly couldn't organize.

So, that's my thought. If we're going to do construction games, we should have a flexible way to accept a variety of constraints and challenges, and allow players to pick and choose what they want to approach in what ways. A big part of this is making it easy to switch constraints and challenges midstream, since many players will want to build and test and iterate instead of just grinding it out in a survival challenge.

You don't need to make the game about survival. It will naturally become about survival if and when the players want it to. It might also be about building cathedrals, or putting together a fleet for a dozen players to work together.

There's also no limit to the kinds of challenges and constraints you can offer. It's popular to just use the basic construction ideas - some facility-wide resources, some physical constraints, some topological challenges, and realtime combat.

But you can define your game with a lot more creativity if you offer a wider range right up front.

For example, what about if you could "weather" your facilities for N years, turning them into ruins or seeing them adapted by NPCs? What if you have missions other than fighting, such as transport, medical, research - if you make them as complex to manage in real-time as combat is, you can have compelling noncombat challenges. How about simulating the people inside the facility?

Any one of these additional "modes" would make your game unique on the marketplace today, but in ten years, I expect they'll all be considered standards in the genre.

That's what I think, anyway.

Tuesday, January 19, 2016

Game Systems and Reboots

Any of you ever play Rifts?

Now there was a tabletop game that creaked and clanged. A byzantine rule set full of weird exceptions, nonexistent balancing, and an endless parade of expensive expansion books.

Was it a bad game? Well...

Let's compare it to D&D. D&D underwent a series of reboots over the years.

While it's a bit uneven, D&D reboots about every five years, invalidating all the books of the previous version. This is a serious move for the creators, since it means all the expansion books to date are now worthless. Expansion books are a huge part of the income from that IP - core books are just the start.

But it looks like around five years after the core books come out, people stop caring to buy expansion books, so it's time to roll out some new core books and start again.

Each iteration of D&D uses new rules, and all the elements of the game (monsters, settings, treasure, classes, skills, etc) are rebalanced and recreated anew. While people have versions they prefer, by and large each version is cleaner than the last version, if just because it hasn't had time to accumulate much cruft.

Rifts didn't reboot. At all. For 25 years, Rifts has kept the same core rules, skills, classes, etc.

Why?

Because Palladium Books likes expansions. The idea of invalidating expansions is just not in their business plan, especially since their expansions are "half core" - nearly every Rifts setting book adds core features to the game's rule set. If you create a tattooed man or a blind warrior maiden or werewolf or Glitterboy pilot, you have a character with radically different rules from most other characters. If those expansions are invalidated, then those concepts don't even exist any more. It's not like invalidating an "elves in detail" book - if you do that, there are still elves.

This is not just speculation - Palladium Books insisted that EVERY expansion book from all settings was theoretically compatible with every system. So you could play a Teenage Mutant Ninja Turtle in Robotech.

This approach made reboots nearly impossible, and power creep inevitable. The best character to play in Rifts was whoever was in the most recent expansion book. The rules grew more cryptic and arcane as exceptions became the norm.

This is an interesting situation to compare. D&D, with its frequent reboots that recentralize and condense vs Rifts, with its infinite expansions, the only new versions being to rerelease the core book with some important expanded content stitched in. Comparing D&D 5e to Rifts is really revealing.

Now, the reason I bring it up is actually a bit different than you might expect.

See, each Rifts expansion book should have just been its own game.

The problem with tabletop publishing at the time is that people played games by having a group of dedicated nerds sit at the same table for years. If you played Rifts, you kept playing Rifts more or less forever. If it was D&D, you played D&D forever. You probably didn't even switch editions!

My opinion was always the opposite. Games should have an arc. They should have a finish. Whether it takes one session or twenty, there is a trajectory and the end is always drawing closer.

If you do this for a while, you notice that the rules and extraneous content make a huge difference. A game can be dramatically weakened by using a rule set that doesn't highlight the core draw of the game. A game can also be weakened if there's random content stuffed in that draws attention away from the core of the game.

Now, if you are playing in the way the old publishers decided everyone was, maybe that's not a big deal. You're attached to the characters and setting, rather than to the game or the core draw.

But if you play games that have an end, you quickly start to notice these things. And when someone says "hey, want to play this d20 game?" You find yourself shaking your head.

"D20 doesn't have much to say any more," you reply, and they stare at you blankly.

Wednesday, December 30, 2015

Star Wars Review

Finally saw Star Wars. This will be me talking about it, because I'm sure everyone wants to hear my opinions!

Well, they might be a bit unusual.

First, though: spoilers ahead!

All the spoilers.

...

Force Awakens is by far the best film JJ Abram's ever put out. The movie is... not bad. The DP is great, the effects are mostly great, the actors are mostly pretty good, the sets are great, the music was fitting, and the directing has been carefully cut into pieces and arranged to be as unbad as could reasonably be managed. The writing is awful, but in an inoffensive way.

It is radically better than I expected, which is nice. It is... not bad.

Now, let's talk about some thematic stuff, because this is where the movie interests me most. Obviously, any thematic stuff is in here on accident or because JJ Abrams saw the cover for a book or something, but there's still some meat here.

First, the villain. I like him.

Now, let's be clear. The guy is a doofus. He's a pale shadow of Darth Vader. But that's the point! That's great! There's no way for a new dragon to step into Vader's shoes, and this is an open, in-world admission of that. I like the fact that the mask makes him look vaguely intimidating, but he's a snot-faced kid inside. I think that's fantastic. It fits in-universe as a scared boy stepping into radically outsized shoes, and it fits in the metafilm as an admission that nobody's gonna match Vader, and it fits in the mythology of the Force: villainy isn't born from strength.

I like the overall arc of him killing his father, and his father basically letting him do it. I think the progression was bad, the dialog was incredibly overweight, and the moment-to-moment writing/directing was pretty abominable, but the overall arc is fantastic. The idea that a scared kid needs to kill his father to prove himself, and his father just lets him? That's powerful. That's good.

Unfortunately, it's extremely hard to build a villain up from "scared little kid". It takes a lot of screen time to grow up, and they aren't going to give this kid that amount of screen time. So he's never likely to feel like a real threat. It's easier to work backwards: show a badass, reveal he was a scared little kid. Because of that, I don't think this villain will ever really work. This is especially true since they gave the heroes a massive power boost and brought them up to his level already, meaning that he has to grow substantially faster than the heroes, but with a fraction of the screentime.

...

The overall concept of the movie was good. JJ Abrams is no good, and everyone knows it. Forcing him to recreate the original Star Wars movie is a great way to keep him pinned and reasonable, and then you can rely on editors to save the film. A tried and true Star Wars approach.

Unfortunately, it doesn't make much sense. It undoes the original trilogy, and nobody in-world has any explanations or concerns about how it happened.

I understand that Disney needed to use their existing actors before they die of age, and that Disney needed to make a "return to Star Wars classic" movie. But I just can't accept this nonsense setting. You have to reaaaaally stretch to explain it, and even if you do, it ends with "and that means the original trilogy basically accomplished nothing."

The big bad is awful, just the least interesting villain I've ever seen. Clearly they just wanted the Emperor again, but it's really dull. It's made worse because it makes no sense. Where did this ultimate big bad come from? Everyone talks about him as if he's always been around, but that again degrades the original trilogy.

It's a very "Dragonball Z" plotline.

Now, I think it would be really interesting if the villain turns out to be making Kylo suck on purpose. The idea of training a Sith lord wrong in order to bring his fear and anger to a peak, then fixing the mistakes... is an interesting one. I don't think that's what's in store, but it could have been an interesting idea. Still, the villain is nonsense.

"But where are they supposed to find a villain if-"

Uh? Exar Kun? The backstory could have been "Kylo Ren was in training, stumbled across a Sith holocron, and OH SHIIIIIIIII"

I think that could have been equally compelling. And there's a lot of cool reveals built into that. For example: Kylo Ren keeps asking for guidance from a hologram. Then it's revealed it's just the holocron, and he's just searching it. There is no super villain Emperor equivalent: everyone just thinks there is, because Kylo keeps bringing them in to see this really intimidating holocron. And it's really good at administration: they ask it what to do, and the computer spits out an optimal answer. Everyone thinks it's a real person - maybe even Kylo.

This would be an amazing way to instantly level him up, a real Bates Motel moment. We go from thinking "how is this Sith Lord so bad at everything" to "HOLY SHIT HE'S HELD THE WHOLE EMPIRE TOGETHER WITH THE POWER OF HIS DELUSION!"

Look, if we're gonna talk about movies that Could Have Been, let's talk about the nonsense map. Of the many things in this movie that didn't hold up, this was a biggie. So, here's a simple alternative:

Luke's teachings failed, and Kylo was seduced by the dark side of the Force. Everyone was killed. So Luke goes in search of the original temple to try and find clues as to how to teach better. Fine, great. The original temple is in the galactic core. Nobody can get in safely without a map. Luke left R2-D2 behind as an anchor, to help keep him oriented and to "catch" his messages. R2 has spit out a number of map fragments over the past decade or so, but rather than saying "we can't pick out these stars", they say "we know which stars they are, but we can only get this far. We need the map for the black holes deeper in to get any further."

And BB8 holds the first piece. The one that just gets you started. The rest is already complete.

This offers a lot of cool ideas. Diving through stellar debris. The Empire - oops, 'Order' - trying to brute-force find a path by sacrificing ships. Our Jedi-to-be having to feel her way through an area that's drifted since Luke went through, using the same techniques he used. This is a good, concrete-but-not-blatant "following in his footsteps" analog.

Look, the movie could have been a lot of things. Thousands of people have given their suggestions on what the movie should have been or how it could have been made better. Adding mine to the stack is no big thing, but I did want to say one more thing:

This is the first sci fi movie in a while that made me want to write my own stuff. Not fanfic, but things with some of the same themes, or pieces inspired by the holes in this movie.

That makes this at least a successful sci fi film. I know the director is worthless and any new ideas were included on accident, but at least I was inspired.

Wednesday, November 25, 2015

The Resurgence of the Civil War

So, apparently the new superhero megamovies are going to be about the civil war arc. HAHAHAHAHAHA HAH HAHAHAHAH HA-

sorry, lemme 'splain.

I last dived into superhero comics just when that arc came out, because it was sort of a concrete arc with a definite beginning. Before, after, and during that phase, I was pretty much done with superheroes. However, it was entertaining to read what I did, because it was so amazingly bad. Then the video game about it came out, and it was so amazingly bad.

If you are a comic nerd, you probably know all about the civil war arc. For everyone else, here's the basic idea:

A terrorist attack convinces the government that people with superpowers cannot be allowed to run rampant, and they decide it's time to register them. The heroes split down the middle, half of them siding with the government's programs, and half against. Hence the title.

Now, this is a concept with an incredible amount of potential. Especially nowadays, with our hilariously racist and ineffectual "anti-terrorism" activities. Since it's a fictional universe, it could be played either way, with either side being "correct", or with both sides having merits, etc, etc.

But it's important to remember that fictional universes don't exist in a vacuum.

First, this is a non-mutant thing. Captain America and Iron Man and all those people. But Marvel and mutants are the progenitor of the "mutant registration" storylines. In fact, Marvel's universe is stained bloody red with the concept of registration from the start: Magneto is a concentration camp survivor.

Mutants not only have the chops to tell these stories, they did tell these stories. They started off with these stories and kept bringing them up. The entire nature of mutants gives credence to these stories, anchors them in believability.

On the other hand, with non-mutants, the universe is set up to tell stories of individuals proving their personal merit. Each hero chooses on their own to fight evil with whatever power they have personally managed to obtain.

So as you might expect, it quickly went awry. It felt like the "civil war" was between the writers, with half staunchly backing the registration as the right move, and the other half staunchly against it. Each writer obviously believed his side was right and the other side was bullshit, but since writers constantly rotated in and out of view as each new issue was released, the result was a chaotic mishmash.

In the end, the storyline went off the rails with cybernetic villains and corrupt prisons and so on. This could have been very interesting... But it was very rushed and was obviously just a way to get all the heroes to drop the issue and work together for the climax.

So... what do you think this movie will be about?

I bet it will be carefully washed out. We wouldn't want to draw any parallels to modern society, to our treatment of Muslims and anyone that looks vaguely Muslim. We wouldn't want to have any meat in our popcorn movies, or accidentally make anyone think!

Water it down, water it down.

From watching the trailer, it looks like they've watered it down to the extent where all they've kept is the nonsense writing, with all the heroes acting out of character for no reason. Without the social commentary, I wonder how well that will go over?

Edit: An earlier version of this essay forgot that DC basically doesn't exist, and that Marvel's responsible for literally everyone.

Monday, November 23, 2015

Open World Epic

So, recently I've been revisiting some of my favorite old sci fi things, and watching some trailers for more recent sci fi things (for example, this Cyberpunk 2077 trailer). I thought I'd talk a bit about making stories, worlds, and scenes with impact.

Now, in linear media, this is pretty well-understood. Books, movies, trailers, songs: all have pretty clear techniques to make things deep, moving, and epic. But games are not really well-understood, typically borrowing from those other media without being able to apply it very well.

If the game is linear, this might not be a huge issue. Linear RPGs and FPS games are quite comfortable dropping into movie-trailer-style cutscenes whenever they need to, and this works to some extent.

But this falls apart when a game is nonlinear. A good example is the proliferance of "open world" games like GTA, Minecraft, Witcher, Fallout, etc.

Most of these games have a linear storyline that progresses in fits and spurts as the player reaches for the next plot element. Right now, the key is to ask permission to take control. You let the player know what they have to do to progress the plot, and when they do that thing they are prepared for the long, noninteractive cutscenes. This works reasonably well, but has some very serious flaws.

Chief among those flaws: bad mood control.

The world has its own feel. In a linear game, the world changes as you progress, so the feel can change. But in an open-world game, the world is largely unchanging - or, at least, the mood of the world rarely changes. In fact, the mood is typically super-bland so that the player never feels alienated by the world.

This means that even if a player is willing to do the next plot event, there's absolutely no guarantee that they are in the right mood. If you want to something moving and epic, you have to spend several minutes prepping the player, pulling them into the right mood, and that's just the worst way to design an experience. This is even nastier if the player dies and has to redo the mission: they either skip the prep and are in the wrong mood, or they sit through it all again and get annoyed.

The good news is that I think there's a pretty easy way around it: work with the player during their open play experience.

One way to do this is very similar to adaptive difficulty. Detect which of the basic gameplay modes the player is in, and expose missions based on that. If they're in an epic fight, have a big boss show up. If they're hiding from the cops, have the hunter squad come in. If they're cruising down the highway, have companions start chattering or a new road show up, or whatever. If they're walking through the streets feeling mellow, pop up quests based on that - a companion shows them their favorite place. A villain invites them to sit at a cafe and have lunch. A street vendor tries to sell them a weird old talisman that he swears is magical.

This basic system relies on a pretty clever system which detects the player's activities and can create or surface good responses without stepping on anyone's toes. This would require a bit of work, and there's no industry standard method of doing it.

There's an easier way, though, one that leverages the open-world nature of the game: have your open world have different places in it.

This sounds obvious, but open-world games typically do not focus on the places in their game, instead only focusing on the "content" in those places. You go to Elvisburg because it has the next mission in it, not because it's a cool place to be. If we can change that, we can make each neighborhood have their own mood, and have missions in each neighborhood reflect that mood.

For example, if you wanted a plot event where a good friend was murdered, you'd make it happen on Murder Row, the brutal neighborhood. In Murder Row, the mood is always suitable for a moving death scene, so the player would be entering the right mood before they even reached the quest marker. Whether they are drawn into the neighborhood seeking the quest marker or whether they just wanted to explore, they'll be in a suitable mood.

It's not quiiiiite that simple, though. There are a few more things required.

1) A reason to stick around. If each neighborhood is just a place to store quest markers, nobody will stay in a neighborhood long enough to absorb the mood. This can be collectibles, hacking passerby, scaling buildings for burgling opportunities, hunting missions, managing local resources (expanding shops, furnishing buildings, harvesting crops, etc). It can also be more passive things, like only regenerating mana while you're standing still, or being able to spend time with a date literally anywhere, or having to talk to locals to level up in various ways.

2) Less permeable neighborhoods. Restrict fast travel (both in terms of high-speed vehicles and in terms of clicking on a place and teleporting there). If you have fast cars, encourage the player to put a beacon on their map in the place they are trying to go, and then use that beacon's location to establish music, palette, and other things, so they are drawn into the mood as they are underway. A big problem with establishing mood is that the player tends to go straight to their destination without spending any time on the intervening space, so we need to fix that.

3) Progressive music. It takes less than a minute for good music to pull a player into the right mood, so have regional ambiance that pulls the player into the proper mood. Musical progression will automatically make the player want to hang around, which will automatically make them discover the various things to do in any given place.

All of these things are fundamentally about wasting the player's time, but the point is to waste small amounts of their time to make your world feel real and your events feel epic, rather than wasting their time on a cut scene to do the same thing.

It has limits, of course. It's hard to set up any epic murders on the beach, because the mood is always wrong. Well, you could change the beach's mood if the next plot event is on the beach and dark.

Either way, in the end this is opportunistic events. When you know what the player will feel, you can place events that suit that mood and are epic. Whether you monitor how the player feels, or whether you draw them into feeling the right thing, it is still a solid approach.

But... it's not very well-suited to a linear plot line. The linear plot line of most open world games is a chain of specific events, one after the other, while allowing the player to run around as they see fit between. This system works better if you have many chains of events with many different moods, so that no matter what the player is feeling, something cool and suitable will happen.

Character-driven stories are a good fit, here. If you have a dozen important companions, you can have each have their own linear story. Paced properly, there will always be an event for each mood. Just be careful: if a player really hates a particular mood, they could push all the character plots forward until everyone's next event is in that mood, then get stuck trudging through ten missions in a mood they hate. It's probably better to have two mood variants for ever character's next step, so that doesn't happen.

Anyway, that's my idea. It's not complicated, but I like it.

I think it will make open world games feel "right". The weird, clumsy feel they have today is probably just because nobody's really taking advantage of the nature of an open world.

Wednesday, November 18, 2015

Alternatives to Dialog Trees

I was thinking about dialog trees. I made a video about how they're not very good, but I'd like to present some alternatives.

Obviously, one alternative is keywords. Whether typed or added to a list as you discover them, this allows you to steadily uncover new topics in the world and converse with existing NPCs in new ways.

There's a lot of untapped potential in this idea, but it's far from the only idea.

Let's consider the purpose of dialog trees.

In linear, story-driven games, a dialog tree exists to A) tell the player what's going on in the story and B) allow the player to steer the story along predetermined paths. They are limited to predetermined paths because the assets (dialog, visuals, enemies, dungeons) are created custom for each choice.

This is also true of keyword systems. Each keyword is painstakingly scripted with a particular response intended to help draw the player into things. It may not be quite as plot-centric: there's a lot more choices and a lot of them are only tangential to the NPC in question, so often a response will be world-centric or NPC-centric instead of plot-centric. Still, the basic idea is the same: scripted ahead of time.

We do have other options. For example, you can generate topics algorithmically and have different NPCs assigned to know about different aspects of it. NPC 1 might know where the next event node is happening. NPC 2 might know what kinds of enemies you'll face. NPC 3 might know the treasure reward. NPC 4 might have hints for what will happen next.

We can script it in a way where we can substitute in values freely, and allow them to be generated rather than scripted.

This isn't a bad idea, but it doesn't take long before it devolves into dull clue-hunting. Rather than the NPCs being people, they start to feel like cards you just flip over and glance at to see if they're the one you need.

To have us consider the NPCs as people, they need to be more than sources of information. Making NPCs more complex is easy - I can build NPCs that have schedules, like random things, behave differently depending on the weather, whatever. But this complexity only matters if it is "surfaced" to the player. That is, if the player never wants to interact with that complexity, the complexity is just in the way of what the player wants to do.

The complexity we can create depends on the mechanics of the game world. For example, in Rune Factory the calendar plays a big role. So the characters have birthdays and celebrate different festivals in different ways. But this wouldn't work in, say, Fallout 4, because the calendar doesn't matter in that game.

This is an "offloaded" method of interaction. Rather than building a complicated way of interacting with the NPCs, the method is deceptively simple: it's limited to "talk" and "give gift". The complexity comes from managing your timing and the gift you give.

This is "deceptively" simple because it is functionally equivalent to keyword dialog. The only difference is that rather than choosing time and gift from a menu that pops up when you talk to the character, you choose it from the world. You pop up your inventory list and select the item from that. You waste time until it's the right time, and then trigger the event. It's fundamentally the same, we've just offloaded the menu options to world interactions that carry over when you interact with the character.

Of course, this is a bit more "punchy" than an ordinary keyword system, because if you select the wrong options you will suffer a penalty rather than just getting to try again. That's the real difference between this and the keyword system: choices have ramifications.

What kind of interaction system do we have where choices have ramifications?

Shops.

Shopping is about choosing things you want to buy and sell. The exact things you buy and sell depend on your resources, the kinds of things the NPC sells/buys, and what you are trying to accomplish in the larger scope of the game. It never feels complex, but choosing whether to buy a piece of armor, a potion, or a weapon is a surprisingly complex dance that players can pull off intuitively.

Right now, when we think about choices with ramifications, we tend to think of dating games. Choosing gifts and dates and pandering dialog choices. But I don't think that's a good mechanic. I think we should consider our social interactions more like shops. Rather than a given choice being bad or good, it's about a given choice suiting your needs and tactics.

There's no "bad" options in a shop, because weaker options cost less and stronger options cost more. Even meta options such as buying shares or directing supply runs aren't good or bad, they depend on how much you plan to return to this area and whether it suits your current means.

If we just push the shop metaphor, we can have various events, behaviors, and favors treated as items to buy and sell. As when they were weapons, armor, spells, and ammo, we could also make them things that are equipped or deployed in the field, rather than things which are isolated to you and the NPC.

As an example of this, let's say we're doing a sort of Power-Rangers-Style game, where you play a bottom-rung wannabee hero always struggling to put together a team for any given mission. The NPCs in the game are all Power Rangers themselves, although most have a non-Ranger life such as scientist, vampire hunter, or Teen With 'Tude.

When you interact with them, you can "buy" their participation in your battles to some extent, ranging from helping to keep civilians safe to being on your party proper. You can also get them to loan you their various power crystals, suit enhancements, weapons, cars, etc. You can buy loot - monster drops that they have little use for but would enhance your suit pretty nicely. You can also buy their words and "equip" them: they vouch for you to authorities or other rangers, their encouragement or advice in battle. You can recall their words and lean on them.

They are also the only way to increase your stats: training with them is the only way to spend XP and raise various stats and skills. This includes stats like "heart" and "inspiration", as well as developing new battle cries, suit elements, weapons, cars, giant robots, etc.

That can also benefit them, since the only way they can improve is to train with someone at least their own rank in a stat. That someone might as well be you, right? Unless they already have a good friend that will help them train that skill...

To balance your requests, you can "sell" things. That includes all the things you can "buy", sure. But your participation in their battles and your words of encouragement are probably not very valuable. You might have got some decent loot to sell, but probably not, not unless they're lower level than you. You offering to train them is probably not going to be too much use, since most of them already have a group they train with and no reason to switch.

So instead you bribe them with the dumb B-plot events that Power Rangers is known for. You take them to McBurger. You give them advice on their crush. You go on a double date with them. You help them prepare for their school play. You teach them math. You sub in on the sumo wrestling tournament because they sprained their ankle yesterday...

We've turned the negative into a positive. We've created a way to pull you into the dumb B-plots of this kind of game.

It's just an example, but I think it's a good example of alternatives to dialog trees.

If we throw away the need to push the player into our preferred plot line, we can allow the player to wander through all the little threads and tie them together in a unique, meaningful way.

What do you think?