Building A Raycaster Within Bash

Wolfenstein 3D was a paradigm-shifting piece of software, using raycasting techniques to create a game with pseudo-3D graphics. Now, [izabera] has done something very similar, creating a raycasting display engine that runs entirely within bash.

The work was developed with an eye cast over an existing raycasting tutorial online. As you might imagine, implementing these graphical techniques in a text console proved difficult. The biggest problem [izabera] encountered was that bash is slow. It’s not supposed to display full frames of moving content at 25+ fps. It’s supposed to display text. Making it display graphics by using tons of colorful characters is really pushing the limits. Bash also doesn’t have any ability to work with floating points, so all the calculations are done with massive integers. Other problems involved the limited ways to read the keyboard in bash, and keeping track of the display as a whole.

It’s neat reading about how this was pulled off—specifically because it was hard. It might not be the kind of project you’d ever implement for serious work, but there are learnings to be had here that you won’t get anywhere else. Code is on Github, while there’s a visual storytelling of how it came together on imgur.

We’ve seen similar work before—with magical 3D graphics generated in Microsoft Excel. Will wonders never cease? We hope not, because we always like to see new ones on the tipsline. Keep us busy!

Boy Off The Grid For Years Writes GUI For DOS

In a hacker version of Jumanji, when [fiberbundle]’s parents divorced, his thrice-fugitive new stepfather took him to a remote location in Australia without any access to technology or the outside world. With him he brought an old 486, a gift from his real dad. Lest the police discover them, [fiberbundle] was forbidden contact from most of society and even restricted in the books he was allowed to read.

The boy spent years trying to get the most he could out of his two-generations-old PC. Using only two textbooks from a decade and a half earlier, DOS 6.0, and QBasic he managed to write his own shell dubbed OSCI (pronounced “Aussie”), a ray-caster 3d engine and lots more. No mentors, no Internet. The computers at school were even more outdated Power Macs.

Eventually life returned him to civilization to be mindblown by modern technology 1000x as powerful. He went from playing text-based adventures he had to write for himself, to seeing Crysis. From QBasic to C++. From ASCII art “shooters” to Half-Life 2. From a 486 to a 4-core CPU. From a rural library to Wikipedia.

Follow the link above to see screens of his projects over the years. As of yet no one has verified the story, but, even if only that it is worth a read.

Thanks [Gustavo] for the tip.