Showing posts with label Games. Show all posts
Showing posts with label Games. Show all posts

25 July 2011

Taking a RISK - the distribution of armies lost

I came across the following question at boardgames.stackexchange.com:
How can I estimate my chances to win a Risk battle?
Elliot Avedon Virtual Museum of Games, Courtesy Canadian Museum of Civilization.
Now there is already plenty of material on the web about probability in the popular boardgame RISK*, but maybe I can add just a little bit more.

Most people already know that, given the choice, the Attacker should always 3 dice and the Defender should always roll 2, since this always gives the best results (a Nash equilibrium). Since it's always the Attackers choice to roll an attack or not, the relevant question seem to be "How many armies [X] will the Attacker lose if they make [N] attack rolls?"




Using some probabilities from a RISK FAQ for the probabilities of losses, I calculated the average attacker losses (about 0.921 per roll) and standard deviation (~0.81). It's not possible to lose 0.9 armies in RISK! as the attacker losses vary between 0, 1, and 2 per roll. However, as the results of many attack rolls are added up, the losses will begin to resemble the normal distribution. We can plug the average and standard deviation into a normal approximation formula, and get back a probability for losses in a fairly simple calculation. For a given number of attack rolls "A" and number of attacking armies lost "K",
Z = (K - 0.921*A) / (0.811*sqrt(K))
where Z is a standard normal variable (mean 0, standard deviation 1), and the probability of K-or-fewer losses in A attack rolls can be evaluated with the standard normal probability CDF function, otherwise known as the NORMSDIST(Z) function in Excel. That's pretty much it, except maybe for some graphs to show off the results.


Cumulative probability of K attacking armies lost in 25 attack rolls

The blue line shows the cumulative probability of K losses in A attack rolls (vertical red line). The yellow triangles show an approximate 50% confidence interval, meaning that your actual losses should be within this range 50% of the time. The red diamonds show a 90% interval for the same. These intervals are actually slightly wider than the stated 50%/90%; because I rounded outwards to the nearest whole number of armies, and there is no other good way to do it.

Cumulative probability of K attacking armies lost in 35 attack rolls

Recall this is an approximation, and it depends on there being lots of independent random events (dice rolls!) for the approximation to work well. It should start to work very well somewhere between 20-30 attack rolls, and depending on how fussy you are may give usefully accurate results for as few as 10-15 rolls. For smaller battles, or deciding whether or not you should attack just one more time, you might consider more accurate methods (look here, for starters).

Cumulative probability of K attacking armies lost in 70 attack rolls

You can think of this in terms of Defender losses too. Two armies are lost with every attack (between the attacker and defender), so if there are A attack rolls and K attacking armies are lost, that means the defender will be losing 2*A - K armies. For instance, in 25 attack rolls a total of 50 armies are lost; the probability of the attacker losing 20 armies the same as the probability of the defender losing 30.

Cumulative probability of K attacking armies lost in 50 attack rolls

Nostalgic Tangent: Calculating the probabilities of losses for the attacker and defender was one of my first mathematical efforts to figure out a game. I didn't know how to do the calculation, but I wrote a program on my Apple II+ to roll lots of electronic dice for me, and calculated the probabilities that way. Later I learned that this technique is called Monte Carlo simulation, and statisticians do this regularly to examine the properties of new statistical methods.

*** There WILL BE a link to the spreadsheet for these calculations, but it's getting late, so I'll have to add that in tomorrow. ***


Having written this, I realized that I haven't quite answered the question. I've given the probability for a given number of attacks/losses, but the question is "How many armies will it cost me to win?"

There is another approximation to answer that, but it's much less well known. I guess I'll have to write a part 2. Stay tuned!

---------------------------------------------------------------------------------
* RISK is a registered trademark of HASBRO, Inc., of course.

Footnote: The RISK! game images used in this post are from Elliott Avedon's Virtual Game Museum, and are used with permission of the Canadian Museum of Civilization. The Virtual Game Museum has much more interesting game related information, and I may be posting about it again.

04 April 2011

Fletcher Pratt's Naval Wargame

John Curry, editor of the History of Wargaming Project, has a new book out:


I first wrote about Fletcher Pratt's Naval Wargame almost two years ago in The Origin of Battletech. At the time a new edition of the book was still in the works, so I waited to get it. This edition includes some previously unpublished material from some of Pratt's original players and umpires.

