How Id built Wolfenstein 3D using Commander Keen tech
gamasutra.com
gamasutra.com
https://github.com/FlatRockSoft/Hovertank3D
https://github.com/CatacombGames/Catacomb3D
I'm the current owner of the Catacomb games, and have been working on improving and porting them in my spare time (not publicly available yet, but will be When It's Done). Fabien's Game Engine Black Book has been an invaluable resource for me. I highly recommend it!
[1]: https://web.archive.org/web/20150101022225/http://www.flatro...
[2]: https://github.com/jayschwa/CatacombWebGL
[3]: https://web.archive.org/web/20170623155041/http://www.flatro...
>Hovertank and Catacomb
One omission from that book that would have been nice to have been included is an explanation of how the 3D scenes are drawn in those games. In one of the quoted passages, Carmack states that it is something other than the raycasting used in Wolf3D, with the added disadvantage of not being correct in every case.
From personal observation, the perspective looks strange in those games (no consistent single vanishing point). However, maybe this can be fixed by tweaking a few variables. Supposedly Catacomb and Hovertank have much higher frame rates that Wolf3D on old computers.
(another omission is that it doesn't completely explain the theory behind linear feedback shift registers, necessitating further research on the part of the reader to understand them).
In addition to releasing Keen Dreams, he also did a reskin of Hovertank 3D (which I believe is open source) except the plot is replaced with weird racist revenge fantasies about killing refugees.
Then, after being forced off Steam, he seems to spend most of his time creating anonymous email addresses and harassing people.
A company called Night Dive Studios (the current licensee of System Shock) managed to get Keen Dreams back on Steam with reassurances that they had gotten it from Chavez and that he would receive no ongoing income from it, but the game was mysteriously subsequently pulled.
Here are some Twitter threads that speaks to the above. Warning: racial and homophobic slurs, open praise of Hitler, pages and pages of abuse, etc:
https://twitter.com/dosnostalgic/status/1100934501277016065 https://twitter.com/dosnostalgic/status/1140641745920770051 https://twitter.com/dosnostalgic/status/1140726699014971393
Keen Dreams is currently available on Nintendo Switch apparently with Chavez's blessing, but buying that is obviously supporting the above insanity.
For example, Wolfenstein 3D has you killing Nazis which we're already trained to see as valid targets for violence fantasies. Doom's human enemies are "former humans", Quake's human enemies have probes in their brains to make them evil. Sonic the Hedgehog only kills robots, not animals or even Dr. Robotnik who always escapes. But you wouldn't know these things unless you read the manuals or really paid attention. So would a teenage player really feel any different killing non-dehumanized humans instead? Maybe it's just a storm in a teacup when there's outrage at games like this immigrant killing one, Postal 2, or CoD's No Russian level. It all seems kind of perverse to train people that killing is very bad unless it's somebody belonging to a class which has been labeled as "bad" in any superficial way, or a humanoid monster, in which case any amount of gory violence is fine, such as Doom 2016.
That said, children have been playing games of "shoot em up" for many years. At one point it was cowboys and Indians, earlier it would have been whoever the local defender and perceived "bad guy" was.
I have a feeling that this is human nature, and I actually feel that we are far better having our children playing computer games where they are targeting mythical creatures, than playing shoot the Taliban or some such.
Wolf 3D felt like a next gen tech demo out of time. It was great fun, it was violent, it looked unlike anything else (besides Ultima Underworld). Of course, that monumental achievement looks insignificant when compared with Doom, which single-handedly added stairs, different floors, multiplayer (!) and modding.
Most of us here work in software. To see software so casually come in, introduce never seen before concepts, it’s so impressive to me. I don’t think That I know of something having quite this impact in other aspects of software.
But ... the PC did have hardware supported scrolling? CGA, EGA, VGA and the various SVGAs all had a register for "address of beginning of screen". It was not well documented, and nontrivial to use especially because of the banked memory setup -- but it WAS there even on the first ever CGA, Hercules and Monochrome adapter which were all based on the 6845 - and also available on EGA, VGA etc - the latter made things even less usable by practically requiring Mode-X plane memory addressing to use.
And IIRC, that's what commander keen had used.
The classics of gaming were laid during these years.
But seriously: Overstated! You mean overstated!
As a little tyke I used to actually duck left of my monitor when an imp threw a fireball with my heart thumping. Replaying as an adult I'm like wtf that's just a lumpy mass of pixels, how could I have been so scared?
The control system is absurdly complex but exquisitely satisfying once mastered.
They, like us, quickly got used to it, but both film and interactive 3d computer games are very powerful things!
When I was interning at Apple back in the day I had a side project of porting wolf3d to OS X, and it was the first occasion I had where I came to admire John Carmack's code directly. His game source code is something I recommend checking out to coders interested in gamedev.
Also, I have fond memories of poking around making DOS experiments in Borland C++ as a teen.
But speaking of version control — I guess that's just how things were done in the 90s. I read recently that not only was Final Fantasy 7 developed and shipped without it, but Squaresoft contemporaneously lost the final PlayStation source code and art assets. The studio contracted to port it to PC was supplied with a mishmash of non-final code and assets.
To date myself a bit, the first time for me was Refactoring, and one of the most recent was the Mikado method (a technique for top-down refactoring). The reason I'm book-ended this way, and the point of my response, is that Mikado requires you to be very comfortable both with version control and throwing away a big chunk of code you just wrote.
I don't think I would have ever sussed out Mikado if I were trying to do Poor Man's version control. I think the cost-benefit analysis would fail.
The thing is, the Mikado method, at its best, makes you look like some sort of coding god, because you've accomplished some gigantic change to the system behavior with fifty lines of terribly reasonable code. Instead of five hundred lines of error-prone nightmare.
Maybe my second SVN project, we had a monorepo, Windows, and a virus scanner (multiply pull time by five). I'd come in in the morning, log in, do an svn up, go get coffee and say hi to the people I was collaborating with, and be back to my desk all before it finished.
Many days I only synced to head twice because it was a pain in the ass, and the SVN maintainers were not at all sympathetic. A new contributor consolidated the config files and cut the number of file open operations by a couple orders of magnitude. I don't think we ever properly thanked that guy.
Unspoken benefit of “new person” — eventually someone not desensitized to the crap will throw up their hands and fix it.
I once increased performance of a CMS by 30 percent my first day in the job because I happened to spot a handful of lines of unnecessary string copying while trying to figure out how the thing worked.
Everyone else could have, but none of them had any reason to look at that part of the code because it worked.
That said, modern SVN is nice to work with in my limited experience but I'm definitely firmly in the Git camp now.
Commandline automation of these for build or deployment scripts was painful but we were grateful for any source control on Windows at all because the alternative was still common and it sounded like this, shouted over a cubicle wall: "Hey, I'm going to edit UTIL.C on the WFW3.11 share ... everyone okay with that?" Cringe.
I'd say that taking a backup of the code at the end of the day and sticking it all in a directory on a server somewhere constitutes version control. Especially as Id documented everything they did so thoroughly (based on Carmack's .plan files etc).
When SVN and Git came along they basically just streamlined and improved practices that a lot of devs were already following - and added some useful features like merging with proper conflict resolution and whatnot.
It's a daily blog of progress / lessons learned on whatever he was working on during the listed years.
The whole archive is at: https://github.com/ESWAT/john-carmack-plan-archive/tree/mast...
The 1990s is when it was most active.
I really liked reading DOOM's source code :)
That is both impressive and terrifying. I'm old enough to remember when I first started using VSS, and being amazed at how awesome source control was :D
These days, it's hard to look back at SourceSafe with anything other than horror....
Once networking and servers became more prevalent, it slowly made sense that backups turned into revision control. If your machine crashes, there is a remote repo you can connect to and get back to where you were.
According to a May 15, 1990 issue of PC Magazine, that was a $3,500-4,000 USD machine back then.
Used to develop Wolf3D, but only good for about 8fps when Doom (ID's next hit) came out.
When the AdLib was released in 1986, developers were instructed to send data "as fast as
possible". At 4.77MHz, a PC was unable to out-pace the AdLib. Yet as CPUs got faster,
issues started to arise and the card was unable to keep up.
So if an old program ran on a new machine, it might mangle the sound or even cause a hardware crash. So the only way to play it was to slow down the new computer to the speed of the old one.These SRAM chips were dual-inline pin packages (DIP), i.e. those black rectangular chips with fat pins down both long edges. Sometimes these were in friction-fit sockets and sometimes soldered down. On the 286, I think the DRAM was also socketed DIP.
It was around 1500 euros, when converting directly the price into today's money, without taking currency evolution into account. Back then working as cashier would get you around 300 euro per month, before taxes.
We were really lucky.
Now, some 25 years later, I have been playing through Wolfenstein II: The New Colossus, and I had nostalgic good fun playing several levels of the original Wolfenstein via an in-game arcade machine.
I like stories.
Highly dependent on the VGA card, believe it or not (there's a nice set of benchmarks showing this in Game Engine Black Book).
You don't have to get into pointy headed boss territory to be a successful programmer and leave the office at a respectable time every day.
At least in a 2/3 man team surviving on pizza and Coke you're not lining someone else's pockets with millions of dollars only to be thrown out onto the street at the end of the process.
hagiography (webster):
1 : biography of saints or venerated persons
2 : idealizing or idolizing biography
Yep, he's right
If him blasting music and destroying things with various weapons while devs were trying to code and running ads telling customers he was "about to make you his bitch" was a hagiographic gloss, then reality must have been truly dark.
At least that was how it was presented in (iirc) Masters of Doom, who knows what the actual truth is.
Released December 21, 1994
1. No prototypes. Just make the game. Polish as you go. Don't depend on polish happening later. Always maintain constantly shippable code. (Large teams require more planning though.)
2. It's incredibly important that your game can always be run by your team. Bulletproof your engine by providing defaults (for input data) upon load failure.
3. Keep your code absolutely simple. Keep looking at your functions and figure out how you can simplify further.
4. Great tools help make great games. Spend as much time on tools as possible.
5. We are our own best testing team and should never allow anyone else to experience bugs or see the game crash. Don't waste others' time. Test thoroughly before checking in your code.
6. As soon as you see a bug, you fix it. Do not continue on. If you don't fix your bugs your new code will be built on a buggy codebase and ensure an unstable foundation.
7. Use a development system that is superior to your target.
8. Write your code for this game only - not for a future game. You're going to be writing new code later because you'll be smarter.
9. Encapsulate functionality to ensure design consistency. This minimizes mistakes and saves design time.
10. Try to code transparently. Tell your lead and peers exactly how you are going to solve your current task and get feedback and advice. Do not treat game programming like each coder is a black box. The project could go off the rails and cause delays.
11. Programming is a creative art form based in logic. Every programmer is different and will code differently. It's the output that matters.
Extra advice:
1. Only program for a few minutes and test code immediately. Try not to code for even as long as 30 minutes. This is will help to avoid debugging because you will catch bugs sooner, and won't have as wide an area of code to look through for the bug.
Using the Borland C++ IDE in 1991 is way more similar to using Emacs these days, than Visual Studio Code.
He just wants to get work done, doesn't feel the need to prove anything.
Specially interesting, given XEmacs.
Such an exciting time for PC games, with ID way out at the forefront - highly recommend the Masters of Doom book mentioned in the article too, it's a deep dive into the making and eventual impact of Doom. Great snapshot of the ID guys and of that time period.
Then Doom came out, and I found out the hard way that I get motion sickness from playing immersive games with good graphics. :-(
I've not been able to play first person shooters since. But I sure loved Wolfenstein 3D.
With a good 1000Hz wired mouse and games I where I get at least 100fps, preferably >144fps, I don't feel anything at all when I play. Still can't watch others play though.
However I've also found that 3-D systems that everyone else oohs over whose operators promise don't cause motion sickness any more, always do. Really fast. So I'm apparently on the sensitive end of motion sickness from computer systems.
Later, there was a near clone of the Borland IDE called RHIDE which wrapped DJGPP, a GCC port for DOS/DPMS. I had some fun times with that.
I thank Borland to my introduction to type safe systems programming via Turbo Basic and Turbo Pascal.
The OOP learnings from Turbo Vision, OWL and VCL.
And by teaching me already in MS-DOS that C++ was a much better alternative for people that care about safety than C would ever be.
Oh and BGI was a very nice library.
It was only much later that an uncle of mine got a promotional copy of Watcom C DOS4GW that he gave to me.
Of course the quickest way to get a working TUI-mode editor that is stably maintained is probably to add support to Emacs, which already has text-mode working with things like a global menu, widgets, multiple "frames" etc. many of which were directly lifted from the "GUI" version.
Turbo Vision?