Castles and mazes

Possibly I’m a little late for the “casual daily puzzle game” party. (Did Wordle already get invented in this timeline; I forget?)

I think there’s something in an idea I’ve been toying with. Bring on the weekend, when I can throw some brainpower at the frontend code!

A notebook is held in front of terminal output. The terminal begins with 'Start position: [0,4]' and then shows a series of 5×5 grids containing numbers: one, labelled 'Route:', shows random grid of the numbers 0 through 24; the second, labelled 'Puzzle:', contains 1s, 2s, and 3s, corresponding perhaps to the orthagonal distances between consecutive numbers from the first grid; the third, whose title is obscured by the notebook, shows the same thing again but with 'walls' drawn in ASCII art between some of the numbers. The notebook in front contains hand-drawn sketches of similar grids with arrows "jumping" around between them.

×

It’s not cheating if you write the video game solver yourself

This is a repost promoting content originally published elsewhere. See more things Dan's reposted.

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.

It is as if you were on your phone

This is a repost promoting content originally published elsewhere. See more things Dan's reposted.

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.

Give it a go on your phone and see if you agree.

Rewilding Slay

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.

Hex-based videogame board, entirely owned by the yellow player, but with only a single solitary soldier standing alone. The rest of the island is heavily forested in pine and, along one coast, palm trees, with the exception of the far North beyond a line of castles.

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?

×

Lego: Zero Dawn

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!).

Lego model of a Tallneck from videogame Horizon: Zero Dawn/Forbidden West, with minifigure of protagonist Aloy standing atop its head.

×

Note #25375

Today, while I cooked dinner, I introduced my two children (aged 10 and 8) to Goat Simulator.

Within half an hour, they’d added an imaginative twist and a role-playing element. My eldest had decreed themselves Angel of Goats and the younger Goat Devil and the two were locked in an endless battle to control the holy land at the top of a rollercoaster.

The shrieks of joy and surprise from the living room could be heard throughout the entire house. Perhaps our whole village.

Harswell Steel

My past self, receiving a copy of Transport Tycoon for his 14th birthday, would have his mind blown if he could see the kind of insanely-complex super-stations that are possible in (the open-source successor to) the game 30 years on.

Of course, this kind of thing – multiple simultaneously shared in-and-out routes on a bidirectional station – wasn’t (sensibly) possible before the introduction of path-based signalling in OpenTTD 0.7.0. And modern path-based signals in the game are even smarter.

But still, 14-year-old me had a dream. And nowadays that dream is real.

Note #24972

Future Arimaa grand masters at practice, this Sunday morning boardgaming session.

In a cluttered dining room, two children play Arimaa, a chess-like board game.

×

Double Sausages

This child is eating sausages with one hand while playing a video game about eating sausages with the other.

A child slouches in an airport lounge chair. Her right hand is being used to eat a plate of sausages. Her left hand is playing 'Fork N Sausage' on a tablet.

Is this life-imitating-art or the other way around? Who can possibly say?

×

Note #24701

Playing simultaneous games against both children might have been less challenging if they hadn’t both kept trying to start fights with one another at the same time! 😂

Two frustrated-looking children each sit in front of a separate chessboard (the photographer is presumably playing both of them).

×

D20 with Advantage

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.

A 'full set' of white polyhedral dice commonly-used by roleplayers - a D4, D6, D8, two D10s, a D12, and a D20 - sit half-submerged in a red liquid.
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.

'400-sided die' shown on Numberwang.
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.

× ×

2024 in Videogames

Duration

Podcast Version

This post is also available as a podcast. Listen here, download for later, or subscribe wherever you consume podcasts.

My life affords me less time for videogames than it used to, and so my tastes have changed accordingly:

  • I appreciate games that I can drop at a moment’s notice and pick up again some other time, without losing lots of progress1.
  • And if the game can remind me what it was I was trying to achieve when I come back… perhaps weeks or months later… that’s a bonus!
  • I’ve a reduced tolerance for dynamically-generated content (oh, you want me to fetch you another five nirnroot do you? – hard pass2): if I might only get to throw 20 hours total at a game, I’d much prefer to spend that time exploring content deliberately and thoughtfully authored by a human.
  • And, y’know, it has to be fun. I rarely buy games on impulse anymore, and usually wait weeks or months after release dates even for titles I’ve been anticipating, to see what the reviewers make of it.

