28 December 2010

Battletech: Sword and Dragon Sessions

Image: ClassicBattletech.com
Our local Battletech group has been playing through the Sword and Dragon Starterbook scenarios.  I already posted my Mission Matrix, which has been a big help in planning missions, but I wanted to spend a little time with some other aspects of these scenarios. We have one player acting as gamemaster, two regularly attending players one each of the Fox's Teeth/Sorenson's Sabres sides, and 2-4 irregular players who sit-in as needed for the players or the OpFor. We've been having fun, but we are starting to run into some difficulties. One of our group made an especially good comment the other night as we were packing up for the evening, and I will quote him here to the best of my recollection:
JZ: "For a scenario book that is supposed to be an introduction to Battletech for new players, there are a lot of problems that only an experienced player would know how to deal with."
A lot of problems indeed. This book is intended as a sort of bridge between the Boxed Set and Total War rules, but it assumes players already know the full rules. Many missions descriptions are also quite vague as to exactly how they are supposed to be set up. Our veteran crew and GM take these problems in stride, but it would be difficult for new players to figure these things out.
The book could have done with more playtesting too, and mea culpa, I was one of the playtesters! My recollection is hazy, but we only had 18 days - enough for proofreading, but nowhere near enough time to play many missions. This also came at a busy time for most of our group, and I don't recall that we played any of these missions. This may also be a problem of having veteran players review a product intended for new players; the bugs that will trip up new players are nearly invisible to players that have been playing the game for years.

Errata problems aside, there are issues with the scenario tracks too. An inexperienced player could easily run out of WarChest Points (WP) with just a few unwise decisions. Taking the wrong combination of force and mission options (plus a little bad luck) turned into a big setback for our Sabres players. Now it's OK if players run out of WP, but I don't see how inexperienced players could avoid running into trouble. These scenarios really need an experienced gamemaster to supervise and help keep the players on a steady course.

There is another issue with these missions that is quickly becoming apparent; the scenario balance is just awful. If you play with the original mechwarriors and mechs from the book, and if the opposing force gets a few good rolls of the dice during the setup, then some of these missions can be challenging. --BUT-- If you are playing (as we are) where mechs can "lightly" modified with prototype weapons and upgrades, or replaced with other mechs purchased or captured, then the scenarios become heavy unbalanced in favor of the Teeth/Sabres sides.
I must admit my bias: I like well balanced scenarios because they are the most fun. I have been playing Battletech long enough that simply winning has little attraction for me - I want a challenge, because challenges are fun! Winning is still cool, but I want to win in a fair fight, not in some goofball setup where one side has no real chance to win (Our group even have a special name for these sort of scenarios). Consider how the following aspects of the Sword and Dragon missions lead to unbalanced scenarios:
  1. Random opposition selection is highly variable, and the players could be up against a tough fight. This encourages them to ALWAYS field the strongest lance of mechs available, even when a weaker lance might be able to pull it off with a little luck. 
  2. There are heavy penalties for not accomplishing mission objectives, so players are again encouraged to field a very powerful force, even if they might get by with less, simply because they cannot afford to lose.
  3. Random force selection does not consider that players may have upgraded their force. Even if the scenario might have been balanced originally, any improvements players make with push this towards unbalanced missions.
There is a common theme here. Given any amount of control other the scenario parameters, players will tend to optimize things for themselves even if that does not lead to a fun game. This can be OK if the other side has an equal chance to optimize, but in this sort of one-sided random scenario generation it gets broken pretty quickly. A a basic principle of good game design is broken here: There is no flow, no Fear of Failing to challenge players to the limits of their abilities.

I know I am asking for a lot. Computer games might be be able to adapt to players in this way, but can a boardgame possibly do this? The answer is yes, after a fashion. In a series of Battletech scenarios, there is no reason you couldn't have measure of performance or margin of victory, and use this to adjust the difficulty of future scenarios. To do this you need to start with a good way to rate the strength of force and opposition, which is one of the reasons I keep going on and on about point balance systems. You would also need a way to measure margin of victory over a series of scenarios. Chess, basketball, and many other games have ratings of skill and ability as measured by their performance against other players or teams. You could do this for Battletech too, with a bit of work. Finally, instead of just rewarding players for winning, make the rewards contingent on the difficulty of scenario they choose. Given the choice of an easy win or a challenging game, I think players will go for the challenge every time.

Hint: This is a topic I hope to spend some time with in 2011 (now where did I leave my notes?).

I should add a comment about scenario objectives, since there were some recent comments about objectives and balance in my recent post on Point Values for Squadron Strike. Sword and Dragon does use scenario objectives, but most of them are useless for maintaining any sort of balance, and some actually make it worse. A way to rate the difficulty of scenario objectives is something else I'm going to have to consider (and that's a tough one!).

And here is a bit of copyright info, just to make sure everyone is happy.
© 2001-2010 The Topps Company, Inc. MechWarrior, BattleMech, ‘Mech and AeroTech are registered trademarks of The Topps Company, Inc. All Rights Reserved.
GBR Giant Battling Robots Favicon

24 December 2010

The Grinder - Christmas Edition

A selection of items ground into mincemeat, just in time for the holidays!

Like spaceship art? Check out Concept Ships.




And as that isn't cool enough, there is also Concept Robots. I think I already ground this up a while back, but it's worth a second pass.


A while back I wrote about a Wired article How the Allies used math against German Tanks. John Cook has a follow on post about how America tried to do the same thing with Soviet bombers in 1958, but the Soviets were wise to the trick:  Military Intelligence from Serial Numbers. [From The Endeavorer]




