OpenTafl v0.2.1b released

OpenTafl v0.2.1b has been released here. It has almost full support for OpenTafl Engine Protocol, and the protocol specification is also near-final. (I’ll be finalizing the protocol definition in a release or two.)

The other feature on the docket for 0.2.x is a local engine-vs-engine tournament mode, which I (and, for that matter, you) can use to quantify strength gains from changes you make to your AI, by playing the current version against prior versions. I’ll provide more information on this feature as I develop it.

Pereh Missile Carrier

The Israelis have finally allowed details of one of their weapon systems to become public. Let’s take a look.

To understand the weapon system, we need to go back to the Yom Kippur War in 1973. During that war, the Israelis were fighting (and mostly losing, though it worked out ok in the end) a war on two fronts: against Egypt in the South and Syria in the north. There were considerable fears that the two Arab armies, with their new Soviet hardware, would overrun the Israelis.

While the Israelis got plenty of support from the Americans, they were also deeply aware of how fickle allies could be. France and Britain had abandoned Israel after the Six-Day war in 1967. So Israel decided to do a lot of indigenous work. You can always rely on yourself. One such bit was the development of an indigenously produced tank, the famed Merkava.

But, what to do with the old tanks? They’re not suitable for frontline service, but throwing them out would be wasteful. And, more anti-tank firepower was needed. The Israelis had already put quite a bit of effort into upgrading their outmoded M48 and M60 tanks. These were called the Magach series, but eventually the Soviet tanks were too good.

There’s a long history of converting old tank chassis into support vehicles. The Germans did this in the Second World War, making the well-regarded StuG III off of surplus PzKpfW III hulls. The Israelis went a similar direction with their old Magachs. Time had marched on, though, and the Israelis installed Spike-NLOS ATGMs instead of a gun. The result is called Pereh, which is probably a terrible transliteration. It means Onager in Hebrew.

Let’s talk about the missile: Spike-NLOS. These are big, long-ranged missiles. They’ve been around since the 80s, so quite a bit longer than the small Spike that’s a Javelin competitor. They’ve got a range of about 25 km, and weigh in at 70 kg or so. Spike is, uh, well, I would say SACLOS, but the wireless datalink doesn’t require line of sight to work. So, SACLOS-like, I guess. You can also provide midcourse updates via the wireless datalink, or even program target coordinates for the missile to hit. Maybe we should call it SACLOS++ or SACLOS# guidance. Bad programmer jokes aside, the Pereh carries twelve of them.

Structurally, the Pereh is rather interesting. The Israelis went to great lengths to disguise it as a tank. It has a dummy turret, complete with dummy gun, built around the box launcher for the Spike missiles. The box launcher retracts into the turret bustle, and the antenna can fold down. The turret has a pretty serious looking array of explosive reactive armor on it. Remember, the Israelis came up with this stuff first, and they’re pretty good at making it. It would not surprise me if the Pereh kept a bunch of the turret armor of the parent M48/M60/Magach.

So what are the uses? Well, the enemy will see a second-line tank, sitting in the second line, just where they would expect to find it. But from there the Spike missiles can still reduce an approaching tank assault force. The Spike missiles can also be used as precision, short-range artillery against fixed positions, and the IDF has used the Pereh this way to great effect in conflicts in Lebanon. So it’s got shades of the classic M18 Hellcat tank destroyer, but also the StuG III assault gun. And all that ERA will make it more resistant to enemy rockets and ATGMs that might come after it.

We think these are great. And Borgundy would like them too. I wonder if we have any M60s lying around.

On tafl: time use strategy

I wrote last month on game clocks for tafl games, and settled on something like the go game clock: main time, plus replenishing overtimes. You can find my reasoning at that link, so I won’t go into it here, rather taking the opportunity to chat about how to use the time that game clock gives you.

In undertaking any previously un-undertaken task in AI development, this question usually has an instructive answer: “How does chess do it?” Unfortunately, this case is one of the ones where the answer is a little less instructive. A perfectly functional, if not altogether optimal, time usage strategy for a chess AI is to assume that, however many moves the game has taken so far, finishing it will take 20 to 40 more moves. The AI should therefore use between 1/20 and 1/40 of the time remaining. Simple, and surprisingly effective: a chess game gets less complex over time, as pieces come off of the board.

