Portal 2 is mostly known as the successful sequel to Valve’s weird physics platformer, Portal. It’s not really known for being a webserver. That might change, though, given the hard work of [PortalRunner].
Quite literally, [PortalRunner] hacked the Source engine and Portal 2 to actually run a working HTTP web server. That required setting up the code to implement a TCP network socket that was suitable for web traffic, since the engine primarily functions with UDP sockets for multiplayer use. This was achieved with a feature initially put in the Source engine for server management in the Left 4 Dead games. From there, the game engine just had to be set up to reply to HTTP requests on that socket with the proper responses a visiting browser expects. If the game engine responds to a browser’s connection request with a bunch of HTML, that’s what the browser will display. Bam! You’ve got a web server running in Portal 2.
From there, [PortalRunner] went further, setting things up so that the status of in-game objects effects the HTML served up to visiting web browsers. Move objects in the game, and the served web page changes. It’s pretty fun, and the complexity and features [PortalRunner] implements only get more advanced from there. When he gets into stacking companion cubes to write HTML in visual form, you’ll want to applaud the Minecraftian glory of it all.
The devil is really in the details on this one, and it’s a great watch. In reality, making Portal 2 into a simple web server is far easier than you might have thought possible. Valve’s physics masterpiece really is popular with hackers; we see it popping up around here all the time. Video after the break.
I guess it’s less making portal 2 a webserver and more gluing a crude homebrew webserver into the game so it can report status info.
an “impressively capable” report status info, for the sake of clikmony
You’d be correct
Still, one must applaud his creativity. Now if you could make something more intuitive or fun?
But honestly, this is my cutoff for what modern games are about. You can build computer logic through a games engine mechanics, where as space age games were still limited.
Going from “it’s a series of tubes” to “it’s a bunch of portals”.