Mathematics in Movies - with short video clips for most.





[from IO9] A problem that every parent faces - you know what I mean - sooner or later you have to have talk to them about that difficult subject ... you know the one ...





[From Web 2.0 RC1] Sparkley Dice!


A calculus joke from Proof: Calculus and Transformers
Also from Proof:
Q: what do you get when you cross a mosquito and a mountain climber?
A: nothing. you can’t cross a vector and a scalar.
{Drum-riff-cymbal-crash}

Merry Christmas!
GBR Giant Battling Robots Favicon

20 December 2010

Support Net Neutrality

Not much time left. Make yourselves known.
In less than 24 hours, FCC Chairman Julius Genachowski will unveil the FCC’s plan for Net Neutrality.  From what’s leaked to the public so far, the proposed rules are not Net Neutrality and in fact would make things worse for consumers.  Tiered pricing and network management that causes degrading of video are just some of what we can expect if these rules pass.  This is the FCC siding with the telecommunication industry.
This is the perfect example of corporate lobbyists and behind closed door dealings running our government. We’ve been organizing for years on this and tens of thousands of you have written the FCC over the years.  But, this is it.  Make sure your voice is added and you speak out to demand Net Neutrality.
Happy gaming,
Brett Schenker, Online Advocacy Manager
Entertainment Consumers Association (ECA)

GBR Giant Battling Robots Favicon

18 December 2010

Point Values for Squadron Strike

I had a long discussion with my friend Ken yesterday about point value systems in games, and specifically how this can be applied to his game Squadron Strike (Ad Astra Games). We spent several hours hashing out the details of a Lanchester type scoring system, and how various aspects of the game ought to affect the point value. I came prepared with the best I could muster from the theoretical standpoint, and Ken kept the focus on taking what the math says ought-to-be and turning it into something that works. At times we argued - a good sort of argument - and the very best work people can achieve often comes from such discussion.  I can't reproduce all the details, but I think I can recall the high points:
  1. There is no theoretically correct way to make a point system where values and simply be added together, but ...
  2. There is a way to balance point values, somewhere between Lanchester's Linear and Square laws, that is optimal. That is, a point system can be structured so that there is a small advantage to be gained by taking a moderate strategy - with moderate meaning the right combination of intermediate sized ships should be superior to both a swarm of small ships and a single Dreadnought.
  3. We argued discussed at length how various ship capabilities should affect the balance point. The result is that player ship-building decisions are going to change the balance point, and building The Ultimate Fleet that beats all challengers is going to be quite difficult (perhaps nigh impossible).
  4. Squadron Strike has a detailed ship construction system that already has it's own checks and balances built in. I encouraged Ken not to penalize point costs for aspects that should already be self-balancing. For instance, I suggested that movement didn't need to be part of this point cost, because ships with more hull space devoted to maneuverability automatically have less space left for weapons and defenses. Making movement increase costs too much could penalize players for building maneuverable ships, and Ken wants plays to build maneuverable ships. (I think that's when Ken accused me of being a closet Republican.)
I think we ended up hammering out a good basis for Squadron Strike point values for scenario balance. It isn't the the last word in the mathematics of game balance. Squadron Strike is far too complex to be able to write out as any sort of "equation for victory", but then most games are far too complex to solve in that way. That very complexity is why game are fun, and why we play them. A point system doesn't have to be perfect. It is after all just another rule by which a game can be played. A lot of hard work went into making this rule, and I think it's going to be a good one.
GBR Giant Battling Robots Favicon

Lanchester's Game

I've been kicking ideas around about using Lanchester's Laws as a way to create a point-value system (1) for balancing sides in a game, and one of these involves designing a game around this mathematical principle. Usually point system seem to evolve after the game is created; I want to create the point system first, and build a game to fit the math. I'm not sure this is possible, but it should be interesting to try. So I set out to write out the rules for a simple game to demonstrate the difference between Lanchester's Linear, Square, and Logarithmic (see footnote 2) Laws, which I will abbreviate with L1, L2L0. This turned out to be a really good idea, because it gave me an insight about how these laws arise, and a simpler way to explain them.

[A note aside: I wrote most of this post two months ago, and it gave me many good ideas for other post in the process, but I never quite figured out how to finish this one. Now I need this basic discussion to go along with some new posts I'm working on, so I'm making a second effort to finish this one.]

The Game
This game is really very simple, actually more of a thought experiment that explains Lanchester's laws.


Map, Movement, and Range: There is no map, and so no movement, and no range. This is an abstract game, and attacking another unit depend on which Attack Rule is being played (see below). It would be a more interesting game with these elements, but they only complicate the discussion. Maybe I will try to add these back in for another post. (Also good discussion points.)


Forces: Two sides, Blue and Red, each side have a number of tokens (B or R tokens, respectively) or markers representing the strength of each force (These might represent soldiers, tanks, etc.). Each player should start with 20 to 30 tokens, but not necessarily the same number.

Lethality: an attack is resolved by rolling a die: success kills one enemy, remove that marker/token. Assume equal lethality for simplicity, or allow to be different for completeness. Each attack has a lethality, or probability of a kill equal to b for Blue and r for Red. Lethality does not have to be the same for each side, but it simplifies this discussion if it is. For a good demonstration this should be a fairly small probability, so that the game will last 10-20 turns. The following discussion will assume a lethality of b = r = 1/6, so a roll of 1 on 1d6 can be used to resolve this easily.

Attacks: Every turn each player makes one or more attacks. The number of attacks a player makes depends on the Attack Rule in play, and could depend on the current size of each force (B or R).

Sequence of play:
1) Set up the game, decide force sizes, lethality, and Attack Rule.
2) Begin turn: players make one or more attacks, as determined by the Attack Rule in play.
3) Resolve attacks for each player based on the size of their force at the beginning of the turn.
4) Remove destroyed forces.
5) If both played still have forces remaining, go back to step 2 and play another turn. Play continues until one side is eliminated.