No such luck with tafl games, though. A tafl game starts at moderate complexity, then grows significantly in complexity into the middle game, before tailing off again as the action focuses on a corner and as captures are made1. So, for fixed-time games, we want to spend a moderate amount of time on the early game, the bulk of the time in the middle game, and a decreasing amount of time in the endgame, conserving it as long as possible. For fixed-time games, OpenTafl, in its current incarnation, assumes that it’ll want to make a certain number of opening game moves (3, 5, or 10, for board sizes 7, 9, and 11), a certain number of midgame moves (6, 10, or 20), and an indeterminate number of endgame moves after the midgame. It dedicates a fixed amount of time (at present, 5%, but probably likely to increase) to finish all of its opening moves, a much longer amount of time (presently 75%) to the midgame moves, and a constantly decreasing amount of time to its endgame moves, with the remaining 20%. This seems functional enough in play with me, but the numbers will obviously be tweaked once I finish automatic self-play. (A feature which will be in 0.2.x, I’m pretty sure, given how handy it is for AI developers.)

Four hundred words in, though, and I haven’t yet covered the topic I said I wanted to cover to begin with: how do we handle overtime timing? It turns out that it’s simpler than fixed time, even: take the number of midgame moves above, use the main time for them, and use overtimes for all remaining moves. This, too, may be non-ideal—I could see some benefit to using the fixed-time framework for early game and midgame, and falling back on the overtimes only for endgame moves2.

There are some extra features I hope to add at some point: a little bit of history awareness, so that, whenever OpenTafl sees a wild swing in expected value for the current state, it can dedicate extra time to a deeper search. Another useful addition would probably be some slightly more adaptive time usage generally, with the ability to understand when the game has moved from the early game to the midgame, so that it can adjust its thinking time based on the state of the board, rather than fixed numbers of moves. That said, it’s heartening to see that my system for main time plus overtime time usage is basically what AlphaGo used in its games against Lee Sedol3.

Finally, and a little tangentially, I want to talk about OpenTafl’s success against me on various time controls. Now, I am a poor to average tafl player at best, so you should not take this paragraph to mean that I think OpenTafl has much of a chance against anyone good. Keep that caveat in mind. OpenTafl generally loses to me, and loses pretty severely, on longer time controls: this is a result of its flawed evaluation function4, which, along with alpha-beta pruning, frequently gets rid of branches that are ultimately better than the one it chooses to explore most deeply. The matches are closer with blitz timing: a 60-second brandub game proved to be pretty intense, and I only won with six seconds left on the clock. The shorter time control plays to the computer’s strengths: exhaustive reading three or four plies out, and it gets much closer to me in skill (in part because I can’t read exhaustively in such a small amount of time).

Anyway. That’s your inside look at the most recent major OpenTafl feature. Stay tuned for more in the coming weeks.

1. I should note that by ‘complexity’ here I’m referring mainly to branching factor, the quantitative measure, mixed with a little bit of my sense for what proportion of moves are worth considering, a much more qualitative one, and, for that matter, a much more unreliable one.
2. Although it may strike you that 30 moves for an 11×11 game seems a bit light, consider that it’s actually 30 turns, or 60 moves total: for most 11×11 games, the game has either ended by then, or we’re well into the midgame or late game.
3. I got sleepy just thinking about being up that late. It is my sincere hope that when DeepMind announces its match against Ke Jie or whoever’s next, that they agree to play in London. Or maybe New York. Somewhere closer to Eastern Time, please.
4. A topic I intend to go into deeper detail on in a later post, when I’m working on some cleanup and improvement.

Battle Royale: P320 vs. PPQ vs. VP9

You’ve been waiting for it, and here it is. Parvusimperator’s take on the new crop of striker fired handguns. Well, newish. I’ve waited to see if any bugs fell out (they haven’t). I would get Fishbreath’s opinion too, but he doesn’t have a range with a good rental selection near him. Also, he’s quite fond of hammer fired weapons, because he’s old school like that.