That said, I’ve played three excellent videogames this year that I’d like to recommend to you (no spoilers):

Horizon: Forbidden West

I loved Horizon: Zero Dawn. Even if this review persuades you that you should play its sequel, Forbidden West, you really oughta play Zero Dawn first3. There’s a direct continuation of plot going on there that you’ll appreciate better that way. Also: Zero Dawn stands alone as a great game in its own right.

Aloy, the protagonist of the Horizon games, wearing Mark of Pride face paint and red-stained Quen Deadeye armour, stands at sunset in a jungle environment.
Horizon gives a lot to love, from a rich world and story, immersive environments, near-seamless loading, excellent voice acting, and a rewarding difficulty curve. But perhaps all are second-place to what a kickass character the protagonist is.

The Horizon series tells the story of Aloy from her childhood onwards, growing up an outcast in a tribal society on a future Earth inhabited by robotic reimaginings of creatures familiar to us today (albeit some of them extinct). Once relatively docile, a mysterious event known as the derangement, shortly before Aloy’s birth, made these machines aggressive and dangerous, leading to a hostile world in which Aloy seeks to prove herself a worthy hunter to the tribe that cast her out.

All of which leads to a series of adventures that gradually explain the nature of the world and how it became that way, and provide a path by which Aloy can perhaps provide a brighter future for humankind. It’s well-written and clever and you’ll fight and die over and over as you learn your way around the countless permutations of weapons, tools, traps, and strategies that you’ll employ. But it’s the kind of learning curve that’s more rewarding than frustrating, and there are so many paths to victory that when I watch Ruth play she uses tactics that I’d never even conceived of.

Aloy aims a precision longbow at a Tremortusk, an elephant-like machine, in a sunny desert environment.
Horizon: Forbidden West is like Zero Dawn but… more. More quests, more exploration, more machines, more characters, and more of the same story, answering questions you might have found yourself thinking during the prequel. But it’s not just more-of-the-same.

Forbidden West is in some ways more-of-the-same, but it outgrows the mould of its predecessor, too. Faced with bigger challenges than she can take on by herself, Aloy comes to assemble a team of trusted party members, and when you’re not out fighting giant robots or spelunking underwater caves or exploring the ruins of ancient San Francisco you’re working alongside them, and that’s one of the places the game really shines. Your associates chatter to each other, grow and change, and each brings something special to the story that invites you to care for each of them as individuals.

The musical score – cinematic in its scope – has been revamped too, and shows off its ability to adapt dynamically to different situations. Face off against one of the terrifying new aquatic enemies and you’ll be treated to a nautical theme, for example. And the formulaic quests of the predecessor (get to the place, climb the thing…), which were already fine, are riddled with new quirks and complexities to keep you thinking.

And finally: I love the game’s commitment to demonstrating the diversity of humanity: both speaking and background characters express a rarely-seen mixture of races, genders, and sexualities, and the story sensitively and compassionately touches on issues of disability, neurodiversity, and transgender identity. It’s more presence than representation (“Hey look, it’s Sappho and her friend!”), but it’s still much better than I’m used to seeing in major video game releases.

Thank Goodness You’re Here!

If ever I need to explain to an American colleague why that one time they visited London does not give them an understanding of what life is like in the North of England… this is the videogame I’ll point them at.

Main menu for Thank Goodness You're Here, featuring options "Gu On Then", "Faff", and "Si' Thi", superimposed on a picture of a street in Barnsley, Yorkshire.
Among the many language options available for the game are “English”, as you’d probably expect, and “Dialect”, which imposes a South Yorkshire accent to everything, as illustrated here by the main menu.

A short, somewhat minigame-driven, absurd to the point of Monty Python-ism, wildly British comedy game, Thank Goodness You’re Here! is a gem. It’s not challenging by any stretch of the imagination, but that only serves to turn focus even more on the weird and wonderful game world of Barnsworth (itself clearly inspired by real-world Barnsley).