Attack Rules:

L1: Each player makes one attack every turn. No matter what casualties occur over the course of the game, each player will have same same total number of attacks, and this number will be proportional to the small of the two forces. This is exactly what is expected under the Linear Law.

L2: Each player makes one attack for every 5 tokens they have remaining (round up or carry fractions o the next turn). Over the course of the game the total number of attacks will be larger for the player with the larger initial force. The ratio of total Blue attacks to Red attacks will be proportional to (B/R)^2 [the ratio B/R, quantity squared]. (It does not have to one attack for every 5 tokens, it only need be some small proportion of the current size of the force. 5 was just convenient).

L0: Each player makes one attack for every 5 (convenience again) of the other sides tokens. Here the number of attacks made against you is proportional to the size of your own force (see footnote 2 again). This seems like a strange rule, but war in unhealthy! Putting your army in the field makes if subject to direct and indirect threats. Starvation, disease, accidents, mules kicks, artillery and bombing, are all hazards that put the entire force at risk. Sometimes the more you bring, the more you lose.

Discussion:
Each of these "attack rules" will lead to distinctly different outcomes for the game. More importantly, a form of one or more of these rules is inherently present in all war games and combat simulations. Even if it is not written explicitly, but it will still arise from how the game plays.
Game combine these rules in interesting ways. For instance, terrain, stacking rules, and range limits will tend to restrict some units in a game to the L1 attack rule. Other units will have a clear field of fire to attack (and be attacked) will use the L2 rule. Some units might stay in relative safety and threaten the other force from afar (like artillery) and subject the other side to the L0 rule. A unit firing from a bunker might only be attacked under the L1 rule, may be able to attack other using the L2 rule. so it's not necessarily the same rule in effect for both sides.

I have read many papers trying to model data from historical battles as if there is a new rule that somehow combines two or more of these rules. From a certain standpoint that is the wrong approach. These rules might mix, affecting different parts of armies in different ways, but there is no rule that says you will always get the same sort of mixture every time. In fact, you will almost certainly get a little different mixture in every battle. Lanchester's laws are not something over which either side has total control - they are something that happen to you during the battle. In a close fight, the army that is better able to exploit the rules is more likely to win.


Footnotes:
(1) Such as BattleValue in Battletech, which is the one I know the best. Ogre/GEV has a very simple point system. Warhammer 20K+/-20K has a point system but I know nothing about it other than it exists. If you can suggest other games that use point systems please post or email me about it so I can look into this topic further.
(2) The "Logarithmic" law arose from attempts to fit actual data of battle casualties to either the Square or Linear law, and finding that sometimes neither one is a very good fit. I have avoided mentioning it thus far in order to simplify discussion. The interpretation of the Logarithmic Law implies that the casualties suffered by one force are proportional to the size of one own force (not the opposing force). This seems unusual, but is sometimes observed in historical data describing large scale battles. See Fricken (1997) for the an excellent discussion and justification for the Logarithmic law.
GBR Giant Battling Robots Favicon

12 December 2010

Granular Skill Checks, and Interpolation

I just read a discussion in the CBT forums (Thanks PiP!) about the "granularity" of skill rolls in Battletech. The basic problem is that skill level changes in the boardgame make a BIG difference in play, but if you are running A Time Of War (Battletech roleplaying) then you want may small changes so that characters can improve gradually in many small steps - as opposed to 3-steps to a Superman.

I'll keep this discussion about the Battletech RPG, but these comments should apply to any game where characters have skill levels that seem too granular. I originally posted this whole thing in the CBT forums, then UN-posted it because what I had was broken. Now it is fixed, but much longer, so I hope nobody minds that I'm linking back to myself.

One way of doing this would be to use a different random distribution for skill checks. The second editions of the Battletech roleplaying game (Mechwarrior) uses 2d6 rolls just like the boardgame, and all skill were very granular. The 3rd edition of the game made a switch to 2d10 "exploding" dice, which greatly reduced the granularity problem, but suffered because it was difficult to make meaningful improvement in character skills.

There are also various "house rules" for doing the same sort of thing, but these generally require changing other aspects of the game to balance out the change in probability distribution. For instance you might switch to a 2d10 or 4d6 to-hit roll. There is less granularity now, which is good for your RPG, but the game has changed! On this new scale a +1 or -2 modifier will have relatively less effect or results, potentially "breaking" the usual balance of the game. You might fix this by adjusting all these modifier, but you won't ever get the original balance back this way.

I have an alternate suggestion: Add a decimal point to the skill levels, and an extra 1d10 roll when rolling for a skill check. Differences between Battletech skill level are BIG changes, so the idea is to add steps in-between. For example, instead of Gunnery 5 and 4, some possible skill levels are 5.0, then 4,9, 4.8, 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1 and finally 4.0. Likewise any skill level, just adding a fractional skill level to it. There is a word for this - "Interpolation". We can interpolate between whole number skill levels, filling in with smaller changes in probability.

