WEBVTT
Kind: captions
Language: en

00:00:00.160 --> 00:00:04.720
"Narbacular Drop" is the game that got Valve to&nbsp;
make Portal. It was made by a team of students&nbsp;&nbsp;

00:00:04.720 --> 00:00:09.280
for their senior project. The story goes that&nbsp;
right after they presented the game to Valve,&nbsp;&nbsp;

00:00:09.280 --> 00:00:14.720
they were all offered jobs on the spot. They&nbsp;
were then right away assigned to a new project,&nbsp;&nbsp;

00:00:14.720 --> 00:00:20.320
and that's how we ended up with Portal.
But Narbacular Drop is ancient history by now,&nbsp;&nbsp;

00:00:20.320 --> 00:00:23.680
and even back then it didn't&nbsp;
have a thriving modding scene,&nbsp;&nbsp;

00:00:23.680 --> 00:00:29.280
so would you believe me if I told you that&nbsp;
I spent a week of my life descending down a&nbsp;&nbsp;

00:00:29.280 --> 00:00:36.000
rabbit hole and writing entirely new tools just&nbsp;
to backport Portal 2 maps to Narbacular Drop?

00:00:36.000 --> 00:00:41.440
Okay, first of all, how did we get here? This game&nbsp;
doesn't have much in terms of modding tools. It's&nbsp;&nbsp;

00:00:41.440 --> 00:00:47.440
a showcase at best, there's no remaining community&nbsp;
around it. So what inspired me to do this?&nbsp;

00:00:47.440 --> 00:00:51.680
Well, I randomly found out that one&nbsp;
of the tools I use for modding Portal&nbsp;&nbsp;

00:00:51.680 --> 00:00:56.560
2 supports reading the package format&nbsp;
of Narbacular Drop. That's it. That's&nbsp;&nbsp;

00:00:56.560 --> 00:01:02.800
the whole inspiration. And from there, I asked&nbsp;
myself - could I mod this to be like Portal 2?&nbsp;

00:01:02.800 --> 00:01:07.280
Of course, it wasn't going to be all that&nbsp;
simple. This tool could only read the file tree,&nbsp;&nbsp;

00:01:07.280 --> 00:01:11.440
but not write to it or even parse the&nbsp;
model data. And, taking a deeper look,&nbsp;&nbsp;

00:01:11.440 --> 00:01:16.560
it's obvious why: the file format is actually&nbsp;
incredibly simple, you could even piece it&nbsp;&nbsp;

00:01:16.560 --> 00:01:20.400
together with a hex editor if you had the&nbsp;
patience. So I'm guessing that the authors&nbsp;&nbsp;

00:01:20.400 --> 00:01:25.200
of the tool just threw it together one day, just&nbsp;
for fun, as it wouldn't have taken long to do.

00:01:25.200 --> 00:01:30.160
But if I was going to actually mod the game,&nbsp;
I needed a way to at least swap its assets&nbsp;&nbsp;

00:01:30.160 --> 00:01:34.160
somehow. I first thought I might be able&nbsp;
to do some rudimentary texture swaps by&nbsp;&nbsp;

00:01:34.160 --> 00:01:38.800
finding the offsets pointing to the bitmap&nbsp;
files and shifting everything manually,&nbsp;&nbsp;

00:01:38.800 --> 00:01:43.920
but I'm glad I caught myself before jumping&nbsp;
at the first idea that came into my head.&nbsp;

00:01:43.920 --> 00:01:49.920
Notice how the root file tree contains three&nbsp;
directories: levels, audio, and video. The&nbsp;&nbsp;

00:01:49.920 --> 00:01:55.040
textures are all in the video directory, but&nbsp;
something seemed familiar about the levels folder.&nbsp;

00:01:55.040 --> 00:02:00.240
You see, for level building, this game uses&nbsp;
a program that converts special GoldSrc-era&nbsp;&nbsp;

00:02:00.240 --> 00:02:05.360
Hammer maps into the game's proprietary format. In&nbsp;
the tutorial for this tool, you're told to place&nbsp;&nbsp;

00:02:05.360 --> 00:02:12.160
any custom maps under “levels/polishingup.cmf”&nbsp;
next to the game's executable. But here,&nbsp;&nbsp;

00:02:12.160 --> 00:02:20.640
in the game's package file, we can find a file&nbsp;
for the same path - “levels/polishingup.cmf”.&nbsp;

00:02:20.640 --> 00:02:24.240
This suggests that the game first&nbsp;
checks for files outside of the package,&nbsp;&nbsp;

00:02:24.240 --> 00:02:28.960
and only then loads the packaged versions.&nbsp;
And the theory was that if this works the&nbsp;&nbsp;

00:02:28.960 --> 00:02:33.600
same for all other assets, there may be no&nbsp;
need to reverse-engineer the package format.

00:02:33.600 --> 00:02:38.480
By now, I had already rebuilt a part of test&nbsp;
chamber 04 with the extremely limited built-in&nbsp;&nbsp;