So, let’s get down to it. We’ll look at each pistol, and then do some comparisons.

Walther PPQ
Pros: The best factory trigger on a striker fired pistol. The best. Marginally smaller than the VP9, quite a bit smaller than the P320 full size (this was what I had to rent). Very good ergonomics allowing a nice, high grip. Navy option available, with a cool factory threaded barrel and some extra bits to let you shoot it underwater (not that you care). Ambidextrous slide release.
Cons: Walther has atrocious market penetration. Frankly they have given exactly zero fucks about the American market, so Walther vendors are few and far between. This means that spare parts, accessories, and magazines are the hardest to come by of the three. One upside here is that you won’t get associated with obnoxious Walther fanbois, because there aren’t any fanboys at all, obnoxious or otherwise. Also counting against the PPQ is that it seemed to be somewhat flippy. This is admittedly subjective, but it seemed like it took longer for it to come out of recoil, negating some of the awesomeness of that trigger. More like shooting a .40 S&W, even though this was a 9mm.

HK VP9
Pros: Amazing ergonomics. HK’s grip is one of the best anywhere, with interchangeable side panels and backstraps. Will fit your hand really well; let’s you have a nice high grip. I could gush for hours about the grip. The trigger was very good. I actually prefered it to that of the PPQ and that of the P320 as far as Things I Would Carry. It’s got some take up and a noticeable break, and didn’t feel overly light or heavy. Very smooth. I felt like it had enough take up to feel comfortable carrying and light enough weight (and crisp enough reset) to shoot fast in competition. Again, ambi slide catches. Also, I liked the paddle magazine release, personally. Your mileage may vary.
Cons: The price. HK is the most expensive of the three. Also, you’ll be called an HK fanboy, so be prepared. You suck, and they hate you or something. HK has been really good to LE and Military contractholders. Civilian market, not so much. Their service has gotten way better than it was in the 90s though. You may hate the paddle releases. Accessory availability is meh, spare parts and magazines are available but expensive.

SiG P320
Pros: You may really like the modularity. The trigger lacks that safety blade thing, which is nice. It’s also really short, with very little take up and a very short reset. So it’s really easy to shoot fast, but felt a bit like having a P226 that I hadn’t decocked–I’m not sure if I’d want to carry it like that. Weird. It also feels heavier than the other two. But it’s probably a sweet gamer trigger. SiG has the least shitty aftermarket presence by far of the three, which is big points here. The sights are standard across all their P-series pistols, so those are available now for you. Again, slide release is ambidextrous. And, the P320 gets 17 in the mag, not 15. You might think this is cheating in the comparison, but the mag for the P320 is about the same size as that of the VP9 or the PPQ. And two more bullets is always nice.
Cons: I do not like the modularity. For one thing, every other gun comes with all the stuff you need to monkey around with the grip and figure out which is best for you out of the box. Even HK. With the SiG, you get the medium grip frame, and you have to go buy the others. Good luck finding ones to try in a gun shop before you buy. That’s just cheap and dumb. Further, I have some concerns about the durability of the wee inner module (the actual ‘firearm’, legally speaking). I don’t know how well it will hold up, especially if you’re doing lots of swapping. I probably don’t have anything to worry about here, but there it is. The controls are in their usual SiG place, and seem large. The slide release is super far back, even though there’s no decocker. They really should include the low-profile one so your thumb isn’t hitting it all the time. Once again, some gubbins to buy. Oh, and you’ll be called a SiG fanboy. They’re like HK fanboys, but rarer, because nobody cool uses SiGs anymore. Be sure to get the capitalization right like I’m doing, or expect a flogging.

