WEBVTT
Kind: captions
Language: en

00:00:00.320 --> 00:00:05.360
This is a simple website. Nothing&nbsp;
too special, just some HTML and CSS.

00:00:05.360 --> 00:00:16.720
And this is the server that's running it. Don't&nbsp;
believe me? Here, let's see if this helps.

00:00:16.720 --> 00:00:22.400
And let's give that a refresh, yep, that's&nbsp;
more like it. To be clear, it's not just that&nbsp;&nbsp;

00:00:22.400 --> 00:00:28.400
the page layout is defined by those cubes. The&nbsp;
Portal 2 engine itself is hosting the server.&nbsp;&nbsp;

00:00:28.400 --> 00:00:32.320
In this video, we'll take a look at how&nbsp;
this even works, what you have to do to&nbsp;&nbsp;

00:00:32.320 --> 00:00:37.120
make Portal 2 serve a website, and explore a&nbsp;
few of the possibilities that this provides.

00:00:37.120 --> 00:00:40.880
First things first, why is the Source&nbsp;
engine even capable of doing something&nbsp;&nbsp;

00:00:40.880 --> 00:00:45.680
like this? Why should a game be able&nbsp;
to host a website? Well, in most cases,&nbsp;&nbsp;

00:00:45.680 --> 00:00:50.880
it shouldn't. Sure, some games may expose a&nbsp;
simple browser for displaying news or updates,&nbsp;&nbsp;

00:00:50.880 --> 00:00:57.120
but that's about it. Okay, so if it's not&nbsp;
a built-in server, then how does this work?

00:00:57.120 --> 00:01:02.080
The protocol used for serving websites&nbsp;
is called HTTP, or Hypertext Transfer&nbsp;&nbsp;

00:01:02.080 --> 00:01:05.840
Protocol. As the name implies, the&nbsp;
protocol is designed to transfer text,&nbsp;&nbsp;

00:01:05.840 --> 00:01:10.000
which makes it incredibly simple and&nbsp;
versatile. In theory, all you need in&nbsp;&nbsp;

00:01:10.000 --> 00:01:16.160
order to run a web server is a network socket&nbsp;
capable of transferring text. Well, sort of.

00:01:16.160 --> 00:01:22.240
See, HTTP runs on top of another protocol,&nbsp;
called TCP. TCP stands for "Transmission&nbsp;&nbsp;

00:01:22.240 --> 00:01:26.480
Control Protocol". And, being the&nbsp;
"control" protocol means it's very&nbsp;&nbsp;

00:01:26.480 --> 00:01:30.480
careful. It ensures that each packet&nbsp;
makes it to the right place and in the&nbsp;&nbsp;

00:01:30.480 --> 00:01:35.600
right order. But this isn't favorable for&nbsp;
real-time applications like video games,&nbsp;&nbsp;

00:01:35.600 --> 00:01:41.120
because having to watch out for and fix these&nbsp;
package ordering issues takes up valuable time.

00:01:41.120 --> 00:01:46.080
This is where UDP comes in - it has&nbsp;
absolutely no regard for order and integrity,&nbsp;&nbsp;

00:01:46.080 --> 00:01:50.080
instead just bombarding the target with&nbsp;
everything it's got. This is great for&nbsp;&nbsp;

00:01:50.080 --> 00:01:55.280
real-time applications like streaming and&nbsp;
video games, but not so much for websites.

00:01:55.280 --> 00:02:00.640
So before we even consider serving HTTP from&nbsp;
Portal 2, we first have to get it to communicate&nbsp;&nbsp;

00:02:00.640 --> 00:02:06.000
using TCP. If we take a look at all of the network&nbsp;
sockets the game is using, it's not too surprising&nbsp;&nbsp;

00:02:06.000 --> 00:02:12.640
to find that the vast majority of these are UDP.&nbsp;
There is one TCP connection, but that's outbound&nbsp;&nbsp;