00:02:38.480 --> 00:02:43.280
assets, and just to test if the texture override&nbsp;
theory works, I impatiently slapped a few pictures&nbsp;&nbsp;

00:02:43.280 --> 00:02:47.840
of a Portal 2 storage cube onto the crate&nbsp;
bitmap, loaded into my Smooth Jazz remake,&nbsp;&nbsp;

00:02:47.840 --> 00:02:54.720
and there it was: an Aperture Science storage&nbsp;
cube, time traveled to before it was invented.&nbsp;

00:02:54.720 --> 00:02:59.200
Naturally, now that I had a foot in the door,&nbsp;
going from this to texturing everything else&nbsp;&nbsp;

00:02:59.200 --> 00:03:03.520
was a matter of simply doing more of the&nbsp;
same. What bugged me was that I couldn't&nbsp;&nbsp;

00:03:03.520 --> 00:03:07.520
figure out a way to replace the models&nbsp;
of entities, as those too seemed to use&nbsp;&nbsp;

00:03:07.520 --> 00:03:13.760
a format I didn't recognize, and I wasn't going&nbsp;
to reverse engineer compiled 3D model binaries.&nbsp;

00:03:13.760 --> 00:03:19.120
We'll come back to this later, I promise. But for&nbsp;
now this only really mattered for the buttons.&nbsp;&nbsp;

00:03:19.120 --> 00:03:23.680
Given that the cubes were now Portal themed, I&nbsp;
really wanted to make the floor buttons match,&nbsp;&nbsp;

00:03:23.680 --> 00:03:28.560
and look more like the big red ones from&nbsp;
Portal. For this, I came up with a simple&nbsp;&nbsp;

00:03:28.560 --> 00:03:34.080
but effective solution - use the level editor&nbsp;
to cover the white and boring button entity&nbsp;&nbsp;

00:03:34.080 --> 00:03:41.520
with a non-solid floor shaped like a button.
This actually worked surprisingly well, it kinda&nbsp;&nbsp;

00:03:41.520 --> 00:03:47.360
fits in with the overall low-tech vibe. And, of&nbsp;
course, most importantly, nothing important broke.&nbsp;&nbsp;

00:03:47.360 --> 00:03:53.760
holding down the button still opens the door.
Speaking of which, I spent a good hour trying to&nbsp;&nbsp;

00:03:53.760 --> 00:03:58.720
figure out how to make doors work before giving&nbsp;
up and simply assuming that they're broken.&nbsp;&nbsp;

00:03:58.720 --> 00:04:03.760
And I later found out that I was right - the&nbsp;
standard door entity was cut from the game during&nbsp;&nbsp;

00:04:03.760 --> 00:04:09.920
development. Instead, the level exits all use a&nbsp;
special door entity that loads the next level.&nbsp;&nbsp;

00:04:09.920 --> 00:04:16.000
These are very limiting. You can't resize them,&nbsp;
you can't rotate them - they always face south,&nbsp;&nbsp;

00:04:16.000 --> 00:04:20.960
and once they're open, you can't close them,&nbsp;
either. And, I forgot to mention this at first,&nbsp;&nbsp;

00:04:20.960 --> 00:04:25.280
but you can only have one of these per&nbsp;
level. If you place in more than one,&nbsp;&nbsp;

00:04:25.280 --> 00:04:30.400
it just won't work. But, y'know, for a&nbsp;
simple level like this, it's passable.

00:04:30.400 --> 00:04:35.040
Now, at this point, it could've all been&nbsp;
over. I was satisfied with what I had made,&nbsp;&nbsp;

00:04:35.040 --> 00:04:39.840
I learned a few things along the&nbsp;
way, that's an evening well-spent.&nbsp;

00:04:39.840 --> 00:04:44.480
But, of course, I just had to come&nbsp;
up with something else. The idea of&nbsp;&nbsp;

00:04:44.480 --> 00:04:48.720
making a tool that automatically converts&nbsp;
puzzles made in the Portal 2 level editor&nbsp;&nbsp;

00:04:48.720 --> 00:04:54.080
to Narbacular Drop maps was way too exciting&nbsp;
to sleep on. Literally. The following night,&nbsp;&nbsp;

00:04:54.080 --> 00:04:57.520
I stayed up until 5 in the morning&nbsp;
writing a prototype for this program,&nbsp;&nbsp;

00:04:57.520 --> 00:05:02.800
and once that was done, all I could think about&nbsp;
in the coming days were ways to improve it.

00:05:02.800 --> 00:05:08.000
The reason this is even possible is that...&nbsp;
well, remember how I said the Narbacular Drop&nbsp;&nbsp;

00:05:08.000 --> 00:05:13.360
levels are converted from maps generated with an&nbsp;
old version of Hammer? Well, those map files that&nbsp;&nbsp;