To use this, calculate the target number (TN) normally adding the skill level and any modifiers, and round the final number down. Make the usual 2d6 roll;
if this is less than the TN, you fail;
if this is more than the TN, you succeed;
if you roll exactly the target number, then you must also roll the 1d10, read it as 0-9, and this must be equal or greater than the decimal in your skill to succeed (if the decimal is "0" then this always succeeds, no need to roll).

Example: Suppose the base gunnery skill is 3.6, and after various modifiers the target number to-hit is 8.6, which rounds to 8. You roll 2d6 and ...
On a 9 or better you hit,
On a 7 or less you miss,
On exactly 8, you roll 1d10 (0-9), and if this is a 6,7,8, or 9 then you hit, otherwise you miss.

With TN=9 probability of success would be 0.278, and TN=8 it would be 0.417. The effect of the decimal in the skill level and the 1d10 die roll is to interpolate, or smooth out, between those two probabilities. The final probability of success for a TN of 8.6 is 0.333.

This gives 10 steps of skill improvement to every 1 in the regular rules, which ought to be fine-grained enough to satisfy the pickiest Game Master. In fact it may be too fine, and you might want to restrict it to just 5 steps (.0, .2, .4, .6, .8) or even 2 (.0, .5). Further, you will need to adjust the experience needed for fractional skill improvements accordingly. If it cost 100 experience points to improve Gunnery skill from 5 to 4, then it should cost about 10 to improve from 5.0 to 4.9. Most GM's love to tinker with this sort of thing anyway, so I'll leave the application in your capable hands (or fangs, tentacles, whatever).

Now the really good news - interpolating skills does not "break" any other parts of the game by changing the probability distribution the game is designed on, it just smooths it out, so a +1 or -2 modifier still has the same effect it always did. There is nothing special about using 2d6 with this either, so you might easily apply this to any RPG with granular skills.

Here is a chart with the probabilities of success on a 2d6 skill check. The way I have set this up makes it look a bit like a wavy staircase:
Probability of success on 2d6 with standard skills
You could walk up those steps! And the granularity is obvious. This chart has target number up to 13 because I need to show the probability go all the way down to zero for the next chart. Now a chart showing the same for interpolated "Skills with a decimal":
Probability of success with interpolated skills
Nice and smooth. If you look really hard you might notice this is actually 11 straight line segments joined together. This method of interpolation really just connects the dots between probabilities for whole number skill levels.

Now we have wiped out the granularity problem, but at the cost of some extra dice rolls. If you don't want to roll so many extra dice, you could make a single 1d10 interpolation roll (after fire declaration) and apply it to all skill checks results for that turn. This will be weirdly granular, because it is like changing your skill level randomly from turn to turn, but it will average out to the same effect over the course of many rolls.

GBR Giant Battling Robots Favicon

10 December 2010

Number Needed to Hit

In the comments on my previous post on Dice and Information, I mentioned a statistic called Number Needed to Treat (NNT). This is used in epidemiology and medical science as a way to compare the benefit and cost of two treatment. For example, this might be two different drugs that might be used to treat an illness. Here "benefit" means any beneficial effect, maybe something major like preventing fatal heart disease, or something minor like prevention of allergy symptoms. For this discussion I will assume it is a BIG benefit, like saving a life.

Benefit: Suppose that in a clinical trial running one year, 80% of patients on drug A benefit from the drug, and 82% of patients on drug B benefit equally. Now drug B is better by 2%, but what does that mean? If we treat 100 patient on each drug for one year, we expect 80 "benefactors" from Drug A and 82 benefactor from drug B, a difference of two patients saved every year for every 100 treated, or one saved for every 50 patients treated (for one year).

A shorter way to calculate this is NNT = 1/(0.82-0.80) 1/(0.02) = 50 patients "needed to treat" for one to benefit. Make sure to subtract the smaller probability from the larger, or you up with a negative number.


Cost: Now suppose that drug B costs $10,000 per year, compared to $1000 per year for drug A; Is drug B worth ten times the expense? NNT helps answer that question. Consider that treating 50 patients for one year (the NNT) would cost $250,000 on drug B and and $50,000 on drug A - a difference of $200,000 for one life saved each year. Now is drug B worth the cost? If the benefit is strong, like not dying, then it may be worthwhile. It certainly is if you are the 1-in-50 patient, but you can't know that is advance. Also, resources are limited. It is not good practice to make patients pay large expenses, or tie-up hospital resources, for treatments with very little benefit.

If anyone is wondering, this is not Obama-Care Death-Panel stuff, this is a serious sort of decision that determines what doctors call "Best Practice".

Well so far this has been pretty boring, but now we can take the idea behind NNT and turn it into a statistic for games. 

If we replace the probability a treatment will be effective with the probability of a successful "to-hit" roll, we get a measure of Number or rolls Needed to Hit (NNH). This is now the number of to-hit attempts you will need to make, with some higher probability of success, in order to hit one more target on average. In the sniper rifle example from the previous comments, the difference between 80% and 82% means one more hit out of every 50 shots fired. This 2% gain could be useful from the perspective of a first-person-shooter game, or even critical to ensure taking out an important target, but on a larger scale other things could matter more. For instance, if the more accurate rifle weighs more, or costs more, and this is reflected in game usage and costs, then 2% gain in accuracy might not be worthwhile.

GBR Giant Battling Robots Favicon

Dice and Information ... So What?

After I finished my previous post on Dice and Information I had the thought, "These are some pretty neat numbers, but So What? What's it good for?"

