Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
CubicDOOM a ray-casting game that fits in a boot sector (510 bytes) (github.com/nanochess)
83 points by rwmj on Dec 24, 2020 | hide | past | favorite | 14 comments


This game was written by Oscar Toledo, whose wife apparently died just three weeks ago (see https://nanochess.org/). So sad :(


I've always been impressed with peoples' ability to create these neat projects within exceptional constraints.

I've never attempted something like this myself, but I'd like to. My questions:

How long does it generally take to build something like this? This one was built in just five days, which actually seems incredible to me.

How much expertise do you need in the problem domain to be able to pull something like this off?

Where does one come up with the initial idea?

How do you assess feasibility?


x86 assembly is surprisingly good at ray casting/tracing in tiny constraints - I know, it's unexpected! The reason is that the 8087 FP co-processor implements a stack machine with single byte instructions for common floating point operations. Have a look at the insanely great demo Pyrit (https://www.pouet.net/prod.php?which=78045) which includes documented source code for a simple raytracer in 256 bytes.


So when it comes to something like this, the way it'll generally work is that you already have the code pretty much in your brain. Then you write it out & make some size optimizations. Hence the short timeline

So feasibility assessment is easy: you already know what you're going to do. The initial idea is going to be something that tugs at your brain & you mull over it in the quiet moments of your life. & the expertise comes from experience


If you've written anything in x86 assembly before and at least know how raycasting works 5 days actually seems like a pretty reasonable timeline. I imagine that a lot of that was trimming the raycast algorithm as much as possible. For instance, normally you do a fish-eye effect correction but that's clearly been skipped here.

As to how people come up with these ideas? It's kinda just like any hobby project, you just have an itch to try something, mull it over for a bit, and then decide to do it. Some people juggle geese...


Cool!

> Use Left Ctrl to turn to left, use Left Alt to turn to right. Press Left Shift to advance, and Right Shift to shoot.

Is there any technical reason why these were chosen? They’re all modifiers so maybe it’s easier to read their key codes?


yes, ease of access. The state of these keys is represented as a bit each in a word at offset 0x417, in the bios data area.


The game compiles into a DOS COM file too, just set 100h as the loading area and delete the BIOS boot code.

So you can try it under DOSBox, too.


Under dosbox you can boot to images directly, just enter:

boot /path/to/disk/boot.img


I forgot that too, doh. And yes, I know the usage cases, in order to install w95 on it booting from a floppy and then a disk image :).


Very Impressive but I was expecting game play .. this is just roaming around


From the video description:

"This is the CubicDoom, all the cubes have rebelled against humankind! You need to stop the invasion!

Use Left Ctrl to turn to left, use Left Alt to turn to right. Press Left Shift to advance, and Right Shift to shoot.

Destroy all cubes on the current maze to advance to the next one. Careful! The cubes will advance towards you."


Got it. Makes sense now


I'm fairly certain they were shooting the brightly coloured cubes, and getting killed when said cubes got too close.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: