The ray tracer racer

Whipping Together A Little Ray Tracer Racer

When you hear raytracing, you might think of complex dark algorithms that to stare too long at their source code invites the beginning of madness. And you’re technically not far off from the truth, but [h3r2tic] put a small open-source ray tracing game demo up on GitHub. The actual rust code powering the game is relatively short (just four files), with the longest file being the physics file. But, of course, there is a small mountain of code under this sample in the form of libraries.

Kajiya, physx-rs, and dolly are the three libraries that make this little demo possible. Kajiya, in particular, is what makes raytracing possible as it uses the newer RTX features (so only more recent Nvidia and AMD cards are supported) and Vulkan bindings. But, of course, it isn’t wholly ray-traced as we are still several years out from proper real-time raytracing. Nevertheless, the blend between raytracing and traditional rasterization looks incredible. The most important thing about this simple tiny sample isn’t the game itself but what it stands for. It shows how easy it is to create a sample like this. Even just five years, creating a demo like this required massive effort and expertise.

Visually, it is stunning to look at. While the reflections are most apparent, the takeaway from this is the ease that real-time global illumination brings. A quick look through the code shows that there are very few lights in the scene, despite looking well lit with soft shadows. Traditional video games spend a significant amount of development time lighting a scene, placing additional lights, and tweaking them to make up for all the shortcuts that lighting has to take in a rasterized environment. As more and more games are built with raytracing in mind rather than tacked on at the end, we can ditch the small crumbling mountain of hacks that we are forced to use in games today and just rely on the rays to accurately light a scene.

If using a library for your raytracing seems too easy, perhaps you’d like to take on the challenge of raytracing in excel. Video after the break.

Continue reading “Whipping Together A Little Ray Tracer Racer”

The Legend Of Zelda: Decompiled

Keeping source code to programs closed is something that is generally frowned upon here for plenty of reasons. Closed source code is less secure and less customizable, but unfortunately we won’t be able to convince everyone of the merits of open source code any time soon. On the other hand, it is possible to decompile some of those programs whose source remains behind locked doors in an attempt to better understand that code, and one of the more impressive examples of that of late is this project which has fully decompiled Ocarina of Time.

To get started with the code for this project, one simply needs to clone the Git repository and then use a certain set of software tools (depending on the user’s operating system) to compile the ROM from the source code. From there, though, the world is your rupee-filled jar. Like we’ve seen from other decompiled games, any number of enhancements to the original game can be made including increasing the frame rate, improving the graphics, or otherwise adding flourishes that wouldn’t otherwise be there.

The creators of this project do point out that this is still a work-in-progress as only one of the 18 versions have been completed, but the fact that the source code they have been able to decompile builds a fully-working game when recompiled speaks to how far along it’s come. We’ve seen similar processes used for other games before that also help to illustrate how much improvement is possible when re-writing old games from their source code.

Continue reading “The Legend Of Zelda: Decompiled”

The Dreamcast Legacy

The Dreamcast is a bit of an odd beast. Coming on the heels of the unpopular Sega Saturn, the Dreamcast was meant to be a simple console built with off-the-shelf parts and released in late 1998. The Nintendo 64 was already tough competition (1996). Ultimately, the Dreamcast fell out of the public eye in the early 2000s as the Playstation 2, Xbox, and Gamecube were all released with incredible fanfare just a few years later. In some sense, Sega’s last console is a footnote in gaming history.

But despite not achieving the success that Sega hoped for, the Dreamcast has formed a small cult following, because as we know, nothing builds a cult-like following like an untimely demise. Since its release, it has gained a reputation for being ahead of its time. It was the first console to include a modem for network play and an easy storage solution for transferring game data between consoles via the VMUs that docked in the controllers. It had innovative and classic games such as Crazy TaxiJet Set RadioPhantasy Star Online, and Shenmue. Microsoft even released a version of Windows CE with DirectX allowing developers to port PC games to the console quickly.

