Wednesday, August 31, 2011

Using Auto Resolve for Battles

One feature that many turn-based games allow is for a battle to be fought off-screen automatically by the computer. This can be helpful in situations where one army vastly outmatches the other and the player doesn't want to waste his time fighting it out manually. It's a good feature for a game to have if battles take a lot deal of time to complete, especially if you can't save the game in the middle of one.


No game developer wants time to be what a player is most focused on.

However, one concern I always have when I use auto-resolve is how does the computer calculate who wins? Does it actually fight the battle out using its own AI in the battle system quickly? Does it roll some dice behind the screen based on the relative strength of both sides? Let's look at a couple turn-based games to see how this seems to work.

Heroes of Might and Magic
The earlier Heroes of Might and Magic games are some of the easiest to see how the computer resolves battles. You don't have an option to have it resolved off-screen, but you can have the computer automatically fight for you if you choose, saving a few mouse clicks. It does a fairly competent job, focusing on taking enemy ranged and flying troops out of the action as soon as possible.


In this instance, the computer has the player's hero cast meteor swarm to kill some enemy gryphons.

In later games in the series, the option was added for the computer to do this completely off-screen. I tried it a couple times and it seemed to not be too unfair, the side that seemed to have a superior force won. I never attempted it for a fairly even battle though.

The one time I would complain about this system is that the computer is no good at unconventional strategies. For example, in most of the Heroes games when you are defending a castle under siege you have arrow towers that fire each turn to hurt the enemy. One way to win if you are vastly outnumbered can be to avoid fighting and move your soldiers around all over the battle map so that the enemy troops can't catch up to kill them. Over time, the arrow towers can potentially kill the entire besieging force.

Another example is that heroes can learn to cast a spell that summons stacks of creatures like air or fire elementals. A player with a weak to nonexistent army could choose to keep casting this spell for as long as they have magic points left and win a battle through attrition if the enemy force can't kill them fast enough. They will lose all of the summoned creatures after the battle and die, but at least they'll take out the enemy as well.


A Pyrrhic victory is still better than no victory at all for some.

So the lesson from the Heroes series is that auto resolve can be programmed to be pretty fair, just don't rely on it to win any battle for you that require guile or odd tactics.

Medieval II Total War
I apologize for writing so much about this game, but it's the only game I've played much recently so it's fresh in my mind. Every battle that's initiated on the main world map has a screen go up beforehand that shows the strength of all of the sides involved.


In this instance, Admiral Davy of England vastly outmatches the opposing pirate navy, as indicated by the bar in the center.

A player may then choose to fight the battle manually or have the computer resolve it instead. If it is a naval battle, auto resolve is the only option available. For the most part, it seems to be a fair system. The system weighs the odds and then fights it out. There are a few large problems with it though.

One issue appears when an army fights one vastly inferior to it. For example, if 500 plate armored knights with swords forged by master blacksmiths fight 20 unarmored peasants with pitchforks you would expect the peasants to be utterly annihilated. Well, they are, but instead of being eliminated from the world map entirely they usually are reduced in number slightly and stay on the map, now as a force of 15 unarmored peasants. This can be extremely irritating when you're trying to eliminate some of the rebel armies that randomly appear on the world map every now and then. It seems stupid to go through all the effort of commanding your giant army to kill 20 peasants, but you have to do it if you want them to actually be removed completely from play.

The only reason I can think of for why this occurs is that when you fight a battle manually it can end in two ways-when the enemy army is completely slaughtered or when every enemy army unit is routed and fleeing. When the enemy is routed you can choose to end the battle there or continue the battle and capture as many of the fleeing soldiers as possible. I guess that auto resolve must stop the battle when it determines that the enemy has routed so it doesn't finish the gruesome business of killing everyone.

