Open A Portal To An NES Emulator

The Portal games were revolutionary not only for their puzzle-based, narrative-driven gameplay, but also for their unique physics engine, which let players open portals anywhere and conserve momentum and direction through them. They’re widely regarded as some of the best video games ever made, but even beyond that they have some extra features that aren’t talked about as much. Namely, there are a number of level editors and mods that allow the in-game components to be used to build things like logic gates and computers, and this project goes even further by building a working NES emulator, all within Portal 2.

The main limitation here is that Portal 2 can only support a certain number of in-game objects without crashing, far lower than what would be needed to directly emulate NES hardware. The creator of the project, [PortalRunner], instead turned to Squirrel, the Portal 2 scripting language, and set about porting an existing NES emulator called smolnes to this scripting language. This is easier said than done, as everything in the code needs to be converted eight bits and then all of the pointers in smolnes need to be converted to use arrays, since Squirrel doesn’t support pointers at all. As can be easily imagined, this led to a number of bugs that needed to be sorted out before the game would run at all.

For those interested in code golfing, porting, or cross-compatibility, this project is a master class not only in the intricacies of the Portal 2 scripting language but in the way the NES behaves as well, not to mention the coding skill needed to recognize unique behaviors of the C language and the Squirrel scripting language. But eventually [PortalRunner] is able to get Super Mario Bros. running in Portal 2, albeit with low resolution and frame rate. Since we heard you like games within games, someone else put DOOM inside DOOM so you can DOOM while you DOOM.

Continue reading “Open A Portal To An NES Emulator”

Portal 2 Becomes An Impressively Capable Web Server

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.

Continue reading “Portal 2 Becomes An Impressively Capable Web Server”

GLaDOS Potato Assistant

This Potato Virtual Assistant Is Fully Baked

There are a number of reasons you might want to build your own smart speaker virtual assistant. Usually, getting your weather forecast from a snarky, malicious AI potato isn’t one of them, unless you’re a huge Portal fan like [Binh Pham].

[Binh Pham] built the potato incarnation of GLaDOS from the Portal 2 video game with the help of a ReSpeaker Light kit, an ESP32-based board designed for speech recognition and voice control, and as an interface for home assistant running on a Raspberry Pi.

He resisted the temptation to use a real potato as an enclosure and wisely opted instead to print one from a 3D file he found on Thingiverse of the original GLaDOS potato. Providing the assistant with the iconic synthetic voice of GLaDOS was a matter of repackaging an existing voice model for use with Home Assistant.

Of course all of this attention to detail would be for naught if you had to refer to the assistant as “Google” or “Alexa” to get its attention. A bit of custom modelling and on-device wake word detection, and the cyborg tuber was ready to switch lights on and off with it’s signature sinister wit.

We’ve seen a number of projects that brought Portal objects to life for fans of the franchise to enjoy, even an assistant based on another version of the GLaDOS the character. This one adds a dimension of absurdity to the collection.

Continue reading “This Potato Virtual Assistant Is Fully Baked”

3d printed GLaDOS home assistant

GLaDOS Voice Assistant Passive-Aggressively Automates Home

With modern voice assistants we can tell a computer to play our favorite music, check the weather, or turn on a light. Like many of us, [nerdaxic] gave in to the convenience and perceived simplicity of various home automation products made by Google and Amazon. Also like many of us, he found it a bit difficult to accept the privacy implications that surround such cloud connected devices. But after selling his Home and Echo, [nerdaxic] missed the ability to control his smart home by voice command. Instead of giving in and buying back into the closed ecosystems he’d left behind, [nerdaxic] decided to open his home to a murderous, passive aggressive, sarcastic, slightly insane AI: GLaDOS, which you can see in action after the break.

Using open source designs from fellow YouTube creator [Mr. Volt], [nerdaxic] 3d printed as much of the GLaDOS animatronic model as he was able to, and implemented much of the same hardware to make it work. [nerdaxic] put more Open Source Software to use and has created a functional but somewhat limited home AI that can manage his home automation, give the weather, and tell jokes among other things. GLaDOS doesn’t fail to deliver some great one liners inspired by the original Portal games while heeding [nerdaxic]’s commands, either.

A ReSpeaker from Seeed Studio cleans up the audio sent to a Raspberry Pi 4, and allows for future expansion that will allow GLaDOS to look in the direction of the person speaking to it. With its IR capable camera, another enhancement will allow GlaDOS to stare at people as they walk around. That’s not creepy at all, right? [nerdaxic] also plans to bring speech-to-text processing in-house instead of the Google Cloud Speech-To-Text API used in its current iteration, and he’s made everything available on GitHub so that you too can have a villainous AI hanging on your every word.

Of course if having GLaDOS looming isn’t enough, you could always build a functional life size Portal turret or listen to the radio on your very own Portal Radio.

Continue reading “GLaDOS Voice Assistant Passive-Aggressively Automates Home”

This GLaDOS Potato Is A Lie

Why settle for virtual reality when you can make the digital world into reality? [Josh] wanted to have a GLaDOS potato accompany him through life when not playing Portal 2. He set to work to see what kind of replica prop he could come up with. Judging from the image above, and demo video after the break, he nailed it right in the spud.

There’s no worrying about rot. The potato and a few parts were molded from Sculpey and baked in the oven. Since the fake spud is hollow in the center it’s easy to hide the bits that make it talk. An old MP3 player was loaded with quotes from the game, and plays them back via an LM386 audio amplifier circuit and a speaker hidden below the electronic eye. The eye is lit by five yellow LEDs which are also tied into the amplifier to make them blink and fade with the intensity of the audio signal.

A paint job and the nails and wire really make the build look just right. Now [Josh] needs to host a geek-themed Halloween party so he can really show this off.

Continue reading “This GLaDOS Potato Is A Lie”