Difference between revisions of "BuildingScenariosBalancing"

From The Battle for Wesnoth Wiki
(Player's recruitment list: update)
m (Unexpected reinforcements)
 
(15 intermediate revisions by 2 users not shown)
Line 23: Line 23:
 
* Player's starting gold
 
* Player's starting gold
 
* AI's starting gold
 
* AI's starting gold
 +
* AI income
 
* Player's recriutment list
 
* Player's recriutment list
 
* AI's recriutment list
 
* AI's recriutment list
Line 32: Line 33:
 
* Unexpected reinforcements
 
* Unexpected reinforcements
 
* Time of day
 
* Time of day
 +
* Items
 +
* WML effects
  
 
Note that the AI's starting gold is one factor among many.
 
Note that the AI's starting gold is one factor among many.
Line 37: Line 40:
 
===Varying the difficulty of a tactical problem presented to the player in a scenario===
 
===Varying the difficulty of a tactical problem presented to the player in a scenario===
  
Considering the above factors, it is easy (if time consuming for the designer) to present tactical problems of differing difficulty in a single scenario. For most of the above factors, I'll give and example and explain in a sentence how if affects the tactical problem:
+
Considering the above factors, it is easy (if time consuming for the designer) to present tactical problems of differing difficulty in a single scenario. For most of the above factors, I'll give an example and explain in a sentence how if affects the tactical problem:
  
 
====Terrain====
 
====Terrain====
If the map is predominantly a terrain that favors either the player's forces or the ai's forces, it will have a huge effect on the difficulty of the battle. For example, a player whose units are broadly loyalists will have a disasterous time trying to root Elves out of woods. The terrain is, however, generally fixed by the nature of the scenario (i.e. the designer can't really make a whole new map for each difficulty level). I would submit, however, that 80% of the actual
+
If the map is predominantly a terrain that favors either the player's forces or the ai's forces, it will have a huge effect on the difficulty of the battle. For example, a player whose units are broadly loyalists will have a disastrous time trying to root Elves out of woods. The terrain is, however, generally fixed by the nature of the scenario (i.e. the designer can't really make a whole new map for each difficulty level). I would submit, however, that 80% of the actual
 
fighting in a typical scenario occurs in less than 10% of the hexes. It is possible to change only one or two hexes and have a dramatic effect on the outcome of the battle if you can identify those "chokepoint" hexes.
 
fighting in a typical scenario occurs in less than 10% of the hexes. It is possible to change only one or two hexes and have a dramatic effect on the outcome of the battle if you can identify those "chokepoint" hexes.
  
  
This can either be done my having three different maps (which I suspect is more work) or by using the WML tag [terrain].
+
This can either be done by having three different maps (which I suspect is more work) or by using the WML tag [terrain].
 
For example, the code:
 
For example, the code:
  
Line 64: Line 67:
  
 
Setting the AI gold too high will require the player to perform perfectly, or in some cases, even better than perfect (meaning extreme luck with the RNG). Reducing the AI gold, however, does significantly reduce the difficulty of most scenarios (but try to avoid removing all the challenge). Unfortunately, due to the variation in player starting gold in a campaign, finding the optimal AI starting gold amount is nearly impossible.
 
Setting the AI gold too high will require the player to perform perfectly, or in some cases, even better than perfect (meaning extreme luck with the RNG). Reducing the AI gold, however, does significantly reduce the difficulty of most scenarios (but try to avoid removing all the challenge). Unfortunately, due to the variation in player starting gold in a campaign, finding the optimal AI starting gold amount is nearly impossible.
 +
 +
====AI income====
 +
Income provides a steady stream of gold, allowing the AI to mount a continued offensive. Income can be generated from villages, or supplied directly by the scenario designer using WML. A steady stream of income can help provide a more balanced challenge, instead of deciding the battle directly upon the first engagement. Extra income is generally less destabilizing than larger amounts of starting gold, making it a good candidate for fine-tuning scenario balance.
  
 
====Player's recruitment list====
 
====Player's recruitment list====
Line 72: Line 78:
 
====AI recruitment list====
 
====AI recruitment list====
 
Restricting the enemy to a certain class of units (i.e. melee-only, ranged-only, impact-attacks-only) can simplify the tactical problem immensely. Consider an enemy who can only recruit thieves and thugs facing a predominantly loyalist force, who can recruit Bowmen and Spearmen.  Bowmen are very good against thugs and thieves because they have a strong ranged attack. If the enemy can also recruit poachers and footpads, the tactical problem becomes more difficult because the player must balance the effectiveness of the Bowmen against the thieves and thugs with their (relative) weakness against footpads and poachers.
 
Restricting the enemy to a certain class of units (i.e. melee-only, ranged-only, impact-attacks-only) can simplify the tactical problem immensely. Consider an enemy who can only recruit thieves and thugs facing a predominantly loyalist force, who can recruit Bowmen and Spearmen.  Bowmen are very good against thugs and thieves because they have a strong ranged attack. If the enemy can also recruit poachers and footpads, the tactical problem becomes more difficult because the player must balance the effectiveness of the Bowmen against the thieves and thugs with their (relative) weakness against footpads and poachers.
 +
 +
More typically, the scenario designer can remove higher-level units to lower difficulty, and add them to raise difficulty. As an example, in '''Muff Malal Peninsula''' from HttT the AI is allowed to recruit Blood Bats on "hard", but only Vampire Bats on "normal" and "easy". Because the AI pays "full price" for their units, changing the units available doesn't significantly reduce the total power of the side, but it does limit the total power that can be brought to bear in a single turn. It can also be useful to limit defensive "bottlenecks" (weaker individual AI units allow the player to power through the defenders).
  
 
====Player's recall list====
 
====Player's recall list====
 +
A player's recall list is vital to the balance of the scenario, however the designer has little control over it. Because recalled troops are available at a ''significant'' discount, they can easily turn the tide of battle, especially against lower-level enemies. Unfortunately, as with the player's starting gold, the recall list is generally unbalanced: the accomplished players will have multiple high-level units, while the struggling players will have few. The situation is further complicated by another wrinkle: playing on "hard" often provides significantly more experience points than playing on easy, with the result that the "hard" recall list often has more high-level units than the "easy" list.
  
 +
At the beginning of a campaign, it is reasonable to assume few recalled troops (and those that are generally aren't too unbalancing). At the end of a mid-length campaign it is reasonable to assume that most of a player's troops will be level 3 and balance accordingly. In the middle of the campaign, however, it is nearly impossible to find a balance that suits all players. Some campaigns try to limit the player's recall list (such as '''Evacuation''' in EI), however they are rarely entirely successful (and often annoy players).
  
 +
====Time limitations====
 +
The turn limit controls to what extent the player is allowed to waste turns not directly accomplishing his mission.  In the most difficult case scenario, a player must move his leader across the map and only enough turns are allotted such that if he ever moves in any other direction, time will run out. Increasing the turn limit allows an inexperienced player to make turn-costing mistakes and still be victorious.
  
====Time limitations====
+
Extremely tight turn limits should be avoided. Because of the random nature of battle in Wesnoth, the player cannot guarantee that their four level-3 units will be able to take out the enemy leader in a single turn. Restricting the time limit to that level is equivalent to requiring good rolls from the RNG: something the player has no control over. In general, the time limit should serve to ''motivate'' the player, not as the driving challenge of the scenario.
The turn limit controls to what extent the player is allowed to waste turns not directly accomplishing his mission. In the most difficult case scenario, a player must move his leader across the map and only enough turns are allotted such that if he ever moves in any other direction, time will run out. Elongating the turn limit allows an inexperienced player to turn-costing make mistakes and still be victorious.
 
  
 
====Keep sizes====
 
====Keep sizes====
Line 90: Line 101:
 
====Distribution of villages====
 
====Distribution of villages====
 
Using the [terrain] WML tag you can easily alter the distribution of villages in a scenario. Move the distribution towards the player, and things get easier. Move it towards the enemy, and they get harder.
 
Using the [terrain] WML tag you can easily alter the distribution of villages in a scenario. Move the distribution towards the player, and things get easier. Move it towards the enemy, and they get harder.
 +
 +
Villages are useful for three distinct reasons: they are defensible terrain, they grant income (and support), and they provide healing. Of those three, the first two can easily be replaced by other terrain and WML-granted income respectively. Village healing is necessary for the AI, and the player with no healers, however only two or three villages near the conflict are really useful for healing. With those limitations in mind, villages prove only slightly useful in balancing a scenario. For a subtle example, '''The Outpost''' in EI moves a village one hex closer on "easy" (putting it within convenient reach of the player's leader).
  
 
====Unexpected reinforcements====
 
====Unexpected reinforcements====
 
Reinforcements, either friendly or hostile, can significantly complicate the tactical problem. They are a surprise that the player must accommodate with already deployed troops. Unfortunately, reinforcements often become [[tomato surprise]]s, meaning the best course of action for the player is to replay the scenario with foreknowledge of the "surprise". To avoid that result, reinforcements should generally be either foreshadowed, appear early in the scenario, or appear in moderation.
 
Reinforcements, either friendly or hostile, can significantly complicate the tactical problem. They are a surprise that the player must accommodate with already deployed troops. Unfortunately, reinforcements often become [[tomato surprise]]s, meaning the best course of action for the player is to replay the scenario with foreknowledge of the "surprise". To avoid that result, reinforcements should generally be either foreshadowed, appear early in the scenario, or appear in moderation.
  
As an example, the scenario '''Crossroads''' in HttT introduces enemy enemy reinforcements that randomly appear in hill tiles. These reinforcements are explained near the beginning of the scenario, and the enemy units appear in moderation (a few at a time, and only when the player moves onto hill terrain). The scenario '''Drowned Plains''' in EI uses the same code, but adjusts the type of ambushing units depending on the difficulty level. On the other side, many scenarios give the player a few friendly units near the beginning, with the number and type adjusted for difficulty.
+
As an example, the scenario '''Crossroads''' in HttT introduces enemy reinforcements that randomly appear in hill tiles. These reinforcements are explained near the beginning of the scenario, and the enemy units appear in moderation (a few at a time, and only when the player moves onto hill terrain). The scenario '''Drowned Plains''' in EI uses the same code, but adjusts the type of ambushing units depending on the difficulty level. On the other side, many scenarios give the player a few friendly units near the beginning, with the number and type adjusted for difficulty.
  
 
====Time of day====
 
====Time of day====
 
Time of day can be an interesting factor (assuming the map is not a cave and the armies aren't entirely neutral). While you are normally not free to change the cycle, changing the initial time of day can have a significant impact on the outcome of a battle. In particular, the time of day when the first AI rush is engaged can be crucial. On smaller maps, the time of day for the first engagement is practically dictated by the scenario designer. On a large or open battlefield, the player can arrange for a more favorable first encounter, so the initial time of day is not nearly as important. Note that these effects are most pronounced when the two armies are of opposite alignment.
 
Time of day can be an interesting factor (assuming the map is not a cave and the armies aren't entirely neutral). While you are normally not free to change the cycle, changing the initial time of day can have a significant impact on the outcome of a battle. In particular, the time of day when the first AI rush is engaged can be crucial. On smaller maps, the time of day for the first engagement is practically dictated by the scenario designer. On a large or open battlefield, the player can arrange for a more favorable first encounter, so the initial time of day is not nearly as important. Note that these effects are most pronounced when the two armies are of opposite alignment.
 +
 +
====Items====
 +
Items can modify the attributes of one of the player's units, often providing an extra advantage. Some typical items are "Holy Water" (changes melee weapons to ''arcane'' damage) and "Storm Trident" (adds ranged ''fire'' attack), while WML allows for very detailed customization. Even adding a few hitpoints, an extra movement point, or resistance to a specific type of damage can sway the balance of a close engagement.
 +
 +
====WML effects====
 +
This is sort of a catch-all entry. One typical use is via the [http://www.wesnoth.org/macro-reference.xhtml#file:side-utils.cfg LIMIT_CONTEMPORANEOUS_RECRUITS] [[Macro]], which prevents the AI from over-recruiting one specific type of unit. As another example, '''Unexpected Appearance''' in EI uses WML to force the ''chance-to-hit'' to 100% at the beginning of the scenario (to prevent the player from losing if the RNG is mildly uncooperative). Making significant and unexplained modifications to the behavior players have come to expect in Wesnoth should be avoided, but used sparingly WML offers exceptionally fine-grained control for balancing a stubborn scenario.
  
 
== See Also ==
 
== See Also ==

Latest revision as of 19:42, 19 June 2015

Introduction

I'm writing this wiki article to talk about some things that came up as I was balancing a couple of the scenarios in the South Guard Campaign. I'm going to respond to something that PDF wrote but that I think is a pretty common idea. I don't mean to single him out:

The PDF wrote:

  "Adding a difficulty level does not necessarily requires much balancing;
  you can, for example, just add or remove gold."


I'm going to argue that that is fundamentally a flawed way to balance campaigns, and should only be used in conjunction with other balancing methods.

A Wesnoth scenario as a tactical problem

Each scenario in Wesnoth presents a tactical problem. The problem is generally phrased something like this: "Kill the enemy leader in so much time while keeping your leader alive," and its most common variation being: "Move your leader to this hex in said amount time with out letting him die." Of course, there are subtleties to these tactical problems. Because of the bonus gold at the end you want to finish in less then the stated time. And since you can recall experienced units for harder scenarios you may not want your vetrans to die, and of course there might be other units that you have or want to keep alive. There may also be certain units you must kill in order to succeed. At its core however, each scenario is a relatively simple tactical problem.


Factors that influence the difficulty of a tactical problem in Wesnoth

I am going to briefly list the factors (that I perceive) which affect the difficulty of a tactical problem in Wesnoth. This list is probably not exhaustive, so if there's something I've missed, post it and I'll add it to the list. They are in no particular order:

  • Terrain
  • Player's starting gold
  • AI's starting gold
  • AI income
  • Player's recriutment list
  • AI's recriutment list
  • Player's recall list
  • Time limitations
  • Keep sizes
  • AI Parameters (more on this in a minute)
  • Distribution of villages
  • Unexpected reinforcements
  • Time of day
  • Items
  • WML effects

Note that the AI's starting gold is one factor among many.

Varying the difficulty of a tactical problem presented to the player in a scenario

Considering the above factors, it is easy (if time consuming for the designer) to present tactical problems of differing difficulty in a single scenario. For most of the above factors, I'll give an example and explain in a sentence how if affects the tactical problem:

Terrain

If the map is predominantly a terrain that favors either the player's forces or the ai's forces, it will have a huge effect on the difficulty of the battle. For example, a player whose units are broadly loyalists will have a disastrous time trying to root Elves out of woods. The terrain is, however, generally fixed by the nature of the scenario (i.e. the designer can't really make a whole new map for each difficulty level). I would submit, however, that 80% of the actual fighting in a typical scenario occurs in less than 10% of the hexes. It is possible to change only one or two hexes and have a dramatic effect on the outcome of the battle if you can identify those "chokepoint" hexes.


This can either be done by having three different maps (which I suspect is more work) or by using the WML tag [terrain]. For example, the code:

  #ifdef EASY
     [terrain]
     x=4
     y=5
     letter=Ce
     [/terrain]
  #endif

will turn the hex at (4,5) into an encampment.

Player's starting gold

If the player has more gold he can make more tactical mistakes because he can recruit more troops to replace the ones he's lost. Additionally, quantity has a quality all of its own; with sufficient starting gold the player can employ a swarm of cheap units to distract and overwhelm the AI forces. Balancing gold becomes difficult in campaigns because of gold carryover, which often has the exact opposite of the desired effect: struggling players will start with less gold (usually the minimum), while accomplished players will have a sizable treasury. This severely limits the designer's ability to balance the scenario by adjusting the player's starting gold.

AI starting gold

The easiest, and often first choice to balance a scenario, the AI starting gold primarily controls the size of the initial AI "rush". While adjusting this value clearly influences the difficulty of the scenario in a rather straightforward manner, it is often difficult to properly balance a scenario with gold alone. The relationship between AI starting gold and difficulty is not linear--a few more enemy units can make the first engagement impossible, while a few less can lead to a boring rout. Wesnoth was designed to balance well with equal gold, but unfortunately limitations of the AI generally require a significant gold advantage just to level the playing field.

Setting the AI gold too high will require the player to perform perfectly, or in some cases, even better than perfect (meaning extreme luck with the RNG). Reducing the AI gold, however, does significantly reduce the difficulty of most scenarios (but try to avoid removing all the challenge). Unfortunately, due to the variation in player starting gold in a campaign, finding the optimal AI starting gold amount is nearly impossible.

AI income

Income provides a steady stream of gold, allowing the AI to mount a continued offensive. Income can be generated from villages, or supplied directly by the scenario designer using WML. A steady stream of income can help provide a more balanced challenge, instead of deciding the battle directly upon the first engagement. Extra income is generally less destabilizing than larger amounts of starting gold, making it a good candidate for fine-tuning scenario balance.

Player's recruitment list

If the player can only recruit units that will be effective against the enemy's forces, then the tactical problem is simplified. If I can only recruit heavy infantry to face a force of skeleton archers, then I have a less difficult tactical decision to make than if I can recruit heavy infantry and spearmen. Especially if I don't know the game well.

While adjusting the player's recruitment list can prevent new players from recruiting "poor" units, that effect quickly levels off. Even a moderately inexperienced player quickly learns that heavy infantry "beat" skeleton archers. On the other hand, disallowing the best units can create a new tactical challenge. Either way, though, the player's recruitment list is a defining characteristic of the scenario, and usually does not lend itself to balancing due to limited options and lack of fine-grained control.

AI recruitment list

Restricting the enemy to a certain class of units (i.e. melee-only, ranged-only, impact-attacks-only) can simplify the tactical problem immensely. Consider an enemy who can only recruit thieves and thugs facing a predominantly loyalist force, who can recruit Bowmen and Spearmen. Bowmen are very good against thugs and thieves because they have a strong ranged attack. If the enemy can also recruit poachers and footpads, the tactical problem becomes more difficult because the player must balance the effectiveness of the Bowmen against the thieves and thugs with their (relative) weakness against footpads and poachers.

More typically, the scenario designer can remove higher-level units to lower difficulty, and add them to raise difficulty. As an example, in Muff Malal Peninsula from HttT the AI is allowed to recruit Blood Bats on "hard", but only Vampire Bats on "normal" and "easy". Because the AI pays "full price" for their units, changing the units available doesn't significantly reduce the total power of the side, but it does limit the total power that can be brought to bear in a single turn. It can also be useful to limit defensive "bottlenecks" (weaker individual AI units allow the player to power through the defenders).

Player's recall list

A player's recall list is vital to the balance of the scenario, however the designer has little control over it. Because recalled troops are available at a significant discount, they can easily turn the tide of battle, especially against lower-level enemies. Unfortunately, as with the player's starting gold, the recall list is generally unbalanced: the accomplished players will have multiple high-level units, while the struggling players will have few. The situation is further complicated by another wrinkle: playing on "hard" often provides significantly more experience points than playing on easy, with the result that the "hard" recall list often has more high-level units than the "easy" list.

At the beginning of a campaign, it is reasonable to assume few recalled troops (and those that are generally aren't too unbalancing). At the end of a mid-length campaign it is reasonable to assume that most of a player's troops will be level 3 and balance accordingly. In the middle of the campaign, however, it is nearly impossible to find a balance that suits all players. Some campaigns try to limit the player's recall list (such as Evacuation in EI), however they are rarely entirely successful (and often annoy players).

Time limitations

The turn limit controls to what extent the player is allowed to waste turns not directly accomplishing his mission. In the most difficult case scenario, a player must move his leader across the map and only enough turns are allotted such that if he ever moves in any other direction, time will run out. Increasing the turn limit allows an inexperienced player to make turn-costing mistakes and still be victorious.

Extremely tight turn limits should be avoided. Because of the random nature of battle in Wesnoth, the player cannot guarantee that their four level-3 units will be able to take out the enemy leader in a single turn. Restricting the time limit to that level is equivalent to requiring good rolls from the RNG: something the player has no control over. In general, the time limit should serve to motivate the player, not as the driving challenge of the scenario.

Keep sizes

The size of a player's keep determines at what rate he can recruit troops. The size of the enemy's keep determines at what rate he can recruit troops. Divide one by the other and you get a relative-recruitment-rate (assuming both have lots of gold). If the relative recruitment rate favors the player, the tactical problem should be easier because he can replenish losses more easily than the AI player. If the AI player's keep is larger, then any losses by the human player will be that much more difficult to replace.

Note that these parameters generally only have a significant influence on the first few turns--rarely will players (or AI) have sufficient gold to recruit a full keep of replacement troops (and almost never will they be able to do so on multiple turns in a row). In those first few turns, a smaller AI keep can "spread out" the initial rush, making it easier for the player to defend (but this effect can disappear entirely if the AI improves). The only time keep size is critical to the players is when they are limited to 'X' rounds of recruitment (either because their keep is forcibly removed or they are required to begin moving their leaders towards an objective). In short, while keep size can have an effect in some specific circumstances, it is generally not very useful for balancing scenarios.

AI Parameters

The AI parameters are perhaps the best way to alter a tactical problem. AiWML is a particularly important read for a scenario designer. I'd draw attention to aggression and [target] in particular. attack_depth is also very nice. These parameters are especially important for building scenarios with tactical problems that are fundamentally different from the basic kill-his-leader ones.

Distribution of villages

Using the [terrain] WML tag you can easily alter the distribution of villages in a scenario. Move the distribution towards the player, and things get easier. Move it towards the enemy, and they get harder.

Villages are useful for three distinct reasons: they are defensible terrain, they grant income (and support), and they provide healing. Of those three, the first two can easily be replaced by other terrain and WML-granted income respectively. Village healing is necessary for the AI, and the player with no healers, however only two or three villages near the conflict are really useful for healing. With those limitations in mind, villages prove only slightly useful in balancing a scenario. For a subtle example, The Outpost in EI moves a village one hex closer on "easy" (putting it within convenient reach of the player's leader).

Unexpected reinforcements

Reinforcements, either friendly or hostile, can significantly complicate the tactical problem. They are a surprise that the player must accommodate with already deployed troops. Unfortunately, reinforcements often become tomato surprises, meaning the best course of action for the player is to replay the scenario with foreknowledge of the "surprise". To avoid that result, reinforcements should generally be either foreshadowed, appear early in the scenario, or appear in moderation.

As an example, the scenario Crossroads in HttT introduces enemy reinforcements that randomly appear in hill tiles. These reinforcements are explained near the beginning of the scenario, and the enemy units appear in moderation (a few at a time, and only when the player moves onto hill terrain). The scenario Drowned Plains in EI uses the same code, but adjusts the type of ambushing units depending on the difficulty level. On the other side, many scenarios give the player a few friendly units near the beginning, with the number and type adjusted for difficulty.

Time of day

Time of day can be an interesting factor (assuming the map is not a cave and the armies aren't entirely neutral). While you are normally not free to change the cycle, changing the initial time of day can have a significant impact on the outcome of a battle. In particular, the time of day when the first AI rush is engaged can be crucial. On smaller maps, the time of day for the first engagement is practically dictated by the scenario designer. On a large or open battlefield, the player can arrange for a more favorable first encounter, so the initial time of day is not nearly as important. Note that these effects are most pronounced when the two armies are of opposite alignment.

Items

Items can modify the attributes of one of the player's units, often providing an extra advantage. Some typical items are "Holy Water" (changes melee weapons to arcane damage) and "Storm Trident" (adds ranged fire attack), while WML allows for very detailed customization. Even adding a few hitpoints, an extra movement point, or resistance to a specific type of damage can sway the balance of a close engagement.

WML effects

This is sort of a catch-all entry. One typical use is via the LIMIT_CONTEMPORANEOUS_RECRUITS Macro, which prevents the AI from over-recruiting one specific type of unit. As another example, Unexpected Appearance in EI uses WML to force the chance-to-hit to 100% at the beginning of the scenario (to prevent the player from losing if the RNG is mildly uncooperative). Making significant and unexplained modifications to the behavior players have come to expect in Wesnoth should be avoided, but used sparingly WML offers exceptionally fine-grained control for balancing a stubborn scenario.

See Also

This page was last edited on 19 June 2015, at 19:42.