00:05:13.360 --> 00:05:20.000
Hammer produces are very similar to a modern day&nbsp;
VMF - that's the format used for compiling maps&nbsp;&nbsp;

00:05:20.000 --> 00:05:24.720
in games like Portal 2. All it took to create&nbsp;
something that resembles the shape of a test&nbsp;&nbsp;

00:05:24.720 --> 00:05:29.680
chamber was to move some numbers around.
Of course, the hard part was going to be&nbsp;&nbsp;

00:05:29.680 --> 00:05:33.760
reproducing actual puzzles. Sure, I&nbsp;
can get the walls to look similar,&nbsp;&nbsp;

00:05:33.760 --> 00:05:39.440
but these are still two completely separate&nbsp;
game engines. I can't just tell Narbacular Drop&nbsp;&nbsp;

00:05:39.440 --> 00:05:44.640
to connect a button to a door, because not only&nbsp;
does it apparently not understand what a door is,&nbsp;&nbsp;

00:05:44.640 --> 00:05:49.760
its entities also just function completely&nbsp;
differently from those Portal 2 uses.&nbsp;

00:05:49.760 --> 00:05:53.520
At the very least, I was going to have to&nbsp;
build a sort of "translation layer" between&nbsp;&nbsp;

00:05:53.520 --> 00:05:58.800
the two languages. And I was going to have to&nbsp;
find ways to substitute missing entities. Most&nbsp;&nbsp;

00:05:58.800 --> 00:06:05.040
of the puzzle elements from Portal 2 obviously&nbsp;
have no equivalent in this glorified tech demo.

00:06:05.040 --> 00:06:08.960
Right away, I got to work porting over&nbsp;
the simpler entities, those being cubes&nbsp;&nbsp;

00:06:08.960 --> 00:06:14.480
and simple lights. These are just single points&nbsp;
in 3D space with no additional logic. And after&nbsp;&nbsp;

00:06:14.480 --> 00:06:20.880
that came buttons and doors - these obviously do&nbsp;
have some map logic attached to them, and for now,&nbsp;&nbsp;

00:06:20.880 --> 00:06:26.000
to simplify things, I just made all buttons&nbsp;
in the level point to a single counter entity,&nbsp;&nbsp;

00:06:26.000 --> 00:06:29.680
which then points to the only door&nbsp;
I can afford to have in the level.&nbsp;

00:06:29.680 --> 00:06:34.400
Of course, you'll notice that these buttons are&nbsp;
still the small crappy white ones. To solve that,&nbsp;&nbsp;

00:06:34.400 --> 00:06:39.120
I made a very simple map in Hammer containing&nbsp;
only that button-shaped floor I mentioned earlier,&nbsp;&nbsp;

00:06:39.120 --> 00:06:43.600
and had my code effectively copy-paste&nbsp;
that on top of each button. Now the only&nbsp;&nbsp;

00:06:43.600 --> 00:06:47.520
problem is that the physical button is&nbsp;
smaller than it looks, so to remedy that,&nbsp;&nbsp;

00:06:47.520 --> 00:06:52.160
I placed 4 of the small buttons at each corner&nbsp;
of the big one, and linked them all together to&nbsp;&nbsp;

00:06:52.160 --> 00:06:57.840
create one big super-colliding super button.
At this point, you could technically build an&nbsp;&nbsp;

00:06:57.840 --> 00:07:03.680
entire Portal 2 test chamber for Narbacular&nbsp;
Drop. So, that's what I did. Introducing,&nbsp;&nbsp;

00:07:03.680 --> 00:07:10.960
the first ever Narbacular Drop puzzle designed&nbsp;
entirely within the Portal 2 in-game level editor.&nbsp;

00:07:10.960 --> 00:07:16.320
Of course, it's really nothing special. Currently,&nbsp;
all you can make are simple cube and button based&nbsp;&nbsp;

00:07:16.320 --> 00:07:20.720
puzzles, and maybe something with flings if&nbsp;
you get creative. We'll get to porting over&nbsp;&nbsp;

00:07:20.720 --> 00:07:26.320
other testing elements in a bit, but for now,&nbsp;
I wanted to tackle a few more pressing matters.

00:07:26.320 --> 00:07:31.440
I still wanted to figure out how to swap out the&nbsp;
models, because I felt like that would make it&nbsp;&nbsp;

00:07:31.440 --> 00:07:37.440
10 times more immersive. From a quick search,&nbsp;
it turns out that these ".x" files are actually&nbsp;&nbsp;

00:07:37.440 --> 00:07:43.040
DirectX models. These have been long abandoned&nbsp;
in favor of more modern and flexible formats,&nbsp;&nbsp;

00:07:43.040 --> 00:07:45.920
which is probably why I have never&nbsp;
heard of them before. Of course,&nbsp;&nbsp;

00:07:45.920 --> 00:07:50.960
Blender doesn't natively support them, so I had&nbsp;
to install a couple of plugins. But even these are&nbsp;&nbsp;