Another problem occurs with the traits and rewards for the commanding generals of battles. During the game, each of a player's generals can acquire better traits when they win a battle. For instance, they might gain another star of command rating, which gives all units under their command bonuses in battle. They also might acquire new people to their retinue of support staff, most of which give small bonuses to the general. A victorious general might get a shieldbearer, who gives the general more health, making him more difficult to be killed during a battle.

When a battle is resolved automatically, it seems that these bonuses are not granted as frequently as when the player fights them on the battle map. This may not be a problem, as it offers an incentive to actually use the real time battle system, but it can be disappointing if you're in a hurry and don't have time to fight every battle of a campaign out.

The last problem is the most major one-the auto resolve system does not appear to consider city or castle walls at all in its calculations.


Which may just be a little bit of an oversight when those walls are as tough as these. And also feature ballista and arrow towers that hurl hundreds of fiery bolts at the attacker.

Even in a battle where the town defender is nothing more than one old man with a stick, any attacking force will take at least 5-10% casualties just getting over or through the walls. When the defenders have archers and some spearmen to hold the gate and walls, the attacker needs to have 2-3 times the number of defenders to have a chance of winning. Why is this the case?

Well, an attacker has four options to attack a city. When besieging a city, an army can construct three items: rams, ladders, and siege towers. Rams can be used to break down the main gate of the castle and also to break wooden walls that are part of the lowest upgraded levels of towns and castles. Ladders can be used by infantry units to climb the walls of a castle or town and try to take the battlements. Siege towers are slowly rolled up to the walls and then open up to unleash the troops inside on the battlements. The fourth option is to bring along artillery such as ballistas, catapaults, or cannons to destroy the walls and towers entirely.

These sound like good options, but in practice, rams and artillery are the only good tool from this list. Soldiers climbing up on ladders take heavy casualties when walking up to the wall and don't reach the top in numbers sufficient to defeat any units they encounter, even the weakest defenders like peasant archers. Siege towers are a little better than ladders, as 20 or so troops instantly deploy on to the battlements instead of 3 at a time when ladders are used, but they still tend to lose to any decent defending troops.


They also can be set on fire while they're moving into position, which makes them just a little bit unreliable.

So that leaves rams, which can destroy the main gate to allow the besieging force to move in for the kill. Unfortunately, the nature of a gate is that it forms a stopgap that's difficult to pass. Any wise defender positions most of their soldiers at the gate so that when it's broken down the attacker cannot rush in, they're stuck trying to make it past a hedgehog of spears, pikes, and swords. Even a tiny defending force can usually hold the gate, it's just too difficult for attackers to get a foothold inside.


Venice's armored knights aren't having much luck making it past England's spear militia.

In addition to that problem, the attacking force still has a tail end waiting to move in that's stuck receiving the fire of all the archers and towers, resulting in heavy casualties before they get under cover.


Finally out of bowshot, the Venetian soldiers were relieved. Unfortunately, they barely caught a breath before being hurled into fierce close combat fighting with spears and swords.

That leaves the best option for a besieging force, bringing along artillery to destroy the walls and arrow towers entirely. This limits casualties the most of the four options, but even opening holes in the walls is not sufficient to protect an attacking force enough. Each of those gaps in the walls still leaves a plug which a defending force can assemble behind to limit the number of attackers who can enter at a time.

When auto-resolve is used for a castle siege, the game doesn't seem to consider any of this and will tend to base it entirely on the number and quality of troops involved. If you instead choose to fight it manually, the result is that the defender will almost always prove victorious.


Usually decisively so.

Conclusion
When using auto resolve for turn-based games, try and figure out how it bases the result. It may be that you are at a severe disadvantage if you use the system, as if you rely on it for defending your castles in Medieval II Total War. It may also be quite fair, as in Heroes of Might and Magic.

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. One thing that irritates me most in total war auto resolve are loses in artillery units. Even when enemy is totally outnumbered and do not have to much horses, still attacker tend to loss some of artillery men. During normal play even AI know that artillery have to be protected.

    ReplyDelete