My copy is on order, and I'm looking forward to seeing it soon. Maybe I will organize a local play session? 

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

15 October 2010

10 Games To Be Forgotten

image source
As a follow-up on my contribution to the 15 Games That Will Always Stick With Me meme, my better half suggested "10 Games I Would Rather Forget" as a follow up. The rules are a simple modification of the previous ones:
The rules: Don't take too long to think about it. List 10 games you've played that somehow didn't click with you. These might good games, but something about them wasn't fun, a game that just didn't reach its best potential, or even a bad experience with a game you really like. List the first 10 you can recall in no more than ten minutes. Pass the meme along if you can, and link back so other can follow the responses (or just post them here).

To be clear, I intend to include games I like and play,


  1. Striker (GDW) - Miniatures rules for Traveller, with a detailed construction system that let you create you own soldiers, weapons, armored vehicles and aircraft in the full range of Traveller tech levels. VERY COOL. The down side is that it came with no very little in the way of pre-designed soldiers, weapons, armored vehicles, or aircraft, so if you wanted to play you had to create all of these things for yourself. This meant hours of paperwork and hand-calculations (this was 1981) to create the gun you wanted to mount in a fast scout tank, only to find out that it was too heavy and you have to redesign the gun or redesign the tank. Very frustrating. File this under "Too far ahead of it's time."
  2. D&D - Yes, this was on my "Stick With Me" list too, but this time I am specifically referring to persons or player groups that were just unbearable. My example is a Dungeon Master who only wanted to feed his own ego, and letting him be in charge of running the game was just a bad idea. File this under "Bad Experience."
  3. Mechwarrior 3 - The Lifepaths character creation system from this RPG is practically a game in itself, and is perhaps it's best aspect. Character creation can also be tortuously complex, so it's also a bad aspect. After all this work, you either end up with a character that is mediocre at everything, OR, if you work extra hard to twist things to turn out a certain way, you could actually have a really good skill level in one area. None of this matters much, because the 2D10 exploding dice skills system tends to minimize the importance of skills anyway. File this under "Why did I bother?"
  4. Life - Sort of a personal thing, but I got "fired" in the game shortly after losing a real job, and it stung. File this under "Well, that sucked."
  5. Trivial Pursuit - Fun once in a while, but the amusement quickly fades. There's little worse than being stuck in a group of people who are keen to play "just one more round" after you have already played 2 or 3 games. File this under "Enough Already."
  6. Battletech Total War - Battletech is another game from my "Stick With" list, and the single game I have played more than any other. - BUT - The were some rules changes in the new Total War edition of Battletech that never should have been. The Battlemech will always own this game, but in older editions it was possible to play armored vehicles (tanks!) and have fun challenging the new kings of battle. Under the Total War rules, already weak vehicles were totally emasculated by critical hits and motive hits. In a typical game, your vehicle is quickly immobilized, and then it explodes. If you are lucky enough not to explode, then you can enjoy playing a pillbox for as long as you can (but usually not long). The critical and motive hits rules are a good addition to the game - they add interest - but they are unbalanced. This has sort of ruined vehicles as being interesting and fun, where they used to be a good feature of the game. (Don't ask me what I think about WiGE's.) Mea Cupla: You will find my name among the playtesters for this book; I complained then, but now I wish I had complained louder. File this under "I'm going to catch some heat for this."
  7. Diablo - I enjoyed playing Diablo, until I tried playing it online. I thought I knew what "bad behavior" in online gaming was, until I tried playing it online. If the transcendence of WoW is any indication, some of those issues with early online communities have been worked out. I sure hope so. File this under "Does not play well with others."
  8. Zynga games - 'Nuff said (but I'm lookin' at you, Facebook.). File this under "Exploitation of privacy."
  9. The Lottery (most any lottery will do) - Otherwise known as a tax on people that can't do math. File this under "Tax the poor."
  10. Dawn Patrol (TSR) - I like air combat games, or at least I think I do, because I own a small  fleet of them. I don't own Dawn Patrol, but it illustrates a serious flaw. I expect an air combat game to be about crafty maneuvers and outwitting your opponent in an aerial duel. In Dawn Patrol the planes are generally mobile enough to get a good shot at whomever may have moved before them, and moving first is a death sentence. There is no strategy, no outwitting your opponent, just luck in who happens to move first or last. Interestingly, this same thing often occurs in Batteltech, with 'Mechs forming a "conga line of death". The outcome in these situations is much more uncertain in Battletech, and the player generally has a chance to either escape or go down fighting. File this under "Barely Interesting."