00:07:50.960 --> 00:07:56.240
dated and kept throwing errors in specific cases.
I managed to import the Narbacular Drop cube model&nbsp;&nbsp;

00:07:56.240 --> 00:08:01.600
as a reference for scaling the Portal 2 cube,&nbsp;
and after hours and hours of debugging textures,&nbsp;&nbsp;

00:08:01.600 --> 00:08:08.960
I finally got it to load. There it is. It felt&nbsp;
like l had unlocked a new chapter or something,&nbsp;&nbsp;

00:08:08.960 --> 00:08:13.520
as I had now proven that it's&nbsp;
possible to change the models, too.&nbsp;

00:08:13.520 --> 00:08:19.120
And now the issue was that the buttons were way&nbsp;
too low-poly. They stood out like a sore thumb.&nbsp;&nbsp;

00:08:19.120 --> 00:08:24.240
But, armed with the experience of working with&nbsp;
DirectX model files, I could swap those out, too.&nbsp;

00:08:24.240 --> 00:08:29.280
When I loaded up the original button model, it&nbsp;
was split into two separate objects. I assumed&nbsp;&nbsp;

00:08:29.280 --> 00:08:34.480
that this was so they could animate independently,&nbsp;
which is why I made my button also consist of two&nbsp;&nbsp;

00:08:34.480 --> 00:08:39.920
separate objects. I will later go on to discover&nbsp;
that this was absolutely pointless, but oh well.&nbsp;

00:08:39.920 --> 00:08:44.400
The scale of the button in Blender was also&nbsp;
completely off, so I couldn't use it as a&nbsp;&nbsp;

00:08:44.400 --> 00:08:49.520
reference. I had to eyeball it, but after just a&nbsp;
couple of retakes, I ended up getting it exactly&nbsp;&nbsp;

00:08:49.520 --> 00:08:54.320
right. And to once again counter that issue where&nbsp;
the buttons look bigger than they really are,&nbsp;&nbsp;

00:08:54.320 --> 00:08:59.200
this time I just made the cube model smaller.&nbsp;
The reasoning for this is that the hitbox of&nbsp;&nbsp;

00:08:59.200 --> 00:09:04.880
the cube doesn't depend on the model, instead&nbsp;
using its size property from the map file. So&nbsp;&nbsp;

00:09:04.880 --> 00:09:09.920
if I made the hitbox bigger but the cube model&nbsp;
smaller, things will look the same as before,&nbsp;&nbsp;

00:09:09.920 --> 00:09:15.440
but with much more reasonable collisions.
Now the game had this borderline uncanny&nbsp;&nbsp;

00:09:15.440 --> 00:09:20.000
feel to it, like something isn't quite where you&nbsp;
expect it to be. Needless to say, the chambers&nbsp;&nbsp;

00:09:20.000 --> 00:09:25.120
were starting to look pretty good, so next up&nbsp;
on the list was making them more functional.

00:09:25.840 --> 00:09:31.600
I opened up the list of testing elements&nbsp;
in the editor and, well, it didn't look too&nbsp;&nbsp;

00:09:31.600 --> 00:09:37.200
promising. I can't implement most of these,&nbsp;
simply because Narbacular Drop doesn't have&nbsp;&nbsp;

00:09:37.200 --> 00:09:42.640
an equivalent for things like lasers, turrets,&nbsp;
or even moving walls, as previously discussed.&nbsp;

00:09:42.640 --> 00:09:47.200
So, I took the opposite approach - I went&nbsp;
looking for interesting behavior that could&nbsp;&nbsp;

00:09:47.200 --> 00:09:51.360
somehow be useful for Portal 2 testing&nbsp;
elements. And while messing around in&nbsp;&nbsp;

00:09:51.360 --> 00:09:56.400
the so-called "art room", I noticed that&nbsp;
landing on the stationary boulder would&nbsp;&nbsp;

00:09:56.400 --> 00:10:01.040
sometimes shoot you away with a ton of speed.
And, it just so happens that there's a testing&nbsp;&nbsp;

00:10:01.040 --> 00:10:06.960
element that does exactly that - the aerial&nbsp;
faith plate. And there you go - I had my new&nbsp;&nbsp;

00:10:06.960 --> 00:10:11.840
mechanic! All that was left was to figure&nbsp;
out how exactly the launching thing works.&nbsp;

00:10:11.840 --> 00:10:17.280
Okay, so normally, a boulder rolls along an&nbsp;
axis-aligned path with a set speed, crushing&nbsp;&nbsp;

00:10:17.280 --> 00:10:21.280
the player if they get in the way. When creating&nbsp;
a map, you can set the speed of the boulder,&nbsp;&nbsp;

00:10:21.280 --> 00:10:25.680
as well as the direction that it rolls in. With a&nbsp;
bit of tinkering, I found that setting the speed&nbsp;&nbsp;