Playing a salesman sent to the town to meet the lord mayor, the player ends up stuck with nothing to do4, and takes on a couple of dozen odd-jobs for the inhabitants of the town, meeting a mixed bag of stereotypes and tropes as they go along.

Hand-drawn advertisement for Big Ron's Big Pies (Barnsworth's Best since 1904).
Ahm gowin t’shop to gi’ sumof Big Ron’s Big Pies! Y’wanout, buggerlugs? Players without a grounding in Yorkshire English, and especially non-Brits, might benefit from turning the subtitles on.

Presented in a hand-drawn style that’s as distinctive and bizarre as it is an expression of the effort that must’ve gone into it, this game’s clearly a project of passion for Yorkshire-based developers Coal Supper (yes, that’s really what they call themselves). I particularly enjoyed a recurring joke in which the player is performing some chore (mowing grass for the park keeper, chopping spuds at the chippy) when the scene cuts to some typically-inanimate objects having a conversation (flowers, potatoes) while the player’s actions bring them closer and closer in the background. But it’s hard to pick out a very favourite part from this wonderful, crazy, self-aware slice of Northern life in game form.

Tactical Breach Wizards

Finally, I’ve got to sing the praises of Tactical Breach Wizards by Suspicious Developments (who for some reason don’t bother to list it on their website; the closest thing to an official page for the project other than its Steam entry might be this launch announcement!)5, the team behind Gunpoint and Heat Signature.

The game feels like a cross between XCOM/Xenonauts‘ turn-based tactical combat and Rainbow Six‘s special ops theme. Except instead of a squad of gun-toting body-armoured military/police types, your squad is a team of wizards in a world in which magical combat specialists work alongside conventionally-equipped soldiers on missions where their powers make all the difference.

Jen, the Storm Witch, throws a bolt of lightning through three enemies on a moving train carriage.
Jen the Storm Witch primarily uses large static shocks to fling targets around: relatively harmless, unless she and her teammates have arranged for/tricked enemies to be standing next to something they can be thrown into… or near a window they can be flung out of!

By itself, that could be enough: there’s certainly sufficient differences between all of the powers that the magic users exploit that you’ll find all kinds of ways to combine them. How about having your teleport-capable medic blink themselves to a corner so your witch’s multi-step lightning bolt can use them as a channel to get around a corner and zap a target there? Or what about using the time-manipulation powers of your Navy Seer (yes, really) to give your siege cleric enough actions that they can shield-push your opponent within range of the turret you hacked? And so on.

But Tactical Breach Wizards, which stands somewhere between a tactical squad-based shooter and a deterministic positional puzzle game, goes beyond that by virtue of its storytelling. Despite the limitations of the format, the game manages to pack in a lot of background and personality for every one of your team and even many of the NPCs too (Steve Clark, Traffic Warlock is a riot). Oh, and much of the dialogue is laugh-out-loud funny, to boot.

Three spec ops wizards have a conversation about an upcoming assault.
The dialogue between your teammates – most of it right as they’re about to breach a door – reads like lighthearted banter but exposes the underpinning backstory of the setting.

The writing’s great, to the extent that when I got to the epilogue – interactive segments during the credits where you can influence “what happens next” to each of the characters you’ve come to know – I genuinely flip-flopped on a few of them to give some of them a greater opportunity to continue to feature in one another’s lives. Even though the game was clearly over. It’s that compelling.

And puzzling out some of the tougher levels, especially if you’re going for the advanced (“Confidence”) challenges, too, is really fun. But with autosaves every turn, the opportunity to skip and return to levels that are too challenging, and a within-turn “undo” feature that lets you explore different strategies before you commit to one, this is a great game for someone who, like me, doesn’t have much time to dedicate to play.


So yeah: that’s what I’ve been up to in videogaming-time so far this year. Any suggestions for the autumn/winter?

Footnotes

