Featured post

Textbook: Writing for Statistics and Data Science

If you are looking for my textbook Writing for Statistics and Data Science here it is for free in the Open Educational Resource Commons. Wri...

Showing posts with label game design. Show all posts
Showing posts with label game design. Show all posts

Sunday, 20 December 2020

Borel Dice Edition - Brute Forcing Experiments

 

Borel and Borel: Dice Edition are educational games about probability. I picked up a copy of each because I thought they would be useful in introducing some ideas of probability and gambling without the cultural baggage of better known games.

 

I'm biased because it's my field, but Borel has a lot more play value than most games of its kind. The dice edition, which is much easier to find, and easier to get into and play, has a set of 7 dice (four 6-sided, and one each of a 10-sided, 20-sided and 30-sided die), and a deck of 100 "experiments", like Experiment 001:

 

Saturday, 22 August 2020

Fantasy League Sports Cards

 

The sports card industry (specifically baseball cards) crashed in 1994. Fantasy sports existed as early as the 60's, but really caught public attention around 1995. That timing is not coincident.

In both hobbies, fans get to have  surrogate ownership of players, and the market value of those surrogates goes up or down with the performance of those players. At the casual level, being in a fantasy league is just a more publicly acceptable way to collect and play with cards. At the serious level, fantasy is a more viable, faster way to make a profit with your expertise than cards were.

In short, fantasy is just trading cards for grown ups.

But what if physical cards let you draft players?

 

Sunday, 5 July 2020

Statistics, Gambling, and Games of Chance

This is a proposal for a survey course on statistics that uses gambling extensively in examples. The target audience is senior undergraduates with a non-statistical background, but quantitative students will also find enough novelty to be interested. The goal of the course is not to encourage gambling, but to use it as a vehicle for a broad range of otherwise difficult statistical topics.

Friday, 8 November 2019

Postmortems from 'Game Developer', a book review


"Postmortems from 'Game Developer'", edited by Austin Grossman is a collection of after-the-fact analyses of popular video games that had been recently developed and sold. The analyses are all written by senior members of each game's development team, and usually the game's head creator. "Postmortems" was published in 2003, so the games being analyzed include Diablo 2, Age of Empires, System Shock 2, and Black and White.

I purchased my copy from a thrift store in 2016, which had a suggested Canadian price of $42. This copy had several discount stickers on it, one of which had the book for sale for $0.84, a 98% discount.

Thursday, 8 August 2019

Reversi in R - Part 2: Graphics and Custom Boards


In this post, I finish the Reversi / Othello game in R by improving the graphics, adding the ability to save and load boards, and fixing bugs. Also, many more boards have been added and tested, including those with unusual shapes, three or more players, and walls that can make the board into unusual shapes or even break it in half.

Sunday, 21 July 2019

Reversi in R - Part 1: Bare Bones


In this post, I showcase a bare-bones point-and-click implementation of the classic board Reversi (also called Othello*) in the R programming language. R is typically used for more serious, statistical endeavors, but it works reasonably well for more playful projects. Building a classic game like this is an excellent high-school level introduction to programming, as well as a good basis for building and testing game AI.


Tuesday, 2 July 2019

I read this: New Rules for Classic Games


New Rules for Classic Games, by R. Wayne Schmittberger, written in 1992, is exactly what it sounds like. "New Rules" contains possible amendments to rules for Risk, Monopoly, Poker, Bridge, Scrabble, Reversi/Othello*, Shogi, Go, and of course Chess.

Monday, 1 April 2019

Bingo analysis, a tutorial in R



