Wednesday, January 25, 2017

Steering Behaviors

hey all,

I've been working on getting my steering behaviors working a bit better for most of this week, and I think I'm finally getting close.



The diagram above is based on Mat Buckland's diagrams and description of the wander algorithm that Craig Reynolds developed. Basically, you pick a random point on the red circle, then add a small random displacement to it. You then normalize this displacement to put it back on the red circle. Finally, you project this circle in front of the agent. The vector from the agent to the green circle gives your agent a goal to move towards.

Another way to do it would be to pick a random angle within a limit of your agent's current value, and move your agent towards that angle at a constant speed.

I've developed on that uses 1D Perlin noise to smoothly move from one angle to another.
Vector2 Wander()
 {
  if (currentLoc >= width)
  {
   currentLoc = 0;
   perlinNoise = GenerateNoiseMap(width, seed++, scale, octaves, persistance, lacunarity);
  }

  //get the next angle and increment currentLoc
  WanderAngle = perlinNoise[currentLoc];
  currentLoc++;

  targetRotation = new Vector3(0f, WanderAngle, 0f);
  Vector3 localwanderTarget = new Vector3(Mathf.Cos(WanderAngle * Mathf.Deg2Rad), 0f, Mathf.Sin(WanderAngle * Mathf.Deg2Rad));
  Vector3 worldwanderTarget = transform.TransformDirection(localwanderTarget);

  wanderTarget = new Vector2(worldwanderTarget.x, worldwanderTarget.z);

  return wanderTarget;
 }

Here's a short video showing it at work.



Cheers,

Saturday, January 21, 2017

On The Road to a Decision

hey all,

Jan. 20th marked the end and the beginning of an era, in more ways than one. On the world stage, Mr. Trump has entered office as the 45th POTUS, ending 8 years of Mr. Obama. Whatever you think of either man's politics, Mr. Obama presided with dignity and respect, and delivered his speeches with gravitas and eloquence. Nobody knows exactly what Mr. Trump will do, but we all know it will be done in an outrageous and probably offensive manner.

On my own small personal stage, Jan. 20th marked my last full time day as an English teacher. Starting Monday, I will be devoting my mornings to programming, research on game design and development, and job hunting for positions in the game industry.

...

I've been watching The Matrix series and blasting Rage Against the Machine's eponymous album for the last week. The themes of CHOICE and DECISION seem to be haunting me, perhaps partly because that has been what I'm struggling to implement in my The Sims-inspired needs system. I've written code that goes through all the needs, and compares how meeting each need would affect the mood of the NPC.


public float SimulateMoodChange(NeedType nt, float potency)
 {
  float curmood = CurrentMood;
  float deltamood = 0;
  //float curmood = CurrentMood- nee.MoodResponse((int)nt)[potency];
  float nttwo = 0;
  switch (nt)
  {
   case NeedType.Food:
    nttwo = nee.Hunger;
    break;
   case NeedType.Hydration:
    nttwo = nee.Thirst;
    break;
   case NeedType.Rest:
    nttwo = nee.Tiredness;
    break;
   case NeedType.Sex:
    nttwo = nee.Lust;
    break;
   case NeedType.Comfort:
    nttwo = nee.Comfort;
    break;
   case NeedType.Cleanliness:
    nttwo = nee.Cleanliness;
    break;
   case NeedType.Shelter:
    nttwo = nee.Shelter;
    break;
   case NeedType.Intimacy:
    nttwo = nee.Intimacy;
    break;
   case NeedType.Fun:
    nttwo = nee.Fun;
    break;
   case NeedType.Safety:
    nttwo = nee.Safety;
    break;
   case NeedType.Respect:
    nttwo = nee.Respect;
    break;
   case NeedType.MAX:
    break;
   default:
    break;
  }
  Debug.Log("Simulate mood change" + " need is " + nt);
  //Debug.Log("potency ")
  for (int i = 0; i < nee.NumberOfNeeds; i++)
  {
   ResponseCurveFloat mr = nee.MoodResponse(i);
   switch ((NeedType)i)
   {
    case NeedType.Food:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Hunger], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Hydration:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Thirst], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Rest:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Tiredness], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Sex:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Lust], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Comfort:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Comfort], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Cleanliness:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Cleanliness], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Shelter:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Shelter], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Intimacy:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Intimacy], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Fun:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Fun], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Safety:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Safety], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.Respect:
     if ((NeedType)i != nt)
     {
      deltamood = Mathf.Clamp(deltamood + mr[nee.Respect], -100, 100);
     }
     else
     {
      deltamood = Mathf.Clamp(deltamood + nee.MoodResponse((int)nt)[nttwo - (100f - potency)], -100, 100);
     }
     break;
    case NeedType.MAX:
     break;
    default:
     break;
   }
  }
  //float delta = nee.MoodResponse((int)nt)[nttwo - (100f-potency)];
  float delta = deltamood - CurrentMood;

  //curmood = Mathf.Clamp(curmood + nee.MoodResponse((int)nt)[nttwo - (potency*nttwo)], -100, 100);
  return delta;
 }

