Bringing The Quake Flicker To Life With A Hacked Light

If you ever feel a pang of shame because you’ve been reusing the same snippets of code in your projects for years, don’t. Even the big names do it, as evidenced by the fact that code written to govern flickering lights back in 1996 for Quake is still being used in AAA titles like 2020’s Half-Life: Alyx. In honor of this iconic example of digital buck-passing, [Rodrigo Feliciano] thought he’d port the code in question over to the Arduino and recreate the effect in real-life.

Since the Quake engine has been released under the GPLv2, it’s easy to pull up the relevant section of the code to see how the lighting was configured. Interestingly, lighting patterns were implemented as strings, where the letters from a to z referenced how bright the light should appear. So for example, a strobe light that goes between minimum and maximum brightness would be written as “aaaaaaaazzzzzzzz”, while a flickering light could be represented with the string nmonqnmomnmomomno“.

An emergency light provided the LEDs and enclosure.

This ended up being very easy to implement on the Arduino in just a few lines, as [Rodrigo] simply had to assign each letter in the string a numerical value between 0 and 255 using map, and then use the resulting number to set the LED brightness with analogWrite.

With the code written, [Rodrigo] then had to put the hardware together. He stripped down a basic emergency light to get an array of white LEDs and a handy enclosure. He also wired up a simple transistor circuit on a scrap of perfboard so the Arduino Pro Mini could control all the LEDs from a single GPIO pin. Combined with a long USB cable to power it, and he’s got a perfect desk accessory for late-night gaming sessions.

In the video below you can see the final result, which [Rodrigo] has even synced up to footage from the classic 1996 shooter. The light makes for an interesting conversation piece, but we think the logical next step is to work this technique into an ambilight-like system to really make it feel like you’re wandering down those dimly lit corridors.

Continue reading “Bringing The Quake Flicker To Life With A Hacked Light”

Illustrated Kristina with an IBM Model M keyboard floating between her hands.

Keebin’ With Kristina: The One With The Grabbity Gloves

I keep saying I need to stay away from auction sites, but then I wouldn’t have as much fodder for Hackaday, would I? As I write this, I’m waiting on a Dell AT101W, which will be my first keeb with Alps switches. Well, hopefully it has Alps SKCM salmon or black switches — according to Deskthority, it might have rubber domes. If it doesn’t keyboard, I will probably salvage the switches and build something more ergonomic. Either way, I’m thinking we need a post about Alps switches, because some people think they’re even better than Cherry MX switches.

Continue reading “Keebin’ With Kristina: The One With The Grabbity Gloves”

Researchers monitor calves as they use the MooLoo, a special pen for urination.

Toilet-Training Cows Is No Bull

Human activity may be the main cause of climate change, but all these cows milling and mooing about don’t help, either. Everyone knows that cows produce methane-laden flatulence, but there’s another problem — their urine contains ammonia. The nitrogen leeches into the soil and turns into nitrous oxide, which is no laughing matter. So what’s the answer, giant diapers? No, just train them to use a toilet instead of the soil-let.

A pair of researchers from the University of Auckland traveled to a research institute’s farm in Germany with the hope of training a group of 16 calves to do their business in a special pen. The “MooLoo” is painted bright green and carpeted with artificial turf so it’s less weird for the cows. First they left the calves in the pen until they peed, and then gave it a reward of sugar water. From there, they started extended the animals’ distance from the MooLoo. Whenever the calves thought outside the box, they would be sprayed with water for three seconds. The results are kind of surprising: within an average of 15-20 urination sessions, 11 of the 16 cows had been trained successfully and were using the MooLoo 75% of the time. Watch a calf earn some sugar water after the break.

German cows mostly live in barns, but millions of other cows spend much of their time outside. So, how would that work? The researchers believe that cows could be trained to go when they gather for milking time. Makes sense to us, but how do you train cows on a large scale? Maybe with bovine VR?

Continue reading “Toilet-Training Cows Is No Bull”

Mechanisms Behind Vaccine Side-Effects: The Science That Causes That Sore Arm

After receiving a vaccination shot, it’s likely that we’ll feel some side-effects. These can range from merely a sore arm to swollen lymph nodes and even a fever. Which side-effects to expect depend on the exact vaccine, with each type and variant coming with its own list of common side-effects. Each person’s immune system will also react differently, which makes it hard to say exactly what one can expect after receiving the vaccination.

What we can do is look closer at the underlying mechanisms that cause these side-effects, to try and understand why they occur and how to best deal with them. Most relevant here for the initial response is the body’s innate immune system, with dendritic cells generally being among the first to come into contact with the vaccine and to present the antigen to the body’s adaptive immune system.

Key to the redness, swelling, and fever are substances produced by the body which include various cytokines as well as prostaglandin, producing the symptoms seen with inflammation and injury.