00:02:12.640 --> 00:02:18.240
for communication with Steam. If we want a socket&nbsp;
we can control, we'll have to dig a bit deeper.

00:02:18.240 --> 00:02:23.040
The Linux versions of the Left 4 Dead dedicated&nbsp;
servers shipped with a few unique launch options&nbsp;&nbsp;

00:02:23.040 --> 00:02:29.040
for easier server management. One of these options&nbsp;
is "-netconport", which creates a TCP server that&nbsp;&nbsp;

00:02:29.040 --> 00:02:34.320
exposes the developer console. As it turns out,&nbsp;
this launch option has actually remained in the&nbsp;&nbsp;

00:02:34.320 --> 00:02:39.200
Source engine for future Valve games, including&nbsp;
Portal 2. By setting this launch option,&nbsp;&nbsp;

00:02:39.200 --> 00:02:43.920
you can send commands to the developer&nbsp;
console and read their output, as promised.

00:02:43.920 --> 00:02:50.960
But what about HTTP? What happens if we try to&nbsp;
connect to this socket as if it were a website?

00:02:50.960 --> 00:02:55.840
Well, the browser is stuck loading, but&nbsp;
the Portal 2 console seems to receive a&nbsp;&nbsp;

00:02:55.840 --> 00:03:01.520
lot of garbage in the form of HTTP headers. This&nbsp;
means that we do have a fully functional server,&nbsp;&nbsp;

00:03:01.520 --> 00:03:06.560
it just isn't responding with valid HTTP.&nbsp;
Let's see what we can do about that.

00:03:06.560 --> 00:03:10.000
As I mentioned, the HTTP headers&nbsp;
that the browser is sending seem&nbsp;&nbsp;

00:03:10.000 --> 00:03:14.640
to be getting interpreted as console commands.&nbsp;
For context, a "header" is just some property&nbsp;&nbsp;

00:03:14.640 --> 00:03:18.720
that describes the data being sent. In this&nbsp;
case, we seem to be getting the request type,&nbsp;&nbsp;

00:03:18.720 --> 00:03:24.720
followed by headers like "Host", "User-Agent",&nbsp;
and so on. But "GET" isn't a valid command,&nbsp;&nbsp;

00:03:24.720 --> 00:03:30.800
and neither is Host or User-Agent. Even if they&nbsp;
were, that wouldn't be particularly helpful. We&nbsp;&nbsp;

00:03:30.800 --> 00:03:36.160
need a way to forge a custom response to one of&nbsp;
these non-existent commands. Specifically, we&nbsp;&nbsp;

00:03:36.160 --> 00:03:40.560
should probably respond to the very first one, to&nbsp;
avoid the other errors from confusing the browser.

00:03:40.560 --> 00:03:45.200
For this, we can use the "alias" command.&nbsp;
It allows us to mask a different command&nbsp;&nbsp;

00:03:45.200 --> 00:03:50.240
under a custom name. In this case, we&nbsp;
can alias "GET" to print some text to&nbsp;&nbsp;

00:03:50.240 --> 00:03:54.720
the console. To make this a bit easier, I'll&nbsp;
implement the logic in VScript - that's the&nbsp;&nbsp;

00:03:54.720 --> 00:03:58.480
system used for creating various scripted&nbsp;
events throughout the game. It's actually&nbsp;&nbsp;

00:03:58.480 --> 00:04:02.480
a fairly powerful system, and is more&nbsp;
than enough for what we want to do.

00:04:02.480 --> 00:04:05.600
I'm using a library called ppmod&nbsp;
to make the code a bit cleaner,&nbsp;&nbsp;

00:04:05.600 --> 00:04:10.400
and this lets us directly attach a script function&nbsp;
to the GET alias. Inside of this script function,&nbsp;&nbsp;

00:04:10.400 --> 00:04:16.640
I'm just printing a very basic HTTP response to&nbsp;
the console. Again, it's all just plain text,&nbsp;&nbsp;