Following the lecture notes to Richard Evans's GDC talk about The Sims 3, I am converting the delta value into a probability. Since his equation is a little bit mystical to me still,


I am just normalizing the value of each delta value by dividing it by the total amount of mood change, which gives a percentage between 0 (never going to happen) and 1 (an inevitability, Mr. Anderson).


void EvaluateMood()
 {
  float runningTotal = 0f;
  float needlevel = 0;

  List < NeedProb > needProbabilities = new List < NeedProb > ();
  foreach (GameObject go in adObjects)
  {
   switch (go.GetComponent < advertisingobject > ().MyNeedType)
   {
    case NeedType.Food:
     needlevel = myNeeds.Hunger;
     break;
    case NeedType.Hydration:
     needlevel = myNeeds.Thirst;
     break;
    case NeedType.Rest:
     needlevel = myNeeds.Tiredness;
     break;
    case NeedType.Sex:
     needlevel = myNeeds.Lust;
     break;
    case NeedType.Comfort:
     needlevel = myNeeds.Comfort;
     break;
    case NeedType.Cleanliness:
     needlevel = myNeeds.Cleanliness;
     break;
    case NeedType.Shelter:
     needlevel = myNeeds.Shelter;
     break;
    case NeedType.Intimacy:
     needlevel = myNeeds.Intimacy;
     break;
    case NeedType.Fun:
     needlevel = myNeeds.Fun;
     break;
    case NeedType.Safety:
     needlevel = myNeeds.Safety;
     break;
    case NeedType.Respect:
     needlevel = myNeeds.Respect;
     break;
    case NeedType.MAX:
     break;
    default:
     break;
   }
   needProbabilities.Add(new NeedProb(go.GetComponent < advertisingobject > ().MyNeedType, myMood.SimulateMoodChange(go.GetComponent < advertisingobject >().MyNeedType,
    go.GetComponent < advertisingobject > ().MyMeetNeed.potency)));
   runningTotal += myMood.SimulateMoodChange(go.GetComponent < advertisingobject > ().MyNeedType, 
    go.GetComponent < advertisingobject > ().MyMeetNeed.potency);
  }

  for (int i = 0; i < needProbabilities.Count; i++)
  {
   Debug.Log(needProbabilities[i].nt + " probability is " + needProbabilities[i].probabilty);

  }

  for (int i = 0; i < needProbabilities.Count; i++)
  {
   if (runningTotal > 0)
   {
    needProbabilities[i].probabilty = needProbabilities[i].probabilty / runningTotal;
   }
  }

  for (int i = 0; i < needProbabilities.Count; i++)
  {
   Debug.Log(needProbabilities[i].nt + " normalized probability is " + needProbabilities[i].probabilty);

  }

 }

I've also set up another function that just evaluates the needs, and ran into the following problem. If I want to implement one of the common methods of picking an option, I create a simple array of length 100, and assign a NeedType to each, I need a way of rounding the floating probabilities to integers such that they will add up to 100. For example, if Food is 45.65934% probable, Hydration is 23.763%, etc. I need a way to round those fractional values in such a way that they get assigned to appropriate needs.

Luckily for me, one of America's Founding Fathers, Alexander Hamilton, had already figured out a way to deal with this problem. Basically, you take the integer part of each percentage and sum them. You find the difference between the sum and the target number, then you take integers that had the largest remainders and add 1 to them until there no places available.

How great is it that this method was developed by a man who was the first Secretary of Treasury of the US, and, given his desire for a strong executive branch and military, and support for industrialization, would most likely have had the support of our current POTUS.