That's my 10, pass it on and link back (please). Or not.

06 October 2010

15 Games That Will Always Stick With Me, Too

I picked up this meme from D20 Sapphire's post at 20 Sided Woman:
The rules: Don't take too long to think about it. 15 games you've played that will always stick with you. List the first 15 you can recall in no more than fifteen minutes. Tag fifteen friends, including me, because I'm interested in seeing what games my friends choose.
You can probably tell this originated from Facebook, but like my friend Sapphire I'm going to skip the tagging part and link back to her instead. When I started my list I thought I would have trouble coming up with 15 games, but within 5 minute I was already trying to decide which ones to leave out. SO many choices! At risk of over-thinking the question, I have split this into two parts: board games/RPG's and computer/console game (of any sort), and Honorable Mentions are included along the way. Each will be roughly in chronological order, starting with the board games:
  1. Risk (Parker Brothers) - I would go to slumber-parties with my friends and play Risk and Monopoly for 12 hours straight, fall asleep, then wake up and play for another 12 hours. We never got tired of playing (but we did eventually get tired). Honorable mention: Monopoly.
  2. Dungeons & Dragons (TSR) - Starting from the blue box, I played all I could when I was a young teenager.
  3. Ogre/GEV - Originally published by Metagaming, and Steve Jackson's first published game. This was my introduction to the "map, chits, and dice" wargame. Honorable mention: Warpwar, also by Metagaming.
  4. Air War (SPI) - I'm skipping a bunch of other games to list this one. I played many combat/battle board games, but Air War was sort of the apex of these games for me. Air War is quite complex, and as much a simulation as it is a game. Honorable Mention: Armor (Avalon Hill?), a great tank combat game.
  5. Traveller (then GDW) - Science Fiction role-playing. I played quite a bit, but it wasn't until I hooked up with a college gaming group that it really started to shine for me.
  6. Champions (Hero Games) - Another game I found in college, and with the same game master, my friend Pat (who also GM'd Traveller). Honorable mention: The Fantasy Trip (Metagaming) - Another game by Steve Jackson. This was an a very simple RPG based on the Microgames Melee and Wizard, and the basis of the two best fantasy RPG campaigns I ever played (One GM'ed by Pat, again!).
  7. Battetech (then FASA, now Catalyst) - Fastforward about 10 years - graduation, job, grad school, job-hunting, marriage - where I didn't play board games at all. I did play some computer game version of Battletech, Solaris 3025 (online) and Mechwarrior 2, and I bought a rulebook so I could understand the computer versions better. I wan't until I took a job in Milwaukee, started going to GENCON (when it was still here), and fell-in with a group of die-hard Battletech players that I really learned to love the board game. Maybe more importantly, Battletech re-awakened my love of painting miniatures, something I still enjoy just as much as playing.
  8. Squadron Strike (Ad Astra Games) - 3D science fiction space combat, and I get to help the author with some of the mathematical aspect of the game too - something I ought to be writing about!
And now the computer games, which I hate: 

  1. Asteroids (arcade) - I plunked a lot of quarters into arcade video games, and this is the game that started it. Gamers much younger than me won't recall a time when video and computer games didn't exist, but I do. I'd like to think that all of today's gamers would still be gamers even if there were not any electronic involved at all, but for many kids today, computer and console games are all there is (which is sad). Honorable mention: Donkey Kong.
  2. Hack/Rogue - This amazing little dungeon crawl game was being passed around among the computer science students when I was in college, and I found it incredibly addicting - and still do. I have a version on my Palm Pilot now, and still play it from time to time. Honorable mention: Empire.
  3. Harpoon - A computer version of Larry Bond's miniatures game, and a great naval warfare simulation. Honorable mention: 688 Attack Sub and Sea Wolf - Two submarine simulations that I spent a lot of time with. These games typically have long intervals of increasing tension as you hunt your target (or vice-versa), punctuated by a few minute of heart-and-keyboard-pounding excitement when the torpedoes start to run.
  4. Master of Magic - Sort of a cross between Civilization and Magic, the Gathering. This game offered many different choices during setup that allowed for variety and interesting play.
  5. MUME (Multi Users in Middle Earth (MUD) - A text-based "dungeon" adventure devoted to re-creating Middle Earth. This was my first experience in online gaming, and a terrible this to discover during graduate school, because it threatened to suck-up my every waking moment. I was never able to get a fast connection though, and this generally resulted in BAD things happening to my characters when this started getting tough, so I finally wised-up and focused on studying instead. I still log in every few years to see if there are still any of the old players still playing there (and there are). Honorable mention: Doom + Quake - Two games I refused of purchase because they definitely would have made me flunk out of grad school.
  6. Starcraft - I've got to have an RTS in here somewhere, don't I? 
  7. Gran Turismo 2 (Playstation) - The only console game I'm listing here, because it's the only console game I've spent much time with. Even then, I had to get up early on Saturday mornings to run the longer races (100 laps) before my son want the PS2 for himself. This isn't so much a game as it is a driving simulator, and it's as close as I'll ever get to driving a real performance car too. I have the newer editions of the game too, but they don't have the same memories.  Honorable mention: Netrek - Another online multi-player game, one if the first of its kind, and a whole lot of fun. This got demoted to "mention" status because I haven't actually played it all that much.
That's my 15 games I'll always remember, but I already know what number 16 will be:

Honorable mention: Gratuitous Space Battles - My first computer game purchase in a long time, and I am really loving it. Look for a proper review on these pages sometime soon.
GBR Giant Battling Robots Favicon

04 October 2010

Battletech 4th Edition

I made a good find yesterday at Half-Price Books: The Battletech 4th Edition boxed set.


The box itself was a bit beaten up, and I already own a beaten-up 4th edition box minus the original contents.



One quick peek inside the box was enough to show me at the original rulebook was still there. That, and a very distinctive lump metal, shown just to the right. I still wasn't sure the $25 price was worth it, even for an out-of-print Atlas miniature, but what the heck.



Later, out in the parking lot, I broke the box open again to show my wife the Atlas, and found the Zeus mini too. THAT'S when I was sure I'd made a good buy.





The rest is icing on the cake. The box may have had some wear and tear, but all the components appear to be in perfect condition.



There is also a set of stickers (above, on the left) with the Inner Sphere House insignia that I didn't expect. (Also a nice Power Rangers pencil.)


This is my second stroke of luck with used FASA games. Needless to say, I am quite pleased.
GBR Giant Battling Robots Favicon

29 August 2010

Avalon Hill founder Charles Roberts passes away

Charles S. Roberts, Train line expert and founder of Avalon Hill games, died on August 20th. He is more well known for his writing about railroads than for his games, but the games are what I know.
In 1958, he founded Avalon Hill Co., a Baltimore game publishing company that specialized in war and other mental combat games such as "D-Day," "Stalingrad," "Battle of the Bulge," "Gettysburg" and "Victory in the Pacific."


See the full article at the Baltimore Sun:

[Big Hat-Tip to Brant at Grog News]

Update: Christian has a much better article on Charles Roberts at Cinerati.
GBR Giant Battling Robots Favicon

02 June 2010

The Pods Are Back!

The PODS are coming back to Origins and GenCon.


Nickolas 'PropWash' Smith
writes:


MechJock.Com (not to be confused with our friends at MechCorps.com) will once again be bringing 12 of its Virtual World Entertainment, Tesla II BattleTech: Firestorm cockpits to both Origins and GenCon. 
This will be our 4th (or 5th?) appearance at GenCon, and our 2nd at Origins. 
Here is the latest release for Origins at BattleTech.Com 
http://battletech.catalystgamelabs.com/2010/05/27/mech-forces-gathering-origins/ 
Hope to see you there.

Want to rule the pods? Brush up or get a head start on your skills; Check this post from last year for a link to the Online Training Manual.


GBR Giant Battling Robots Favicon

16 May 2010

Orbiter - Space Flight Simulator

This looks cool ...


ORBITER is a free flight simulator that goes beyond the confines of Earth's atmosphere. Launch the Space Shuttle from Kennedy Space Center to deploy a satellite, rendezvous with the International Space Station or take the futuristic Delta-glider for a tour through the solar system - the choice is yours.





This is a simulator firmly based in physic and and reality, but a few bits of Sci-Fi sneak in.


Now all I need is TIME for another diversion! :-)