00:04:16.640 --> 00:04:20.480
so the browser should have no problem&nbsp;
treating this as a valid response.

00:04:20.480 --> 00:04:26.080
However, when I actually start up a map and&nbsp;
open up my browser, it's still stuck loading,&nbsp;&nbsp;

00:04:26.080 --> 00:04:29.840
even though the console output looks to&nbsp;
be correct. It's not until we check the&nbsp;&nbsp;

00:04:29.840 --> 00:04:34.640
network tab and cancel the request that we&nbsp;
see something resembling the desired output,&nbsp;&nbsp;

00:04:34.640 --> 00:04:36.720
with some more console garbage below.

00:04:36.720 --> 00:04:40.720
See, normally, after the whole document&nbsp;
has been sent, the server would terminate&nbsp;&nbsp;

00:04:40.720 --> 00:04:43.440
the connection to let the browser&nbsp;
know that nothing else is coming,&nbsp;&nbsp;

00:04:43.440 --> 00:04:48.560
and that it's safe to start rendering. But in&nbsp;
our case, the console socket never closes. The&nbsp;&nbsp;

00:04:48.560 --> 00:04:52.880
browser has no idea when to stop listening&nbsp;
for output. It reads our example page,&nbsp;&nbsp;

00:04:52.880 --> 00:04:57.840
then all of the garbage, and then continues&nbsp;
waiting for even more data. Now, we could&nbsp;&nbsp;

00:04:57.840 --> 00:05:03.600
terminate the socket by shutting down the game,&nbsp;
but surely there's a less destructive option.

00:05:03.600 --> 00:05:08.400
Well, it turns out that we can make the browser&nbsp;
close the connection after a certain amount of&nbsp;&nbsp;

00:05:08.400 --> 00:05:13.840
data has been received. This can be done with the&nbsp;
Content-Length header, which, as the name implies,&nbsp;&nbsp;

00:05:13.840 --> 00:05:18.880
tells the browser the length of the document in&nbsp;
bytes. Most modern browsers will respect this&nbsp;&nbsp;

00:05:18.880 --> 00:05:23.760
property and stop receiving data as soon as the&nbsp;
target amount has been reached. So, in our case,&nbsp;&nbsp;

00:05:23.760 --> 00:05:28.960
as long as we just count the amount of bytes we're&nbsp;
sending, the browser can take care of the rest.

00:05:28.960 --> 00:05:33.760
Okay! So that's a start, but what is&nbsp;
this really good for? Well, remember,&nbsp;&nbsp;

00:05:33.760 --> 00:05:39.520
this is the Portal 2 engine itself sending&nbsp;
the HTTP data. It's actually pretty trivial&nbsp;&nbsp;

00:05:39.520 --> 00:05:45.280
to make it read data from the game and send that&nbsp;
instead of just some static text. For an example,&nbsp;&nbsp;

00:05:45.280 --> 00:05:49.760
let's try sending the name of the current map&nbsp;
file. For that, we first have to calculate the&nbsp;&nbsp;

00:05:49.760 --> 00:05:54.960
Content-Length of the potential output, and then&nbsp;
send the map name as part of the output string.&nbsp;&nbsp;

00:05:54.960 --> 00:06:00.960
Now, if I restart the map and refresh the webpage,&nbsp;
it'll pull the map name directly from the engine!

00:06:00.960 --> 00:06:05.200
You could even track objects in the game world&nbsp;
like this. Suppose we want the website to tell you&nbsp;&nbsp;

00:06:05.200 --> 00:06:10.080
whether a cube is on the left or right side of a&nbsp;
room. We can get that cube's X coordinate, compare&nbsp;&nbsp;

00:06:10.080 --> 00:06:14.960
it to a known value, and print the respective&nbsp;
text. And, again, loading up the page for the&nbsp;&nbsp;

00:06:14.960 --> 00:06:19.440
first time, it'll correctly report the cube as&nbsp;
being on the right. But if I go ahead and move&nbsp;&nbsp;