Finally, I really, really don’t like the modularity. Yes, I’m going to dwell on it because people won’t shut up about it. Look, I don’t live in some communist hell-hole where the number of guns I can own is limited. I live in America. I like guns. I want to buy more guns. That guy behind the counter at my gun store? He wants to sell me more guns. Get with the program, SiG. I’ve never wanted to caliber-convert a 9mm to a .40 or vice versa. 9mm is cheap. .40 is slightly less so, but if I was a .40 guy, I’d want to get used to managing the recoil of the .40, and I’d want my sights to work with the ballistics of .40. Maybe a .22 conversion kit is worth it, if you want a cheap trainer with negligible recoil. But hey, when you’ve bought the new frame, new slide, and new barrel to turn your P320 full size into a compact or your 9mm into a .40, you’ve basically bought a new gun in terms of money spent. So…just buy a new gun, and have more guns. More is better. Duh. If you bought a new gun, you’d have more mags too. Or mags in the new caliber.

Okay, all that out of the way, it’s comparison time!
How do they shoot: Trigger?
PPQ is the best here. That trigger was like nothing at all. Might be almost too light, if we’re talking carry or duty use. Maybe. Hard for me to make that judgement. But it’s great for shooting. It’s like a double action pull with next to no weight. Personally, I rank the VP9 as second since it felt lighter than the P320, and I’ve grown to like some takeup. The P320 pull is heavy and short, which seems an odd combination. I’d like more takeup.

How do they shoot: Accuracy?
VP9 takes top honors here. Maybe this is that HK build quality I keep hearing about. Maybe it’s fitted tighter or there are some match parts or something. P320 comes in second, with a longer sight radius and heavier slide, edging out the PPQ with its great trigger.

How do they shoot: Recoil?
Subjectively, I thought the VP9 was the nicest shooting of the three. It was softer recoiling than the P320, and significantly less flippy than the PPQ. The P320 seems quite heavy for a plastic gun, but the grip is the usual SiG-low. It seemed jumpy, but wasn’t flippy. For purely subjective definitions of ‘jumpy’ and ‘flippy’ of course, since I don’t have a great way to measure recoil. Again, your shooting preferences will dictate your choice. Personally, I like the higher grip of the VP9. You might like the traditional SiG-style grip on the P320, which is a little lower. The PPQ was noticeably harsher and flipper. Not bad, but they’ve managed to make a 9mm feel .40-like in a handgun that isn’t a mousegun. Quite a trick.

How do the Ergonomics Compare?
The VP9 has the best ergos by far with all the side panels. It lets you get the right fit for your hand, even if you shoot better with something asymmetric. The little “cocking tabs” are nice for those with less grip strength. Or just to make you work less at it. The PPQ has a similar sort of shape as the VP9, but has only adjustable backstraps, like most pistols. Still, it fills the hand well and gives you a high grip naturally. The SiG will not let you get as high on it. It fitted my hand reasonably well, but I might have liked to play with the different frame sizes. I prefer a higher grip, or else it would have scored better here. Note also that the SiG only comes with the standard grip-frame module. If you want another size, you’ve gotta go buy it.

Were the guns grippy enough?
No. Nothing was grippy enough. That said, I like guns with barbed grips, or barring that, 20 lpi checkering. Maybe I should have these stippled.

Also, note that all three of these guns only come with two magazines, which is the bare acceptable minimum these days. I would have been much happier if they came with three magazines in the box. Not a dealbreaker, but you should be aware. All of them have crappy magazine prices. No wonderfully cheap Glock or M&P mags here.

Alright, now we come to the main event. Which should you buy? Well, being as this is America, you should buy all three. But that’s not a very helpful answer. Neither is ‘They’re all quite good, you can’t go wrong with any of them.’

Realistically, you should rent all three, and go home with whichever one you shoot best, preferably with some timed/scored drills. This may or may not be possible for you, based on what the ranges near you have available for rent, and how they’re configured.
You should also probably wait a little while and see what my friends Mr. Foxtrot, Mr. Bravo, and Mr. India come up with when they go to choose, since that design will get a big leg up in the aftermarket presence. But that means waiting. Again, rent them and draw your own conclusions.

Of course after all that, you’re still not satisfied. You want to know two things: Which one is best, and is it better than a Glock?

Fine.