One way to look at information is as a measure of uncertainty in the game, or at least the uncertainty in the outcome of a single move that is part of a larger game (The information in an entire game, start to finish, is a matter for another day.). Consider the game of Chess, which has nothing random about it. There is no information at all in a chess move, your just make your move, perhaps taking another piece, and it always works. Suppose now we change Chess so that it requires an attack roll if you want to take another piece, with a 50% chance of success (put the piece back where it started if the attack fails). Now there is uncertainty with each move (1 bit of entropy) and the outcome of any move is far from certain. We might change this to 90% success, which works out to about 0.08 bits* (oops. Thanks Bradley!) about 0.47 bits* of entropy per attack. This means that any attack is nearly certain quite likely to succeed. If the chance of success is 10%, then the entropy is again 0.08 0.47 bits*, and the attack is nearly certain likely to fail.

So entropy is measuring uncertainty in the sense of the predictability of results, but NOT the predictably of  a preferred result, such as a successful attack roll.

* It might help to think of 10% or 90% success as the flip of an unbalanced coin. Information is maximized, and the result is most uncertain, when the coin is fair (50% success).


This post hasn't gone the direction I thought it would - I was thinking (incorrectly) I could describe Entropy as a measure of the uncertainty in the outcome, but this is rather different. Consider a player making three to-hit rolls in a game, at 90%, 50%, and 10% success. The first (90%) has just a little entropy (0.47 bits) and the outcome is quite likely. The player has a high degree of control, because the decision to attack is very likely to succeed. At 50% the entropy of this roll is maximized at 1 bit, and the player will be most uncertain of the result either way. At 10% entropy is again 0.47 bits, but the player is very likely NOT to succeed. Now the player has very little control, or very little influence on the outcome of the game (with this single roll).

Back to the drawing board? The paragraph above hits a few rough spots, because Entropy and player control out outcomes in a game are maybe two different things. This gives me something new to think about.

...

And before I can finish hammering the bugs out of this post, Ashley has her response up over at Paint-it-Pink. At risk of quoting Ashley out-of-context ...

Ashley: Now when one applies modifiers to a 2D6 roll, if one knows that it only encodes 3.27 bits, then a modifier of one is equivalent to one bit. If I'm correct then a modifier of three is equal to three bits of information, which has the effect of reducing surprise in the diced for result? Such modification of the base 2D6 roll is therefore highly significant, which seems to me to support my proposition about the modifiers for targeting computers and pulse lasers in the Battletech game being too coarse.
Not quite right, but Ashley's intuition is basically correct. We need to sort this out a bit. First, the modifiers she mentions are for a Battletech "To-Hit" roll with Hit-or-Miss outcomes, and this is the same situation as flipping an unbalance coin. As in my "battle chess" example above, modifying this roll doesn't necessarily decrease the information. Second, the 3.27 bits a for a 2d6 hit-location roll** is separate from the To-Hit roll. However, we might combine the To-Hit and Hit-Location rolls by considering a "miss" to be a no-location result and grouping it with actual location results.

** Irrelevant quibble: this is actually about 3.0, because there are multiple ways to roll "Arm" hits.

Here is a new table, similar to my earlier table where I calculated the Entropy of a 2d6 result, but now the possibility of a miss of a 2d6 roll of 7 or less.



Now suppose the To-Hit roll is more difficult. Ashley's intuition says the entropy ought to decrease. Here's another table with a "12" needed to-hit.


Sure enough, the entropy has decreased. Unlike the battle Chess example, here the Entropy of hit-location (including no-location) will usually decrease with more difficult to-hit rolls (it hits maximum entropy with a to-hit roll of 3+).

Lesson learned: When thinking about entropy, it is important to include all possible outcomes of the random result.

Somehow I think this topic is not done yet, but that is all I have time for today.

A small update (12/12/2010, 4 PM): I just made the following comment on Ashley's blog, and I'm copying it here so I might remember to come back to the idea later.
Now here is a brain bender - Suppose you could roll one set of dice to resolve a whole turn of Battletech play, or a whole game - How much information would be in that? I don't know myself, but I'll think on it. My intuition is a simpler game should have less total information than a complex one, but I'm not sure yet what it would mean to compare them.

07 December 2010

Dice and Information

There is a concept is statistics and the information sciences of information. Several concepts actually, as there are different types of information, but I want to focus specifically on Shannon information or Entropy. Entropy is a way of measuring the amount of variability or uncertainty in a probability distribution, and a simple way to illustrate this is with the example of a coin flip.

But first, a comment of notation, since the Blogger editor is not too equation friendly. Calculating entropy requires a logarithm function, usually denoted ln(x) or loge(x) for base-e or natural-log, and Shannon Information specifically uses a base-2 logarithm, which I denote here as log2(x). If  my equations are not clear, any mention of the log function (outside this paragraph) always means the base-2 logarithm. If you are following along with a calculator, you probably have a natrual-log button ln(x), but can calculate the base-2 log as log2(x) = ln(x)/ln(2).

Image source, and quite interesting in itself.
Assuming a fair coin with a 0.50 probability of heads or tails, then the first step is to calculate a quantity called the Self-information or "surprisal" of all events. This is a measure of how surprising a given event is relative to the other possible events in the distribution. This less likely the event, the higher the value of its surprisal.

Surprisal is equal to -log2(p), where p is the probability of a given outcome. Calculating ...
log2(.5) = -1, 
-(-1) = 1
... and the NOT so surprising result here is that heads and tails are equally surprising, with a value of 1 each.

Shannon Information is measured in "bits", the basic unit of information used in calculation by computers. To relate this to games it might help to think of one bit of information being equal to the amount of variability in the flip of a coin. Now that we have the surprisal, we can calculate the Entropy as the average or expected value of the surprisal over the entire distribution. This is p times the surprisal -log2(p) of each event, summed over all events. For this example the calculation is trivial; 0.5 times the surprisal of 1 (for heads) plus another 0.5 times a surprisal of 1 (for tails), is just 1, so a fair coin flip has 1 bit of entropy.

Here I have a table representing the information in discrete uniform distributions from 1 to N. In gaming terms this is the information in single N-sided dice, with each face of the die being equally likely as all others. I included all the values representing true polyhedral dice, and some additional values for comparison (most of these are powers of 2 or 10).
The second column p(x) gives the probability of each "face", the third the surprisal, and the forth the entropy.
Here we can see that a 2-sided die (a coin!) again has 1 bit of entropy, a 4-sided die (d4) has 2 bits, a d8 has 3 bits, and a hypothetical d16 has 4 bits, following powers of 2 as you might expect. I put in some extreme values just for fun - the final row, a one million-sided die, would have nearly 20 bits (or 20 coin-flips) of entropy.

As in the example of the fair coin, when all outcomes are equally likely, the surprisal and entropy are equal. This also maximizes the value of the entropy - meaning that if any result was more or less likely than another, the result cam only become more predictable, and the value of the entropy must be less, as will be seen in the next example.

For the second example I'm calculating the entropy of the sum of two six-sided dice. This table show the possible results from 2 to 12, the probability of each result (twice) as the odds-in-36 and a probability. Next (4th column) is the surprisal of each result, and unlike the uniform distributions this values varies with the probability of the outcome. A roll of 7 has a surprisal of 2.58 bits, and a roll of 12 (or 2) 5.17 bits; a 12 is the more surprising result, relatively speaking.
The final column is the surprisal multiplied by the probability, and these are summed to determine the Entropy at the bottom, which is 3.27.
In terms of information, a 2d6 roll is in-between the d9 and d10 rolls from the first table. This doesn't mean they are the same, but that they have a similar amount of variability.

For the third table I have calculated the entropy for some commonly used dice-rolls in games and listed them in order of increasing entropy. The 2d10- designates the difference of two ten-sided dice, as used for penetration damage in Squadron Strike.

Note the entropy of 4d6 is less than twice than of 2d6, and likewise 2d6 is not twice that 1d6. As numbers from single dice are summed, the distribution becomes less uniform, more like the bell curve of the normal distribution, is more predictable, and therefore has less entropy. If we were using two separate d6 rolls to generate a uniform random number between 1 and 36, we should expect the d36 entropy to be twice than of a d6, and it is; log2(1/36) = 5.17. We also see this with the entropy of d100 being twice that of d10.

What strikes me from this is rolls of 1d6, 3d6, and everything in-between, vary by only about 1 coin-flip of entropy, so maybe the many variations of dice used in games really don't make so much difference in terms of the variability of play.

A final note: Just because there might be more information in some combinations of dice does not mean the game takes full advantage of that variability. For instance if you are making a to-hit roll with some probability of success (hit or miss), then there is at most 1 bit of information in that result no matter what kind of dice you roll it with. There are only a full 6.64 bit of information in a d100 roll if there are 100 unique outcomes.

More:
Dice and Information, So What?
More Dice, More Information ...
GBR Giant Battling Robots Favicon

03 December 2010

Blue versus Gray, or maybe Federation versus Rebels?

"Mr. Business" left me a good question on my last post about Gratuitous Space Battles, and it deserves a good answer.
N.B. writes: As an alternative, what about special anti-fighter weapons? Perhaps a frigate type ship that can act as picket against fighter waves. Specialized weapons can overcome numbers in many cases.
And
Like American Civil War. 100 Grays with rifles vs 3 Blues with a Gatling gun. On the open fields of a typical A.C.W. battlefield, your 3 Blues are going to win.
To the first part about specialized weapons, GSB lets you do just that. There are anti-fighter missiles and tractor beams to help shoot down those pesky little space-piranhas. Of course, big ships can carry heavy armor that is nearly impenetrable to fighter weapons, so it helps to have a few big ships with big guns to soften up those hard targets. Real battles are complicated, with many factors influencing the outcome. Lanchester's Laws are a simplification down to the bare basics of the number of men and how effective the are at killing the other guys. This demonstrates a principle of warfare; the advantage of superior numbers and why it exists, but it doesn't begin to cover all the possibilities that real situations allow.

The second part though - the Civil War example - is something that can be described nicely by Lanchester's Law (squared law). I'll change the number just a bit for my convenience though.

Suppose we start off with equal sides: 100 Blue and 100 Gray soldiers, each side equivalently armed with Rifle Muskets, and each able to shoot freely at any soldier on the other side. These sides should be approximately equal, with 100 soldiers on one side going to receive about as many casualties as they deal out to the other.
A game-like example will be useful: If we set this up as a game played in rounds, and give each soldier a 2% change of killing one of the other soldiers each round (completely arbitrary, just bear with me), then each side will lose about 2 soldiers each round (at the start) and the winner is probably just a matter of chance.