We see our fair share of console hacks here on Hackaday, but what is the ultimate legacy of the Dreamcast? How did it come to be? What happened to it, and why did so much of Sega’s hopes ride on it? Continue reading “The Dreamcast Legacy”

Assistive Tech And Video Games

Assistive technologies have a pretty big presence here on Hackaday, and this hack is nothing short of interesting. [kerchoo_22] is working on a hands-free video game controller as a final project for her engineering class and we think it’s worth sharing.

The basic premise of the circuit is pretty simple. She DIY’d a few contact switches using conductive plates made of cardboard, duct tape, and aluminum foil. The output of the switch is read by analog input pins on an Arduino Leonardo. When the switches are off, the analog input pins are pulled HIGH using 1 MegaOhm resistors. But when the user hits their head on one of the four conductive pads, the switch is engaged, and the analog input pins are shorted to ground.

The Arduino Leonardo, having a native USB port, is able to directly emulate a keyboard. Each conductive pad is mapped to a different key press corresponding to different functions within the game. Left, right, shoot, etc. And there you have it, gameplay without using hands or a controller!

Now, it seems as though [kerchoo_22] put an appropriate amount of cushion on the head pads, so there probably isn’t much danger of a concussion. Either way, you can never be too careful.

My Major Is Gaming…

Times have changed. You can now take a university class in writing games. In fact, YOU can now take a university class about writing games because [Dave Churchill] of Memorial University has put all 22 of his lectures up for your enjoyment. [Dr. Churchill] isn’t planning on releasing the assignment files, but you can still get a lot from watching the videos. Apparently, the classes were also live streamed on Twitch.

The games build on SFML so the resulting games can be portable. The library abstracts input, graphics, sound, and networking.

Continue reading “My Major Is Gaming…”

Play Runescape IRL

Runescape is pushing nearly 21 years old, and while that’s quite a long time for a game to stay active with an engaged userbase, it’s also a long time for people to modify the game in all kinds of colorful ways. For some older games like Team Fortress 2 this means spinning up a bot to ruin servers, but for Runescape the hacks are a little more lighthearted and fun. Like this axe which allows [BigFancyBen] to play Runescape in real life.

This is more of an augmented reality hack which upgrades his normal human interface device from a simple keyboard and mouse to also include this axe. When the axe is manipulated in real life, the in-game axe can be used at the same time. There are a lot of layers to this one but essentially a Switch joycon is connected to the axe to sense motion, which relays the information on axe swings to an API via a Python script. A bot in the game then chops the virtual tree, which is reported back to the API which then reports it back to [BigFancyBen]’s viewscreen which is additionally streamed on Twitch.

While this started off as frustration with the game’s insistence on grinding in order to reach certain objectives, it seems that there are some fun ways of manipulating that game mechanic for the greater good. [BigFancyBen] originally said he would rather go to the gym than “click anymore rooftops”  this is quite the start on the full IRLScape world. Don’t forget that it’s equally possible to take this type of build in the opposite direction and control real-world things from inside a video game.

Continue reading “Play Runescape IRL”

Play Doom Or GTA V With Your Own Custom Controller And Xbox Emulator

[Arnov] is bringing his own custom-made controller to the party and it is sure to impress. The design appears to have been inspired by the Xbox controller layout. Two joysticks for fine control of game characters, 4 face buttons, and two shoulder buttons. He opted for all through-hole components to make the assembly easier. No messing with tiny surface mount components here. We really appreciate the detail given to the silkscreen and the homage paid to a staple of retro gaming.

We were pretty impressed with how smoothly the controller translated to the game. He mentioned that was a huge improvement over his previous design. His original design had buttons instead of joysticks, but switching to joysticks gave him much better in-game control. That could also have a lot to do with the Xbox controller emulator running the background, but still.

Given that gift-giving season is upon us, you could really impress the video game enthusiast in your life with this as a custom gift. You could even run Retro games like Doom if you hook it up to a RetroPie. That ought to get a few people’s attention.

Continue reading “Play Doom Or GTA V With Your Own Custom Controller And Xbox Emulator”