00:06:19.440 --> 00:06:24.000
it to the other side of the room, then refresh&nbsp;
the page again, the text will have changed.

00:06:24.000 --> 00:06:28.560
Hopefully you're starting to get the idea, but&nbsp;
there are some obvious limitations to this.&nbsp;&nbsp;

00:06:28.560 --> 00:06:33.680
For one, the calculation for the Content-Length&nbsp;
is starting to become pretty complicated. Since&nbsp;&nbsp;

00:06:33.680 --> 00:06:38.240
it would be very impractical to manually&nbsp;
calculate the value for every change we make,&nbsp;&nbsp;

00:06:38.240 --> 00:06:42.160
we can instead just hold the page&nbsp;
content in one pre-built string,&nbsp;&nbsp;

00:06:42.160 --> 00:06:45.920
and then use the length of that&nbsp;
string as the total Content-Length.

00:06:45.920 --> 00:06:49.920
That works pretty well, and allows&nbsp;
us to print even more dynamic values,&nbsp;&nbsp;

00:06:49.920 --> 00:06:56.800
like the cube's actual coordinates in 3D space.&nbsp;
But this now exposes another limitation - you&nbsp;&nbsp;

00:06:56.800 --> 00:07:02.000
have to refresh the page to actually see the&nbsp;
content update. This is where JavaScript comes&nbsp;&nbsp;

00:07:02.000 --> 00:07:06.800
into play - it's a programming language used&nbsp;
for making websites more dynamic. We could use&nbsp;&nbsp;

00:07:06.800 --> 00:07:11.600
it to automatically refresh the page, but&nbsp;
that's not a very clean solution. Instead,&nbsp;&nbsp;

00:07:11.600 --> 00:07:17.120
for dynamically updating page content, websites&nbsp;
usually fetch an API endpoint. You can think of&nbsp;&nbsp;

00:07:17.120 --> 00:07:22.000
this as just a special address on the server that&nbsp;
returns some consistently formatted data. But,&nbsp;&nbsp;

00:07:22.000 --> 00:07:27.840
in our case, we can't actually read the address.&nbsp;
The Portal 2 console only interprets the first&nbsp;&nbsp;

00:07:27.840 --> 00:07:32.800
word of a line as the alias, and discards&nbsp;
the rest. There just is no way to tell&nbsp;&nbsp;

00:07:32.800 --> 00:07:38.400
what address was being fetched, but we can&nbsp;
distinguish between different request types.

00:07:38.400 --> 00:07:42.320
"GET" is just one of a few - it's&nbsp;
the default request type used by a&nbsp;&nbsp;

00:07:42.320 --> 00:07:46.800
browser trying to "get" the contents of&nbsp;
some document. But, if we fetch using a&nbsp;&nbsp;

00:07:46.800 --> 00:07:51.680
different request type with JavaScript,&nbsp;
that can now have its own unique alias.

00:07:51.680 --> 00:07:56.240
This approach is a bit cursed, but it allows&nbsp;
us to effectively implement different routes&nbsp;&nbsp;

00:07:56.240 --> 00:08:00.960
for data. In this case, I'm just hijacking&nbsp;
the "POST" request type to send some JSON&nbsp;&nbsp;

00:08:00.960 --> 00:08:05.760
data containing the position of the cube as a&nbsp;
string. Then, I can write some JavaScript that&nbsp;&nbsp;

00:08:05.760 --> 00:08:09.680
fetches this endpoint every second&nbsp;
and updates the text on the page.

00:08:09.680 --> 00:08:14.720
But now if we go to run it, the text seems to&nbsp;
disappear entirely. Checking the source of the&nbsp;&nbsp;

00:08:14.720 --> 00:08:19.760
page, we find that the closing script tag&nbsp;
is cut short, and the browser automatically&nbsp;&nbsp;

00:08:19.760 --> 00:08:24.560
generates one on top of it. Evidently, our&nbsp;
Content-Length is being calculated incorrectly,&nbsp;&nbsp;