My old friend Matt brought this simulator to my attention when he posted pictures from it on Facebook. Matt and I used to spend a lot of time in a different sort of spacecraft simulation. ;-)


[Tip-O-The-Hat to my Old Buddy Matt!]









Matt adds (via Facebook):
"Happy to introduce another to it.  If you haven't found www.orbithangar.com, that's the best all-around repository for the stuff you'll need (there are lots of private stashes, too).  Great memories on that Asteroids clip! :D"

Yeah ... good times ... and a LOT of quarters! ;-)

GBR Giant Battling Robots Favicon

30 April 2010

Games That Teach Math

Terence Tao - one of the premier mathematicians in the world - has a post up asking for Suggestions for Games that Promote Mathematical Thinking. The suggestions are pouring in, including a few of my own. If you are an educator looking for resources, you will likely find something interesting. Click thru to What's New - Terence Tao's blog.
GBR Giant Battling Robots Favicon

23 October 2009

Games and Reality are Probably Different, Part 4

In the previous posts in this series (1 2 3) I have been describing the probability distributions generated by dice and trying to describe why that doesn't quite match what we experience in reality. Not all games have dice though; some games use physics to simulate the real world, and the only random element might be the actions of the player themselves. Do these games suffer the same problem? - I think they do - but first, I need to tell you about my favorite TV show.

My favorite TV show - Top Gear on BBC television - is a mix of fast cars, testosterone, and the best of British absurdest humor humour. The show is co-hosted by Jeremy Clarkson, BBC television host and professional overgrown child. I can call him that because I am horribly jealous of his job, which seems to consist entirely of driving fast cars and making snarky comments. Here is his mini biography:
Jeremy has often been described as 'the most influential man in motoring journalism', mainly by himself. Estimates suggest that he is slightly over nine feet tall, owns 14,000 pairs of jeans and has destroyed almost 4.2 million tyres in his lifetime. He is best known for possessing a right foot apparently consisting of some sort of lead-based substance, for creating some of the most tortured similes ever committed to television, and for leaving the world's longest pauses between two parts... of the same sentence. He has never taken public transport.
In a recent (recent to me) segment of the show Jeremy takes on "The Corkscrew" at Laguna Seca, perhaps the most difficult corner of any race track in the world. First Jeremy first practices with Gran Turismo 4 to get a good track time, and then tries the same track in real life. (What is there about his job not to be jealous of?) See how well he does:




[The video is broken, but try one of these links:
http://videosift.com/video/Top-Gear-Real-life-racing-vs-Gran-Turismo
http://en.wikipedia.org/wiki/Mazda_Raceway_Laguna_Seca#Automotive
http://www.streetfire.net/video/top-gear-nsx-laguna-seca_208766.htm
http://www.kewego.com/video/iLyROoaft0ZG.html]

The Gran Turismo games are great simulations, but they miss some of the little things that make race driving harder. While there is no random dice rolling to this game or to driving a car (1), the limitations of human reactions add an element of uncertainty and randomness. Most of the time that random aspect is too small to notice, but when it comes to doing something really hard those little things start to matter. The Game is no longer a good representation of the Reality. One of the things Jeremy points out is that a game can't make you afraid of spinning off the track, and so fear adds another layer of difficulty in the real car.

That's OK, it's supposed to be a game. If every player had to learn all the skills of a real race driver it wouldn't be much fun. As pointed out in the comments to Part 1 of this series, games don't need to have a perfect representation to give players a challenging task and tough decisions to make.


Footnotes:
  1. If you want to get picky, then for practical purposes it's not possible to measure or simulate every last detail, and this error could well be described as "random".
Related Post: Physics of Racing, and Gran Turismo 2.
GBR Giant Battling Robots Favicon

05 October 2009

Farkle Probabilities

I've been playing Farkle on Facebook, so I started getting curious about the probabilities involved with the game. I'm not the only one doing this, as I've found several others doing much the same (1,2,3). You can also play Farkle at TADMAS. It took me a quite a bit of time tinkering with a spreadsheet until I understood how to think about this. I'm already up past my bedtime tonight, so I'm going to spare you the gory details and get right to the results. This post will focus on the number of dice you roll and the number of times you roll them. I haven't completely figured out the scoring distribution yet, so that may be a follow-up post.

The following table gives the probabilities for how many dice will remain after you remove all the dice which score points (but you might choose not to remove all). For instance, when you roll 6 dice, there is a 2.31% chance of not scoring at all, or a "Farkle" (marked in red), and 15.43% chance that you will be able to score exactly one die (a 1 or a 5). The percentages (marked in green) are the probabilities that all remaining dice can be scored, thus gaining a "new roll".



If you score one die and re-roll the remaining 5 dice, and there is (for example) a 30.86% chance that there will be 2 (three Sir) 3 dice left (and therefore the other two are 1's or 5's).
As you play, there is a choice to not score all of the dice. You might do this in hopes of getting a better throw on the next try, and you might use this table to consider the risk of choosing to re-roll 1's and 5's, instead of scoring them immediately.

That first table looked the the game from the "one roll at a time" perspective. The next table is a little more complicated because it "looks ahead" at what will happen if you score all the dice you can and keep rolling until you Farkle or get a new roll. Win/lose percentages marked in red and green are as before. Numbers in shaded gray are intermediate probabilities used in my calculations and have no simple interpretation.



These (red and green percentages) are conditional probabilities for what might happen. If you roll 6 dice, AND score one of those, AND roll the 5 remaining dice, there is a 1.19% chance of a Farkle.

My final table presents some some further conditional probability calculations, and gives the overall probabilities of either Farkle-ing or getting a new roll, if you score all possible dice and re-roll all that remain.


Starting with 6 dice, there is a 68.63% of Farkling before getting a new roll, assuming you choose not to "cash-in" your points first. If you want to think about the possibility of getting several re-rolls (thus scoring a large number of points), you can look at each group of 6 dice as a geometric series - a probability distribution which I have mentioned a few times before.

You can use these tables to inform yourself about the risk of Farkling as you play the game. This might help you understand the game, but by itself it probably won't help you achieve a high-score to beat all your friends. To do that will require an understanding of the relationship between the risk of losing your points versus the probability of achieving your target high-score. When I figure that out, I'll let you know.
[some revisions, 3/26/2011]
GBR Giant Battling Robots Favicon

03 September 2009

Itatsi: Part 2

My communication with the author of the game Itatsi.
Itatsi word game
Jim writes:
Thanks for the support. Itatsi is a work in progress. I'm still trying to figure out how to make it into an attractive game. So far only my duty bound family has said it is playable and interesting.

I got the idea while playing with Elsberry's Weasel page. I tried using words as the target instead of sentences. I discovered that words could be made in ten or twenty generations with a small population. From there it was just a matter of learning JavaScript and figuring out how to do the dynamic HTML. I've dabbled in these before, but never to this extent.

I had visions that Itatsi had commercial potential, so I hid the mutation engine and fitness scoring engine on the server side. ( I also needed a database to handle the fitness table.

The fitness table went through several generations. I'm told I'm using a hidden Markov model. I didn't know what that meant until I looked it up. The last math course I took was intro to statistics in 1970. I developed a frequency table for letter pairs and triplets. The Weasel children are scored for fitness base on a database lookup.

The fitness scoring was an afterthought. I originally intended to make a very difficult game in which the player would be completely on his own. This is still and option, but I doubt in many humans could have the skill and patience to go beyond five letters. So I decided to make a hinting engine.

[and my response]

Dan: Thanks for the reply. I did a bit of research (ie: playing) so I could understand it better. I discovered that I would often exhaust the un-scored words on for the current stem, and I by intentionally choosing a parent with a lower fitness I could quickly move to a parent that would allow me to score well again. In other words, I had to go down in fitness before I could move up; an interesting evolutionary strategy!

This certainly qualifies as "a series of interesting decisions", which is Sid Meier's definition of a game, and as such it is playable as-is. My wife played a lot of "Scrabbulous" before Hasbro sued to shut it down, and Itatsi has some similarities to that, though a very different game engine (I might be mistaking Scrabbulous for another game). The scoring system allows for a competitive goal, which is always good in a game. It would be nice if you could compare score with other players too.

It occurs to me that if different players could all start with the same random seed number, or if a single player could replay a game starting with the same seed, this would allow a common starting point for competition. Letting two players play with a common list of score words (one player can't score a word if the other player already got it) would add a different sort of competition.

I congratulate you on a clever idea, and I hope you might have some success in taking it commercial.

Jim Responds:
If you check the demo mode an set a game length of 100 or 500 and a long word length you may notice that the demo engine automatically chooses the second most fit child every fourth generation. You can see this by watching the fitness scores. I call this my extinction event. I find it gratifying that you found that strategy independently.

The yellow (or gold) highlighted child has the highest fitness score; the silver child the second highest. These hints can be turned on or off. As currently written, a player accumulates no score while hints are on. I have been thinking of having the program swap turns with the human player and compete for score. The program has the advantage in early rounds, but the program has the disadvantage of not knowing about scoreable words, and not knowing to avoid words that have already been scored. It does remarkably well anyway in demo mode -- something that I find relevant to the issue of irreducible complexity.

You might also find the variable word length demo interesting, if given 500 generations. The French language appears to have less distance between words, and 10 letter words appear quite often in demo mode. You can switch language in mid-game.

Dan again: And I did. I played the variable word length, and I found it quickly took me into longer strings than I could easily manage. I therefore tried to keep the length from growing too much and so I could consistently get new words, but this may have been poor strategy; Longer words score many more points, and I can afford not to score any words for several generations if there is a big payoff down the road. Darn, Now I want to go try this out - a hallmark of a fun game. :-)
GBR Giant Battling Robots Favicon

02 September 2009

ITATSI: A Weasely Word Game

Serendipity is a wonderful thing. Comments on my other blog lead me to contact the author of Itatsi, a game based on a simple search algorithm presented in Richard Dawkins book The Blind Watchmaker. First though, a description of the game itself:

Itatsi word game
The ideas is very simple, starting with 50 strings of three random letters, pick one that will be the parent of the next generation. With each new generation there is a random chance each letter will be randomly replace by another letter. The game has a database of some 30,000 words (3 letters or more), and choosing a parent that spells one of these words will score points - more points for longer words. In the example below there is also a chance the string will become longer, allowing longer words to be found.
The game also gives a "fitness" score, when is related to how close the parent string is to other words in the database. A higher fitness indicates a greater chance that the next generation will contain words that can be scored. Each word can only be scored once, so the strategy is to choose parents that not only score points, but also lead to new words that can be scored.

I'll be describing the screen-shots as I go along, but you might find it easier to see if you open another tab or window.

Itatsi game Weasel algorithm blind watchmakerThose are the controls for starting the game (most of them). Word length controls the number of characters randomized. Remember that longer words also score more points. For this example I'm playing with variable length words. For starters you will want to select "Training Weasel: Yes".

Itatsi game Weasel algorithm blind watchmakerSo here is the first turn or "generation" of the game. It doesn't say, but because about half of the 50 children are "CAU" it appears that "CAU" was also the original parent string.
The gold or yellow "CAW" string is the child with the highest fitness, or the most likely to generate scoring words if chosen as the parent. The silver/grey "CAN" is the second highest fitness.




Itatsi game Weasel algorithm blind watchmakerThe other colors indicate children that have mutated (one or more letters changed) from the parent. Note that some of the children have randomized to become longer (4 characters instead of 3).


This turn I select the string "CAW", and the next generation will be created by randomizing that string 50 times. (below)
You can see I scored 2 points for the word "CAW" and its fitness score was 46.
Itatsi game Weasel algorithm blind watchmakerIn generation 2 the highest fitness is again "CAW" (I could choose any of them), but since I already scored "CAW", I choose "WAW" instead.
Itatsi game Weasel algorithm blind watchmakerAbove is generation 3. I scored 2 more points for "WAW", and "CAN" is now the highest fitness. The "Training Weasel" is the feature is what marks the highest two fitness as gold/silver. You will want to use this feature to learn, but the game does not track your points when it is giving you these hint.
Now here comes a a bunch of turns.
Itatsi game Weasel algorithm blind watchmakerAt generation 12 now, and you can see my chpices over on the right. "NAGS" scored 8 points. Let's zoom ahead now ...
Itatsi game Weasel algorithm blind watchmaker... to generation 20. I scored big on turn 17 (12 points for HEAL and HEALS), and another 14 on turn 18. I'm up to 7 letters now, and that might be trouble because it gets harder with longer strings.
Itatsi game Weasel algorithm blind watchmakerAt generation 38 now, and I think that's enough to give you the general idea. I had one more screen-shot to show, but I must have forgotten to save it. Too bad, because it the Weasel found the string "BEHE" (a little joke there).

In part two, I'll share my exchange with the game creator. GBR Giant Battling Robots Favicon