Recent discussion about the perils of doors in gamedev reminded me of a bug caused by a door in a game you may have heard of called “Half Life 2”. Are you sitting comfortably? Then
I shall begin.
…
What is meant to happen is a guard (spoiler alert – it’s actually Barney in disguise) bangs on a door, the door opens, he says “get in”, and then the game waits for you to enter
the room before the script proceeds.
But in this case the door sort of rattled, but didn’t open, and then locked shut again. So you can’t get in the room, and the gate closed behind you, so you can’t go do anything
else. The guard waits forever, pointing at the locked door, and you’re stuck.
…
If you watch the video, when the door unlocks and then opens, there’s a second guard standing inside the room to the left of the opening door. That guard is actually standing very
slightly too close – the very corner of his bounding box intersects the door’s path as it opens. So what’s happening is the door starts to open, slightly nudges into the guard’s
toe, bounces back, closes, and then automatically locks. And because there’s no script to deal with this and re-open the door, you’re stuck.
…
So this kicked off an even longer bug-hunt. The answer was (as with so many of my stories) good old floating point. Half Life 2 was originally shipped in 2004, and although the SSE
instruction set existed, it wasn’t yet ubiquitous, so most of HL2 was compiled to use the older 8087 or x87 maths instruction set. That has a wacky grab-bag of precisions – some
things are 32-bit, some are 64-bit, some are 80-bit, and exactly which precision you get in which bits of code is somewhat arcane.
…
Amazing thread from Tom Forsyth, reflecting on his time working at Valve. The tl;dr is that after their compiler was upgraded (to support the SSE instruction sets that had now become
common in processors), subsequent builds of Half-Life 2 became unwinnable. The reason was knock-on effects from a series of precision roundings, which meant that a Combine
security guard’s toe was in a slightly wrong place and the physics engine would bounce a door off him.
A proper 500-mile-email grade story, in terms of unusual bugs.
This weekend, I received my copy of DOCTYPE, and man: it feels like a step back to yesteryear to type in a computer program from a
magazine: I can’t have done that in at least thirty years.
So yeah, DOCTYPE is a dead-tree (only) medium magazine containing the source code to 10 Web pages which, when typed-in to your computer, each provide you with some kind of fun and
interactive plaything. Each of the programs is contributed by a different author, including several I follow and one or two whom I’m corresponded with at some point or another, and each
brings their own personality and imagination to their contribution.
I opted to start with Stuart Langridge‘s The Nine Pyramids, a puzzle game about trying to connect all nodes in a 3×3 grid in a
continuous line bridging adjacent (orthogonal or diagonal) nodes without visiting the same node twice nor moving in the same direction twice in a row (that last provision is described
as “not visiting three in a straight line”, but I think my interpretation would have resulted in simpler code: I might demonstrate this, down the line!).
The puzzle actually made me stop to think about it for a bit, which was unexpected and pleasing!
Per tradition with this kind of programming, I made a couple of typos, the worst of which was missing an entire parameter in a CSS conic-gradient() which resulted in the
majority of the user interface being invisible: whoops! I found myself reminded of typing-in the code for Werewolves and
Wanderer from The Amazing Amstrad Omnibus, whose data section – the part most-liable to be affected by a typographic bug without introducing a syntax error – had
a helpful “checksum” to identify if a problem had occurred, and wishing that such a thing had been possible here!
But thankfully a tiny bit of poking in my browser’s inspector revealed the troublesome CSS and I was able to complete the code, and then the puzzle.
I’ve really been enjoying DOCTYPE, and you can still buy a copy if you’d like one of your own. It manages to simultaneously feel both fresh and nostalgic,
and that’s really cool.
I’d love to write a longer review to praise the art style and the concept, but there’s not much to say. Just… go and give it a shot; it’ll improve your day, I’m sure.
Or: Sometimes You Don’t Need a Computer, Just a Brain
I was watching an episode of 8 Out Of 10 Cats Does Countdown the other night1
and I was wondering: what’s the hardest hand you can be dealt in a Countdown letters game?
Or maybe I was just looking for an excuse to open an image editor, I don’t know.
Sometimes it’s possible to get fixated on a particular way of solving a problem, without having yet fully thought-through it. That’s what happened to me, because the first thing I did
was start to write a computer program to solve this question. The program, I figured, would permute through all of the legitimate permutations of letters that could be drawn in a game
of Countdown, and determine how many words and of what length could be derived from them2.
It’d repeat in this fashion, at any given point retaining the worst possible hands (both in terms of number of words and best possible score).
When the program completed (or, if I got bored of waiting, when I stopped it) it’d be showing the worst-found deals both in terms of lowest-scoring-best-word and fewest-possible-words.
Easy.
Here’s how far I got with that program before I changed techniques. Maybe you’ll see why:
At this point in writing out some constants I’d need to define the rules, my brain was already racing ahead to find optimisations.
For example: given that you must choose at least four cards from the consonants deck, you’re allowed no more than five vowels… but no individual vowel appears in the vowel deck fewer
than five times, so my program actually had free-choice of the vowels.
Knowing that3, I figured that there must exist Countdown deals that contain no valid words, and
that finding one of those would be easier than writing a program to permute through all viable options. My head’s full of useful heuristics about English words, after all, which leads
to rules like:
None of the vowels can be I or A, because they’re words in their own right.
Five letter Us is a strong starting point, because it’s very rarely used in two-letter words (and this set of tiles is likely to be hard enough that three-letter words are already
an impossibility).
This eliminates the consonants M (mu, um: the Greek letter and the “I’m thinking” sound), N (nu, un-: the Greek letter and the inverting prefix), H (uh: another sound for when
you’re thinking or hesitating), P (up: the direction of ascension), R (ur-: the prefix for “original”), S (us: the first-person-plural pronoun), and X (xu: the unit of currency). So as
long as we can find four consonants within the allowable deck letter frequency that aren’t those five… we’re sorted.
I came up with U J Y U Q V U U Z, but there are definitely many other tile-sets that are completely valid within the rules of Counddown (albeit insanely unlikely to turn
up organically) but for which there are no valid words to be found.
I enjoyed getting “Q” into my proposed letter set. I like to image a competitor, having already drawn two “U”s, a “J”, and a Y”, being briefly happy to draw a “Q” and already thinking
about all those “QU-” words that they’re excited to be able to use… before discovering that there aren’t any of them and, indeed, aren’t actually any words at all.
Even up to the last letter they were probably hoping for some consonant that could make it work. A K (juku), maybe?
But the moral of the story is: you don’t always have to use a computer. Sometimes all you need is a brain and a few minutes while you eat your breakfast on a slow Sunday morning, and
that’s plenty sufficient.
Update: As soon as I published this, I spotted my mistake. A “yuzu” is a kind of East
Asian plum, but it didn’t show up in this countdown solver! So my impossible deal isn’t quite so impossible after
all. Perhaps U J Y U Q V U U C would be a better “impossible” set of tiles, where that “C” makes it briefly look like there might be a word in there, even if it’s just a three
or four-letter one… but there isn’t. Or is there…?
Footnotes
1 It boggles my mind to realise that show’s managed 28 seasons, now. Sure, I know that
Countdown has managed something approaching 9,000 episodes by now, but Cats Does Countdown was always supposed to be a silly one-off, not a show in it’s own
right. Anyway: it’s somehow better than both 8 Out Of 10 Cats and Countdown, and if you disagree then we can take this outside.
2 Herein lay my first challenge, because it turns out that the letter frequencies and even
the rules of Countdown have changed on several occasions, and short of starting a conversation on what might be the world’s nerdiest
surviving phpBB installation I couldn’t necessarily determine a completely up-to-date ruleset.
3 And having, y’know, a modest knowledge of the English language
Blender Studio’s official game project is a short casual interactive story. Play a big, adorable dog traversing through winter woods and help out a little kid decorate a snowman
with colorful items hidden in the environment.
…
…
DOGWALK is a free, open-source Godot game for Windows, MacOS and Linux, produced and given to the world by Blender Studio as a way of
showcasing some of their video lessons. The beautiful, playful “papercraft” models were made by making actual hand-painted paper models of the assets, unfolding them,
scanning them, and then re-folding the maps back into in-game assets, which is an amazing and imaginative approach.
It was released a little over a week ago, and it’s a short but adorable little game.
You’ve probably come across GeoGuessr already: it’s an online game where you (and friends, if you’ve got them) get dropped into Google Street
View and have two minutes to try to work out where in the world you are and drop a pin on it.
Can you tell where we are, yet?
A great strategy is to “walk around” a little, looking for landmarks, phone numbers, advertisements, linguistic clues, cultural indicators, and so on, narrowing down the region of the
world you think you’re looking at before committing to a country or even a city. You’re eventually scored by how close you are to the actual location.
Cheating at GeoGuessr
I decided to see if ChatGPT can do better than me. Using only the free tier of both GeoGuessr and ChatGPT1, I pasted
screenshots of what I was seeing right into ChatGPT:
ChatGPT confidently assessed the geographic clues, translated some text that it found, and eventually made a guess down to a particular street in St Petersburg.
That’s pretty spooky, right?
The response came back plenty fast enough for me to copy-and-paste the suggested address into Google Maps, get the approximate location, and then drop a pin in the right place in
GeoGuessr. It’s probably one of my most-accurate guesses ever.
This isn’t a one-off fluke. I tried again, this time using only a single photo, rather than one pointing in each direction on the street:
Again, the text recognition and translation capabilities of the AI were highly useful, but it was helped by architectural and cultural clues too.
This time, it wasn’t quite right: the actual location of the photo was Chittagong, not Dhaka, about 200km away.
But that’s still reasonably spectacular from only a single vantage from a single point.
Don’t think I’d have done better, though.
Obviously my approach here was crude, but it’d be relatively easy to, for example, implement a browser wrapper that cheated on-your-behalf: while playing GeoGuessr, you’d just click a
“send to AI” button whenever you fancied and it’d start working in the background, improving precision with each subsequent screenshot (so you could still “walk around” and pass extra
details to it).
And similarly, a little prompt manipulation could have the output include estimated GPS coordinates, allowing the code to place the pin for you while outputting its reasoning
on the side2.
The short of what I’m saying is: if you’re playing GeoGuessr against somebody you don’t trust not to cheat… they might well be cheating. And thanks to the explanatory output, they can
even justify their explanations for the places they dropped pins.
What about other photos?
The other thought that comes to my mind is: could this be used to infer approximate geolocations from photos whose EXIF metadata has been stripped. Because if so, that’s the
kind of thing that’s certain to get exploited by all kind of people who want to know where you are/were at a particular time. For example… law enforcement, stalkers, and
other unsavoury types.
Explanation: The photograph shows a large ship docked at a port with a building that displays the text “WELCOME TO PORT OF SPAIN”. This text is in English,
indicating an English-speaking country. The mention of “Port of Spain” directly specifies the port’s location in the capital city of Trinidad and Tobago. The design and style of
the port facilities, as well as the presence of a ship named “Logos Hope”, which is known to visit many ports globally, further suggests a Caribbean port, aligning with Port of
Spain’s known characteristics.
Location: The Rollright Stones, England, United Kingdom
Explanation: The photograph depicts an area with several ancient standing stones arranged in a circle in a rural setting, characteristic of a stone circle.
These are typically found in certain parts of the UK. The terrain is typical of the British countryside, with a grassy field and surrounding trees. The specific arrangement
and size of the stones, along with the style of fencing and walking paths, are reminiscent of the Rollright Stones, one of Britain’s historic sites known for a circle of
Neolithic or Bronze Age standing stones located in Oxfordshire, England.
Coordinates: 51.9743, -1.5731
✅ Again, spot on. If you’d never been to the Rollright Stones, you probably wouldn’t get that one, because while it’s a distinctive-looking stone circle… it’s not that
distinctive-looking, right? Let’s be honest: it’s some rocks in a field.
Explanation: The photograph prominently features the Galata Tower in the background, a well-known landmark in Istanbul, Turkey. Moreover, the presence of a ferry
or similar boat and the architectural style of the surrounding buildings are indicative of Istanbul’s famous skyline. The signage in Turkish, as suggested by the word partially
visible on the left, also supports this location as Turkey is a predominantly Turkish-speaking country. These elements combined make it highly likely that the photograph was taken
in Istanbul.
Coordinates: 41.0082, 28.9784
✅ The coordinates aren’t exactly right – it’s placed us in the city rather than on a boat, which we clearly are – but it’s not done badly. Spotting the Galata Tower3 was a nice move.
Location: Cardiff Bay, Cardiff, Wales, United Kingdom
Explanation: The photograph features a marina with modern residential buildings, which is characteristic of the Cardiff Bay area in Cardiff, Wales. The
architecture, clear blue skies, and marina setting are reminiscent of Cardiff’s waterfront development. Additionally, the presence of English signage on the boat (“FINBAR”)
supports a location in an English-speaking country. Cardiff Bay is known for its redeveloped waterfront area with modern apartments and leisure facilities surrounding the marina.
The style and design of the building are consistent with developments in Cardiff’s revitalized docklands.
Coordinates: 51.4626, -3.1678
❌ Oops! Nope. I can see the thinking of what it’s claiming, there, but this was actually the Ipswich marina. I went for a walk to take a break from the code I’d been writing
and took this somewhere in the vicinity of the blue plaque for Edward Ardizzone that I’d just spotted (I was
recording a video for my kids, who’ve enjoyed several of his Tim… books).
So I don’t think this is necessarily a game-changer for Internet creeps yet. So long as you’re careful not to post photos in which you’re in front of any national monuments and
strip your EXIF metadata as normal, you’re probably not going to give away where you are quite yet.
Footnotes
1 And in a single-player game only: I didn’t actually want to cheat anybody out
of a legitimate victory!
2 I’m not going to implement GeoCheatr, as I’d probably name it. Unless somebody
feels like paying me to do so: I’m open for freelance work right now, so if you want to try to guarantee the win at the GeoGuessr World Championships (which will involve the much-riskier act of cheating in
person, so you’ll want a secret UI – I’m thinking a keyboard shortcut to send data to the AI, and an in-ear headphone so it can “talk” back to you?), look me up? (I’m mostly
kidding, of course: just because something’s technically-possible doesn’t mean it’s something I want to do, even for your money!)
4 3Camp is Three Rings‘ annual volunteer
get-together, hackathon, and meetup. People come together for an intensive week of making-things-better for charities the world over.
In light of Trump’s attempts to axe Voice of America, because it is, he claims,
“anti-Trump” (and because he’s so insecure that he can’t stand the thought that taxpayer dollars might go to anybody who disagrees with him in any way, for any reason), I’ve produced a
suggested update to the rules of Twilight Struggle for the inevitable 9th
printing:
I guess the Russian player gets to stretch their influence unchecked, anywhere they want, from 2025 onwards.
In the game, I mean.
Yet another blow to US soft power in order to appease the ego of convicted felon Donald Trump. Sigh.
Being on your phone all the time and while also not being on your phone all the time has never been more important.
“It is as if you were on your phone” is a phone-based experience for pretending to be on your phone without needing to be on your phone. All from the comfort of your phone.
Relax and blend in with familiar gestures and realistic human behaviour.
When I tried this fun and experimental game, I was struck by a feeling of deja vu. Was this really new? It felt ever so familiar.
Turns out, it draws a lot of inspiration from its 2016 prequel, It is as if you were playing
chess. Which I’d completely forgotten about until just now.
It really is almost as if I were on my phone.
Anyway, It is as if you were on your phone is… well, it’s certainly a faithful simulation of what it would be like to be on my phone. If you saw me, you’d genuinely think that
I was on my phone, even though in reality I was just playing It is as if you were on your phone on my phone. That’s how accurate it is.
I’ve been playing Sean O’Connor’s Slay for around 30 years (!), but somehow it took until today, on the Android version,
before I tried my hand at “rewilding” the game world.
The rules of the game make trees… a bad thing: you earn no income from hexes with them. But by the time I was winning this map anyway, I figured that encouraging growback would be a
pleasant way to finish the round.
Play your videogames any damn way you want. Don’t let anybody tell you there’s a right or wrong way to enjoy a single-player game. Today I took a strategy wargame and grew a forest. How
will you play?
Except to children, I don’t really give Christmas presents to (or expect to receive them from) others any more.
But that didn’t stop my buying myself a gift of a particularly fun Lego set to build over the festive period (with a little help from the eldest child!).
Dungeons & Dragons players spend a lot of time rolling 20-sided polyhedral dice, known as D20s.
In general, they’re looking to roll as high as possible to successfully stab a wyvern, jump a chasm, pick a lock, charm a Duke1,
or whatever.
Submerging your dice set in the blood of a halfling is a sure-fire way to get luckier rolls.
Roll with advantage
Sometimes, a player gets to roll with advantage. In this case, the player rolls two dice, and takes the higher roll. This really boosts their chances of not-getting a
low roll. Do you know by how much?
I dreamed about this very question last night. And then, still in my dream, I came up with the answer2.
I woke up thinking about it3
and checked my working.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
2
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
3
3
3
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
4
4
4
4
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
5
5
5
5
5
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
6
6
6
6
6
6
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
7
7
7
7
7
7
7
7
8
9
10
11
12
13
14
15
16
17
18
19
20
8
8
8
8
8
8
8
8
8
9
10
11
12
13
14
15
16
17
18
19
20
9
9
9
9
9
9
9
9
9
9
10
11
12
13
14
15
16
17
18
19
20
10
10
10
10
10
10
10
10
10
10
10
11
12
13
14
15
16
17
18
19
20
11
11
11
11
11
11
11
11
11
11
11
11
12
13
14
15
16
17
18
19
20
12
12
12
12
12
12
12
12
12
12
12
12
12
13
14
15
16
17
18
19
20
13
13
13
13
13
13
13
13
13
13
13
13
13
13
14
15
16
17
18
19
20
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
15
16
17
18
19
20
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
16
17
18
19
20
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
17
18
19
20
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
18
19
20
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
19
20
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
Table illustrating the different permutations of two D20 rolls and the “advantage” result (i.e. the higher of the two).
The chance of getting a “natural 1” result on a D20 is 1 in 20… but when you roll with advantage, that goes down to 1 in 400: a huge improvement! The chance of rolling a 10 or 11 (2 in
20 chance of one or the other) remains the same. And the chance of a “crit” – 20 – goes up from 1 in 20 when rolling a single D20 to 39 in 400 – almost 10% – when rolling with
advantage.
You can see that in the table above: the headers along the top and left are the natural rolls, the intersections are the resulting values – the higher of the two.
The nice thing about the table above (which again: was how I visualised the question in my dream!) is it really helps to visualise why these numbers are what they are. The
general formula for calculating the chance of a given number when rolling D20 with advantage is ( n2 – (n-1)2 ) / 400. That is, the square of the number
you’re looking for, minus the square of the number one less than that, over 400 (the total number of permutations)4.
Why roll two dice when one massive one will do?
Knowing the probability matrix, it’s theoretically possible to construct a “D20 with Advantage” die5. Such a tool would
have 400 sides (one 1, three 2s, five 3s… and thirty-nine 20s). Rolling-with-advantage would be a single roll.
I don’t think anybody’s ever built a real 400-sided die, but Numberwang! claimed to have one.
This is probably a totally academic exercise. The only conceivable reason I can think of would be if you were implementing a computer system on which generating random numbers
was computationally-expensive, but memory was cheap: under this circumstance, you could pre-generate a 400-item array of possible results and randomly select from it.
But if anybody’s got a 3D printer capable of making a large tetrahectogon (yes, that’s what you call a 400-sided polygon – you learned something today!), I’d love to see an “Advantage
D20” in the flesh. Or if you’d just like to implement a 3D model for Dice Box that’d be fine too!
Footnotes
1 Or throw a fireball, recall an anecdote, navigate a rainforest, survive a poisoning,
sneak past a troll, swim through a magical swamp, hold on to a speeding aurochs, disarm a tripwire, fire a crossbow, mix a potion, appeal to one among a pantheon of gods, beat the
inn’s landlord at an arm-wrestling match, seduce a duergar guard, persuade a talking squirrel to spy on some bandits, hold open a heavy door, determine the nature of a curse, follow a
trail of blood, find a long-lost tome, win a drinking competition, pickpocket a sleeping ogre, bury a magic sword so deep that nobody will ever find it, pilot a spacefaring rowboat,
interpret a forgotten language, notice an imminent ambush, telepathically commune with a distant friend, accurately copy-out an ancient manuscript, perform a religious ritual, find
the secret button under the wizard’s desk, survive the blistering cold, entertain a gang of street urchins, push through a force field, resist mind control, and then compose a ballad
celebrating your adventure.
2 I don’t know what it says about me as a human being that sometimes I dream in
mathematics, but it perhaps shouldn’t be surprising given I’m nerdy enough to have previously recorded instances of dreaming in (a) Perl, and (b) Nethack (terminal mode).
3 When I woke up I also found that I had One Jump from Disney’s Aladdin stuck in my head, but I’m not sure
that’s relevant to the discussion of probability; however, it might still be a reasonable indicator of my mental state in general.
4 An alternative formula which is easier to read but harder to explain would be ( 2(n
– 1) + 1 ) / 400.
5 Or a “D20 with Disadvantage”: the table’s basically the inverse of the advantage one –
i.e. 1 in 400 chance of a 20 through to 39 in 400 chance of a 1.
In the late ’70s, a shadowy group of British technologists concluded that nuclear war was inevitable and secretly started work on a cutting-edge system designed to help
rebuild society. And thanks to Matt Round-and-friends at vole.wtf (who I might have
mentioned before), the system they created – ARCC – can now be emulated in your browser.
I’ve been playing with it on-and-off all year, and I’ve (finally) managed to finish exploring pretty-much everything the platform currently has to offer, which makes it pretty damn good
value for money for the £6.52 I paid for my ticket (the price started at £2.56 and increases by 2p for every ticket sold). But you can get it cheaper than I did if you score 25+ on one
of the emulated games.
It gives me more pride than it ought to that I hold the high score for a mostly-unheard-of game for an almost-as-unheard-of computer system.
Most of what I just told you is true. Everything… except the premise. There never was a secretive cabal of engineers who made this whackballs computer system. What vole.wtf emulates is
an imaginary system, and playing with that system is like stepping into a bizarre alternate timeline or a weird world. Over several separate days of visits you’ll explore more
and more of a beautifully-realised fiction that draws from retrocomputing, Cold War fearmongering, early multi-user networks with dumb terminal interfaces, and aesthetics that straddle
the tripoint between VHS, Teletext, and BBS systems. Oh yeah, and it’s also a lot like being in a cult.
Needless to say, therefore, it presses all the right buttons for me.
If you make it onto ARCC – or are already there! – drop me a message. My handle is DAN50.
If you enjoy any of those things, maybe you’d like this too. I can’t begin to explain the amount of work that’s gone into it. If you’re looking for anything more-specific in a
recommendation, suffice to say: this is a piece of art worth seeing.