00:10:25.680 --> 00:10:31.840
to -1 reproduces that effect of it rolling in&nbsp;
place. But touching the boulder still crushes&nbsp;&nbsp;

00:10:31.840 --> 00:10:36.400
the player sometimes, even if it's not moving. And&nbsp;
I think the way this works is that it checks for&nbsp;&nbsp;

00:10:36.400 --> 00:10:41.440
a player in the direction that it's supposed to&nbsp;
be rolling in, even if it's not actually rolling.&nbsp;

00:10:41.440 --> 00:10:46.320
To work around all of that, I buried the boulder&nbsp;
in the ground where the faith plate would normally&nbsp;&nbsp;

00:10:46.320 --> 00:10:51.760
be, and made the rolling direction point directly&nbsp;
downwards - and since you can only ever reach the&nbsp;&nbsp;

00:10:51.760 --> 00:10:57.360
boulder from the top, it won't crush you but&nbsp;
will fling you like expected. Oh, and making&nbsp;&nbsp;

00:10:57.360 --> 00:11:02.800
it point downwards also has the added benefit of&nbsp;
disabling the rolling animation, which means that,&nbsp;&nbsp;

00:11:02.800 --> 00:11:08.880
just like before, I can swap out the boulder's&nbsp;
model for a model of the Portal 2 faith plate.&nbsp;

00:11:08.880 --> 00:11:14.080
This was admittedly easier said than done,&nbsp;
the faith plate model uses a reflective glass&nbsp;&nbsp;

00:11:14.080 --> 00:11:21.280
texture for its surface, and to no one's surprise,&nbsp;
Narbacular Drop doesn't have a glass shader. I had&nbsp;&nbsp;

00:11:21.280 --> 00:11:26.400
to edit the model to remove the glass while making&nbsp;
it still look like a faith plate at a glance.&nbsp;

00:11:26.400 --> 00:11:32.080
In the end though, this was all completely worth&nbsp;
it. The faith plate works better than I expected,&nbsp;&nbsp;

00:11:32.080 --> 00:11:35.360
and although you can't control&nbsp;
the direction it launches you in,&nbsp;&nbsp;

00:11:35.360 --> 00:11:40.000
it still gets you a good amount of height&nbsp;
for clearing gaps or setting up flings.

00:11:40.000 --> 00:11:44.320
So far, we've been spending a lot of time&nbsp;
looking at the puzzle maker but, in theory,&nbsp;&nbsp;

00:11:44.320 --> 00:11:48.720
there's nothing stopping me from converting&nbsp;
campaign maps with this. It's the same file&nbsp;&nbsp;

00:11:48.720 --> 00:11:52.480
format, but the texture and entity&nbsp;
mappings are quite a bit different.&nbsp;

00:11:52.480 --> 00:11:57.840
My initial test of Smooth Jazz looks...&nbsp;
significantly worse than the hand-made&nbsp;&nbsp;

00:11:57.840 --> 00:12:03.040
version. This is for a few reasons. First,&nbsp;
a bunch of the textures are missing. Second,&nbsp;&nbsp;

00:12:03.040 --> 00:12:08.880
there are no lights yet, and third, there are&nbsp;
many more props here left unaccounted for. It&nbsp;&nbsp;

00:12:08.880 --> 00:12:13.840
doesn't feel like you're walking through a&nbsp;
Portal test chamber, it's more like... an&nbsp;&nbsp;

00:12:13.840 --> 00:12:20.160
empty shell of something you barely recognize.
There's also another, less visual discrepancy.&nbsp;&nbsp;

00:12:20.160 --> 00:12:25.360
Remember how I said that the first prototype&nbsp;
algorithm was hastily thrown together at 5 AM?&nbsp;&nbsp;

00:12:25.360 --> 00:12:31.840
Well, now that's finally coming back to haunt me.
Every wall is considered one whole solid - that's&nbsp;&nbsp;

00:12:31.840 --> 00:12:37.520
the simplest way to program this, but it's&nbsp;
also not entirely accurate. Take, for example,&nbsp;&nbsp;

00:12:37.520 --> 00:12:43.200
this extrusion here. Currently, the algorithm&nbsp;
treats it all as one large portalable block - and&nbsp;&nbsp;

00:12:43.200 --> 00:12:48.000
that's fine in most cases! But watch what&nbsp;
happens if I color half of the surfaces black,&nbsp;&nbsp;

00:12:48.000 --> 00:12:54.080
while leaving the others white: since this is&nbsp;
all still one big block, all faces share the same&nbsp;&nbsp;

00:12:54.080 --> 00:12:58.960
surface properties. And the algorithm now has&nbsp;
to make a choice - do you make the whole thing&nbsp;&nbsp;

00:12:58.960 --> 00:13:03.840
portalable or do you make it all non-portalable?&nbsp;
And, regardless of what you choose, it's still&nbsp;&nbsp;