Now lets change it up - lets give the Blues Gattling guns (or maybe Uzi's?), and lets say that these BIG guns inflict casualties on the other sider 25 times faster that the old muskets of the Gray's. Now the Blue team is 25 time more effective, and therefore 100 Blues should now be equal to 25 times 100 equals 2500 Gray soldiers. Right?

Nope, 'fraid not, at least not according to Lanchester. The Squared law tells us that the advantage of greater number is proportional to the square of the ratio of the number of soldiers on each side. The Gray's can balance the Blue advantage with just 500 soldiers, not 2500, because a 500-to-100 is a ratio of 5, and 5 squared is 25. The reason behind this is that ever time Blue suffers a single casualty, they lose a greater portion of their total firepower.

Back to my game-like example: If each Blue soldier now has a 50% chance of killing a Gray soldier each round, and the Grays are still at 2% but there are now 500 of them, then there should be about 50 Gray and 10 Blue casualties in the first round. Now the ratio is 450 to 90, still 5-to-1, and the sides are still balanced. Under the differential equations of Lanchester's Laws, these to forces will grind each other down always at this 5-to-1 ratio until both sides are dead.

Now if this game has any bit of randomness, or as in reality things are not always equal, that ratio will not stay at 5-to-1 for very long. Before many rounds of fire are exchanged one side will gain a slight advantage, and that advantage will expand in to a victory without killing all the soldiers on both sides. If Gray bring 600 soldiers instead of 500 they should win this game every time, and this still isn't half way to 2500.

We could play this game differently too. Instead of giving Gray more soliers we can take away some of the Blues. With their BIG guns, just 4 Blues should be equal to 100 Grays. Now the difference in the casualty ratio really shows, because after just one round Blue will have 2 soldiers left, and Gray will still have 98. 20 Blue to 100 Gray should be about even (but don't hold me to that, because I make mistake when I'm tired and do math in my head).

That said, I haven't really done justice to N.B.'s Civil war example. There probably were Civil War examples of 100 Confederates charging a Union Gattling gun and getting torn to peices. As I said before, it's complicated! I'm no student of Civil war history, but I know it was a time of changing technology and tactics. A few decades earllier and 200 musket-wielding Grays charging straight at 100 similarly armed Blues was probably a winning tactic, but 200 Grays charging 100 Blues - who by-the-way have a few of Mr. Gattling's latest inventions - I think that might not work out so well for the Grays.
GBR Giant Battling Robots Favicon

29 November 2010

Gratuitous Space Battles

This is actually part 3 of my series on Lanchester's Laws, sort of. Since writing parts 1 and 2 have been reconsidering the whole topic, and I seem to have a number of ideas that branch off of this topic but one doesn't necessarily follow another. Therefore I've decided to worry a little less about how this all fits together, and just write something and get it posted. The figuring out can come later.
That said, it time for something I've been putting off for far too long ...

... which is a game called Gratuitous Space Battles. GSB is my first computer game purchase in several years, and I consider it money well spent. Let's start with a video of the action!



This operates a little differently from most space battle games; this is a Tower Defense game. If a game is a series of interesting decisions, then all the decisions in this game come at the beginning. First you design ships, choose your fleet, give then orders, and click on START. Then you sit back and WATCH the battle unfold. If you lose the battle, you go back and try a different set-up. if you WIN the battle, you can go back and try to win with few resources. The replay value of this game is very high.

Gratuitous Space Battles has been called "massively single player", because you can submit and download scenario challenges from other players in the online GSB community. I haven't done much of this yet, but my experience so far has been very positive, with other players happily responding to my challenges, politely pounding me to newbie-snot, and offering tips on how I might do better. This offers the sort of difficulty level you can only get from human players, even though you aren't playing online, or even simultaneously.
GSB has a downloadable Demo that I would like you to try. This isn't just because I think it is a cool game; which it is, but I have something specific in mind. GSB is a perfect way to demonstrate Lanchester's Square Law in action. If you want to give this a try, download the demo and play a few rounds to get the idea how it works. Once you have that under you belt, try the following setup:

Create a fleet with as many fighters as you can manage, and tune it until it wins consistently. Next, start removing fighters a few at time until your fleet no longer wins easily. Lanchester's Square Law predicts that the casualties you will inflict are proportional to the square of the ratio of friendly/enemy units. With a bit of experimentation you should be able to find the balance point - the point where your fleet doesn't always win, but the addition or subtraction of just a few fighters changes the balance drastically. Try to find the point where adding 2-3 fighter practically guarantees a win, but subtracting 2-3 fighters is a sure loss. In GSB, fighters are as close to single soldiers as you can get, and it is interesting to find that balance point where "just a few men" can completely turn the tide of the battle.

Some hints if you want them, in white text in case you prefer to figure things out for yourself. Select the text below to view:
[hidden text]
Choose a few cruisers with 2-3 Plasma Launchers, and a few shorter range weapons.
One cruiser should have a Fighter Support Bay, and order your fighters to be "Cautious" so they will will return to the bay for repairs.
Faster, lightly-armed fighters attacking at minimum range (inside cruiser shields) are much more effective than slow, heavily armed fighters.
Give your fighters orders for "Cooperative", "Vulture", and "Stick Together". You should also order them to "Escort" one of your cruisers (at range 600) so they do not wander too far from the rest of your fleet.

[/hidden text]


OK, now for just a tiny bit of mathematical consideration. Suppose we take the source code for GSB and simplify it - stripping out everything that makes it look like a game, removing all options except for how many ship there are and the firepower of each ship, removing movement (assuming every ship can fire at any other), leaving just the input of forces at the beginning and a report of the battle outcome. What we have left is a basic attrition model; a simple program that conducts a simulated "battle", even though we don't get to watch the progress of that battle any more. With all the simplifications it is barely resemble a game, but it become a very effective tool for studying the effect small changes in force selection (or force orders) can have on the outcome of a battle. Consider putting this tool inside of a computer program and run through hundred, thousands, or even millions of scenarios, each with slightly different starting conditions, then look at which starting conditions lead to success or failure.

Just like my suggested example above, tinkering with the number of fighters to find a balance point, you might tinker with the behavior of forces. You can examine things like the effect of the priority in which enemy units are attacked, maybe add ammunition considerations, command and control, whatever you like. The point is, there can be value in studying very basic considerations in a model that has been stripped of all but the most basic structure. It's true that the effect of something complex (like command and control) probably depends on any number of other factors, but if you don't understand how something works in a simple model, then it is unlikely you can understand how it works in a more complex model.


I'm a big fan of simplifying thing down to base elements, and trying to understand them from the bottom up. Gratuitous Space Battles, even in demo form, is a good tools for studying Lanchester's Laws. It's not an ideal tool for such - that would require your own program - but it is very accessible to anyone with an interest in the topics, and it's a heap of fun too.  I give GSB a four-robot rating :-)
GBR Giant Battling Robots FaviconGBR Giant Battling Robots FaviconGBR Giant Battling Robots FaviconGBR Giant Battling Robots Favicon