I'm toying with the idea of writing a book about statistical analyses of classic games. The target audience would be mathematically interested laypeople, much like Jeffrey Rosenthal's book Struck by Lightning ( https://www.amazon.ca/Struck-Lightning-Jeffrey-S-Rosenthal/dp/0006394957 ).

The twist would be that chapter would contain step-by-step R code or Python code so that the reader could do the same analysis and make changes based on their own questions. Material would like this post on Bingo, as well as my previous post on Snakes and Ladders ( https://www.stats-et-al.com/2017/11/snakes-and-ladders-and-transition.html ).

There would also be some work on chess variants, othello, poker, and possibly go, mahjong, and pente. Tied to each analysis could be light lessons on statistics. This Bingo analysis involves Monte Carlo style simulation, as well as notes on computing expected values, CDFs and PDFs.

Friday, 20 July 2018

Chess Variant - Laser Chess / Khet / Deflexion

Khet, Deflexion, and Laser Chess are different names for the same game.  The currently commercially available game is called Laser Chess, and it has a space theme. Deflexion, Khet, and Khet 2.0 have an ancient Egyptian theme. The themes and some of the suggested starting boards differ between versions, but the pieces and board are functionally identical. They have also introduced a couple of new starting positions and improved the accuracy of the laser, but otherwise kept the fundamentals the same.


Saturday, 14 April 2018

Simultaneous Strategy 2: Kung Fu Chess

Kung Fu Chess, as found at https://www.kfchess.com/ is a remake of a much older PC game by Shizmoo games, and has recently been adapted for online play.


Kung Fu Chess has the initial setup and most of the same rules as the standard game of queen's chess that everyone is familiar with. The primary difference is that instead of one player moving one piece at a time, a player may move any of their pieces at any time, provided that the peace in question has not been moved in the last 10 seconds.

Simultaneous Strategy 1: Cosmic Blocks

In the chess-like game Cosmic Blocks, by Narcissa Wright, and available through the Discord server at https://discordapp.com/invite/szpznUj , players each start with a 1-square base on an 11-by-21 grid. That base spreads influence, represented by coloured shading of squares, to the 3-by-3 area surrounding the base. The goal is to spread this influence into the opposing base.


Sunday, 28 January 2018

AlphaZero, Stockfish, and flexibility regarding chess variants.

Recently there was a high-profile set of matches between reigning champion chess AI stockfish and a newcomer called AlphaZero. AlphaZero was created with the same deep learning System that created AlphaGo, an AI that beat the world's best at the game Go. In the 50 matches that AlphaZero played as white, it won 24 of them and drew on the other 26. In the 50 games that it played as black it won three of them and drew on the other 47.

This advantage towards the white player may seem startling, however it's not out of line with other matches between artificial intelligence programs at the world-class level, nor is it out of line between matches between world-class human players. Stockfish, which evaluates positions in a chess game in terms of pawns of advantage starts the game with an advantage towards white of 0.1 pawns. AlphaZero, on the other hand, has no idea how many pawns of advantage white has, because it looks at the game holistically which is a radically different method of analysis compared to other modern AIs.

Part of the reason I bring up issues of artificial intelligence is to look at how well the these various systems will carry over to different chess variants rather than just the orthrodox version of the game.

Let's start with Stockfish: Stockfish is a system very much like Deep Blue and many of the other ones that came between it and Stockfish. The difference being that Stockfish is open source, meaning anyone can examine the code and edit it. This and many of the artificial intelligence programs that came before it run on a minimax principle, meaning that they try to choose the move on the assumption that their opponent will choose the best counter move in response to it, thus they try to pick the move which has the worst best counter-solution. (They try to minimize their opponent's maximum move quality.

To simplify, consider this abstract game. You have two options: Option A allows your opponent to score 5 points. Option B allows your opponent to choose between a move that scores 6 points, and a move that scores 2 points. Assuming that your opponent will choose their best move, your best choice is to select Option A, because it limits their score to 5. The fact that Option B provides the possibility for your opponent to score only 2 points is irrelevant. This is the minimax principle.

Most of what a traditional chess AI does when selecting a move is to evaluate a particular position is worth in terms of some abstract score, such as 'number of pawns'. The value of pieces is straightfoward: a pawn is worth approximately 1, a bishop or knight is worth about 3, and a queen is worth roughly 9. However the position of these pieces also matters. Having a piece in the middle or able to reach the middle at any point is worth a premium. A 'passed pawn', or one which has no opposing pawn directly ahead of it, is worth more than it would otherwise be, because of its greater potential to be promoted. The alpha-beta algorithm (not related to AlphaZero) contains set of parameters which decide how much each board piece is worth on each square. Different machine learning methods such as neural networks can be used to determine what these parameters should be.

For variants of chess that are very close to the original game such as Chess 960 (a.k.a Fischer Random Chess) or Really Bad Chess, which both feature 8 by 8 grids, 16 pieces per side, and only the orthodox six pieces, an AI using the alpha-beta algorithm should be able to play such games with few if any complications.

These AIs work even after pieces have been removed from the game so variants that use fewer pieces don't produce any difficulties either. In practice, variants with different board sizes are different arrangements such as Martin Gardener's mini chess or Romanchenko Chess (shown in the figure, source: Jocly) work well too as long as the value of any squares beyond the board are hard-coded to zero. This also means in practice that an alpha-beta algorithm can produce a viable chess AI on a board that is not a perfect square or rectangle. However it can increase the computational load the non-viable squares are considered, as they are in Jocly's implementation of alpha-beta on Romanchenko Chess.



Some systems, including Deep Blue, take advantage of chess literature, specifically for the orthodox game also take advantage of openings and their reputations methods for winning particular and games such as when you have a rook and a bishop against an opponent who just has a rook. However, after the opening and before the end game it's pretty much alpha-beta all the way. [1]

Variants that included new pieces such as fairy chess, or non-linear board movement such as Smess, the Ninny's Chess, can also be supported by AI programs that uses the alpha-beta algorithm. However these programs will need additional manual training to be able to evaluate the value of different pieces and space.

AlphaZero works on an entirely different principle; it does not assume that its opponent is the best possible opponent, one which will make the best possible counter move. Instead, AlphaZero evaluates a candidate position by simulating games of weighted random moves starting from the position to be evaluated. The evaluation is simply the proportion those random-move games that win* from AlphaZero's side. It evaluates the position this way for each move that it could make, and simply chooses the move that results in the best win proportion.

In these simulation games that AlphaZero uses, the weighting of the moves is based on moves that are likely to lead to a win based on games that AlphaZero played against itself. For example, AlphaZero may assign more weight towards a move that takes a piece over one that doesn't. It may also assign greater weight towards moves that give it control of the centre of the board. But these weight assignments would not be the result of any human supervision.

Similarly, AlphaZero has no concept of chess theory such as openings or their refutations, and it doesn't have a book of endgames to rely upon. AlphaZero was trained simply by giving the system the rules of chess, and letting it play many games against different versions of itself. It's reasonable to assume from here that AlphaZero would be able to handle many chess variants without any additional modifications other than informing it of the new rules. Furthermore a very similar training system could be given to nearly any chess variant to produce an AI program that could play that particular game.

* More exactly, the evaluation is (Proportion of Wins) + 1/2*(Proportion of Ties)

[1] Beyond Deep Blue: Chess in the Stratosphere, Monty Newborn

Monday, 13 November 2017

Snakes and Ladders and Transition Matrices

Recently, /u/mikeeg555 created this post  on the statistics subreddit with their results from a simulation of 10,000,000 games of this instance of Snakes and Ladders. This is the sort of information that's good to show in an undergrad or senior secondary level classroom as a highlight of the sort of insights you can get from the kind of simulation that anyone can program.

Tuesday, 12 September 2017

Left-brain creativity

One commonly cited way to improve or maintain mental health is to do something creative, such as painting, drawing, writing, dancing, making music, knitting or cooking. So what's the strategy to gain these benefits if you're not creatively inclined in these or any similar ways? What if you're, say, a statistician or a software engineer?

This post is about acknowledging other, more mathematical means of being creative, that aren't general thought of as traditionally creative. I'm calling these 'left-brain' creative means, which is reductionist, but easy to convey. Whether any of these are artistic in any way is irrelevant.

Martin Gardner was a master of left-brain creativity. He wrote books of mathematical puzzles and novelties, including a version of mini chess mentioned here. Making these challenges was absolutely creative. I would argue that the process of solving these puzzles would also be creative because it requires imagination and decisions that are novel to the solver.

Reiner Knizia has a PhD in mathematics and makes board games for a living. His visual artwork is rudimentary, which is fine because it's meant merely as dressing for the real creative work of abstract sets of rules meant to inspire clever player behaviour.

I mention these two first because I have been disparaged before for being un-creative when I would rely on similar abstractions as outlets. For instance, when told by (now ex-) girlfriend to go try to do something creative, I started working on a farming game I had envisioned, and decided to start with a list of livestock and a draft of their prices in the game. This didn't impress her.

With building toys, I usually made abstract patterns rather than anything that would traditionally have been considered creative. With Lego / Mega Blocks, my most memorable builds were a giant hollow box for holding hockey pucks, and an extremely delicate staircase. With K'nex, my work was always abstract shapes made in an ad-hoc manner.

I enjoy the concept of building toys a lot more more than actually building anything with them. It's a dream of mine that Capsella toys will make a return through 3D printing. Capsella was a toy make of clear plastic capsules with gears inside. It would be difficult, but doable.

There's also this game called Gravity Maze, in which the goal is to drop a marble in one tower of cubes and have it land in a target cube. The game comes with a set of puzzle cards which include a starting configuration of towers and a set of towers that you need to add to finish the maze. The game only comes with 60 such puzzle cards and additional ones aren't available for sale. On one vacation, I took it upon myself to draft a program that could randomly generate configurations and see if they were solutions. It's still in a notebook somewhere. Is this creative? It feels better if I think of it that way; doing this gave me the same joy I imagine someone gets from more traditional creative exploits.

On another vacation, I wrote a proof of concept for Gaussian elimination of a 4x4 matrix where the matrix was populated with fractions. The point was to write the entries of the resulting matrix each as a single fraction. That way, an ASIC (Application Specific Integrated Circuit) could later be made to solve such a matrix in fractions, which avoids the computationally slow method of subtraction, which is typically done through iterated subtraction. Was that creative? It felt a lot like doodling or sketching to decide upon this and solve it.

I was a big fan of Dungeons and Dragons, and later Rifts and GURPS, when I was younger. I almost never played roleplaying games, but I spent a lot of time reading rulebooks and compendiums, and writing my own material such as new monsters. To someone expecting creative work to look more like art, this probably resembled accounting.

This clearly isn't a new discovery to a lot of people. Just looking at websites for chess variants and chess puzzles tell me that much, along with the large custom card making subset of the Magic: The Gathering community tell me this much. There are many people that seem to enjoy making up challenges and rulesets and get creative joy out of it.

If there's a thesis to this post, it's that if you're not inclined to make what would be typically considered art, you can still reap the mental health benefits of being creative through more 'left-brain' means. Other activities worth mentioning, but not from personal experience, include making crossword puzzles, nurikabe puzzles, maps, and fractals. Do something that involves building or making and a lot of small decisions, and don't worry about whether it's expressive, artistic, or traditionally considered creative.

Sunday, 13 August 2017

Sports questions - Speculation, RISP, and PEDs


What will popular sports look like in the year 2030? (All sports)

Technology is rapidly making new sports possible. 

Will improved cameras and laser gates make races with running starts viable? I would love to know how much faster the 100 metre dash can be without starting from a standstill.

Will drone racing or drone hunting take flight?  Will e-sports continue their growth and penetration into the mainstream?

Will self driving cars start competing in Nascar? Formula One? Rally car racing? Will all of these racing formats survive or maintain their scale in the next 15-20 years?

Demographics are opening new possibilities too. 

Shrinking populations and urbanization are leaving behind many otherwise livable and usable buildings as abandoned. Will terrain-based sports like airsoft and paintball take off with the abundance of good locations? Will GoPro and similar robust and portable camera make such pursuits into spectator sports?

Will we see a shift of focus towards women in sport, following the trend of tennis? Will we see mixed-sex competition in sports where size and muscle mass mean less?

Will extreme sports see a revival, led by Red Bull sponsored events like Crashed Ice and Flugtag?

What sports will decline? 

Will UFC mixed martial-arts continue to eat into the viewing market share of WWE wrestling? Why didn't Texas Hold 'em keep its hold on the public? Could the NHL (and the KHL) mismanage ice hockey into a fringe sport? Can American Football maintain its popularity in the face of growing concern over brain injury? Will American football adapt? Can golf maintain its popularity given its cost?

What about stadiums?

Instead of building stadiums for specific sports, or a limited set of sports, will new sports emerge to fit into already made stadiums? Will existing sports start to use stadiums that were built for other purposes, such as softball in a baseball stadium, or soccer football in an American football stadium?




On RISP, Runners In Scoring Position. (Baseball)

Batters do better (or pitchers do worse) when there are runners in scoring position. Why? Is it just a result of skill auto-correlation, such as a pitcher's tendency to do poorly in streaks of batters, or is it something else? Is it the distraction on the pitcher for having a batter who could steal a base or read signs? Is it the effect of the fielders having to do more than one job at once? 

A more measurable or actionable question: is the RISP advantage greater for certain batters? For example does a player with a reputation for stealing bases give a larger 'RISP bonus'  than another with ordinary base-running. Does the effect add with multiple runners? Does it change with base? Does it change with pickoff attempts? How much of this is balks being drawn?

Similarly, how should pickoff attempts be counted with regards to pitching load? My guess is that they have the effect of about half a pitch in terms of performance in that game and in that plate appearance.


What performance enhancers are 'fair'? (All sports)

A lot of drugs are banned from a lot of sports, but why? My assumption is that it makes the feats of one era comparable to another. We can take Usain Bolt's running records and compare them to the records of Donovan Bailey's in the 90's, and say with little or no argument that Bolt at his peak was faster than Bailey at his. The difference in their 100 metre dash times can isolated to the runners and not the chemical technology of their respective eras.

My assumption comes from the qualifying statements in hockey and baseball about different eras of each sport defined by seemingly minor changes in the equipment or rules of the game. Hitting feats from the 1990s seasons of MLB baseball are qualified with comments about steroid use by superstar hitters. Steroid use was allowed at the time, I presume on the basis that every player had access to the steroids.

Why is chemical technology is seen as unfair and other technology like improved running shoes is fair? Probably the hidden nature of drugs, and the related difficulty in directly regulating the 'equipment' used. It's much simpler to enforce rules about the volume of a golf club face, or the curvature of a hockey stick, rather than an acceptable dosage of steroids.

Things have gotten confusing lately.

Oscar Pistorius, whom had both his legs amputated below the knee as an infant, was until recently a competitive paralypmic sprinter. He used springy blades, described here, to run. He also wanted to compete in general sprinting competition but was barred from general competition as it was found that his prosthetic feet were more efficient for running than baseline human feet. So, even though paralypmic competition was designed to provide viable competition to those with physical disabilities, the technology used to mitigate Pistorius's disability was deemed too effective.

In January 2017, the IOC (International Oympic Committee) released the results of testing they had done on various drugs to test for performance enhancement in, of all things, chess. They found that caffeine, Ritalin, and Adderal all improved performance in double blind tests. So, if chess ever becomes an Olympic sport, should these drugs be banned and tested for? What happens if someone has a prescription for Ritalin, do they have to go without to compete?


Things are about to get a lot more confusing.

CRISPR is a technology that may have the potential to arbitrarily rewrite genetic code. If done to a human embryo to specialize the resulting human into a particular sport, what are the rules to be surrounding that? Generic editing seems like drugs and blood doping in that it's a hidden technology that would be very complicated to regulate other than to ban completely. It would be at least intended to be performance enhancing, and not every competitor would have access to the technology, at least not at first.

But changing the genetics of a person is not adding something foreign to the person, it is changing who that person is. That's who that person will be through their entire life growing up. Should we ban someone from competition for being 'naturally' too good at something as a result of a decision made before that person's birth?

Or, do we separate competitors into 'baseline' and 'enhanced' humans? This is starting to sound way more like a dystopian, racist dog show (with terms like 'best in breed') than the 'faster, higher, stronger' tone I was aiming for. It's something we collectively need to think about though, not just for sport but for all human interaction going forward.

Let's close with this thought on the subject by speedrunner Narcissa Wright: "All the categories are arbitrary".

Monday, 17 July 2017

Chess Variants - 960 and Really Bad Chess

Fischer chess, or chess 960, is like queen’s chess which is the standard Orthodox game we know, except in 960, the starting position of the pieces in the back rank is random. It can be played live with a standard chess set, or online through Jocly or Lichess.

There are restrictions on the starting arrangements such as that the king must be between the rooks and that one bishop must be on each colour of square. All the restrictions leave 960 legal arrangements out of 8!/(2!2!2!1!1!) or 5040 unique ways to arrange two rooks, two knights, two bishops, one king and one queen. Both players are given the same arrangements using the files or columns on the board not mirrored for each player's perspective chosen at random.
 
As far as chess variants go, ‘960’ it's pretty close to Queen’s chess in that it is played with the the same number and types of pieces the same 8 by 8 board and that aside from difference in starting Arrangements no other rule changes are imposed.  The restrictions even ensure that castling in either direction is possible.

If chess 960 is chess done with poetic license then Really Bad Chess (RBC) is done with artistic transgression.  In Really Bad Chess, by Zach Gage (http://reallybadchess.com/presskit/ ) and available on Android and Apple, play is done on an 8 by 8 board with one king and a collection of pawns,  knights, bishops, rooks, and queens arranged into ranks per team. That's about all I can say for certain about the starting state of a Really Bad Chess game.

The pieces each player receives are random, really random. The average piece tends to be more powerful than they would be in a game of Queen’s chess.  At the lowest ranks/difficulties, players typically start with three or four queens as well as a front rank comprised mostly of bishops. At those same lower difficulties the opponent AI would have a much less impressive collection of pieces.

That's one big difference between 960 and RBC: the players are each given their own random set.  When playing against humans, both are treated to a random high-powered arsenal. In ranked mode, games are against the AI and the difference in power is determined by the difficulty setting. At rank/difficulty 0 the player starts with a massive material advantage over the computer. At  100, this advantage is reversed. At 50, both players are given equally strong pieces although the pieces are still different for each player and they are still more powerful on average than in Queen’s chess. For example each player could have two queens and roughly six knights. 

Every win in ranked play against the AI increases the difference of the next ranked game. Every loss does the opposite. The AI itself gets no smarter which may be to simplify the concept of difficulty, and it keeps the game reasonably fast because AI does not think to Greater depth at high levels.
This is the first variant I've played where I'm not absolute trash and I have the proof:

  

The AI tends to strongly value putting you in check and will needlessly sacrifice pieces to do so sometimes. This strategy works well and it partially sidesteps the issue of uneven material value. For example, in difficulties less than 50 even trades for pieces are desirable. At difficulties above 50 they are not. But these material advantages are most important in the endgame. I have played several matches above-50 where I have overcome the material disadvantage and then some only to be checkmated in the mid-game. For example, this game, in which I played as white:


There is an undo button that allows you to take back one move against an artificial intelligence. The button only works to a depth of one move, and it can only be done so many times. Undo uses can be recovered or stockpiled by either watching video ads (5 per view), or direct purchase ($1.40 per 100). 100 undo uses are bundled with the premium version of the game. The premium version settings are well worth the $4 if you're going to play 10 or more matches. The default color scheme is hideous but you can change it with premium.

One minor complaint is that the term ‘rank’ is used instead of ‘difficulty’. Rank goes up as you win when logically such a number should decrease. Rank 1 typically means ‘the best’, but not here.
A bigger problem is that pawns are always promoted to queens when promoted. This is usually what I want but cases do exist when another piece is better and the extra decision step isn't that cumbersome.

It's a lot of fun to go on a power trip and play matches with a lot more non-pawn pieces than I would otherwise have. It speeds the game up to the point of absurdity where 50% to 70% of pieces are moved to capture another piece.

The undo button and the wide set of possible scenarios in Really Bad Chess has been a fun tool for a casual player like me to practice tactics, however impossible they would be in a real game. I'm a little worried that games like this are teaching me to play chess incorrectly which will make it harder to develop skill in the standard game. However I've never played chess seriously and I'm in my thirties so the opportunity cost doesn’t seem too steep.

Really Bad Chess is really good at making puzzles as well. It has daily and weekly puzzles which are just matches with preset pieces.

Saturday, 8 July 2017

Chess Variant - Wave Chess

Wave chess is a variant of chess meant to be played over multiple games.


Each player starts the match with x1 and x2 'waves' respectively. They start the match by first playing a game of standard, orthodox Queen's Chess. In each game after the first, the loser starts with all their pieces and all their clock time, but with one fewer wave in reserve. The winner of the previous game plays with the pieces and time they had remaining after the previous game, but the winner does not lose a wave.

Each remaining winner's piece can be placed in any space that it could legally start at. For example, a player with one remaining rook can choose either corner to start that rook in. They can also place their remaining pawns anywhere in the front rank.

A player is considered to have lost or won a previous game regardless of whether they have lost by forfeit or checkmate. The loser of the previous game becomes the white player.


In a draw, both players lose a wave and begin their next game with all pieces and time, and the previous game's white player becomes the black player.


This variant extends the idea of material odds handicapping. In a single game, one common handicap is to forfeit one or more pieces at the beginning of the game. In wave chess, smaller incremental handicaps are possible by forfeiting pieces only for a player's first wave. Also, larger handicaps are possible by giving one player more waves.


The wave mechanic also reduces the incentive of forfeiting. A player from a lost position may still want to continue a game in order to reduce their opponent's material for the next game.


After the first non-draw game, subsequent draws become less likely because one player will start with a material advantage.  I would expect that matches between strong, evenly matched opponents would start with one side beating the other with only a few pieces in the end game, followed by alternations between short games where the winner of the previous game manages to take a few pieces before being mated, and normal length games where the previous winner starts only a few pieces behind.


I would also expect that matches between badly mismatched players would result in the weaker player throwing wave after wave at the stronger player, which could make the game more exciting for both players. How many waves does it a take for a 1400-rated player to take down a single wave of a world class chess AI like Stockfish? How many waves of novice players, or randomly selected moves, can you withstand against?


One possible compromise between Queen's Chess and Wave Chess is to allow a winning player to regain x points of material between games. 

As there are thousands of variants out there, it's plausible this has been done before. If someone reading this knows of a similar concept, I would love to know so I can send a link to it and give credit.

Thursday, 22 June 2017

Assorted Sports Questions

These are some problems I'd like to posit to the sports analytics community, as food for thought and future research starters.

The scheduling of 31 teams (NHL Ice Hockey)


What scheduling problems, will arise in the national hockey league by having a prime number of teams? It must restrict their options for the number of games in a season, at the very least.

Are there even any other major leagues with odd numbers of teams? Leagues without a divisional structure such as Barclay's Premier League in soccer could get away with it, but they have the complications of Champion's League promotion and of relegation to deal with.

It's not just about creating a set of pairings so that every team has the same number of home and away games as well as games against same-division and same-conference opponents. There is also scheduling to consider, in that the limited number of weekend nights are preferable for business purposes, and that teams must be able to physically be in the same location at the same time, presumably with a rest buffer. There were already issues with the 30-team, 82-schedule because of injury risk (and greater injury consequence in terms of games missed). Adding a team will compound this, and the forced asymmetry of a prime number of teams reduces the flexibility of the schedule to account for weekends and rest.

As an aside, look to Balanced Incomplete Block Designs as a basis for designing team schedules.


Ratings for Sports Officials (All Sports)

In baseball, the location of the pitch as it crosses home plate is recorded for every throw, so people can tell where each umpire considers the strike zone to be, and the level of consistency of that zone.

What ways are there to evaluate the accuracy and consistency of officials in other sports? Tracking live decisions vs after the fact decisions from recordings?  Could you do it as a 'deviation from superhuman AI' metric like how professional chess players are sometimes rated? For example, we could probably existing trackers (which are 2D for players and 3D for the ball) in NBA basketball to check the level of enforcement of traveling.

What are the ethical and behaviour implications of tracking and reporting officials' performance statistics like we do with players? Will officials lose focus on the game if they are also concerned with their stats? Would there be sufficient value to sports to do this?




Playoff Match Draft (All Sports, NHL Hockey example)

Instead of having first-round playoff match-ups determined solely by seed, matches should be determined by draft. Take the national hockey league (please). The NHL is split into two conferences of 15 and 16 teams respectively. In each conference, the 1st seed team plays the 8th seed team (Ignoring wild card complications), the 2nd seed team plays the 7th, 3rd plays 6th, and 4th plays 5th. If a team's skill were one-dimensional, this setup makes sense and the team that does best in the regular season is rewarded with the best chance to advance by playing against the weakest qualifying team.

Reality is messier. This setup occasionally leads to teams being punished for playing well in the regular season by being played against a team that they do particular poor against in the first round the playoffs.

Imagine a playoff draft instead. The eight teams in each conference qualify for the playoffs as before, but instead the top seeded team CHOOSES their opponent from the other seven qualifying teams. Then, the top seeded team among the remaining 6 chooses their opponent from the remaining 5 and so on. By default, teams could always select the lowest seeded available opponent, which leads to the same 1-8, 2-7, 3-6, and 4-5 pairings as the current setup. However, doing very well (3rd or better) in the regular season earns you some discretion if there's an opponent that counters you that you would like to avoid.

There would be absolutely no reason for a team to covet a lower position over a higher one. There would be no implication of strategically losing games at the end of the season, because there would be no conceivable reward in it.

A playoff draft also adds the potential for dramatic scenarios. If a team choose anyone other than the default lowest seed opponent, that implies a lot of confidence in being able to beat that opponent specifically. A lot of bragging rights come from a draftee beating their drafter. Would a team draft a stronger but less physical team to reduce their injury risk for the 2nd round, if it happens.

Would a team deliberately develop a reputation for being physical in the hopes of being drafted later against a weaker team?


Home Team Advantage (MLB Baseball)

Is batting last in baseball really an advantage? Sure, the team who bats last has more information when they do bat, which can provide a strategic advantage. However, that information advantage is nothing like it is T20 or One-Day cricket, in which each team only bats once, and teams still opt to bat first sometimes. Also, in baseball, batting last means always pitching for 9 innings in non-tied games; that's on average 6% more pitching than the other team needs to do. Is the information in the current game worth the extra pitching fatigue from the next game?

In Major League Baseball, games are usually played in 3 or 4 game series between opponents. The home team is given the supposed advantage of batting last for all of those games. Would it be a greater advantage to bat first for the first 1 or 2 games? Even if it did, would it be 'better' to increase the home team advantage?


Designated Hitters (MLB Baseball)

What would happen if the catcher didn't have to bat, and was also replaced with a designated hitter like the American league pitcher? Would that speed up the game, or is the time to change gear minimal? Would it lead to more hits by pitch because of the reduced opportunity for retaliation?

Does there need to be 9 players in a batting lineup, or can the designated hitter simply be removed in favour of an 8-player lineup? What second-order effects to the typical roster would there be by eliminating the designated hitter?

Thursday, 16 February 2017

I read this: Chess Variants - Ancient, Regional and Modern

Chess Variants - Ancient, Regional, and Modern by John Gollon is a book published in 1968 that describes 33 different versions of chess, and includes sample games for most of them. It is the closest source I have yet encountered to answering the 'why chess' questions.

In the author's words, it is intended to be a Hoyle's Book of Games, but for chess. It also asrved as a humbling reminder to look outside university resources sometimes. The Bennett library may have nearly every book one could want on statistics, but it has perhaps 10 on chess, and those are mostly about artificial intelligence.

There's a lot of useful information from this book, much of the subtler implications are beyond me. Here's the gist of what I learned:

I read this: Chess Metaphors: Artificial Intelligence and the Human Mind

Chess Metaphors: Artificial Intelligence and the Human Mind, by Diego Rasskin-Gutman uses chess to explain concepts of intelligence both organic and artificial. The first part of the book is about the human mind, and cognitive models like schema and memory chunking, which I only skimmed. The second part discusses how an AI program can efficiently explore all the relevant consequences of any given chess move.

In the AI portion, 'Metaphors' explained how minimax algorithms worked, and discussed the Alpha-Beta algorithm, a chess playing staple, in particular. Minimax algorithms are useful for zero-sum two player games, like chess and most other head-to-head games.

Algorithms of this type work by compiling a set of possible moves, and for each move a set of possible responses by the opponent. The consequences of the response (e.g. the board state) is evaluated for each considered response. The worst (from the perspective of the AI) board state possible is assumed to be the response, and the evaluation (e.g. how 'good' that board state is) is recorded as the value of making that move. This repeats for each possible move, such that the AI has the worst case that comes from each possible move (each max). It then chooses the move that produces the best of the worst cases (the minimax). If someone playing against this AI doesn't respond with that optimal response, all the better.

The algorithm described above would only work for looking one move (one ply) ahead for each team. To consider deeper strategies, the process is repeated in an exponential explosion of possibilities. Reasonably, many of these algorithms differ in their focus on finding ways to avoid evaluating unnecessary positions, which is what Alpha-Beta does.

What really surprised me is how simple the evaluations can be. A very common evaluation method is to assign a value for each piece and a value for each square that piece can move to. This implies that such an AI would be functional, although not optimal, for a wide range of chess variants. In fact, if only the orthodox pieces are used, no additional programming would be required other than alter the possible moves to the new board. An algorithm like alpha-beta could be applied 'out of the box' to variants that don't use new pieces. This would explain why the 'chess variants' app that has the smaller boards like Garner's Minichess, and rearranged boards like Chess960 uses Alpha-Beta.

Including new pieces would involve programming in their possible moves and assigning them a material value (e.g. worth 4 pawns). Therefore, adapting existing AI to many of the variations seen in John Gollon's "Ancient, Regional, and Modern" book should be feasible. There are many ways to tune the relative value of pieces and immediate movement ability, including pitting AIs with different parameter values against each other in an evolutionary pool.


Footnote: Judging by http://www.chessvariants.com/ and the chess variants subreddit, it's much easier to make a variant than to drum up support and playerbase for it.

To consider later: Smess (also available as an app):
https://boardgamegeek.com/boardgame/1289/smess-ninnys-chess
In this game, the pieces have very simple moves and the board itself defines the difference in moves.