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.
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
A Castle Built From Random Rooms is a work in progress/early access/demo version of a full game that’ll probably never exist. But if it does exist, it will be
basically the same as this, but on a grander scale, and include the following features:
– over a hundred random rooms instead of about ten
– character jobs and descriptions that actually add individualised effects/skills/starting equipment and so on
– special pre-chosen characters with particulalrly challenging stats levels for extra difficult challenges
– more stats! more items! more use of the stats and items within different rooms to create different outcomes!
– high scores and loot rankings and possibly even achievements of some kind
– less bugs (aspiration)
– decent endings (stretch goal)
What the game almost certainly won’t ever have:
– any semblance of quality or coherence
– sound and/or music
– monetary success
It’s a Twine-like choose-your-own-adventure, but with the rooms randomly shuffled each time, in sort-of a semi-rougelite way. Some imaginative work in this. And the art style is
wonderful!
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.
Y’all seemed to enjoy the “overworld” map I shared the other day, so here’s another “feelie” from my kids’ ongoing D&D campaign.
The party has just arranged for passage aboard a pioneering (and experimental) Elvish airship. Here’s a deck plan (only needs a “you are here” dot!) to help them get their bearings.
In preparation for Family D&D Night (and with thanks to my earlier guide to splicing maps together!), I’ve finally completed an
expanded “overworld” map for our game world. So far, the kids have mostly hung around on the North coast of the Central Sea, but they’re picked up a hook that may take them all the way
across to the other side… and beyond?
Banana for scale.
(If your GMing for kids, you probably already know this, but “feelies” go a long way. All the maps. All the scrolls. Maybe even some props. Go all in. They love it.)
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.
Made a little progress on the game idea I’d been experimenting with. The idea is to do find a series of orthogonal (like a rook in chess!)
moves that land on every square exactly once each before returning to the start, dodging walls and jumping pits.
But the squares have arrows (limiting the direction you can move out of them) or numbers (specifying the distance you must travel from them).
Every board is solvable, starting from any square. There’ll be a playable version to use on your device (with helpful features like “undo”) sometime soon, but for now you can give them
a go by hand, if you like this kind of puzzle!
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.
I didn’t know how to solve the puzzle, but I did know how to write a computer program to solve it for me. That would probably be even more fun, and I could argue that it didn’t
actually count as cheating. I didn’t want the solution to reveal itself to me before I’d had a chance to systematically hunt it down, so I dived across the room to turn off the
console.
I wanted to have a shower but I was worried that if I did then inspiration might strike and I might figure out the answer myself. So I ran upstairs to my office, hit my Pomodoro
timer, scrolled Twitter to warm up my brain, took a break, made a JIRA board, Slacked my wife a status update, no reply, she must be out of signal. Finally I fired up my preferred
assistive professional tool. Time to have a real vacation.
…
Obviously, I’d be a fan of playing your single-player video game any damn way you like. But beyond that, I see Robert’s point: there are some
puzzles that are just as much (or more) fun to write a program to solve than to solve as a human. Digital jigsaws would be an obvious
and ongoing example, for me, but I’ve also enjoyed “solving” Hangman (not strictly a single-player game, but
my “solution” isn’t really applicable to human opponents anyway), Mastermind (this is single-player, in my personal
opinion – fight me! – the codemaster doesn’t technically have anything “real” to do; their only purpose is to hold secret information), and I never got into Sudoku principally because I
found implementing a solver much more fun that being a solver.
Anyway: Robert’s post shows that he’s got too much time on his hands when his wife and kids are away, and it’s pretty fun.