Of the three, I’d take the VP9. I shot it best, I like it’s trigger for anything I might choose to do with it (including carry and competition), the ergonomics are great, and it shoots well. Plus, there’s plenty of cachet from being an HK owner. I’m a cool, badass CTU agent. Or…maybe I suck? I don’t know, I lost track of my metaphors in the aura of Teutonic greatness. But, shut up this pistol is great. You wouldn’t understand, you non-HK-owning peon. Go sit with the filth and buy your scum class tickets.

So is it better than my Glock 17? That depends. In terms of what you get out of the box, no contest. HK wins all the way. Better trigger, better ergonomics, better sights. Glock has an extra magazine, but that doesn’t quite make up the difference. The VP9 is the better pistol.

However, who the hell leaves a Glock stock? There’s a ton of aftermarket support for Glocks. Any sights you could possibly imagine, you can get. You can get bigger or smaller controls for the mag release and the slide release to fit your preference. You can get aftermarket triggers and fire control parts to make the trigger into anything you like, from a heavier duty trigger to a tuned competition trigger. You get a lot more sight options from experimenters and small outfits with Glock. Hell, you can build a Glock entirely from parts that aren’t made by Glock. So it’s simply a question of how much you like to tinker. If you want to tinker, get the Glock. It will reward experimentation. If you want to buy a pistol, add the sights of your choice, and be done, get the HK.

But really, this is America. The correct answer is to buy the Glock and the HK.

OpenTafl v0.2.0: Engine support arrives

In experimental, incomplete fashion, but it’s sufficient for you, as a developer, to start working with OpenTafl in engine mode. You can find the new version at the OpenTafl site. The engine protocol document has been updated with the latest developments. Although I won’t be able to say for sure until I’ve finished the implementation, this version of the protocol is nearly feature-complete, and likely won’t change very much going forward.

Expect a post in the not-too-distant future on OpenTafl’s time usage planning and time-filling activities, both of which are topics of some interest.

AlphaGo-Lee Sedol Game 5 Liveblog

Coming tonight: AlphaGo-Lee Sedol Game 5 liveblog

What was looking like it could turn into a 5-0 stomping is now at worst a 4-1 loss, and if Lee Sedol can play to the same level he did yesterday, it may be a mere 3-2 win for the computer.

The Many Words crew will be on hand tonight to provide you the best in altogether amateurish coverage of the game. Stay tuned for the post nearer the start of the match.

The Crossbox Podcast: Episode 5 – March Madness

In this week’s edition, we discuss a rarely-considered and rarely-used firearms choice, a study sim masquerading as Ace Combat, and a procurement project we’ve decided should be struck by lightning.

Also, I discover that there’s a default Audacity plugin for every single sound editing task I have thus far been doing by hand. Oops.


(Download)

Daylight time at last

Parvusimperator gave me an attaboy for writing something so topical as the go tournament posts, so here’s another topical one for you.

We come now to my favorite time of the year: that time when, at long last, we cast off the gloomy shackles of winter and leap forward into the boundless delights of spring and summer.

If you haven’t guessed, I’m in favor of summer time; or rather, I’m in favor of summer time year-round1. For this position I can cite manifold justifications.

First: when it comes to which hours are daylight hours, there is no clear economic benefit either way. Standard time and Daylight time are identical.

Second: switching between Standard and Daylight time results in, by some people’s figures, half a billion dollars of lost productivity. Now we’re getting somewhere: clearly, we shouldn’t switch.

Third: daylight hours are more useful in the evening than in the morning. This is so obvious as to require no explanation, but I’ll go into it a little bit anyway, in case you need convincing.

Nobody likes driving into work when it’s dark out. I understand this. At the same time, in any place where daylight saving time matters, if you wait until it’s light outside to drive to work, you’ll likely be driving home from work when it’s dark. The only time in which you’re truly free to use daylight, if you’re one of the vast majority of people who work during the day, is in the evening, and therefore you should not freely part with your evening daylight.

There are some people who like to run in the mornings, for which daylight is an advantage. Leaving aside that these people, who are looking to run outside when the weather is at its coldest, are clearly madmen (and I say that as a runner), permanent daylight time does not significantly change the calculus. If you wait until the sun comes up to go into work, you’re going to be coming back when the sun’s going down anyway; you don’t lose anything.