00:08:24.560 --> 00:08:30.160
and I think this happens because of the different&nbsp;
types of newline characters. Let me explain.

00:08:30.160 --> 00:08:34.720
Basically, the history of computers is&nbsp;
a bit of a mess. Although nowadays a new&nbsp;&nbsp;

00:08:34.720 --> 00:08:38.640
line is most of the time indicated&nbsp;
by just one "Line Feed" character,&nbsp;&nbsp;

00:08:38.640 --> 00:08:43.920
it used to be common practice to also add&nbsp;
a "Carriage Return" character afterwards.&nbsp;&nbsp;

00:08:43.920 --> 00:08:49.360
This idea stems from the way a typewriter works -&nbsp;
moving down one line and sending the cursor back&nbsp;&nbsp;

00:08:49.360 --> 00:08:58.880
to the start of the page are two separate actions,&nbsp;
and therefore require two separate characters.

00:08:58.880 --> 00:09:11.760
Of course, modern computers don't need to be told&nbsp;
to reposition the cursor after each new line,&nbsp;&nbsp;

00:09:11.760 --> 00:09:15.200
but in some places, including the&nbsp;
Source engine developer console,&nbsp;&nbsp;

00:09:15.200 --> 00:09:17.840
this standard has annoyingly stuck around.

00:09:17.840 --> 00:09:22.320
Long story short, to fix this issue, we&nbsp;
just need to count each newline character&nbsp;&nbsp;

00:09:22.320 --> 00:09:27.040
twice - once for the original line feed,&nbsp;
and another time for the carriage return.

00:09:27.040 --> 00:09:29.280
Refreshing the page now, we get a different error,&nbsp;&nbsp;

00:09:29.280 --> 00:09:33.200
but that's just from my own typo,&nbsp;
so after refreshing the page again,&nbsp;&nbsp;

00:09:33.200 --> 00:09:38.400
the position gets printed to the screen,&nbsp;
with live updates in one-second intervals.

00:09:38.400 --> 00:09:42.560
At this point, we have all of the building&nbsp;
blocks you'd ever need to build a full web&nbsp;&nbsp;

00:09:42.560 --> 00:09:47.120
application. And web apps aren't limited&nbsp;
to just text - here's a demo where I made&nbsp;&nbsp;

00:09:47.120 --> 00:09:51.440
a small rectangle move left and right based&nbsp;
on the cube's position in the game world.

00:09:51.440 --> 00:09:55.280
And, about the address thing, if you&nbsp;
wanted to implement custom subpages,&nbsp;&nbsp;

00:09:55.280 --> 00:10:00.000
you could have some JavaScript on the landing&nbsp;
page read the contents of the address bar,&nbsp;&nbsp;

00:10:00.000 --> 00:10:05.280
and fetch the corresponding API endpoint. And&nbsp;
just so that you're not limited by request types,&nbsp;&nbsp;

00:10:05.280 --> 00:10:10.240
you could also index different endpoints&nbsp;
by using custom headers. That's right - the&nbsp;&nbsp;

00:10:10.240 --> 00:10:15.280
headers aren't necessarily predefined,&nbsp;
you can send and receive custom ones,&nbsp;&nbsp;

00:10:15.280 --> 00:10:19.840
which in our case means literally&nbsp;
sending custom commands to the game.

00:10:19.840 --> 00:10:24.240
The possibilities are virtually endless.&nbsp;
In fact, when I first discovered this,&nbsp;&nbsp;

00:10:24.240 --> 00:10:29.200
I made a fully functional minimap that&nbsp;
would display the terrain in real-time,&nbsp;&nbsp;

00:10:29.200 --> 00:10:33.440
and even let you move the player&nbsp;
by pressing buttons in the browser.

00:10:33.440 --> 00:10:38.080
But- okay, let's be honest, there are&nbsp;
easier ways to visualize information&nbsp;&nbsp;