1 If a game loads quickly that’s a bonus. I still play a little of my favourite variant of the Sid Meier’s Civilization series – that is, Civilization V + Vox Populi (alongside a few quality-of-life mods) but I swear I’d play more of it if it didn’t take so long to load. Even after hacking around it to dodge the launcher, logos, and introduction, my 8P+4E-core i7 processor takes ~80 seconds from clicking to launch the game to having loaded my latest save, which if I’m only going to have time to play three turns is frustratingly long! Contrast Horizon: Forbidden West, which I also mention in this post, a game 13 years younger and with much higher hardware requirements, which takes ~17 seconds to achieve the same. Possibly I’m overanalysing this…

2 This isn’t a criticism of the Elder Scrolls games specifically, but of the relatively-lazy writing that goes into some videogames that feel like they’re using Perchance to come up with their quests, in order to stretch the gameplay. I suppose a better example might have been the on-the-whole disappointment that was Starfield, but I figured an Elder Scrolls reference might be easier to identify at-a-glance. Fetch-questing 100 tonnes of Beryllium just doesn’t have the same ring to it.

3 In fact, if you’re trying to consume the Horizon story as thoroughly as possible and strictly in chronological order, you probably should read the graphic novel between one and the other, which covers some of the events that occur between the two.

4 Did you ever see the alternate ending to Far Cry 4, by the way? If you did, you might appreciate that a similar trick can be used to shortcut Thank Goodness You’re Here! too…

5 They’re also missing a trick by using the domain they’ve registered, wizards.cool, only to redirect to Steam.

× × × × × ×

SkiFreeeeeeee

This is a reply to a post published elsewhere. Its content might be duplicated as a traditional comment at the original source.

Rob Vincent said:

COME PLAY SOLITAIRE WITH US.

A screenshot of Windows 95's Solitaire program into which a bunch of surreal changes have been photoshopped. Suit pips and card numbers and letters are swapped around in impossible ways, the ocean from the beach-based card back design is leaking onto the playfield, and the text all warped and jumbled nightmarishly. The Windows title bar says "Solitolitololoreee".

I always preferred SkiFree!

A screenshot of SkiFree running in Windows 3.1 with a bunch of quirky edits. The window is warped to include a "Shroom Supply" with lots of mushroms, a sign advertises bagels, a helicopter has landed, two monsters are let's-say hugging on the ground, and the score box states Age, Sex, Location and Star Sign. The title of the window is "SkiFreeeeeeee".

× ×

ARCC

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.

3D rendering of an ARCC system, by HappyToast.

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.

ARCC system showing a high score table for M1, with DAN50 (score 13012) at the top.
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.

ARCC terminal in which an email is being written to DAN50.
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.

× ×

Multi-Phase Maps in FoundryVTT

FoundryVTT is a fantastic Web-based environment for tabletop roleplaying adventures1 and something I particularly enjoy is the freedom for virtually-unlimited scripting. Following a demonstration to a fellow DM at work last week I promised to throw together a quick tutorial into scripting simple multi-phase maps using Foundry.2

Why multi-phase maps?

Animated battlemap which organically grows into a leafy flower over six stages.
For this demonstration, I’ll be using AtraxianBear’s Growing Flower Dungeon.

You might use a multi-phase map to:

  • Allow the development and expansion of a siege camp outside the fortress where the heroes are holed-up.3
  • Rotate through day and night cycles or different times of day, perhaps with different things to interact with in each.4
  • Gradually flood a sewer with rising water… increasing the range of the monster that dwells within.5
  • Re-arrange parts of the dungeon when the characters flip certain switches, opening new paths… and closing others.

I’ll use the map above to create a simple linear flow, powered by a macro in the hotbar. Obviously, more-complex scenarios are available, and combining this approach with a plugin like Monk’s Active Tile Triggers can even be used to make the map appear to dynamically change in response to the movement or actions of player characters!

Setting the scene

Create a scene, using the final state of the map as the background. Then, in reverse-order, add the previous states as tiles above it.

Not shown, but highly-recommended: lock each tile when you’re done placing it, so that you don’t accidentally interact with it when you mean to e.g. drag-select multiple actors.

Make a note of the X-position that your tiles are in when they’re where they supposed to be: we’ll “move” the tiles off to the side when they’re hidden, to prevent their ghostly half-hidden forms getting in your way as game master. We’ll also use this X-position to detect which tiles have already been moved/hidden.

