The Tao of Gaming

Boardgames and lesser pursuits

Archive for the ‘Artificial Opponents’ Category

Re: Mastering Chess and Shogi by Self-Play (etc etc)

with 2 comments

More stunning news from the DeepMind crew:

In this paper, we generalise this approach into a single AlphaZero algorithm …. Starting from random play, and given no domain knowledge except the game rules, AlphaZero achieved within 24 hours a superhuman level of play in the games of chess and shogi (Japanese chess) as well as Go, and convincingly defeated a world-champion program in each case. –Abstract

And how did they do?

In chess, AlphaZero outperformed Stockfish after just 4 hours; in shogi, AlphaZero outperformed Elmo after less than 2 hours; and in Go, AlphaZero outperformed AlphaGo Lee after 8 hours.

(Stockfish and Elmo are the best computer programs in the world. AlphaGo Lee beat Lee Sedol, but was later improved on by AlphaGo Zero).

And after 3 days, AlphaZero played a 100 game match against Stockfish and won 28, drew 72 and lost zero.

It did this in spite of a slower search speed:

AlphaZero searches just 80 thousand positions per second in chess and 40 thousand in shogi, compared to 70 million for Stockfish and 35 million for Elmo. AlphaZero compensates for the lower number of evaluations by using its deep neural network to focus much more selectively on the most promising variations – arguably a more “human-like” approach to search

The full paper is worth a read. I don’t understand all the details, although its non-linear evaluation function apparently may have biases (like a hand crafted evaluation function) but the authors argue that their Monte-Carlo search (with its inherent randomness) will “average over [AlphaZero’s] approximation errors” but the traditional Alpha-Beta search propagates them.

Looking at some of the commentary by more experienced chess players, this jumped out at me:

The paper also came accompanied by ten games to share the results. It needs to be said that these are very different from the usual fare of engine games. If Karpov had been a chess engine, he might have been called AlphaZero. There is a relentless positional boa constrictor approach that is simply unheard of. Modern chess engines are focused on activity, and have special safeguards to avoid blocked positions as they have no understanding of them and often find themselves in a dead end before they realize it. AlphaZero has no such prejudices or issues, and seems to thrive on snuffing out the opponent’s play. It is singularly impressive, and what is astonishing is how it is able to also find tactics that the engines seem blind to….

In this position from Game 5 of the ten published, this position arose after move 20…Kh8. The completely disjointed array of Black’s pieces is striking, and AlphaZero came up with the fantastic 21.Bg5!! After analyzing it and the consequences, there is no question this is the killer move here, and while my laptop cannot produce 70 million positions per second, I gave it to Houdini 6.02 with 9 million positions per second. It analyzed it for one full hour and was unable to find 21.Bg5!!

(Emphasis mine, also to note that AlphaZero and stockfish had 1 minute per move).

The DeepMind team just keeps delivering stunning advances. Someone is probably jumping with a reasonable approximation of joy.

Advertisements

Written by taogaming

December 7, 2017 at 11:08 pm

Posted in Artificial Opponents

Tagged with , ,

Mainly Factorio, still

(This is the sort of thing that only someone who plays Factorio will care about).

Read the rest of this entry »

Written by taogaming

November 4, 2017 at 10:12 pm

Posted in Artificial Opponents

Tagged with

Time to make the ….

Paperclips

(Amusing, not necessarily fun. Universal Paperclips achieved in 7 hours 3 minutes 21 seconds)

Written by taogaming

October 11, 2017 at 10:22 pm

Optimism

Tired of working on my latest Factory, I fire up the robots for a few hands of bridge solitaire. I pick up the sort of hand you get in solitaire…

S:KQ7xxx H:A D:KQ62 C:xx 

(You get them because the computer deals out the hands, then swaps your hand with the best hand if you don’t happen to hold it).

Suprisingly, your robot partner opens 1 Heart. I bid 1 Spade and CHO bids 1NT. I bid 2 Diamonds (natural, forcing) and the CHObot admits to having two spades. I suspect four spades is cold and six spades is odds against, but I’m playing against robots and just goofing off. We’ll be light on points but maybe hearts will run (and I do have a sixth trump). Six spades it is.

I get the five of clubs lead and I don’t have time to wonder if I’ll be down before I won a trick because dummy is already tabled.

Dummy S:A9x H:KT9754 D:xx  C:Ax

Hand  S:KQ7xxx H:A D:KQ62 C:xx 

(Club 5 led by LHO)

That’s my type of opening … minimum. Well, I fly with the club ace and think. This is a decided underdog. Do I have any lines of play? In fact, I do see one. The nice thing about slam hands is that you usually don’t have a tangle of possible lines.

I win the club ace (naturally) and lead a heart to the ace. (Technically I should probably lead a spade the king and then cash the heart ace, but that’s a minor improvement and If hearts are 7-0 I think I would have heard something). I lead the spade king and then a spade to the ace, as spades break 2-2.

I needed that.

Next comes the heart king, pitching my losing club as LHO shows out. Uh, ok. I lead a diamond and it goes ten-queen-small. It looks like the diamond ace is onside.

I needed that, too.

But I also need RHO to have started with the ace and shortness (A, Ax, or Axx).

Nothing to do but lead a small diamond. LHO wins the 9 (RHO completing an echo!) and leads a club. I ruff the lub, ruff a diamond and … RHO plays the ace.

Score it up.

Once the diamond queen won, my odds were pretty good. RHO was known to have six hearts and two spades. Not much space for four diamonds and if he did have four, LHO had 8 clubs. I definitely think that would have been mentioned.

I also belatedly realize I missed another improvement.

