6 ms·
Game Engine White Papers: Commander Keen
- evilturnip 4mo agoMasters of Doom is a great book on the history of id software, which includes the origins of the development of smooth scrolling by Carmack and Romero, which was groundbreaking at the time on PC.
- _the_inflator 4mo agoFun fact for C64 guys: The underlying mechanics of Carmack's technique is very similar to the full screen smooth scrolling effect on C64 at any speed and distance. It is nowadays referred to as DMA delay. ELIF: You trick the CPU to display screen data at a different starting point than as designed by the hardware. This is tricky and need to be executed cycle exact. Here is the explanation in detail together with all major top notch effects. The article is a legend and kind of the bible of doing the most sophisticated effects on C64. Some effects have since then even more and better explained and exploited due to cross platform development possibilities and better tooling, but understanding all mechanics here is a necessity to play a role in the Champions League of C64 demos, besides and also being able to implement the techniques mentioned here: https://www.zimmers.net/cbmpics/cbm/c64/vic-ii.txt https://www.zimmers.net/cbmpics/cbm/c64/vic-ii.txt
- lazystar 4mo ago> ELIF: You trick the CPU to display screen data at a different starting point than as designed by the hardware. This is tricky and need to be executed cycle exact. heh, is there a new meaning for ELIF? im not sure that there are many 5 year olds who would understand that ;-)
- kevindamm 4mo agoELI5: explain like I'm five, ELIF: explain like I'm forty.
- zem 4mo agoexplain like i'm fifteen, surely (:
- goodmythical 4mo agoFifty? Fungified? Faded? Fading? Foreign? Fabulous? Explain like I'm face-palming/fainting?
- zem 4mo agoF is 15 in hex :)
- bonzini 4mo agoTo clarify, it does not need to be executed cycle exact on the IBM PC, only on the C64.
- deaddodo 4mo agoI was going to say, smooth scrolling is one place where VGA was fairly simple to work with, since it didn’t have to deal with chunky graphics/bitplanes or specific timing tricks. In fact, Carmack specifically states that packed pixels were the impetus for id’s side scrolling experiments that led to Commander Keen and its ilk.
- hbn 4mo agoIt should be noted that John Romero released his own book, Doom Guy, a few years ago which contradicts some of the accounts in Masters of Doom. MoD is probably the more thrilling read and I enjoyed both books, but some of the stories need to be taken with a grain of salt. I also think Doom Guy is worth a read because it gives a lot more insight into what happened at Ion Storm and how the Daikatana project fell apart. And some important context about the infamous "John Romero's about to make you his bitch" ad (mainly that he really didn't want to publish it at all). But I digress.
- vunderba 4mo agoYeah that's confirmed in Masters of Doom as well - sounds like Romero was a bit hesitant about it but Mike Wilson, the marketing guy, pushed him into it.
- hbn 4mo agoAh I couldn't remember if that was only confirmed in Doom Guy. Regardless, it's still worth a read.
- memsom 4mo agoI would recommend the audiobook - John Romero actually reads it so it seems a lot more personal. I did feel that Romero skipped a load of stuff, at least int he audio version. There was no real mention of Stevie Case, just one passing name check. That was really odd. I was expecting him to at least mention her. I've also both read and listened to Masters of Doom (read by Wil Wheaton no less) and it is a great book too. The audio version is really good.
- rendaw 4mo agoI've been following the Japanese early gaming scene, which had a lot of parallels to the west. They had NEC PCs running DOS, and there were a lot of games for the systems. Some of them had smooth scrolling. Did they come later? Did they copy ID Software's approach?
- instagraham 4mo agoOne thing I was sus from the book and which this post didn't clarify for me was whether Carmack truly invented side scrolling for the PC. He claimed to have done so, and even pitched it to Nintendo for a Mario port that never took off. Also, the idea that it hadn't been done yet by 1990, when consoles were well in the game, suggests the PC market was behind popular gaming in a big way.
- WorldMaker 4mo agoThe consoles at the time had dedicated sprite video RAM and hardware and dedicated hardware instructions for background scrolling. The NES for instance had up to 64 sprites (independently moving 16x16 or 32x32 pixel images) supporting up to 8 of those sprites per scanline. The NES background layer was a relatively simple tile map that supported smooth scrolling. All of which was managed by a dedicated hardware Picture Processing Unit [1]. PCs were designed to be general hardware and it didn't seem to make sense to create a generic "PPU" for the PC, so instead game engines at the time (and many game engines to this day) had to emulate one entirely in software. The video RAM of EGA and VGA is just one big blob of pixels, or perhaps two if your system supported double-buffering. At the hardware level it doesn't have concepts like sprites or scrolling backgrounds. Carmack was one of the first (if not the first; Commander Keen was also among the first commercially successful attempts) to get a software "PPU" renderer on the PC working reliably in real time. Another notable achievement for side scrollers on the PC in that era was Cliff Bleszinski managing to software render the parallax effects similar to Sega's "Blast processor" PPU (notable for "gotta go fast" Sonic games) for Jazz Jackrabbit (in 1994). It has sort of long been the arc of PC development of eventually doing entirely in software what consoles and arcades were doing with dedicated and/or one-off hardware. (Right up until about the invention of the modern GPU when suddenly the PC was leading graphics hardware in a different way.) [1] https://www.nesdev.org/wiki/PPU https://www.nesdev.org/wiki/PPU
- quantum669 4mo agoJazz Jackrabbit was coded by Arjan Brussee (from Ultra Force demo group). Cliff Bleszinski did the design.
- LarsDu88 4mo agoSomeone ping Fabien Sanglard! Looks so much like his site!
- bel8 4mo agoAnd his site looks like another thousand, as I'm sure he knows. We consume his site for the content, not for the minimalistic design that exist since the inception of the universe.
- sasas 4mo agoIt appears the author is leveraging Fabien's branding by copying not only the style of post but more importantly the formatting and style of Fabien's books. Even structurally the book appears quite similar. If you didn't double check the author while skimming this Keen book, you may well be mistaken that it was written by Fabien. I took a quick skim of the content, it looks great - tempted to purchase a copy to support the author for their efforts (and have it sit on the bookshelf next to two other very similar looking books...) but need to sit on this for a while. Maybe I'm overthinking this. Would like to hear Fabien's take on the situation. [EDIT] It looks that the Keen book author copied and pasted direct sections[1] out of Fabien's book's TeX[2]. [EDIT] The git commit history has comments that indicate that Fabien reviewed the book, e.g. "updated all chapters after feedback Fabien" and "Proofread Fabien Sanglard en hardcopy review", so perhaps this is all sanctioned. [1] https://github.com/bsmits74/Keen_White_Papers/blob/master/src/mystyle.sty https://github.com/bsmits74/Keen_White_Papers/blob/master/sr... [2] https://github.com/fabiensanglard/gebbdoom/blob/master/src/book.tex https://github.com/fabiensanglard/gebbdoom/blob/master/src/b...
- bombcar 4mo agoHe responds to this thread here: https://news.ycombinator.com/item?id=48546779 https://news.ycombinator.com/item?id=48546779
- fabiensanglard 4mo ago> perhaps this is all sanctioned In short, it is not. I received early draft from bas. While I encouraged him to finish his book, I also told him, in no uncertain terms, that I had released the source code to inspire people and give them a kickstart, but not for them to copy the content. As months passed, I asked repeatedly to remove whole paragraphs he had copy/pasted as is, and drawings he had also copy/pasted. Later, as A.I became more powerful, I used it to compare Wolfenstein 3D and Keen book and noticed a lot more that was verbatim. At which point I told him I no longer wanted to help him in his project. It is cool that someone documented Keen thanks to my framework. But I have only myself to blame for opensourcing the code of my books/website and thinking people would use it as intended. PS: I commented it was a "good idea" to change the cover because originally this was going to be the "Game Engine Black Book: Commander Keen". I did not like that his work could have been mistaken for mine (he also elected to use the same style as my website for his website which only adds to the confusion).
- LarsDu88 4mo agoLovely book. Skimming through it. One thing that might help contextualize it is a brief discussion of the how contemporary hardware like the SNES rendered sprites so efficiently compared to the PC hardware at the time. It's not obvious to modern readers why a PC with significantly more powerful compute capabilities would struggle to keep up with significantly slower Nintendo hardware at the time for sprite rendering.
- mrob 4mo ago>It's not obvious to modern readers why a PC with significantly more powerful compute capabilities would struggle to keep up with significantly slower Nintendo hardware at the time for sprite rendering. To put it briefly, 4th generation and earlier games consoles saved on expensive RAM by not having frame buffers [0]. The CPU wrote a description of how to construct the scene using tiles and sprites to a smaller video ram, then dedicated video hardware converted this to the video signal one line at a time. The whole frame gets rendered from scratch every video refresh, so there's no need for tricks like Commander Keen's adaptive tile refresh. Scrolling at 60 fps (or 50 fps for PAL hardware) is as cheap as changing a single value in video memory. It's like the famous "racing the beam" of the Atari 2600, except less flexible and done by dedicated hardware so you don't tie up the CPU. On the PC, the CPU writes the actual graphics to a frame buffer, then the graphics card outputs the contents of the frame buffer as the video signal. The naive approach to scrolling requires rewriting the entire frame buffer, so tricks to avoid redundant writes are highly beneficial. [0] Except for the Atari Lynx, which was a portable system with a screen resolution of only 160×102. I can't think of any other exceptions, but maybe there are more.
- wk_end 4mo agoI get what you're saying, but the comparison to "racing the beam" is maybe a little misleading, because the point is that you aren't "racing" the beam. Rather, the system is operating in perfect lockstep with the beam. From the software perspective, you set the scene up and then sit back while it draws. And then in the abstract and from the hardware's perspective it's not even one line at a time, it's one dot at a time.
- woutersf 4mo agoIf you want to play it you can do that here: https://www.playdosgames.com/play/commander-keen-4 https://www.playdosgames.com/play/commander-keen-4
- snodes 4mo agoIt's also on Steam: https://store.steampowered.com/app/9180/Commander_Keen/ https://store.steampowered.com/app/9180/Commander_Keen/
- basisword 4mo agoI had no idea you could still get it. This brings back memories! My first and favourite game as a kid. I'd get home from school, boot up the DOS machine and type 'keen.exe' to start it up.
- pan69 4mo agoGreat write up. Reminds me of Cosmodoc, which is similar source but analyzes Cosmo’s Cosmic Adventure instead of Commander Keen. https://cosmodoc.org https://cosmodoc.org
- ChrisArchitect 4mo agoOf related interest: Reconstructed Commander Keen 1-3 Source Code https://pckf.com/viewtopic.php?t=18248 https://pckf.com/viewtopic.php?t=18248 (https://news.ycombinator.com/item?id=46321982 https://news.ycombinator.com/item?id=46321982)
- nnnnico 4mo agothis looks like a copy of fabien's site, plus the topic is very related and likely trampolining on his brand :/
- deleted 4mo ago[deleted]
- mrandish 4mo agoFabien's site is an invaluable resource, but I think I've read it all over the years and he one has post specifically on Commander Keen, and that's focused on just the adaptive tile refresh (https://fabiensanglard.net/ega/ https://fabiensanglard.net/ega/). This book is 211 pages on the entire game. On the first page this author credits Fabian's excellent analysis of Doom and Wolfenstein as the inspiration to attempt the same for Commander Keen. > "Fast forward to 2021, I discovered Fabien Sanglard’s website and began reading his Game Engine Black Books on Wolfenstein 3D and Doom. Inspired by those works, I wondered whether I could do something similar for Commander Keen: open up the source code, ex plore the files, and piece together a picture of the overall architecture and the clever tricks used. The style, dimensions, and structure of this book are intentionally similar to Fabien’s Game Engine Black Books, as an homage to those masterpieces." Just skimming so far, but this book looks like a valuable contribution to the genre of retro game code analysis. Obviously, it will build on the work of others who've done adjacent research. In a page 87 footnote the author refers readers to Fabien's site for detailed instructions on installing a DOSBox and Borland C++ dev environment.
- bel8 4mo agoFirst, shallow dismissals are against HN guidelines, for a good reason. And I fail to make the connection. This content-heavy but minimal design is not unique. Text inside a centered element, text-heavy but also packed with images, exists from the times of formatinng websites with `<table>` tags in DreamWeaver or Microsoft Frontpage 98. If you're talking about the highly detailed article, can we not gatekeep this? I want more of that on the internet, not less.
- lelandfe 4mo ago57 lines of CSS and the only distinguishing characteristic, the use of Deja Vu Sans Mono, isn't present. This is trampolining on his "brand" as much as my text editor is
- ForHackernews 4mo agoAnother game from the same era: https://cosmodoc.org/ https://cosmodoc.org/
- doctorpangloss 4mo agoHave LLMs made all arcana about games engineering meaningless?
- LarsDu88 4mo agoDefinitely not. If anything this arcana is what feeds the llms not the other way around. Imagine if you replaced "games engineering" with "political history" or "nuclear physics"
- alberto-m 4mo agoEh, it's not so clear cut. LLMs have definitely killed a lot of fun in reverse engineering old games by making it trivial to solve riddles that in the past would have been interesting problems to work on. But the field still offers many mysteries that need human brains to be solved. Whether LLMs are a net positive here depends if one is result-oriented (e.g. wants to rewrite an old game in a modern language) or process-oriented (is there for the investigation work and the intellectual challenges).
- doctorpangloss 4mo agoWere they really that interesting?
- bluedino 4mo agoWould love to hear about the other Apogee and Epic games, like Epic Pinball, Tyrain, Halloween Harry, Jill of the Jungle, Duke Nukem...
- to11mtm 4mo ago> Tyrain ... Well, we do at least have OpenTyrian... (Edited to add; And OpenTyrian2000) > Epic Pinball Best I can find for Epic Pinball is an old thread on Pinball Fantasies [0] but I think it almost counts cause there was shared dev work between the two... > Halloween Harry TBH that one would be fairly interesting, especially compared to Duke Nukem 2 (Part of me thinks they might be similar/same engine) > Jill of the Jungle That one honestly WOULD be a fun one to look at... Best I can find is Xargon [1] but part of me always got a vibe that Xargon was some semi-upgraded Jill engine... > Duke Nukem TBH Duke Nukem '1' would not be that exciting to me. AFAIR it's mostly an adapted CK1-3 engine, letter-boxed with status window to make it easier to calc the redraw. Duke Nukem 2, is far more interesting since it's a different, more powerful engine (VGA, digital audio support, but AFAIR only required a 286). [0] - https://news.ycombinator.com/item?id=28667945 https://news.ycombinator.com/item?id=28667945 [1] - https://github.com/dos-games/vanilla-xargon https://github.com/dos-games/vanilla-xargon
- kridsdale1 4mo agoIIRC (from being a kid) Harry was 256 color and DN2 wasn’t quite. Also it felt like it had much better frame rate. But I’m sure that could be engine evolution too. Interesting, I hadn’t ever thought of the connection before. Though the “hot babes stuck in alien pods” from Harry showed up as a central plot point in DN3D.
- to11mtm 4mo agoI mean, I could be wrong as far as Harry and DN2 sharing an engine, OTOH Apogee did a -lot- of engine reuse (Bio-Menace used a CK4 variant, Monster Bash using an evolved FAST..) Although, mea culpa, DN1 engine is not necessarily CK but the programmer has credited Carmack in helping with the drawing assembly...
- jzelinskie 4mo agoSorry for the "asking for more"-style comment, but it would be amazing if this came in epub and not just PDF.
- Waterluvian 4mo agoGiven its open source in latex format, it should be pretty easy to render it in any format that isn’t asking for significant decision-making on how to structure and format it. Ie. Rendering to PDF or HTML would be pretty straightforward. Rendering to video, audio, or as a chocolate bar would require more authorship. Would epub be much more work?
- turpentine 4mo agoIt's a shame that the author both erased their own writing style using ChatGPT, and wholesale copied sections of the content from another author. https://news.ycombinator.com/item?id=48550425 https://news.ycombinator.com/item?id=48550425
- torh 4mo agoIt looks like a complete rip-off. Both the design of the website and the book cover.
- ChrisRR 4mo agoI was almost tricked into thinking this was a new Fabien Sanglard book and got excited
- 97-109-107 4mo ago[I Am Error: The Nintendo Family Computer / Entertainment System Platform | Books Gateway | MIT Press](https://direct.mit.edu/books/monograph/4054/I-Am-ErrorThe-Nintendo-Family-Computer https://direct.mit.edu/books/monograph/4054/I-Am-ErrorThe-Ni...)