00:10:38.080 --> 00:10:41.200
coming from the game. This&nbsp;
is a web server after all,&nbsp;&nbsp;

00:10:41.200 --> 00:10:47.280
so how about we use it for its&nbsp;
intended purpose - serving a website?

00:10:47.280 --> 00:10:53.520
The idea is simple - create a system that maps&nbsp;
objects in-game to elements in a website. Ideally,&nbsp;&nbsp;

00:10:53.520 --> 00:10:57.760
this system would be modular enough to&nbsp;
allow for creating almost any website. And&nbsp;&nbsp;

00:10:57.760 --> 00:11:02.480
to figure out how to do this, let's take&nbsp;
a quick look at what makes up a website.

00:11:02.480 --> 00:11:08.080
This is an HTML file. It's basically the "code"&nbsp;
of a website. And while we could make a system&nbsp;&nbsp;

00:11:08.080 --> 00:11:13.840
where each cube corresponds to one character of&nbsp;
this file, that would be much too annoying. And,&nbsp;&nbsp;

00:11:13.840 --> 00:11:18.960
at the end of the day, we're building a website,&nbsp;
not a text editor. Instead, this file can be&nbsp;&nbsp;

00:11:18.960 --> 00:11:25.280
interpreted using a more abstract form - the&nbsp;
Document Object Model, or DOM. In this form, we're&nbsp;&nbsp;

00:11:25.280 --> 00:11:31.680
no longer dealing with individual characters, but&nbsp;
rather discrete objects that represent HTML tags.

00:11:31.680 --> 00:11:34.960
If we then map these objects&nbsp;
to cubes in the game world,&nbsp;&nbsp;

00:11:34.960 --> 00:11:41.040
we can start to represent a whole entire website&nbsp;
by just stacking these cubes next to each other.

00:11:41.040 --> 00:11:46.080
For example, let's say I want to build a website&nbsp;
with just the text "Subscribe" in it. I've added&nbsp;&nbsp;

00:11:46.080 --> 00:11:51.200
a script command that lets me create the different&nbsp;
types of tags as colored storage cubes. If I set&nbsp;&nbsp;

00:11:51.200 --> 00:11:56.640
down an opening and closing header tag, then put&nbsp;
down a cube representing the text in between those&nbsp;&nbsp;

00:11:56.640 --> 00:12:02.160
tags, our website will now reflect that object&nbsp;
model. If I wanted to add an image below that,&nbsp;&nbsp;

00:12:02.160 --> 00:12:07.920
I can literally just create another cube with the&nbsp;
image tag. And lastly, to add style modifiers,&nbsp;&nbsp;

00:12:07.920 --> 00:12:13.280
I can create special modifier cubes and&nbsp;
stack them on top of the target element.

00:12:13.280 --> 00:12:19.040
With just these core concepts, you can start to&nbsp;
build a simple webpage. And that's exactly how&nbsp;&nbsp;

00:12:19.040 --> 00:12:24.560
I built the site from this video's intro.&nbsp;
Literally stacking blocks one-by-one. Now,&nbsp;&nbsp;

00:12:24.560 --> 00:12:28.800
of course, this quickly becomes impractical&nbsp;
for larger websites. Even while building&nbsp;&nbsp;

00:12:28.800 --> 00:12:32.720
this one it eventually became hard&nbsp;
to stack the cubes any higher. But,&nbsp;&nbsp;

00:12:32.720 --> 00:12:37.600
just for the sake of the argument, what would&nbsp;
a modern website look like in this form?

00:12:37.600 --> 00:12:41.840
Well, to answer that question, I wrote a few&nbsp;
scripts for converting any relatively simple&nbsp;&nbsp;

00:12:41.840 --> 00:12:46.640
website to the corresponding arrangement of&nbsp;
cubes. I was going to try parsing the front&nbsp;&nbsp;

00:12:46.640 --> 00:12:50.320
page of Google, but it turns out that&nbsp;
it's actually not as lightweight as it&nbsp;&nbsp;