Then, of course, we come to summertime: a season defined in large part, for large parts of the world, by long, pleasant evenings. Those evening hours, especially for those of us living in places which see a lot of rain, snow, and cold during the rest of the year, are some of the most precious times of the year. Surrendering that time for four hours of daylight before work is perilously silly, and frankly un-American.

So yeah. I’m ambivalent-to-negative on the whole clock-changing thing, but if we are going to settle on one time, it has to be daylight time. If you want permanent standard time, well, I’m more than ready to argue that we should keep changing the clocks, because daylight time is just straight-up better.

1. I accept that there are places, like Arizona, where an extra hour of daylight in otherwise-usable hours of the summer evenings is a bad idea, but they can just take the opposite position that I’m taking here.

AlphaGo-Lee Sedol: 2-0

AlphaGo takes Lee Sedol in a second game, going up 2-0 and setting itself up for a match victory, if it wins any of the remaining games. Here’s the game replay, or you can go to DeepMind’s Youtube channel and watch the stream. The replay has decent commentary in the chat window, albeit from strong amateur players rather than pros. You can also find some remarks from An Younggil, GoGameGuru’s resident pro, in the comment thread.

This one played out differently; fights didn’t develop until later on in the game, and Lee Sedol did indeed play a more normal opening. He also took a lot more time to play today, a sign of greater caution and probably greater respect for AlphaGo. AlphaGo, however, got ahead and remained ahead on time, and Lee was into byo-yomi while AlphaGo still had fifteen minutes of main time left. At about move 210, Lee resigned, and seemed shaken by the loss.

Which is understandable. Go players and go experts had gotten used to the idea that their pursuit was computationally unassailable. (On your average desktop PC, it still is, for now.) It’s undoubtedly a bit of a shock to them that the tables have turned so quickly; I think we from the computational side are a little better able to recover, because reading about how AlphaGo plays makes us think, “Oh, yeah, that sounds like it should work really well.”

What does it mean for go, though? Well, let’s look at what happened to chess: it’s still played at high levels, human matches draw more eyes than machine matches, you can always find an opponent who is about as good as you are, and correspondence chess is basically dead.

Wait a minute. That last one sounds bad.

Something we discovered, as chess engines capable of beating the best humans became easily available, is that chess, under the rules we use, is a very draw-happy game. In fact, in correspondence chess, where the use of AI as an aid is accepted, draws are now the overwhelmingly most likely outcomes for games: between 80% and 90% of games in the most recent few correspondence chess championships have been drawn. This is widely seen as bad: a tie is a deeply unsatisfying outcome, and it makes sorting players in a tournament a bit of a pain. Much ink both real and digital has been spilled on how to solve the draw problem in chess; if it should turn out (as it did for checkers) that optimal play in chess inevitably leads to a draw, something will probably have to be done, but no chess expert wants to commit to changing the rules in a way whose implications may not be known.

Go1 is a game whose ultimate scoring comes down to points. Playing first is known to be advantageous, so the rules traditionally spot white (the second player to move) 6.5 or 7.5 points, depending on the scoring method in use. The half-point ensures that there can be no ties, and should AI reveal heretofore unknown differences in strength from that 6.5 or 7.5 edge, the handicap can simply be adjusted.

So, where will go be in ten years? Just as vital as today, and perhaps even more so: a hundred thousand people have watched AlphaGo play Lee Sedol on Youtube, and I can’t help but think that a lot of those are English-speakers who have not yet been really introduced to the game. Although I still find go inscrutable, and don’t expect I’ll ever be anything more than a poor recreational player, some of the fellow AI nerds watching will likely be drawn to the game, and once you have us nerds on your side…

1. And, for that matter, most solutions for how to handle tafl matches: bidding on the number of turns a win will take, and playing two-game matches, switching sides and giving the win to the player who wins fastest (if they split the games), both yield a natural, built-in way to compensate for shifts in observed balance. Furthermore, since tafl rules are, as yet, not standardized in any meaningful way, differing tournament to tournament, tafl has an edge on chess that go does not: the tafl community is very open to rules changes to support greater balance or deeper strategy.