Codex Design: Combat and the Patrol Zone


This is the 3rd in a series of design articles about Codex. In case you missed the first two:

#1 Codex Design: Cards and Gold As Resources
#2 Codex Design: Heroes and Tech Buildings


Codex is asynchronous. That means someday you’ll be able to play the online version without your opponent having to be online at the same time as you. You can get through your entire turn without having to wait for your opponent, then they can take their turn without you having to be there either. In offline (tabletop) games, it also means turns go smoothly: without the fits and starts of the opponent constantly interrupting you.

If the opponent doesn’t make decisions on your turn, then doesn’t that make combat too simple? Or not interactive enough? The patrol zone is the answer to those problems.

You can have any of your units or heroes directly attack anything with hit points—any unit, hero, or building of the opponent’s. You don’t have to wait for the opponent to decide how to block your attacks though because they *already* decided their blocking plan before your turn started.

At the end of their main phase, they chose which of their units and heroes to patrol, and which slots they'll go in. If you have an attacker that CAN attack one of those patrollers, you don’t have to attack with it at all, but if you do then it MUST attack a patroller. Patrollers are the defender’s first line of defense so you’ll have to get through them before you can attack something else.

Each patroller has a different bonus. When you’re setting up your defense, carefully consider which bonus you want each of your defenders to get.

The most important slot is the squad leader. Your squad leader gets one point of armor, which means it will take one less damage than usual, but even more importantly it has “taunt.” That means the attacker must attack it even before your other patrollers.

The elite slot gives your patroller +1 ATK, so a 3/3 unit would become a 4/3 unit while patrolling in that slot, letting it deal extra damage if it gets attacked.

The scavenger and technician slots give you 1 gold and let you draw 1 card, respectively, when the patrollers in those slots die. These slots are great when you’re taking a beating. The extra resources of gold and cards can let you mount a comeback as you try to hold off an aggressive attacker.

The lookout slot gives your patroller resist 1. This means the opponent must pay 1 gold to target that patroller with any spell or ability. Sometimes the biggest threat to one of your units or heroes isn’t dying in combat, but rather dying to some sort of spell or ability. The lookout slot gives your opponent a disincentive to mess that patroller.

That’s pretty much it. Combat works in a very straightforward way where one thing directly attacks another thing and they each deal their damage to the other at the same time. Damage is persistent in Codex, meaning it doesn’t get healed automatically at the end of the turn.

Flying

Flying is also worth mentioning here, it's especially powerful. It works like it does in RTS video games, rather than how it works in most card games. In Starcraft, a Zealot (ground melee unit) can’t hit a Mutalisk (flying unit) ever. The same is true here. Flying units can attack ground units and not get hit back at all! Flying units can fly over ground patrollers and are not physically blocked by them at all! 

That’s a bit of a double edged sword though; flying units also can’t physically block ground attackers. So if you patrol one of your fliers, an enemy ground attacker can simply run under it and get to your vulnerable heroes and tech buildings. Overall though, flying units are very deadly, just as they tend to be in RTS video games.

Patrol Zone Design Features

The patrol zone is the most unexpectedly good feature in Codex. It was originally developed as a way to make asynchronous combat interesting enough, but players liked it so much that they said it should be a central feature no matter if the game supported asynchronous play or not. It turns out there’s a lot of nuance in just how you patrol your forces!

Before the patrol zone existed in Codex, some players originally suggested putting "taunt" on particular units (meaning the opponent would have to attack those first), but it's just so inadequate as a solution here. You'd be at the mercy of drawing the right units just to be able to block at all. The patrol zone lets you give that power to any of your forces AND lets you stack more bonuses on them too, which is just way more flexibility to plan your strategy.

The extra bonuses the patrol zone gives your defenders solve some very deep problems that we had for a long time. There's a delicate balance in Codex between rushing down and teching up. At some points in the game's history, rushdown was too good, which makes the game degenerate. At other times, it was too weak which means there's nothing to "keep you honest" if you want to blatantly start going for late game plans way too early. The simplest rules were the ones that lead to rushdown being too good, so is there some way we can do a small tweak to them?

It turns out, the single point of armor you get in the squad leader slot (and to a lesser degree, the +1 ATK you get from the elite slot) matters A LOT. That gives you just enough defense that early turns are not based on degenerate rushdown that you can't do anything about, but your buffer of protection doesn't last you long. Soon enough, units and heroes get big enough to overcome those bonuses and crush a weak defender if they don't start putting up a fight.

Unrelated to all that, the card draw system is also tuned on the edge of a knife. It has the great property that you get to draw a lot of cards, yet "card advantage" still matters. That means if you can use one card to destroy two of the opponent's cards, that actually does help you (which we want). It's also great that you often have a tough decision on whether to play a worker because that helps your economy later but might hurt your card draw in the process. It's all interconnected and just what it needs to be...but I wished you could get *slightly* more cards somehow without having to build the add-on that's specifically for that.

Just like it was very hard to tweak the combat system to give you "slightly more early defense," it was very hard to tweak the card draw system to give you "slightly more card draw." But in both cases, the patrol zone bonuses saved us. We were able to keep generally simple rules and use the bonuses to get the effects we wanted. If you are losing too many units on defense and you're trying to stay in the game, the ability to put a unit in the technician slot to draw an extra card really helps a lot. Same goes for the scavenger, it's the same concept really. If you're losing a lot of units, you might really need more gold or more cards (or both) to get back in the game. So we give you the option to do that, but it's not like we just give you an extra gold and extra card every turn. There's opportunity cost here and you have to work for it.

It turns out that somehow the extra defense, gold, and cards you can get from these bonuses were exactly what we needed. Usually this sort of design is driven from mechanics first. You'd think all this stuff exists precisely because we needed it, but the truth is that players liked the idea of the patrol zone so much that we kept developing it and kind of stumbled into it solving a few other design problems along the way. The original need for asynchronous play was a mechanical need leading to the patrol zone existing, yes, but that we actually kept it and enhanced it as a core part of the game was all from player feedback and what they enjoyed (and what I enjoyed too).

It's also pretty nice flavor that you set your units and heroes to patrol to protect you during the opponent's turn, then you spend that time figuring out your build order (picking cards from your codex to add to your deck). It feels like an RTS thing. ;)


If Codex sounds interesting to you, please support it on Kickstarter while it's there!

timely_messenger.jpg