int integalPart = 0;
  List < NeedProb > remainder = new List < NeedProb > ();
  int extra = 0;
  for (int i = 0; i < needProbabilities.Count; i++)
  {
   integalPart += (int)(needProbabilities[i].probabilty * 100);
   remainder.Add(new NeedProb(needProbabilities[i].nt,(needProbabilities[i].probabilty * 100)- (int)(needProbabilities[i].probabilty * 100)));
  }

  //for (int i = 0; i < needProbabilities.Count; i++)
  //{
  // Debug.Log(needProbabilities[i].nt + " " + needProbabilities[i].probabilty);
  //}


  for (int i = 0; i < needProbabilities.Count; i++)
  {
   needProbabilities[i].probabilty = (int)(needProbabilities[i].probabilty * 100);
  }

  //needProbabilities.Sort();
  //for (int i = 0; i < needProbabilities.Count; i++)
  //{
  // Debug.Log(needProbabilities[i].nt + " at time " + Time.time + " is " + needProbabilities[i].probabilty);
  //}

  extra = 100 - integalPart;


  remainder.Sort();
  remainder.Reverse();
  for (int i = 0; i < extra; i++)
  {
   needProbabilities[(int)remainder[i].nt].probabilty++;

  }

  int cur = 0;
  int cur2 = 0;
  for (int i = 0; i < needProbabilities.Count; i++)
  {
   cur = cur2;
   for (int j = cur; j < cur + (int)(needProbabilities[i].probabilty); j++)
   {
    prob[j] = needProbabilities[i].nt;
    cur2++;
   }
  }

So anyway, using these probabilities, I can generate a random number from between 0 - 99, and access my probability array, prob, to pick a need to satisfy. The next step is to start moving towards it using my Steering Behaviors.

Cheers,

Total War: Warhammer Game Analysis

Total War: Warhammer Analysis

Total War: Warhammer Analysis

David Hunter

January 21, 2017

1 Overview

Total War: Warhammer is a turn-based strategy and real-time tactics game developed by Creative Assembly and published by Sega in 2016. It is based on the Warhammer franchise from Games Workshop.

2 Formal Elements

2.1 Players

In Total War: Warhammer, the player takes control of a faction in the Warhammer universe.
  • Greenskins: Their major resource is gold, but one of their unique mechanics is ”fightiness.” This is a meter for each army that fills as they raid and win battles, but drops during inactivity or losses. If it drops below a certain point, they will fight amongst each other, resulting in losses.
  • Chaos Lords: Their major resource is ”favour” (presumably from the Chaos god), and unlike other factions, they have no buildings.
  • Beastmen: These are like a combination of the chaos and orcs factions: they have no buildings, their major resource is ”favour,” and each army has a bestial rage bar that works the same as the ”fightiness” bar for the orcs.
  • Dwarfs: Their major resource is gold, but their unique mechanic is grudges. Each time a faction raids them, takes a settlement from them or otherwise performs some action detrimental to them, a ”Grudge” is issued, which will be a revenge quest against that faction. Letting grudges accumulate unanswered results in lowered public order and other penalties.
  • Empire: Their major resource is gold, but the player must assign different lords to ”Offices,” such as Treasurer, etc, that have an effect on how the empire is run.
  • Vampire Counts: Almost all the units for the vampire counts are undead, so they will never flee in battle. Further, as they have no ranged units, playing them represents a challenge on the battlefield. Their major resource is Dark Magic, and another unique mechanic is that they can recruit units at the sites of major battles throughout the campaign map for greatly reduced prices.
  • Wood Elves: The elves use gold and Amber, a resource which can be attained through completing quests, trade, and occupying outposts. Like the Empire, they have Offices, to which the player must assign lords.
Each faction has unique units, lords, heroes, abilities, and buildings.

2.2 Objectives

Each faction has unique objectives, which involve completing the lord’s quest line, occupying specific settlements, and eliminating certain factions.

2.3 Rules

Total War: Warhammer is an incredibly complicated game with many rules, interacting systems, and moving parts which affect other moving parts which affect other moving parts which affect …You get the idea. As a small illustration, consider the diagram here subsection 1.

Figure 1:

This shows some of the basic relationships between money generation, keep upgrades, population growth, and public order. Blue elements indicate positive effects. For example, building an upgrade to the keep will increase the amount of money generated by the keep itself, and also by any buildings in the province. Further, it increases the rate at which population is generated. The red elements indicate negative effects. Upgrading the keep increases the amount of population required to get a surplus population point, making it more difficult to get that. It also increases the number of surplus population points required for upgrading the keep and the cost for doing so. There are technologies that, once researched, affect the amount of money, public order or population generated each turn, as well as buildings that have similar effects. Taken together, these feedback loops are similar to the Engine Building mechanic described in Game Mechanics: Advanced Game Design by Joris Dormans and Ernest Adams. The elements in red, however, are part of the Dynamic Friction and Stopping Mechanism patterns in the same book.
2.3.1 Turn Structure and Actions
The player will probably spend a large amount of time looking at the world map. The world map shows the landscape from a standard 3/4 top-down camera that can be zoomed in/out and rotated around. The fog-of-war is active on this map, and the player will be prevented from viewing armies or heroes that are outside of any of the player’s cities’ or armies’ sight radius.


A top-down abstracted version is also available, which shows what faction controls which province and any armies and heroes that are visible to the player.

The player can take many actions from this screen. By clicking on an army’s flag, the player can recruit new units into it, dismiss units from it, trade units between a neighboring army, or give orders to move the army to a different location, to attack another army or lay siege to a city. Hero units can be embedded in an army, or they can move independently inside one’s own provinces or perform actions against other factions, like assaulting their armies, damaging their buildings, or assassinating their heroes or lords.
The player is limited to 20 units per army, although if several armies are close together they can participate in the battle at the same time.
By clicking on a city’s icon, the player may view the garrison, see what buildings have been built and which ones can be upgraded, or decide to destroy a building or build a new one.
Viewing the faction’s available quests, objectives, and research trees can also be accomplished quickly from the main map.
The last set of actions is diplomacy. The player may initiate a wide variety of actions, for example
  • Declare War
  • Demand/Offer Payment
  • Demand faction become a vassal
  • Demand faction join faction
  • Offer Trade Agreement
  • Offer Non-aggression Pact
  • Demand/Offer to Join War
  • Demand Military Alliance
When the player has completed all the actions they want to perform during a turn, they can use the advance turn button (shaped like an hour glass) in the lower right corner. The campaign AI controlled factions then take their own turns, initiating the same actions available to the player.
2.3.2 Real-Time Battles
The camera controls similarly in the real-time battles as for the turn-based campaign map. The play can click on units or select groups of units and have them move around on the map and attack enemy units. Gameplay can be paused, slowed down, or sped up at any time to allow the player to plan their actions.
Since the beginning of the Total War franchise, the real-time tactics have been based on a rock, paper, scissors-like relationship among archers, infantry, and cavalry units.


This simple relationship has been complicated and muddied by different kinds of infantry units with slightly different movement speeds, attack ranges, attack values, defense values, in addition to different kinds of cavalry units, the addition of siege weapons and firearms, and in the latest iteration, by the game-changing addition of magical powers. The terrain further affects the relationship, as archers positioned on a high steep hill might be able to take out a cavalry unit before it reaches them, while hills will also block firearms, which must have straight line-of-sight to their targets.






2.3.3 Faction Research
Each faction has a ”unique” set of technology trees to be researched. I say that in quotes because although the names and named effects of each technology is limited to that faction, the effects follow a general pattern. For example, the Vampire Counts have a technology called Infiltrate Noble Houses, which gives them a +10 in diplomatic relations with all factions. Meanwhile, the Dwarfs have one called Dwarfen Diplomats, with exactly the same effect. The number of turns required to research these technologies is quite different, because these research options are located in different places in their respective research trees, but most of the other technologies are similarly themed. On the military side, there are bonuses for ranged units, infantry units, cavalry , or siege units, and reductions in the costs or upkeep for the same. On the civil side, there are bonuses for trade, growth, or income generating buildings.
There are truly unique technologies, but the vast majority are shared among the factions under different names.
2.3.4 Heroes and Lords’ Skills and Traits
Continuing the trend of combining different game genres, Total War: Warhammer, like several previous games in the Total War franchise, features hero and lord units which have stats, skills, and traits which can be modified during and by play.

Figure 2: Lord stats



Figure 3: Lord Skills

As the player leads these units in battles and missions, they gain XP and and earn skill points which can be invested in several different skills. The skills might be simple stat boosts, magic spells, or abilities which affect how the unit behaves in battle or on the campaign map.
2.3.5 Heroes and Lords’ Equipment and Inventory
As can be seen in the picture here, the lords also have equipment. These include armor, weapons, magical items, followers, banners, and mounts. Equipment can be gained through completing special quests or through battle. As with skills, stats, and traits, these allow the player to further customize their heroes and lords to particular playstyles.

2.4 Procedures

There are several procedures that the player will engage in during play.
  1. Assembling an Army: Putting together an army is a multi-turn process in Total War: Warhammer. Many units take several turns to train, and the best units for each faction are usually unlocked after upgrading the buildings which produce them, and by building auxiliary buildings. The units, like the lords and heroes, gain XP based on their kills in battle, and this is automatically used to increase their rank. Increased rank provides increases to their stats, like damage, speed, defense, etc. Due to the prohibitive upkeep on armies, building a large powerful army requires a lot of economic management throughout the player’s provinces. This also makes building such an army a more time and thought consuming process.
  2. Engage in Diplomacy: Although presented in a bare bones fashion above, each turn the player may try to engage multiple factions in diplomatic actions.
  3. Manage Economy: Each settlement and province, and many buildings have the ability to affect the economy of your faction in some way. The keeps all increase the amount of income generated per turn, while resource generators like Lumber Yards, Iron Mines, or Gold Mines also generate money and resources that can be traded with other factions for even more money. With all these ways to make money, it might seem that fielding huge armies would be no problem, but the designers have given the lords and the units in their armies quite large upkeep costs, so that having one large army of experienced units might consume more than 5,000 gold per turn. Managing how you produce money is therefore critical to success.
  4. Engage in Battle: With a name like Total War, you know you will engage in battles, and the series lives up to its name. The battles in Total War: Warhammer are some of the most beautiful, dramatic, and dynamic of the whole series. Positioning and correctly maneuvering troops is critical, as is considering the special auras of both the enemies’ leaders and your own, and the dynamics of the units themselves. As an example, there are gigantic units which receive special bonuses when fighting units weak to them, as well as receiving extra penalties when up against units that are strong against them.

2.5 Resources

2.5.1 Abstract
  • MONEY: Each faction has their own version of money. The Dwarfs use gold, the Vampires use Dark Magic, etc. These basically work the same way for all factions: the player is given a base rate of 2500 per turn, to which will be added taxes, revenue from buildings, and from which will be subtracted losses due to being raided, construction costs, unit upkeep etc.
  • Rank: Each faction has a dynamically generated rank, which compares the strength of that faction against every other faction. The level and number of armies, in addition to the number of settlements and the power of one’s economy play a role in determining this number.
  • Reputation: Each faction has a reputation with other factions. Like money, numerous factors affect one’s reputation with another faction, including racial effects, recent events between the two, (dis)approval of one’s actions against a third faction, etc.
  • Corruption: Corruption is created by units and buildings which belong to either the Chaos Lords or Vampire Counts factions, but these two factions actually create different kinds of corruption. For the Vampire Counts, Vampiric Corruption will help increase the public order of a province, making it less likely to rebel, while for other factions it has the opposite effect. Chaos corruption works the same for the Chaos -affiliated factions.
  • XP: All lords, heroes, and units receive XP for doing damage in battle and for completing quests. Units upgrade their stats automatically, while the player has a degree of control over how to upgrade lords and heroes.
  • Health: All units have health that works exactly the same as health in every game ever made. The only twist is that lords can be brought back to life after waiting a certain number of turns.
  • Stats: All units have stats, many many stats. These include melee damage rating, range damage rating, range attack distance, melee and ranged defense, movement speed, charge bonus damage, and others. They are affected by leveling up.
  • Morale: A unit’s morale basically tells you how it is feeling. This could be affected by how it is doing in battle, whether it is being attacked from the flanks or rear, whether a lord or hero is near it, magic spells cast on it, and several other factors. Units with low morale have a much greater chance of running from battle.
  • Stamina: Stamina indicates how much energy the unit has for movement and attacks. Units with low stamina will move more slowly and attack less frequently.
  • Ammo: Ranged units like archers, catapults, and riflemen have limited ammunition for their weapons. They can only continue firing while ammo lasts, and after it runs out, they must switch to melee combat.