00:12:50.320 --> 00:12:54.240
looks. The total cube count exceeds&nbsp;
the total entity limit of Portal 2,&nbsp;&nbsp;

00:12:54.240 --> 00:12:58.960
so I used the homepage of another&nbsp;
search engine, DuckDuckGo, instead.

00:12:58.960 --> 00:13:02.400
This is what it looks like&nbsp;
if you parse just the HTML,&nbsp;&nbsp;

00:13:02.400 --> 00:13:07.280
without any style modifiers. It's a pretty&nbsp;
colorful scene, definitely more complex than&nbsp;&nbsp;

00:13:07.280 --> 00:13:12.320
my example from earlier, but it also doesn't&nbsp;
look too coherent when opened in a browser.

00:13:12.320 --> 00:13:17.680
And this is what happens when we add all of&nbsp;
the style modifiers. I have to do this slowly,&nbsp;&nbsp;

00:13:17.680 --> 00:13:22.160
one by one, because of the sheer amount of&nbsp;
cubes in each iteration. The engine just&nbsp;&nbsp;

00:13:22.160 --> 00:13:26.560
can't keep up otherwise. Of course, there&nbsp;
are more efficient ways to represent CSS,&nbsp;&nbsp;

00:13:26.560 --> 00:13:29.680
but I decided to map each&nbsp;
one property to one cube,&nbsp;&nbsp;

00:13:29.680 --> 00:13:33.920
because that kind of follows the same&nbsp;
atomic concept as the document itself.

00:13:33.920 --> 00:13:39.000
Even so, the resulting page isn't completely&nbsp;
accurate to the original. The DuckDuckGo home&nbsp;&nbsp;

00:13:39.000 --> 00:13:44.160
page uses base64 images, which are basically&nbsp;
long strings of text containing the entire&nbsp;&nbsp;

00:13:44.160 --> 00:13:49.360
image data. In fact, this text is longer&nbsp;
than the longest permitted console command,&nbsp;&nbsp;

00:13:49.360 --> 00:13:53.840
which is why the algorithm just ignores it.&nbsp;
The other issues stem from an incomplete DOM&nbsp;&nbsp;

00:13:53.840 --> 00:13:57.680
representation, but I honestly can't&nbsp;
be brought to care enough to fix it.

00:13:57.680 --> 00:14:01.680
The pillar here actually extends outside&nbsp;
of the map, and the only reason it's not&nbsp;&nbsp;

00:14:01.680 --> 00:14:06.560
toppling over or crashing my game is because&nbsp;
I've completely disabled physics simulation.

00:14:06.560 --> 00:14:10.960
But, of course, just for fun, let's see&nbsp;
what happens if we do enable physics,&nbsp;&nbsp;

00:14:10.960 --> 00:14:20.720
but disable gravity, and&nbsp;
fire a rocket at the cubes.

00:14:20.720 --> 00:14:25.600
The game actually performs better than I expected,&nbsp;
mostly because disabling gravity leads to fewer&nbsp;&nbsp;

00:14:25.600 --> 00:14:31.200
collisions overall. And, unsurprisingly,&nbsp;
this completely ruins the page layout.

00:14:31.200 --> 00:14:34.240
Anyway, I'll leave the destruction&nbsp;
on-screen for a while longer,&nbsp;&nbsp;

00:14:34.240 --> 00:14:53.840
but otherwise, that's all&nbsp;
from me, thanks for watching.

00:14:53.840 --> 00:14:56.880
By the way, at least on the Linux&nbsp;
version, Portal 2 does actually&nbsp;&nbsp;

00:14:56.880 --> 00:15:01.280
have a built-in web server. It just doesn't&nbsp;
output anything other than "404 Not Found",&nbsp;&nbsp;

00:15:01.280 --> 00:15:05.040
so it's completely useless, but...&nbsp;
fun bit of trivia none the less.