Over at the developer's blog, you can read about The Fighter Spam Issue he is having with the GSB campaign game. Essentially, by taking advantage of Lanchester's Squared Law, it becomes fairly simple to construct a fighter-heavy fleet that is nearly unbeatable. Balancing the game requires in this situation require putting some limits on the usefulness or availability of fighters.

Credits: Some of the images here are taken from the GSB developer's site, or the GSB Facebook page, and the rest are screenshot I created.

A question in the comments below inspired this response and example, and this related post.
GBR Giant Battling Robots Favicon

28 November 2010

Wet Palette

I've been working on finishing up an Arctic Wolf mini. I took this picture of it (on the right) for a post back in September, and I've been using it to "brush up" my technique, since I'm a bit out of practice. This is not amazing.
I wasn't happy with the browns, so I broke out those colors again and got back to work on it. This also, is not amazing.



Here's a close-up. I started reworking this back in September, but took a long break because I've been busy. The Thanksgiving holiday has given me more free time, and since last week I've been painting again in what time I could manage in the evenings. Some progress has been made, but still not happy with it. And still not amazing.

A picture from few days later; I've got a better blend and a start at highlighting. I'm still working at the browns, and this work has been spread out in short spurts over 3-4 days.

But not amazing.







Since this work has been spread out over time, I've been storing my paints in my new wet palette I bought back in September. The paints in the round well-palette are the same batch that I started this work with back in September. That was about two-and-a-half months ago.

 AND THIS IS AMAZING


I don't get many long stretches of painting time these days, and being able to store my paints open and wet is incredibly useful. I also like to blend my colors, and even the blending spots I make outside of the wells are staying wet.

AMAZING!


To be fair, I haven't exactly left these paints unattended for over two months. Every few weeks I've opened them up and stirred-in a little airbrush medium to keep them wet. I also dosed the palette sponge with rubbing alcohol to help keep the paint from curing. The pigments do settle, and the airbrush medium I added made them very thin. I had to stir them throughly, and I added a little regular acrylic blending medium to get them back to a good consistency. I always work with thin paints anyway, so this didn't me a bit, but if you are used to working with paint straight out of the bottle this might not be to your liking.

This wet palette far exceeds my expectations for what it could do, and will change the way I paint. Now I should be able to pick up the previous colors I've been working without having to spend time remixing and getting the consistency to how I like it.


Bonus Pic: If you recall my little adventure with the pink paint, my might be amused to learn there is still a spot of pink on my living room furniture.

Happy Painting!
GBR Giant Battling Robots Favicon

18 November 2010

Sword and Dragon Mission Matrix

Our local Battletech group has been playing through Starterbook: Sword and Dragon, and we are having a lot of fun doing it. Peter, my cohort in planning for team Fox's Teeth came up with this state diagram as a way to follow the possible mission tracks, to help us plan in advance:


Nifty, but very difficult to follow as many of the arrows are on top of one another. This put the idea in my head to redo it in matrix form. This entailed repeating most of the work Peter had already done, but in the process I gained a much better understanding of how the Warchest Point system works. I'd never paid much attention to this before, so it was worth the effort:


The left-hand side lists the possible current missions, along with prerequisites and Warchest Points (WP), number of 'Mechs in the scenario, and WP rewards for a successful mission. If you follow the row for the current mission over to the right-hand side you can see what missions are available following the current mission. There is a "1" in the cell if that mission can be played next, and blank otherwise. I also added color codes for missions that are only available to either Fox's Teeth or Sorenson's Sabres. This has been corrected for the published errata too, so if you are looking for the mysterious Probe or Holding Action missions, they have gone away. You can download this in spreadsheet format:

Download as Google Docs spreadsheet.
Download as Excel 2003 spreadsheet.
Download as Excel 2007 spreadsheet.

The Creative Commons license I apply to this blog obviously can not apply material derived from this Catalyst Game Labs product. However, I would appreciate being credited as author if you pass this on. The Mission Matrix form is an idea I will develop for my own purposes. Send any suggestions or comments along too, and I'll see about working them in.

I should probably blog about the play sessions too, because there is a lot going on there. Not tonight tho, it's late!
GBR Giant Battling Robots Favicon