00:13:03.840 --> 00:13:08.800
going to be wrong. You need per-face surface&nbsp;
properties, and the only way to do that in&nbsp;&nbsp;

00:13:08.800 --> 00:13:14.880
Narbacular Drop is to create one solid per face.
In a nutshell, that's what the new algorithm does&nbsp;&nbsp;

00:13:14.880 --> 00:13:19.680
in most cases. There are still some scenarios&nbsp;
where it still defaults back to the old system,&nbsp;&nbsp;

00:13:19.680 --> 00:13:24.160
but that's besides the point. Really, all&nbsp;
of this is besides the point. Because while&nbsp;&nbsp;

00:13:24.160 --> 00:13:28.480
this is an important issue, and while there's&nbsp;
still a lot of work to be done in this regard,&nbsp;&nbsp;

00:13:28.480 --> 00:13:34.160
I'm kind of just avoiding the bigger problem&nbsp;
- we need more textures. Or, specifically,&nbsp;&nbsp;

00:13:34.160 --> 00:13:38.080
I can see two paths forward: for one,&nbsp;
I could just improve the mapping for my&nbsp;&nbsp;

00:13:38.080 --> 00:13:43.680
existing limited library of built-in texture&nbsp;
overrides, or two, I could write a program&nbsp;&nbsp;

00:13:43.680 --> 00:13:50.400
that extracts textures from Portal 2 and converts&nbsp;
them into a format that works in Narbacular Drop.

00:13:50.400 --> 00:13:52.800
Can you guess which one I chose?

00:13:52.800 --> 00:13:58.560
Welp, that was a day of my life that I'm never&nbsp;
getting back, but dare I say - the results were&nbsp;&nbsp;

00:13:58.560 --> 00:14:03.280
kinda worth it! Yes, without an actual puzzle,&nbsp;
it still feels like the shell of a test chamber,&nbsp;&nbsp;

00:14:03.280 --> 00:14:08.560
but at least the shell now has a pretty coat of&nbsp;
paint. Needless to say, this completely solves&nbsp;&nbsp;

00:14:08.560 --> 00:14:12.960
the texturing issue. I also had the script&nbsp;
extract surface properties for each material,&nbsp;&nbsp;

00:14:12.960 --> 00:14:17.280
so I could automatically flag them as&nbsp;
portalable or see-through without needing&nbsp;&nbsp;

00:14:17.280 --> 00:14:21.200
to manually go through every texture.
From here, I kept improving the&nbsp;&nbsp;

00:14:21.200 --> 00:14:25.040
entity translation, working on small&nbsp;
compiler bugs, cleaning out the code,&nbsp;&nbsp;

00:14:25.040 --> 00:14:29.840
optimizing and structuring things, and once I was&nbsp;
ready to get back to working on functionality,

00:14:29.840 --> 00:14:33.920
I lost all motivation in the project. Instantly.

00:14:33.920 --> 00:14:39.600
See, I picked this particular map as the test&nbsp;
dummy for... a multitude of reasons. It's an&nbsp;&nbsp;

00:14:39.600 --> 00:14:43.840
incredibly simple puzzle, consisting of just&nbsp;
cubes and buttons, and it's one of the rare few&nbsp;&nbsp;

00:14:43.840 --> 00:14:49.520
that has two chambers in one. In the first part,&nbsp;
a button links directly to a door, while in the&nbsp;&nbsp;

00:14:49.520 --> 00:14:54.480
second part it's two buttons using a counter as&nbsp;
an intermediary. It's a perfect testing ground&nbsp;&nbsp;

00:14:54.480 --> 00:15:01.680
for simple entity connections, except... I don't&nbsp;
have anything to connect to. I don't have doors.

00:15:01.680 --> 00:15:05.040
And, okay - "how hard could it&nbsp;
be to stitch together a door",&nbsp;&nbsp;

00:15:05.040 --> 00:15:09.680
I hear you ask. And that's exactly what I&nbsp;
thought, but it's not that simple, turns out.&nbsp;

00:15:09.680 --> 00:15:14.560
When you think about it, a door is just an&nbsp;
obstacle that can be removed arbitrarily.&nbsp;&nbsp;

00:15:14.560 --> 00:15:18.480
And there are plenty of obstacles&nbsp;
in Narbacular Drop, just none that&nbsp;&nbsp;

00:15:18.480 --> 00:15:22.960
you can get rid of from a button press.
For example, you could construct a door&nbsp;&nbsp;

00:15:22.960 --> 00:15:27.520
by putting a boulder in a small room with an&nbsp;
opening - as it rolls back and forth, the player&nbsp;&nbsp;

00:15:27.520 --> 00:15:32.400
can't proceed until the boulder is gone. You&nbsp;
could... shoot a portal to get rid of the boulder,&nbsp;&nbsp;

00:15:32.400 --> 00:15:37.920
effectively opening the door, and that could be a&nbsp;
tiny puzzle on its own, but there's no interface&nbsp;&nbsp;

00:15:37.920 --> 00:15:44.720
for moving or deleting boulders from map logic.
In fact, here's a truly exhaustive list of&nbsp;&nbsp;

00:15:44.720 --> 00:15:50.800
everything you can do by triggering outputs: you&nbsp;
can make text appear on screen, you can restart&nbsp;&nbsp;

00:15:50.800 --> 00:15:55.200
the level, you can open the level transition&nbsp;
door, which, I'll remind you, is very limiting,&nbsp;&nbsp;

00:15:55.200 --> 00:16:00.320
and I can only have one per map anyway, and you&nbsp;
can make lava rise. That last part, by the way,&nbsp;&nbsp;

00:16:00.320 --> 00:16:05.120
is exactly what it sounds like - you can make&nbsp;
an arbitrary pool of lava slowly go up - but&nbsp;&nbsp;

00:16:05.120 --> 00:16:10.880
not down - by 32 units each time it's triggered.
At first, I thought that's it - you could just&nbsp;&nbsp;

00:16:10.880 --> 00:16:14.960
put a block of lava in front of the door,&nbsp;
and then trigger it to rise up and out&nbsp;&nbsp;

00:16:14.960 --> 00:16:21.760
of the way. But... that's not what happens.&nbsp;
The lava doesn't "go up" - it stretches up,&nbsp;&nbsp;

00:16:21.760 --> 00:16:25.440
so the bottom of it still kills you.
Then I thought I might be able to do&nbsp;&nbsp;

00:16:25.440 --> 00:16:29.360
something with the level reset input -&nbsp;
technically, if you put a trigger plane&nbsp;&nbsp;

00:16:29.360 --> 00:16:34.720
inside of the door and connected it to respawn the&nbsp;
player once touched, you would have an obstacle.&nbsp;&nbsp;

00:16:34.720 --> 00:16:38.640
Connect the trigger through a counter linked&nbsp;
to a button, and you'd have an obstacle that&nbsp;&nbsp;

00:16:38.640 --> 00:16:44.080
turns... on when you hold down the button,&nbsp;
which seems so close to a valid solution,&nbsp;&nbsp;

00:16:44.080 --> 00:16:50.560
but it's literally the opposite of what we want.
What I needed now was a logic element that the&nbsp;&nbsp;

00:16:50.560 --> 00:16:55.760
game just doesn't have - a NOT gate, which&nbsp;
effectively flips the input it's given.&nbsp;&nbsp;

00:16:55.760 --> 00:17:00.640
I tried a bunch of stuff to implement this,&nbsp;
even making the tolerance of buttons negative,&nbsp;&nbsp;

00:17:00.640 --> 00:17:05.520
and that almost worked - they remained pressed&nbsp;
down without a cube. But I couldn't find a way&nbsp;&nbsp;

00:17:05.520 --> 00:17:09.600
to unpress the button, even if I made&nbsp;
the weight of the cube negative, too.&nbsp;

00:17:09.600 --> 00:17:15.280
I had already given up and started writing&nbsp;
the script for this video, when... I got it.&nbsp;&nbsp;

00:17:15.280 --> 00:17:20.880
I figured it out. All of the puzzle pieces&nbsp;
moved into place, I knew exactly what to do.

00:17:20.880 --> 00:17:25.600
Okay, some of this is going to sound insane, but&nbsp;
bear with me. Narbacular Drop has these creatures&nbsp;&nbsp;

00:17:25.600 --> 00:17:30.080
called "lava turtles" - they float on lava to&nbsp;
escort the player, but stay in place when on&nbsp;&nbsp;

00:17:30.080 --> 00:17:36.080
dry land. And, crucially, the turtles can hold&nbsp;
down buttons. So if you place down a button,&nbsp;&nbsp;

00:17:36.080 --> 00:17:40.320
then a turtle on top of that button holding&nbsp;
it down, and lava right below the button,&nbsp;&nbsp;

00:17:40.320 --> 00:17:46.320
you can now trigger the lava to rise, floating&nbsp;
the turtle off of the button. Connect your input&nbsp;&nbsp;

00:17:46.320 --> 00:17:50.960
to the lava and your output from the button&nbsp;
and boom - that's a very mechanical NOT gate.&nbsp;

00:17:50.960 --> 00:17:56.000
And this is how that mechanism looks in-game.&nbsp;
The only downside is that, because of how slow&nbsp;&nbsp;

00:17:56.000 --> 00:18:01.440
the lava is, it takes a while for the turtle to&nbsp;
float off of the button. But otherwise, I can just&nbsp;&nbsp;

00:18:01.440 --> 00:18:07.440
create as many of these as I want out of bounds&nbsp;
and suddenly I've invented a new logic element.&nbsp;

00:18:07.440 --> 00:18:11.360
As you can imagine, this brought back enough&nbsp;
interest in the project for me to tie up the&nbsp;&nbsp;

