[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:01.75,0:00:04.91,Default,,0000,0000,0000,,This is Game Maker's Toolkit, I'm Mark Brown. Dialogue: 0,0:00:04.91,0:00:10.25,Default,,0000,0000,0000,,If there's one game I've played more than\Nany other, it's Spelunky - a viciously hard Dialogue: 0,0:00:10.25,0:00:16.02,Default,,0000,0000,0000,,platformer that takes the side-scrolling thrills\Nof games like Mario and Castlevania, but snatches Dialogue: 0,0:00:16.02,0:00:21.67,Default,,0000,0000,0000,,away your ability to learn the level layouts\Nand enemy spawns by mixing up the map, every Dialogue: 0,0:00:21.67,0:00:22.63,Default,,0000,0000,0000,,time you die. Dialogue: 0,0:00:22.63,0:00:27.67,Default,,0000,0000,0000,,But what makes Spelunky so special is that\Neven though the levels are randomly cobbled Dialogue: 0,0:00:27.67,0:00:33.44,Default,,0000,0000,0000,,together, they're always fair and enjoyable.\NEven after 1000 runs, I've never stumbled Dialogue: 0,0:00:33.44,0:00:35.46,Default,,0000,0000,0000,,upon a crappy level. Dialogue: 0,0:00:35.46,0:00:40.23,Default,,0000,0000,0000,,They just don't feel like the product of an\Nalgorithm - which, in some games, spits out Dialogue: 0,0:00:40.23,0:00:46.07,Default,,0000,0000,0000,,levels that are messy and unfocused and full\Nof dead ends. In Spelunky, these procedurally Dialogue: 0,0:00:46.07,0:00:52.36,Default,,0000,0000,0000,,made stages are as sharp and satisfying\Nas the levels in some hand-crafted games. Dialogue: 0,0:00:52.36,0:00:58.13,Default,,0000,0000,0000,,And that's because creator Derek Yu struck\Nthe perfect balance between random and authored Dialogue: 0,0:00:58.13,0:00:59.88,Default,,0000,0000,0000,,content. Dialogue: 0,0:00:59.88,0:01:04.99,Default,,0000,0000,0000,,He explains how he pulled it off in his new\Nbook, titled Spelunky, which I highly recommend Dialogue: 0,0:01:04.99,0:01:10.30,Default,,0000,0000,0000,,to anyone interested in design. But, while you're\Nwaiting for it to come in the post, I'm going to use Dialogue: 0,0:01:10.30,0:01:16.66,Default,,0000,0000,0000,,some info in the book to explain how a Spelunky\Nlevel is half generated, and half designed. Dialogue: 0,0:01:16.66,0:01:21.19,Default,,0000,0000,0000,,And then we'll look at why it was so important\Nfor the game to have an infinite supply of Dialogue: 0,0:01:21.19,0:01:22.11,Default,,0000,0000,0000,,unique levels. Dialogue: 0,0:01:22.11,0:01:26.52,Default,,0000,0000,0000,,Though, first, we need to go back to where\Nit all began - because while you might think Dialogue: 0,0:01:26.52,0:01:31.82,Default,,0000,0000,0000,,of Spelunky as looking like this, it actually\Nstarted life as a free, pixel art game, now Dialogue: 0,0:01:31.82,0:01:34.16,Default,,0000,0000,0000,,named Spelunky Classic. Dialogue: 0,0:01:36.84,0:01:42.06,Default,,0000,0000,0000,,So, every level in Spelunky is generated by\Na script that starts with the same basic shape Dialogue: 0,0:01:42.06,0:01:46.29,Default,,0000,0000,0000,,and size: 16 rooms in a boxy 4 by 4 grid. Dialogue: 0,0:01:46.29,0:01:51.16,Default,,0000,0000,0000,,The first thing the script does is pick a\Nrandom room from the top row, and makes this Dialogue: 0,0:01:51.16,0:01:51.80,Default,,0000,0000,0000,,the entrance. Dialogue: 0,0:01:51.80,0:01:57.72,Default,,0000,0000,0000,,It will then randomly place a room to the\Nleft, right, or beneath this room. This process Dialogue: 0,0:01:57.72,0:02:01.99,Default,,0000,0000,0000,,is repeated from room to room - and if the\Npath hits the edge of the level, it also goes Dialogue: 0,0:02:01.99,0:02:06.59,Default,,0000,0000,0000,,down - until we get to the lowest level; when\Nit tries to go down once more, an exit is Dialogue: 0,0:02:06.59,0:02:07.62,Default,,0000,0000,0000,,made. Dialogue: 0,0:02:07.62,0:02:11.15,Default,,0000,0000,0000,,Every room on this main path has openings\Nto the left and right, but rooms where the Dialogue: 0,0:02:11.15,0:02:15.88,Default,,0000,0000,0000,,path drops also have exits on the bottom,\Nwhile the rooms you drop into are given exits Dialogue: 0,0:02:15.88,0:02:17.00,Default,,0000,0000,0000,,at the top. Dialogue: 0,0:02:17.00,0:02:21.03,Default,,0000,0000,0000,,What you end up with is a guaranteed path\Nthrough the level that you'll always be able Dialogue: 0,0:02:21.03,0:02:26.34,Default,,0000,0000,0000,,to get through without using ropes or bombs.\NThe other rooms are not on the critical path, Dialogue: 0,0:02:26.34,0:02:30.16,Default,,0000,0000,0000,,so they may be open, or they may be walled\Noff depending on their design. Dialogue: 0,0:02:30.16,0:02:36.87,Default,,0000,0000,0000,,Next, each room is randomly given a template.\NDerek Yu hand crafted a number of room designs, Dialogue: 0,0:02:36.87,0:02:41.46,Default,,0000,0000,0000,,with different layouts for rooms where you\Ndrop down, rooms you land in, corridors you Dialogue: 0,0:02:41.46,0:02:44.65,Default,,0000,0000,0000,,run through, and rooms not on the critical\Npath. Dialogue: 0,0:02:44.65,0:02:49.23,Default,,0000,0000,0000,,But these templates are not set in stone,\Nand parts of them are randomly generated. Dialogue: 0,0:02:49.23,0:02:54.65,Default,,0000,0000,0000,,Sometimes entire chunks of tiles are plastered\Non at random. This means that while you might Dialogue: 0,0:02:54.65,0:02:59.10,Default,,0000,0000,0000,,start to see familiar set-ups, they will always\Nhave their own unique quirks. Dialogue: 0,0:02:59.10,0:03:03.91,Default,,0000,0000,0000,,Next, a script checks every tile on the map\Nand rolls a dice to see if it should place Dialogue: 0,0:03:03.91,0:03:09.19,Default,,0000,0000,0000,,down a monster, some treasure, or another\Nobject. Again, it's not entirely random - gems Dialogue: 0,0:03:09.19,0:03:14.35,Default,,0000,0000,0000,,and crates are more likely to appear in spaces\Nsurrounded by walls, and enemies generally don't spawn Dialogue: 0,0:03:14.35,0:03:19.41,Default,,0000,0000,0000,,in cramped spaces. And everything is weighted,\Nso a level isn't filled with fire frogs or Dialogue: 0,0:03:19.41,0:03:22.58,Default,,0000,0000,0000,,crates containing jetpacks. Dialogue: 0,0:03:22.58,0:03:27.70,Default,,0000,0000,0000,,Describing his level-making algorithm, Derek\NYu says "This system doesn’t create the Dialogue: 0,0:03:27.70,0:03:32.66,Default,,0000,0000,0000,,most natural-looking caves ever, and players\Nwill quickly begin to recognize certain repeating Dialogue: 0,0:03:32.66,0:03:37.18,Default,,0000,0000,0000,,landmarks and perhaps even sense that the\Nlevels are generated on a grid. But with enough Dialogue: 0,0:03:37.18,0:03:42.41,Default,,0000,0000,0000,,templates and random mutations, there’s\Nstill plenty of variability. More importantly, Dialogue: 0,0:03:42.41,0:03:47.04,Default,,0000,0000,0000,,it creates fun and engaging levels that the\Nplayer can’t easily get stuck in, something Dialogue: 0,0:03:47.04,0:03:51.88,Default,,0000,0000,0000,,much more valuable than realism when it comes\Nto making an immersive experience.” Dialogue: 0,0:03:51.88,0:03:57.01,Default,,0000,0000,0000,,There's still more to a Spelunky level, of\Ncourse. Those rooms not on the critical path Dialogue: 0,0:03:57.01,0:04:01.83,Default,,0000,0000,0000,,can contain golden idols that set off a boulder\Ntrap, or a sacrificial altar where you can Dialogue: 0,0:04:01.83,0:04:03.83,Default,,0000,0000,0000,,trade bodies for helpful items. Dialogue: 0,0:04:03.83,0:04:09.33,Default,,0000,0000,0000,,A room can also be a shop where you can buy,\Nor steal items. “The difficulty of buying Dialogue: 0,0:04:09.33,0:04:13.64,Default,,0000,0000,0000,,all the items you want and the consequence\Nto your score" - your final score is based Dialogue: 0,0:04:13.64,0:04:18.41,Default,,0000,0000,0000,,on how much loot you found - "creates a strong\Ntemptation to steal from the shop", says Yu. Dialogue: 0,0:04:18.41,0:04:22.66,Default,,0000,0000,0000,,If you do pilfer an item, the shopkeeper will\Nnot only try and kill you with his shotgun, Dialogue: 0,0:04:22.66,0:04:26.72,Default,,0000,0000,0000,,but his buddies will appear at the end of\Nevery level for that run, and attack you in Dialogue: 0,0:04:26.72,0:04:29.43,Default,,0000,0000,0000,,a mad, unpredictable fury. Dialogue: 0,0:04:29.43,0:04:35.16,Default,,0000,0000,0000,,Every level also has a damsel in distress,\Nwhich gives you one extra health point. Dialogue: 0,0:04:35.16,0:04:39.80,Default,,0000,0000,0000,,While the health pick-ups in other games - be\Nit a mushroom or a turkey leg or a pizza - are Dialogue: 0,0:04:39.80,0:04:44.86,Default,,0000,0000,0000,,activated immediately, Spelunky makes you\Ncarry the damsel to the exit, leading to tricky Dialogue: 0,0:04:44.86,0:04:48.75,Default,,0000,0000,0000,,moments where you have to lug multiple items\Nthrough an unpredictable maze. Dialogue: 0,0:04:48.75,0:04:52.88,Default,,0000,0000,0000,,And finally, there's the ghost. Stick around\Nin one level for too long and a spectre will Dialogue: 0,0:04:52.88,0:04:55.59,Default,,0000,0000,0000,,appear and instantly kill you if it touches\Nyou. Dialogue: 0,0:04:55.59,0:05:01.11,Default,,0000,0000,0000,,All of these additions, which are highly authored,\Nbut scattered about the procedurally generated Dialogue: 0,0:05:01.11,0:05:06.58,Default,,0000,0000,0000,,worlds, are about making choices and weighing\Nup your options. Derek Yu says "I wanted to Dialogue: 0,0:05:06.58,0:05:10.99,Default,,0000,0000,0000,,force [the player] to make difficult decisions\Nand experience both the satisfaction of choosing Dialogue: 0,0:05:10.99,0:05:13.98,Default,,0000,0000,0000,,correctly and the regret of choosing poorly". Dialogue: 0,0:05:13.98,0:05:18.29,Default,,0000,0000,0000,,So do you sacrifice your score by spending\Nmoney on the shop? Or do you just rob it and Dialogue: 0,0:05:18.29,0:05:22.66,Default,,0000,0000,0000,,deal with the consequences? Do you risk throwing\Na damsel down here, or leave your shotgun Dialogue: 0,0:05:22.66,0:05:27.39,Default,,0000,0000,0000,,behind? Do you grab the golden idol, and risk\Ngetting smushed by a boulder? And can you Dialogue: 0,0:05:27.39,0:05:29.67,Default,,0000,0000,0000,,collect these gems before the ghost appears? Dialogue: 0,0:05:29.67,0:05:33.63,Default,,0000,0000,0000,,Those decisions would be far less interesting\Nto make if you had already played the level Dialogue: 0,0:05:33.63,0:05:37.82,Default,,0000,0000,0000,,before and knew the right path to take or\Ncould predict the exact outcome of snatching Dialogue: 0,0:05:37.82,0:05:42.17,Default,,0000,0000,0000,,a golden idol. But because you never know\Nhow the stage will be laid out, the game forces Dialogue: 0,0:05:42.17,0:05:47.55,Default,,0000,0000,0000,,you to read the situation and make a plan,\Nbefore watching it all go hideously wrong. Dialogue: 0,0:05:47.55,0:05:50.71,Default,,0000,0000,0000,,And that's all the more painful when you know\Nyou'll be sent back to the very start of the Dialogue: 0,0:05:50.71,0:05:55.82,Default,,0000,0000,0000,,game, now with all new levels to tackle. The stakes in this game are super high. Dialogue: 0,0:05:55.82,0:05:59.84,Default,,0000,0000,0000,,Plus, not allowing you to master the stages\Nmeans you'll need to master the mechanics Dialogue: 0,0:05:59.84,0:06:04.60,Default,,0000,0000,0000,,instead. You'll need to understand the quirky\Nphysics of your jump and the tiny reach of Dialogue: 0,0:06:04.60,0:06:08.42,Default,,0000,0000,0000,,your whip. You need to learn the unique properties\Nof each enemy, so you can to predict what Dialogue: 0,0:06:08.42,0:06:12.16,Default,,0000,0000,0000,,will happen when you enter their domain. And\Nyou have to learn about the items, and the Dialogue: 0,0:06:12.16,0:06:15.08,Default,,0000,0000,0000,,secrets, and the tricks that will keep you\Nalive for longer. Dialogue: 0,0:06:15.08,0:06:20.24,Default,,0000,0000,0000,,So Spelunky proves that an algorithm doesn't\Nnecessarily lead to soulless levels - balancing Dialogue: 0,0:06:20.24,0:06:25.07,Default,,0000,0000,0000,,authored and random content can lead to levels\Nthat are satisfying to play. And by removing Dialogue: 0,0:06:25.07,0:06:31.02,Default,,0000,0000,0000,,the ability to learn levels - either after\Nyou die or on your second or 1000th playthrough - this Dialogue: 0,0:06:31.02,0:06:35.59,Default,,0000,0000,0000,,game encourages you to learn the underlying\Nmechanics, and makes you read the situation Dialogue: 0,0:06:35.59,0:06:38.97,Default,,0000,0000,0000,,carefully before making those very difficult decisions. Dialogue: 0,0:06:40.38,0:06:42.08,Default,,0000,0000,0000,,Thank you so much for watching! Dialogue: 0,0:06:42.08,0:06:45.78,Default,,0000,0000,0000,,Spelunky is one of my favourite games of all\Ntime so it's great to be able to dig into Dialogue: 0,0:06:45.78,0:06:48.44,Default,,0000,0000,0000,,just one aspect of what makes it so special. Dialogue: 0,0:06:48.44,0:06:52.54,Default,,0000,0000,0000,,I will no doubt come back to the other bits\N- like the emergent gameplay and the crazy Dialogue: 0,0:06:52.54,0:06:54.54,Default,,0000,0000,0000,,secrets - in future videos Dialogue: 0,0:06:54.54,0:06:57.82,Default,,0000,0000,0000,,if you would like to help this show please\Nconsider subscribing on YouTube to get new Dialogue: 0,0:06:57.82,0:07:02.97,Default,,0000,0000,0000,,episodes delivered directly to your inbox, or even\Npitch in a few dollars per episode over on Patreon. Dialogue: 0,0:07:02.97,0:07:04.91,Default,,0000,0000,0000,,just like these top tier subscribers have\Ndone