2.5.2 Physical
  • Items: Lords and heroes can acquire items which increase different stats or which give special abilities. If the lord dies or his army is defeated in battle, these may be lost or stolen.
  • Units: Given that units level up as they survive battles and deal damage to foes, it is easy for the player to become attached to them and to try to keep them around for the whole game. They also cost money and time to train, incentivizing keeping them around for as long as possible.
  • Lords and Heroes: There are several types of lords and heroes. Lords can be magic, ranged, or melee combat focused bad-asses, or they could focus more on administration. The best way to play each lord depends on their skill trees. Heroes are more generic, but still feature items, skills and stats like lords do. Heroes cannot lead armies in battle, but they can assassinate other lords or heroes, damage buildings in a settlement, lay traps, or make speeches to foment rebellion and public discontent.
  • Settlements: There are a huge number of different settlements in the game. These can be taken over, raided, or razed to the ground. If the player decides to occupy one, it can be used as a staging ground for planning attacks or building an army, or even as an economic resource generator, all depending on the buildings which the player constructs there.
  • Buildings: Each settlement can contain several buildings, and upgrading the keep increases the number of available slots for buildings. Buildings basically fall into two categories: military and economic. Like many other aspects of gameplay, the player must decide in which settlement to place a building.

2.6 Conflicts

2.6.1 Stability versus Speed
This plays into the long-term versus short-term investment conflict that is common in many strategy titles. The player may try to expand their territory as rapidly as possible by taking over other faction’s settlements. However, there is an immediate penalty to public order in a recently conquered settlement, and it is quite easy for recently conquered territories to become rebellious, forcing the player to backtrack and deal with the rebellions. On the other hand, eliminating a weak nearby enemy quickly can give the player access to resources and income they might not otherwise receive.
2.6.2 Money versus Military
Since a diplomatic option is usually possible, the player may choose to focus efforts on the construction of economic buildings and research options that enhance their economic power. With enough gifts to hostile factions, they can usually be turned into allies, thus making military investment moot.
2.6.3 Conquest versus Diplomacy
This plays similarly to the above conflict and might be subsumed under it. Inside of attacking one’s neighbors, the player attempts to maintain friendly relations with them.

2.7 Boundaries

2.7.1 Map
There are factional restrictions on occupying settlements. For example, the humans and vampires can occupy only the plains settlements, while dwarfs and orcs can occupy the mountainous and wasteland settlements. These have been implemented, according to the developers, to mirror the behavior of these factions in the tabletop wargame. The Chaos lords and Beastmen are similarly prevented from having any settlements at all, while the Elves may possess any settlement type.
The map is also limited to a small area of the Total War, representing most of the Old World.
2.7.2 Factions
Due to the built-in relationships between the factions, it is basically impossible to become allies with certain factions. For example, the Dwarfs are basically prevented from becoming allies with the Greenskins.

2.8 Outcomes

The game allows for a wide range of outcomes. In Total War: Warhammer, as in other games in the Total War series, the player may plan and scheme and battle for 35 or 50 hours and still in the end be defeated. The player may instead use bribes, diplomacy, and economic trading to gather allies and grow in power and status among the nations of the world. Or the player might raid, plunder, pillage, and burn their way through the world, leaving a path of fire and corpses in their wake. Even a combination of the above is possible.
The state of the world at the end of play could be one of (mostly) peaceful alliances and trading partnerships, or of huge regions subjugated under one rule.

3 Dynamic Elements

Total War: Warhammer is a complex, multi-layered experience that reacts in many ways to the player’s actions and simulated many different AI controlled factions.

3.1 Economy

The player receives a small base income of 2500 money units per turn, but this can be heavily modified by a wide array of other factors:
  • the number of settlements controlled
  • the number of upgrades to the keep of each settlement
  • which technologies the player has researched
  • the number, type, and upgrade level of various economic buildings
  • income from raiding and sacking other factions
  • being raided or sacked by other factions
  • gifts from other factions
  • trade agreements with other factions
  • skills, followers, and traits of heroes and lords
  • number and upkeep requirements for army units
The player’s economic status will thus shift and flow with each new turn of events.

3.2 Diplomatic Relations

Although this system can be gamed to some extent, the AI controlled factions react in mostly reasonable and predictable ways to the player’s actions towards them and towards other factions. Actions that the faction approves of will increase their disposition towards the player, while opposite actions will have the opposite effect. Since each faction has an opinion regarding other factions as well, the player’s actions towards other factions will affect their approval with the first faction.

3.3 Real-time Battles

The AI controls the placement, orientation, and pathing for their units in the real-time battles. As the player makes moves, the AI reacts, attempting to counter them. The AI is not just passive, however; it attempts to enact a battle plan that it has judged will be advantageous to it.
The units undergo loss from magic, melee and ranged damage, and they evaluate their situation to arrive at a morale rating, which if dire enough, may cause them to run away.

4 Dramatic Elements

There are three main types of story elements in Total War: Warhammer:
  • those introduced to guide the player through the game experience at the beginning of each faction’s campaign
  • those that emerge dynamically as the player battles, trades, and forms alliances with other factions.
  • those that are part of the quest line for each major lord

4.1 Characters

Each faction has two legendary lords available for the player to choose from at the beginning of a campaign. The legendary lords have unique abilities and equipment, the later which are unlocked by leveling up the lord and by performing special actions associated with a quest on the campaign map. These actions could be as simple as fighting a specific battle, deploying a particular unit to an area, or having set units in one’s army.
There are textboxes describing what happens off screen during these quests, and the lord will give a special speech before any quest battles.
In addition to any legendary lords, there are numerous minor lords, plus different categories of hero units. In contrast to the legendary lords, these minor lords and hero units do not have any unique quests or stories associated with them.
As detailed before, the lord and hero units are customizable in terms of equipment, abilities, followers, and mounts, all of which could have both battle and campaign effects.

4.2 Story

Although there are limited story elements contained in the quests for each legendary lord, there is little overarching story. Perhaps the only overarching theme is that ”Winter is coming,” to borrow a phrase from another popular franchise. The Chaos Lords are gathering strength in the North, and after turn 100, they begin their invasion of the southern lands.

5 Conclusion

Total War: Warhammer is a huge, complicated game of strategy and tactics, featuring at present seven different playable factions, each with different units, lords, heroes, buildings, technologies, and starting locations. Although Creative Assembly has been slaving away on historically based strategy games for 17 years, this game marks the first time that they have done a fantasy strategy game and their eponymous creativity is on full display.

5.1 Potent Elements

The battles create all the feelings of the Siege of Helm’s Deep or the Battle of Pelennor Fields, combined with those of a well-played chess game when everything goes your way, and if everything doesn’t you get to imagine how Mordor felt in those movies. They are big, loud, dramatic, bloody, and demand constant care to the positioning and disposition of one’s troops.
Even diplomatic options are interesting, but they cannot beat the battles.

5.2 Areas for Improvement

The game’s tutorials leave much to be desired, even for one who is a fan of the series.

Wednesday, January 18, 2017

Warhammer Economy Analysis

hey all,

I've been playing some Total War: Warhammer recently, and I've been working up a game mechanics/economics analysis of the core gameplay, and here is what I have so far.


The basic gameplay on the campaign map revolves around money, public order, and population growth. There are many other factors, but I've singled these out as the most basic and fundamental.




This is close to how it works in the actual game. Your units cost a certain amount of money, and for each unit you train, the upkeep you must pay will increase. Your public order, income, and growth is mostly affected by your keep's upgrades and by income and growth modifying buildings. There are also buildings which affect public order, but I have left them out to simplify somewhat. This is an instance of the Build the Engine pattern from Game Mechanics: Advanced Game Design by Joris Dormans and Ernest Adams. This pattern is all about modifying the feedback loops that drive the fundamental resources used in gameplay. Since the player has such a high degree of control over how these resources are generated, a large amount of gameplay time is spent deciding how to best proceed and on tweaking the values to produce slightly better results.

Saturday, January 14, 2017

Flocking

hey all,

I've got some limited functionality working here on my flocking behaviors. Also show cases that the needs are still working.


Thursday, January 12, 2017

Steering Behaviors

hey all,

I've programmed a little more for my The Sims-like game, but I've been focusing on implementing some steering behaviors, as can be seen in this video by another programmer. Right now, mine are not fully functional, but I hope to have them working by the end of the week.



Cheers,

Thursday, January 5, 2017

GDC

hey all,

Been on a trip the last week. Those interested can read about it here.

Bad news first: I've been turned down from being an assistant at the GDC in San Francisco 2017, but I've applied to the waiting list, so I still might get a chance to go.

Good news is that I am closing in on the end of my full time teaching job, and will finally have a few hours in the morning when my brain is working to devote to coding, research, and development.

Here's to an awesome 2017.

Cheers,