00:18:11.360 --> 00:18:16.560
loose ends. I ended up actually implementing&nbsp;
doors! Well, really, they're more like slightly&nbsp;&nbsp;

00:18:16.560 --> 00:18:21.840
scuffed laser grids. They take a while to turn&nbsp;
off because of the lava rising, and visually they&nbsp;&nbsp;

00:18:21.840 --> 00:18:26.800
always appear on, which is why I added on-screen&nbsp;
text to indicate when it's safe to pass through.&nbsp;

00:18:26.800 --> 00:18:31.360
And since you can't make the turtle's lava&nbsp;
go down in any way, the laser grid will also&nbsp;&nbsp;

00:18:31.360 --> 00:18:35.440
remain disabled once it is triggered. This&nbsp;
would mean that just stepping on a button&nbsp;&nbsp;

00:18:35.440 --> 00:18:39.760
once permanently solves most chambers,&nbsp;
so to fix that, I made it so that the&nbsp;&nbsp;

00:18:39.760 --> 00:18:44.800
laser grid only turns off if you're next to&nbsp;
the exit while the door is being triggered.&nbsp;

00:18:44.800 --> 00:18:48.480
And finally, to prevent the player from&nbsp;
just shooting a portal past the grid,&nbsp;&nbsp;

00:18:48.480 --> 00:18:53.760
I used a wall with only one solid side,&nbsp;
which not only blocks portal shot traces,&nbsp;&nbsp;

00:18:53.760 --> 00:18:58.800
but also works as a one-way gate to&nbsp;
simulate the door closing behind the player.

00:18:58.800 --> 00:19:03.280
Of course, I also went back and added support&nbsp;
for laser grids to the puzzle maker suite. And&nbsp;&nbsp;

00:19:03.280 --> 00:19:07.760
as for doors, well, there's no way to create more&nbsp;
than one exit door in the level editor anyway,&nbsp;&nbsp;

00:19:07.760 --> 00:19:11.680
so for that, I could just afford to just use the&nbsp;
level transition door. Though if you're going to&nbsp;&nbsp;

00:19:11.680 --> 00:19:16.560
be making chambers with this, just remember&nbsp;
that this type of door cannot be rotated.&nbsp;

00:19:16.560 --> 00:19:22.080
Oh, yeah, by the way, you can set this up&nbsp;
for yourself. Well, sort of. This isn't a&nbsp;&nbsp;

00:19:22.080 --> 00:19:28.080
consumer-grade application, there's no fancy UI&nbsp;
with buttons and menus. It's a command line tool,&nbsp;&nbsp;

00:19:28.080 --> 00:19:32.000
and it's all written for Linux, so it might&nbsp;
not even work out of the box on your system.&nbsp;&nbsp;

00:19:32.000 --> 00:19:35.600
If you're still interested in trying it out,&nbsp;
or in digging through the commit history,&nbsp;&nbsp;

00:19:35.600 --> 00:19:40.320
you can check out the GitHub repository linked&nbsp;
in the description, but don't ask me for help&nbsp;&nbsp;

00:19:40.320 --> 00:19:44.800
setting it up. You're on your own, I have&nbsp;
better things to do than to spend my evening&nbsp;&nbsp;

00:19:44.800 --> 00:19:49.600
explaining to strangers how to install WSL.
You will need to own a copy of Portal 2 to&nbsp;&nbsp;

00:19:49.600 --> 00:19:53.600
extract the textures and models from,&nbsp;
both for moral and legal reasons,&nbsp;&nbsp;

00:19:53.600 --> 00:19:58.320
and of course you'll need to supply your own maps.
If you want, you can also skip extracting the&nbsp;&nbsp;

00:19:58.320 --> 00:20:02.720
assets and just use the built-in Narbacular&nbsp;
Drop textures. Here's what that looks like&nbsp;&nbsp;

00:20:02.720 --> 00:20:07.200
on Smooth Jazz. You know, I'd say it&nbsp;
actually looks kinda cool this way, too.

00:20:07.200 --> 00:20:13.840
Anyway, this project was... on the very outskirts&nbsp;
of my comfort zone, I guess. I might keep working&nbsp;&nbsp;

00:20:13.840 --> 00:20:18.800
on it in my free time, there's still a lot&nbsp;
that can be done, but my line of work typically&nbsp;&nbsp;

00:20:18.800 --> 00:20:22.800
revolves around programming mods for Portal 2.&nbsp;
So if that's something you're interested in,&nbsp;&nbsp;

00:20:22.800 --> 00:20:27.440
you can check out my other videos or commission&nbsp;
a mod on my Ko-fi, link in the description. It's&nbsp;&nbsp;

00:20:27.440 --> 00:20:31.840
a great way to support what I do, and you&nbsp;
get something cool and playable in return.&nbsp;

00:20:31.840 --> 00:20:36.000
Okay, that's all from me, subscribe if&nbsp;
you liked it, and I'll see ya around!