Also make note of each tile’s ID, so your script can reference them. It’s easiest to do this as you go along. When you’re ready to write your macro, reverse the list, because we’ll be hiding each tile in the opposite order from the order you placed them.

Writing the script

Next, create a new script macro, e.g. by clicking an empty slot in the macro bar. When you activate this script, the map will move forward one phase (or, if it’s at the end, it’ll reset).

I find Foundry’s built-in script editor a little… small? So I write my scripts in my favourite text editor and then copy-paste.

Here’s the code you’ll need – the 👈 emoji identifies the places you’ll need to modify the code, specifically:

  1. const revealed_tiles_default_x = 250 should refer to the X-position of your tiles when they’re in the correct position.
  2. const revealed_tiles_modified_x = 2825 should refer to the X-position they’ll appear at “off to the right” of your scene. To determine this, just move one tile right until it’s sufficiently out of the way of the battlemap and then check what it’s X-position is! Or just take the default X-position, add the width of your map in pixels, and then add a tiny bit more.
  3. const revealed_tiles = [ ... ] is a list of the tile IDs of each tile what will be hidden, in turn. In my example there are five of them (the sixth and final image being the scene background).
const revealed_tiles_default_x = 250;   // 👈 X-position of tiles when displayed
const revealed_tiles_modified_x = 2825; // 👈 X-position of tiles when not displayed
const revealed_tiles = [
  '2xG7S8Yqk4x1eAdr',                   // 👈 list of tile IDs in order that they should be hidden
  'SjNQDBImHvrjAHWX',                   //     (top to bottom)
  'tuYg4FvLgIla1l21',
  'auX4sj64PWmkAteR',
  'yAL4YP0I4Cv4Sevt',
].map(t=>canvas.tiles.get(t));

/*************************************************************************************************/

// Get the topmost tile that is still visible:
const next_revealed_tile_to_move = revealed_tiles.find(t=>
  t.position.x == revealed_tiles_default_x
);

// If there are NO still-visible tiles, we must need to reset the map:
if( ! next_revealed_tile_to_move ) {
  // To reset the map, we go through each tile and put it back where it belongs -
  for(tile of revealed_tiles){
    canvas.scene.updateEmbeddedDocuments("Tile", [ {
      _id: tile.id,
      x: revealed_tiles_default_x,
      hidden: false
    } ]);
  }
} else {
  // Otherwise, hide the topmost visible tile (and move it off to the side to help the GM) -
  canvas.scene.updateEmbeddedDocuments("Tile", [ {
    _id: next_revealed_tile_to_move.id,
    x: revealed_tiles_modified_x,
    hidden: true
  } ]);
}

I hope that the rest of the code is moderately self-explanatory for anybody with a little JavaScript experience, but if you’re just following this kind of simple, linear case then you don’t need to modify it anyway. But to summarise, what it does is:

  1. Finds the first listed tile that isn’t yet hidden (by comparing its X-position to the pre-set X-position).
  2. If there aren’t any such tiles, we must have hidden them all already, so perform a reset: to do this – iterate through each tile and set its X-position to the pre-set X-position, and un-hide it.
  3. Otherwise, move the first not-hidden tile to the alternative X-position and hide it.

I hope you have fun with scripting your own multi-phase maps. Just don’t get so caught-up in your awesome scenes that you fail to give the players any agency!

Footnotes

1 Also, it’s on sale at 20% off this week to celebrate its fourth anniversary. Just sayin’.

2 I can neither confirm nor deny that a multi-phase map might be in the near future of The Levellers‘ adventure…

3 AtraxianBear has a great series of maps inspired by the 1683 siege of Vienna by the Ottomans that could be a great starting point for a “gradually advancing siege” map.

4 If you’re using Dungeon Alchemist as part of your mapmaking process you can just export orthographic or perspective outputs with different times of day and your party’s regular inn can be appropriately lit for any time of day, even if the party decides to just “wait at this table until nightfall”.

5 Balatro made a stunning map with rising water as a key feature: there’s a preview available.

×