Aug 16, 2017 - Three Factions

Comments

Some of the most fun and interesting games feature three factions. The number 3 is a magic number, allowing for interesting asymmetries. You often see factions that are unique, provide lots of gameplay variety, and are flavourful too. But how do you mechanically balance three radically different factions? And how do you come up with three thematically unique factions?

It’s not easy. With just two factions, balance is a lot easier, as you simply buff one and nerf the other, but with three (or more) factions, anything you do could inadvertently affect the balance with the third faction.

Duality

One common method is to take a classic duality, and have two factions represent each extreme, with the third, “balanced” faction in the middle. TVTrope’s article on the subject mentions the classic duality of powerhouse/subversive. So one faction is a powerhouse, favouring raw strength, the second is subversive, favouring clever tactics and engagements, and the third balanced between the two.

Yin Yang

How does this work? The important thing is that there is no inherent advantage to either side of this duality. The powerhouse is powerful but slow and predictable; the subversive is weak but fast and flexible.

A great example of this is in Westwood’s Dune RTS games and the unique tanks of each faction. The “evil”, powerhouse Harkonnen have the Devastator, the most powerful in the game but slow and ponderous. The “insidious”, subversive Ordos have the deviator, a tank which has no attack but can temporarily take over enemy tanks. The “noble”, balanced Atreides have the sonic tank, which apart from having a unique attack, is otherwise equivalent to a heavy tank.

Devastator Deviator Sonic Tank

Another example of this (and of three factions in general) is, of course, Starcraft. The Protoss tend to have strong yet slow units, the Zerg have weaker, faster units and can expand faster, and the Terran are somewhere in between.

Duality also works thematically. In the classic good/evil dual, the middle ground is neutral - sometimes good, sometimes evil, but perhaps just driven by a morally ambiguous motive, like rational self-interest. A great example of this is the alignment system in Dungeons and Dragons, which also has another duality - law/chaos.

D&D Alignments

If you think too hard about this you’ll grow a neckbeard

There are lots of thematic duals to consider. Magic/spirituality vs. technology/science, biology/nature vs. industry, East vs. West, men vs. women… endless examples if you look for it.

The problem with the “balanced”, “neutral” faction in dualities is that they can seem bland compared to the two extreme factions. To compensate, designers usually give them something unique. The neutral faction often has special abilities or some other desirable quality.

D&D Alignments

No one picks the boring man

For example, in Golden Axe the man is clearly supposed to be the “main” character, but because he is worse than the woman at magic and worse than the dwarf at physical attacks, most players avoided playing him in favour of the other two.

C&C Generals USA Air

On the other hand, in C&C Generals, the balanced faction the USA is not as strong as China and not as subversive as GLA, but are compensated mechanically with having the most units with special abilities, and thematically by being the good guys. USA’s tanks can be augmented with special drones, and their infantry tends to have better special abilities, making them the most versatile faction.

Radical third

Making the balanced faction more special works fine, but if you take this to its extreme, you get another approach: the radical third. Instead of having a faction that’s in-between a duality, it is so different from the other two that it’s not part of the duality at all.

An interesting way to make the third faction mechanically different is to make the rules work differently for them in some way. One is to give them different objectives entirely. In the Dune novels, the Emperor and Landsraad are in a balance of power, but the discreet Spacing Guild is often so influential that they can be kingmakers. What’s unique about them is that their objective is not the accumulation of power or wealth; their raison d’etre is to maintain that balance because for them, “the spice must flow”. A bit like the British’s foreign policy on maintaining the balance of power in Europe.

Dune Guild

In Rise of Legends, the radical third faction, the Cuotl, are not only thematically unique - they’re aliens - but are logistically different, with different ways of gathering resources.

In Red Alert 2: Yuri’s Revenge, the Yuri faction has a unique mechanic: mind control, where enemy units can be converted to their own. This makes engagements very different, and mechanically the faction plays very differently to the other two. The Yuri faction was first seen as the weakest faction, but as players mastered the mind control mechanic, over time the faction has become the strongest; so strong that they are often banned at top-level tournaments!

Yuri Clones

wololo

And this illustrates one pitfall of having radically different factions; they become very hard to balance, and the balance can shift as the metagame evolves. Balance becomes an endless process, as seen by Starcraft’s two-decade legacy of patches, and constant shifts in dominant factions and strategies.

When it comes to radical third themes, a few usual suspects tend to pop up:

But there are also other creative choices. Criminal syndicates, hive minds, religious zealots, and so on.

Faction calculus

There are other ways to balance three factions. Consider rock paper and scissors, where rock beats scissors, scissors beats paper, and paper beats rock, and apply this over the whole game.

RPS

Your game probably shouldn’t be this complex

For example, let’s say there are factions A, B, and C. A’s infantry are the best, B’s mediocre, and C’s worst. But then maybe A’s vehicles are worst, B’s best, and C’s mediocre. And the situation is different yet again with aircraft, with A’s being mediocre, B’s worst, C’s best.

Thus, any non-mirror matchup contains plenty of asymmetries, but no faction has a clear advantage over the other, providing good balance and unique gameplay.