If an honor had fallen on the second round of hearts, I would have had options. If RHO plays the honor I can play for him having QJx tight. If LHO shows up with an honor I could play for QJx tight or Hx. In the latter case I can run the HT for a ruffing finesse through RHO and (assuming it wins) get back to dummy with with a diamond ruff after losing the diamond ace and winning the other diamond, and pitch my last diamond on dummy’s good 9 of hearts.

I hadn’t considered it, but if the honor had popped up, I probably would have noticed. A minor demerit for not thinking about it ahead of time, but it turns out I had just enough luck on this hand.

Written by taogaming

September 24, 2017 at 9:25 am

Posted in Artificial Opponents, Bridge

Tagged with

Another timewaster request open thread

Well, Factorio was a good suggestion from the crowd (even if I balked originally). I’ve been knocking out various achievements (although I doubt I’ll get the “finish in 8 hours” one), but I must admit I’m casting around for something new. I downloaded OpenTTD (since the train engine is the same as factorio) but its a bit too old school for me. So … what computer games are you playing? (Remembering that my computer is not a gaming computer).

Update — After trying the demo of Desktop Dungeons, I sprung for the game. I’m actually not terribly fond of the entire leveling/building system (which strikes as similar to a freemium game) but the actual puzzels have a “nethack in 20 minutes”  nature. Some of the tiny 5 piece puzzles are stumping me, and I suppose the building/unlocking means that they can slowly introduce new things.

Written by taogaming

August 29, 2017 at 7:13 pm

Minor-Miner Update

Now that the boy is in camp, I have some access to the computer again, which means more Factorio. I get 50 hours into a base earlier this summer, but then six weeks away meant I had lost the thread. My power situation was OK but weird (some issue with heat pipes maybe being too far) and my trains were a mess, so I decided to start again. (I still have the save if I figure out the things I could go back to it). I’ve had a few false starts, so I keep resetting after a few hours.  I think I’m going to play the new one … build a small starter base and then build a main bus, and then perhaps a mega base. We’ll see.

I also did go-kart racing (work team builder) which lead to an injury. I knocked a shoe off while getting into the cart (It caught on the edge of the pedal) while switching off in a team-style Le Mans (“Which team can complete the most laps” during the event).  When reaching around/over the steering wheel to replace it I managed to strain every muscle in my core and left arm due to a spasm in that awkward position, which was not an injury I’d ever considered worrying about at a go-kart track. I consistently came close to the tree at the edge of the tight corner, but that just means I wasn’t dawdling….

It turns out that I am pretty good at the (~40MPH) beasts. Surprised me. (A bunch of racing games have given me a decent eye for the best line). Still, 30 minutes in 99° heat (with one break) and muscle spasms meant I was a wreck afterwards.

Thankfully I have tomorrow off to relax my muscles and work on my factory.

In other gaming news, Mrs. Tao did some old school D&D with her coworkers, while my (no-longer-minor) eldest mocked her during her absence.

Strange days, my friends, strange days.

Written by taogaming

July 20, 2017 at 10:51 pm

Posted in Artificial Opponents, Non-Gaming

Tagged with

Software is hard, but not that hard

I just got back from my vacation …. after a full solid 26 hours of airports and planes. It actually wasn’t horrible (apart from the four hour delay at JFK) because Delta planes have in-seat entertainment systems (and I had my books, of course).

The big game for the last two weeks (on the cruise, and in the airplane) was Boggle. (OK, the airplane’s game was the simpler “how many words can you find in this jumble for letters.”)

When I got home, I googled “Open Source dictionary,” because the last two weeks made me think those weren’t a thing.  Here are some words the cruises “Word finder” game didn’t accept:

  • cries
  • cried
  • makes

There were a ton of others. For a while I thought it was not allowing ‘s’ words (or multiple forms of the same word), abut other times it allowed all forms. That game also accepted a bunch of non-English latin words, acronyms, as well as frankly weird things like “ggg” and “Vneder” (but it rejected “Vender,” which is an archaic ‘vendor’.) [It shows a list of “words you missed” after each round, which is how I discovered these.]

It also accepted practically every name. I get that they can’t use the OSPD or SOWPODs (without ponying up licensing money), but downloading an OS dictionary takes literally a few minutes. (After playing for a while, I started mentally designing a “Boggle solver,” that won’t take forever. I may actually write it as an exercise, we’ll see).

Anyway, after spending way too much of my ship time playing Boggle (and being bewildered by dictionary) I played a few hours of “Letter Mix” on Delta on the way home. And I realized two things:

  1. After a dozen times I started seeing repeats of the puzzles (six letters).
  2. One set didn’t contain all the possible words in the solution. (They missed ‘hides’, but got ‘shied’).

And I realized that program didn’t have a solver, just a list of puzzles and acceptable words for each! Come on, this isn’t rocket science. (The Delta series of games definitely had a slapdash nature. The poker program had misleading english. “Player A raises to $2” when he actually raised a $2 bet to $4. And I suspect that the chess program had the “Easy/Medium/Hard” settings flipped, because I casually lost on easy unless I was paying attention, but on Hard the program just hung a queen for no reason.

Look — writing a good computer program may be hard, but some parts shouldn’t be. Get a good dictionary, people.

(My only other gaming news was losing in a cash no-limit game when my aces got cracked. In my last few cruises I spent a lot of time on the casino — I dislike cruises and may yet rant about that if I haven’t already — and after that I decided to just spend my sea time playing boggle instead, since in my two hours playing I couldn’t spot the fish).

I also murdered a few hours playing bridge, but on a cruise ship with random opponents that hardly counts as gaming.

Written by taogaming

June 20, 2017 at 2:25 pm