Continue reading “Mechanisms Behind Vaccine Side-Effects: The Science That Causes That Sore Arm”

Interactive Clips For Game Boy: Sit Back And Watch Or Take Control

How often does this happen to you? You find yourself describing something that happened in a game to someone, and they’re not sure they know what part of the map you’re talking about, or they’ve never gotten that far. Wouldn’t it be cool to make a bookmark in a video game so you can jump right to the beginning of the action and show your friend what you mean using the actual game?

That’s the idea behind [Joël Franusic] and [Adam Smith]’s fantastic Playable Quotes for Game Boy — clip-making that creates a 4-D nugget of gameplay that can either be viewed as a video, or played live within the bounds of the clip. The system is built on a modified version of the PyBoy emulator.

Game Boy game ROM -- complete and partial
Left: the full game ROM. Right: a bookmarked slice of the game ROM with the rest set to zero.

Basically, a Playable Quote is made up of a save state and all that entails, plus a slice of the game’s ROM that includes just enough game data to recreate an interactive clip. Everything is zipped up and steganographically encoded into a PNG file. Here’s a Tetris quote you can play (or watch) right now — you might recognize it from the post thumbnail. You’ll find the others on the games site, which allows people to create and share and build on each other’s work.

There’s so much more that can be done with this type of immersive and interactive tool outside the realm of games, and we’re excited to see where this leads and what people do with it.

Haven’t heard of PyBoy before? Let us introduce you.

Up Close And Personal With An Unusual 3D Printer Kit

While there are still plenty of folks out there tinkering with custom 3D printers, it’s safe to say that most people these days are using a commercially-available machine. The prices are just so low now, even on the resin printers, that unless you have some application that requires exacting specifications, it just doesn’t make a whole lot of sense to fiddle around with a homebrew machine.

As it so happens, [Nicolas Tranchant] actually does have such an application. He needs ultra-high resolution 3D prints for his jewelry company, but even expensive printers designed for doing dental work weren’t giving him the results he was looking for. Rather than spend five-figures on a machine that may or may not get the job done, he decided to check out what was available in kit form. That’s when he found the work of [Frédéric Lautré].

A look at the heavy-duty Z axis.

He purchased the unique “Top-Down” SLA kit from him back in 2017, and now after four years of working with the machine, [Nicolas] decided he would share his experiences with the rest of the class. The basic idea with this printer is that the light source is above the resin vat, rather than below. So instead of the print bed being pulled farther away from the resin on each new layer, it actually sinks deeper into it.

Compared to the “Bottom-Up” style of resin printers that are more common for hobbyists, this approach does away with the need for a non-stick layer of film at the bottom of the tank. Printing is therefore made faster and more reliable, as the part doesn’t need to be peeled off the film for each new layer.

[Nicolas] goes into quite a bit of detail about building and using the $700 USD kit, including the occasional modifications he made. It sounds like the kit later went through a few revisions, but the core concepts are largely the same. It’s worth noting that the kit did not come with the actual projector though, so in his case the total cost was closer to $1,400. We were also surprised to see that [Frédéric] apparently developed the software for this printer himself, so the tips on how to wrangle its unfamiliar interface for slicing and support generation may be particularly helpful.

Unfortunately, it sounds like [Frédéric] has dropped off the radar. The website for the kit is gone, and [Nicolas] has been unable to get in touch with him. Which is a shame, as this looks to be a fascinating project. Perhaps the Hackaday community can help track down this mysterious SLA maestro?

Fight Disease With A Raspberry Pi

Despite the best efforts of scientists around the world, the current global pandemic continues onward. But even if you aren’t working on a new vaccine or trying to curb the virus with some other seemingly miraculous technology, there are a few other ways to help prevent the spread of the virus. By now we all know of ways to do that physically, but now thanks to [James Devine] and a team at CERN we can also model virus exposure directly on our own self-hosted Raspberry Pis.

The program, called the Covid-19 Airborne Risk Assessment (CARA), is able to take in a number of metrics about the size and shape of an area, the number of countermeasures already in place, and plenty of other information in order to provide a computer-generated model of the number of virus particles predicted as a function of time. It can run on a number of different Pi hardware although [James] recommends using the Pi 4 as the model does take up a significant amount of computer resources. Of course, this only generates statistical likelihoods of virus transmission but it does help get a more accurate understanding of specific situations.

For more information on how all of this works, the group at CERN also released a paper about their model. One of the goals of this project is that it is freely available and runs on relatively inexpensive hardware, so hopefully plenty of people around the world are able to easily run it to further develop understanding of how the virus spreads. For other ways of using your own computing power to help fight Covid, don’t forget about Folding@Home for using up all those extra CPU and GPU cycles.