The year is 204 B.C., and Publius Cornelius Scipio stands, blade and standard in hand, over now-conquered Utica. The numerically superior forces of Hasdrubal and Syphax almost completely annihilated in a nighttime assault by the Romans, and the Carthaginian field forces were entirely out of commission in Northern Africa.

The Carthaginian Empire is the verge of ruin, with Scipio's forces clear to take the capital -

And lo! Envoys appear.

Not just any envoys, but 30 Members of Carthage's Council of Elders, the highest and most respected spokesmen for the state.

They prostrate themselves before Scipio, and beg his forgiveness. They blame the entire war on the ambition of Hannibal, and forsake him. They desire peace...

Then, as with everything in life, times change. Scipio's supplies from Rome are blown off course, and the transport ships run aground near Carthage.

The Carthaginian war-faction now overrides the peace faction, and they seize the supplies. Simultaneous with Hannibal's massive force of 24,000 men being recalled from the Italian Peninsula, the tables have turned - and the war is back on.

It's worth noting that there's always multiple factions in any side. There might even be multiple opinions - factions, in a way - inside a single person.

Negotiators will always claim to speak for the whole of their camp when it suits them. And yet...

Bear this in mind. Even when one faction of an opposition is friendly to you, or wants peace, there is almost always a war faction. Delays in calendar time let events change and initiative shift. You cannot rely too closely on one person speaking passionately to you if they don't have the undivided and unopposed respect of everyone significant in their camp... and consistency in their opinions, and integrity in abiding their decisions.

Read Next

At the same time, this is an issue both terrible and important to think about.

B.H. Liddel Hart, in "Scipio Africanus," notes that the majority of causalities, fatalities, and damage don't occur during conflict, but afterwards -- to the losing side.

From Hannibal's defeat at The Battle of Zama -

"...the loss of the Carthaginians and their allies [was] twenty thousand slain and almost as many captured. On the other side, [the estimates range from "1500 Romans" to "2000 of the victors."] The discrepancy is explained by the word "Romans," for Livy's total clearly includes the allied troops. It is a common idea among historians that these figures are an underestimate, and that in ancient battles the tallies given always minimise the losses of the victor. Ardant du Picq, a profound and experienced thinker, has shown the fallacy of these cloistered historians. Even in battle to-day the defeated side suffers its heaviest loss after the issue is decided, in what is practically the massacre of unresisting or disorganised men. How much more must this disproportion have occured when bullets, still less machine-guns, did not exist to take their initial toll of the victors. So long as formations remained unbroken the loss of life was relatively small, but when they were isolated or dissolved the massacre began."

Could there more mercy, more clemency? Well, we would hope so, but then there's the faction/negotiation/diplomacy problem... when the defeated surrender, they only represent one faction who is at possibly the lowest point, most conducive to surrender. Later on, once cleaned-up and re-armed, the war-hawking faction will return, and if the opponent's forces are not reduced in defeat, they will likely be re-deployed and battle will began anew.

Over the past month we (Read: Terry, KFK's lead programmer) has been working pretty hard on the AI for NPC Factions in Kung Fu Kingdom. One of our goals is to add enough variety to the AI that the player will encounter a variety of different behaviors in NPC factions, and will need to spend time to learn about the factions it encounters (assuming you do not want to crush them all beneath your IRON HEEL!). We want to make the AI SMRT! One of the ways we are doing this is through Risk Assessment and Risk Thresholds.

Ok, so the way the AI gets information is through heat maps. http://en.wikipedia.org/wiki/Heat_map All the information the AI is going to need, resource position, dangerous units, dangerous terrain, areas influenced by other Factions, etc, is represented on various heat maps. When the AI needs to get something done, like gathering a resource, it checks the various heat maps for resources and picks the one in the least dangerous area to go harvest. But how they go about that analysis can vary greatly from Faction to Faction - here is how.

Let's make up a scenario where there are two different factions, Tiger Faction (Which has a high risk tolerance level) and Lilly Faction (Which has a low tolerance level). Both of these factions want a resource - lets assume that this resource is in a dangerous area. Both factions will look at the area around the resource and determine its Risk Level (How many enemies have been seen in the area, how many "neutral" units have been seen, how far it is from base, etc.). In this case, the Risk Level is lower than Tiger Faction's threshold, and so they send some units to go pick up the resources. However, it is higher than Lilly Faction's threshold, so they don't.

There are several ways to influence the Risk Level in an area, for example, Lilly faction could dispatch guards to the area, which would reduce the Risk Level. Cool! As a result, Lilly faction will seem much more cautious in their approach (Frequently bringing guards with them) in everything they do, and Tiger Faction will seem less cautious. This works out for Lilly Faction if the dangers actually materialize (they get attacked, etc.) as they will have guards with them, but will benefit Tiger faction if the dangers are absent (they get more stuff done faster because they don't bring guards).

There are more variables at work here, but this risk analysis is at the base of what we are trying to do with the Kung Fu Kingdom AI - add a lot of variety and personality to the AI's behavior with as few, low level variables as possible. Emergent behavior people, EMERGENT BEHAVIOR!