Hacker News new | comments | ask | show | jobs | submit login
A Great Old Timey Game Programming Hack (2013) (moertel.com)
252 points by esaym 4 months ago | hide | past | web | favorite | 22 comments

If you like that, you should read Bob Pape's free book about the making of R-Type on the Spectrum. I think it was one of the most technically accomplished games on the Spectrum, which is no small feat - there were lots of other talented programmers trying their hardest to achieve the impossible on that platform.

The amazing part of the story is how poorly the industry treated Bob and yet an excellent game still made it to the shops.


Oh wow, R-Type was one of my favourites on the Spectrum, had no idea about the book! Thanks.

I've read this story before (likely on one of the two occasions linked) but I enjoyed reading it again.

I don't know how accessibly it is to the young guns today but one thing this story manages to elicit very well is the general zeitgeist I experienced myself during those days. Mind you, I was never as advanced a programmer as the author and his friend were. But the description of "facing a problem caused by the restricted architecture of the machine your working on, the puzzle-like search for a work-around, and simply just having the spare time to dedicate to a project" are memories I know very well too.

Unfortunately, this feeling really is a memory. Coding has changed so much since the days of the 6502 or 6509, it's a completely different ball game. That's why I wrote above, I don't know if those who haven't been there can relate to the story very much, other than it reading like a peculiarity. But it sure is a nice -- and even suspenseful! -- read for an old-timer like me.

As a 24 year old currently hobbiest programmer (looking to change that), I was able to follow along and really enjoyed this article. Anything I can learn technical and close to the "bare metal" I get immense satisfaction from. I have however had experience with registers and contiguous memory etc while working on a fat32 usb interface in C with libusb during my undergrad research. I think a lot of this puzzle-like nature lives on in protocols. That said I definitely agree that spare time is a factor for things like this. At least in the professional world considering the speed of development and computers themselves.

I think that the young generation might still relate to this story. Hacks have changed, but they still exist.

The difference is that now, instead of looking for a particular CPU instruction, you'll look at hidden instructions in you JIT bytecode or ways to trick your sandbox (browser?) to let you use the GPU.

But that's kind of my point: naturally, there are still "hacks" around, I didn't mean to imply otherwise. But as much as the nature of coding has changed, so has the nature of the hacks. I still wonder how easy it is for someone who grew up with IDEs, frameworks/libraries, and StackOverflow to relate to an old-time story like the one above. Sure, you can relate to the general feeling of "something is in the way of me reaching my goal, is there a clever way around it?" but to me, a lot of the "magic" inherent in the older hacks is different from today's. Can that old-time magic still be felt by a kid of today when reading a story like this one?

Still somewhat alive in HPC and maybe embedded (outside mass market mobile chips).

For the longest time, embedded development required some low level work that was quite comparable to game programming hacks of that era. But I see that microcontrollers are getting more powerful and compilers have become really good, so that only few applications require hacks like these anymore.

Thanks for that! I love HN discussions, they add so much to the article linked. These will too!!

This story wasn't prevented by the dupe-filter (presumably), but was your post automated?

I dunno if OP was complaining necessarily - there are a lot of cool stories to be read in the old threads too!

Not a complaint by me, parent to my comment is [the main?] mod, dang. I just was curious whether they'd implemented a side app to post links to past threads.

I'm always a bit surprised this site is not technically advanced on the front end.

Not automated. I just use HN Search the same way anyone else would (or we wish they would).

This post wasn't prevented by the dupe filter because dupeness on HN expires after a year or so. That's in the FAQ: https://news.ycombinator.com/newsfaq.html.

As a developer who has spent most of my time developing web applications, I get this feeling whenever I work with micro controllers. Memory usage and binary size are ever-present during the development process. Compiler optimization flags become really important. You're accessing registers and peripherals directly and you sometimes run into weird bugs and limitations with on-chip drivers that require a clever or unorthodox workaround to be found.

It's a nice deviation from high-level programming.

The commodore 128 allowed the same trick of moving the machine stack and zero page. But the 6510 processor didn't have useful multiple-push or multiple-pull instructions so the possible speedup wasn't as much. Also in practice people writing games for the commodore targetted the C64 as it was a much larger market and the 128 was backwards conpatible so nobody bothered witb 128-only tricks like that.

This is one of the reasons I love working with fantasy emulators like PICO-8. They impose deliberate technical limitations that force you to find creative solutions like this.

I really enjoy how this piece captures the sheer joy of programming.

Just noticed a comment by Terry Davis about TempleOS after the article; RIP.

Ah damn, I didn't realize he died. A fascinating mind.


I love this hack. Genius.

Applications are open for YC Summer 2019

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