This is how Red Alert 3 is balanced; its three factions have different relative strengths in land, air and sea units, and is often considered the most balanced game of its series.

RA3

Asymmetries can also exist across space and time. Some factions could be weaker at the beginning of the game but become stronger in the late game. Some factions could be stronger on some maps or levels than others, such as factions with strong navies in water-dominated maps.

But there are downsides. All this mechanical complexity can overwhelm players, making the game feel over-designed and rules-heavy. Players often need to manage this extra faction calculus on top of the rock-paper-scissors structure of the base game, muddling the strategic aspect of the game. It also makes it harder to design things that affect the game’s rules, such as new maps, or new units. For example, a game with a heavy navy-based faction calculus means that new maps must have the “right” amount of water or risk being unbalanced - too much and the best navy faction dominates, too little and the opposite happens.

Complex mechanics can be a detriment to thematic design; it is harder to design memorable factions with unique characteristics when the mechanics are all over the place.

As is often the case with design, less is more.

Mar 6, 2017 - 3D Rendered Pixel Sprites

Comments

In the recent C-Dogs SDL release, I introduced a new walk cycle animation using pre-rendered 3D sprites; check it out (before, after):

C-Dogs SDL walk cycles

The content pipeline goes like this: Blender, bash/python render scripts, Imagemagick touch-up, montage spritesheet. The results are surprisingly good, given that no manual retouching was required; I can directly edit the blender file, and create updated spritesheets.

Background

Initially I was leery of this whole project. Pixel art is usually done by hand and laborious enough already; creating animations just makes the amount of work explode. The original sprites only had 4 directions (left/right can’t be mirrored due to the gun-handedness), 2 poses (unarmed and holding gun), with idle (1 frame) and walk (4 frames) animations, for a total of 4 × 2 × (4 + 1) = 40 frames. The project was to show all 8 directions with an improved walk cycle of at least 8 frames, which would make the total number of frames balloon to 8 × 2 × (8 + 1) = 144 frames. That’s a lot of work to do manually!

Not only that, but there are future plans for more improvements, like “textures”, different body types, different animations, each of which multiplies the amount of sprites.

Obviously the alternative is to model and animate the whole thing in 3D. But there are big questions around this approach. Will the animations look as good? Can rendered sprites avoid that “rendered” look?

Molez

This is what pre-rendered sprites looked like in the 90’s

Blender

I haven’t really used Blender for 15 years, and I remembered it for being a very hotkey-heavy and idiosyncratic application. Amazingly, its UX hardly changed in all these years, so it was every bit as hard to use as before. Fortunately, these days we have so many free Blender projects to use as examples (e.g. from opengameart.org), and great resources like Blender Stack Exchange, it was really easy to pick things up again.

For rendering spritesheets from Blender, Clint Bellanger’s Isometric Tiles in Blender article is invaluable.

From here it’s just a matter of struggling and applying animation principles, to go from a nice base model to the proportions of the C-Dogs potbellied “Cyberdogs”:

Blender model

Rendering

To render a spritesheet, we can’t just use the built-in render settings in Blender, as we’ll need to render multiple animations and multiple camera angles. Here’s where Blender’s python scripting comes in handy.

Personally I’m not really keen on learning a whole new scripting language just to get one small thing done. But Blender makes this as easy as possible by adding scripting tooltips throughout the application, so it’s super easy to know what to search for if you want to transfer something from Blender to script.

Blender tooltips

Imagemagick

Blender can render individual images, and from here we can use Imagemagick’s montage to stitch them together into a spritesheet. But Imagemagick has more use than that.

You see, it’s very hard to avoid that “3D rendered” look from Blender. There are ways to make it look more like 2D sprites, like cel shading, and other more specific shaders, but each has a distinctive look. It can take a lot of work to set up the lighting and shading to get the right effect.

Instead, a more economical way would be to use Imagemagick’s image processing functions to tweak the output image directly. I used a simple level shift function to get the curves to match up with the old sprites.

Spritesheet levels

Final Result

Final walk cycle

The final result is surprisingly good, given how relatively simple the processing was - no special shaders used. I was a bit worried that the renders are a bit rough, but I guess when animated you don’t really notice.

If you’re currently thinking about doing a lot of sprite work but are worried about the quality and the amount of work required, definitely give this workflow a try.

Dec 2, 2016 - 2D Overhead Traversal

Comments

Why are open world games so fun? A lot of reasons: a huge, interesting world, lots of things to see and do. But one important mechanic that support this, and which pops up a lot when people talk about open world games, is traversal. What’s that?

In a nutshell, it’s the way the player moves around the world, getting from A to B. This sounds (and often is) mundane, which would be a problem for open world games with huge worlds, which is why these games often have interesting, advanced techniques to get around. You see this a lot on 3D open world games.

When it comes to great traversal mechanics, two games often get mentioned: Spiderman 2 and Just Cause 2. In the former, you use your web to swing around the city, and in the latter, a unique combination of paraglide and grappling hook lets you fly around quickly. Both take some skill to pick up, but the result is a fast and cool way to get around their game worlds.

spiderman 2just cause 2

Other games also get mentioned, but I’ve noticed that they are all 3D games, and the traversal mechanics described are 3D mechanics. I’ve been thinking about how traversal might work in a top-down 2D game; a lot of the things that work in 3D simply aren’t there. Like:

  • Great views: open world games are fun because they have great scenery to enjoy. Many open world gamers have anecdotes of climbing up that big mountain to get a spectacular view, or seeing majestic buildings and landscapes in the distance. In a top-down 2D game this simply isn’t possible.

    oblivionarkham knight

  • Vertical movement: lots of traversal is about cool ways to navigate the environment, the vertical axis in particular. Jumping, climbing, spelunking, grappling, gliding, these are all things that are really awkward if not impossible to pull off in top-down 2D. Incidentally, these things are possible in 2D platformers, which is why the 2D platformer equivalent of open world games - Metroidvania - all feature novel movement mechanics, and not just the jump.

    metroid bomb jumpworms ninja rope

  • An extra dimension for navigation: seems obvious, but let’s look at an example of a house. In 2D, usually you can just walk in, out, and around it. But in 3D, you could climb up the walls over it, jump off the roof to the ground, maybe go under it through a tunnel or basement, and so on. For multi-storey buildings or more complex architecture, 3D has even more options. You can fake these things in 2D but in 3D it is much more natural. This means that you can more easily pack in a very content-rich area in a small space, and have the player easily and quickly navigate it. Platforms, lifts, stairs, balconies, trap doors - all very easy to do.

    quake 2minecraft caves

So is it possible to create immersive, rich open worlds in 2D overhead, just like the 3D ones? If it’s possible it’s certainly a lot harder. Let’s go back to first principles: what makes traversal fun? There’s a great article called Traversal Level Design Principles, which covers lots of the points:

  • Fun to get around
    • Interesting mechanics: if getting around is trivial, it’s not very interesting. But make it mechanically challenging, and getting around becomes a game of its own.
    • Lots of ways to traverse. Variety is the spice of life; if there’s just one path from A to B then it’s not very interesting. But what if there’s a bunch of detours, shortcuts, maybe even secret paths? That’s interesting.
    • Make the journey interesting. You know road trips? Hours of driving through featureless terrain isn’t most people’s idea of fun. But what about a road trip with friends? It makes all the difference. As I’ve mentioned, 3D games make the journey interesting by having spectacular views, which is hard to pull off in 2D, but there are many other methods to try, like filler content (think about car radios, for example).
  • Fast travel. Sometimes the trip is just too dull, and most players would rather skip the tedium. That’s ok; having either instant travel or faster travel is a great way to skip the boring bits, especially when you’re backtracking.

Once we start thinking about the principles behind traversal and what makes it fun, it’s easy to see a lot of common techniques already in use, many of which are applicable to 2D overhead as well!

  • Vehicles, which are both more challenging to use and faster than regular movement.

final fantasy airshipsgta

  • Shortcuts. Things like portals and secret passageways are already common in 2D overhead games. One very subtle yet clever implementation is the ledges in Pokemon games, which are one-way obstacles, strategically placed so that during your first trip you cannot pass through them, but on your way back you can jump over them. This removes the tedium of backtracking without compromising the experience when you are first exploring an area.

pokemon ledge

  • Multi-storey Levels. 2D overhead can do multi-storey architecture, even though it doesn’t do it quite as well. Still, it’s a great way to pack lots of content in a limited amount of space, which makes it very useful for 2D overhead where the viewport is constrained. Separate storeys can be linked with portal techniques disguised as stairs, elevators or sometimes even holes.

earthbound stairsfigaro castle

  • Overworld. 2D overhead games have actually portrayed huge worlds for a long time, using an old trick: the overworld. That is, when travelling between key locations, the game scales all the way out, representing vast distances in a small space. The player gets a sense of the size of the world, even though it’s smoke-and-mirrors, and very little of that world is actually fleshed out. A very well established hack!

ultima overworldfinal fantasy overworldchrono trigger overworld

  • Signposts. One of the most un-fun ways to traverse is when you are lost, so signposts help prevent that. Not just literal signposts though; in Final Fantasy 6, Game Design Forum’s Reverse Design shows how the game cleverly uses its NPCs to give direct, subtle, even ironic directions to its game world and plot. It also helps engender a sense of place - the sense that this place is a living, breathing and self-consistent entity which has complex relations between itself and the player.

pokemon signpostsfinal fantasy 6 NPC directions

  • Traversal tools. Who says 2D overhead games can’t have awesome traversal tools? It’s not common but there are examples of special tools that are either challenging to use or get the player to inaccessible places. Adding places that are out-of-the-way, hard to reach makes it all the more rewarding to actually get there, and makes it all the more fun to explore the world.

zelda hookshotpokemon acro bikechocobo in shallows

With all these techniques, it should be possible to create open-world 2D overhead games with great traversal mechanics. As I’ve said before, it always pays to study how games have approached these design problems, and it really helps you make better games!