Code Review of Doom For the iPhone 161
Developer Fabien Sanglard has written a code review for id Software's iPhone port of Doom. It's an interesting look into how the original 1993 game (which he also reviewed to understand its rendering process) was adapted to a modern platform.
"Just like Wolfenstein 3D, Doom was rendering a screenframe pixel per pixel. The only way to do this on iPhone with an acceptable framerate would be to use CoreSurface/CoreSurface.h framework. But it is unfortunately restricted and using it would prevent distribution on the AppStore. The only solution is to use OpenGL, but this comes with a few challenges: Doom was faking 3D with a 2D map. OpenGL needs real 3D vertices. More than 3D vertices, OpenGL needs data to be sent as triangles (among other things because they are easy to rasterize). But Doom sectors were made of arbitrary forms. Doom 1993's perspective was also faked, it was actually closer to an orthogonal projection than a perspective projection. Doom was using VGA palette indexing to perform special effect (red for damage, silver for invulnerable...)."
Pushing pixels (Score:5, Interesting)
Re: (Score:2, Funny)
Re: (Score:3, Interesting)
Re:Pushing pixels (Score:5, Interesting)
Re: (Score:2)
You'd be lucky to get 1fps doing that. Not only is iPhone texture upload horrendously slow, but glTexSubImage2D reprocesses the entire texture even if you just change a single pixel of it. Plus you need power-of-2 textures, so you're looking at a 512x512 texture upload every frame. Not going to happen. /iPhone game developer
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Comment removed (Score:5, Insightful)
Re:Classics never die (Score:4, Interesting)
It's mindless, self-indulging, gory, non-challenging (now, not then!), and it's becoming one of timeless those FPS games that won't die because it's story line is simple and not drug out,
In my opinion, DOOM was a good game but it wasn't ground breaking in the same way that Quake was a few years later. It was the first FPS to do real 3D, and gave birth to real FPS competitive play, based on the groundwork that DOOM did with FPS LAN play. Aside from that, the Quake engine led to all sorts of interesting gamemodes and mods that live with us still (Team Fortress was originally a Quake mod), and the physics of Quake 1 still has a legacy today (rocket jumping, bunny hopping).
I think the insurgence of DOOM ports to phones is because the pseudo 3D interface of DOOM lends itself more to the controls of mobile devices. It'd be nice to see more Quake and Duke3D ports.
Re:Classics never die (Score:5, Funny)
You sir, have a career in video game blogging! Let me sign you up for a 3000 word "Top 10 Groundbreaking games of the 1990s" blog entry.
Re: (Score:2)
Re: (Score:2)
He actually meant only 6 pages of worthwhile content. The other 5 pages worth are nothing but ads.
Isn't that how it's done these days?
~jaraxle
Re: (Score:3, Interesting)
Aside from that, the Quake engine led to all sorts of interesting gamemodes and mods that live with us still
I forgot to say: Action Quake was another Quake 1 mod, which eventually became Counter Strike.
Re: (Score:2, Interesting)
It was S.E.A.L. Quake not Action Quake
Although my favorite quake mod was malice.
Re: (Score:2)
the physics of Quake 1 still has a legacy today (rocket jumping, bunny hopping).
And how is that a good thing exactly?
Re: (Score:3, Insightful)
It added a whole new kind of depth to the gameplay. Suddenly, the game wasn't just about how well you could aim, and how well you knew the maps and where the pickups where, it also mattered how good you were at moving. It was so influencial and loved, that future quake engines made it a point to allow alternative movement styles, the pro mods (CPMA stands out in particular) enhanced and added movement tricks, and entire mods were created around completely around the concept (DeFragged). The quakes were r
Re: (Score:2)
And how is that a good thing exactly?
I agree; those are both ridiculous gameplay elements. I've always thought it was amusing that FPS players, arguably the cutting edge of photorealistic video game graphics and game physics, don't see a problem with characters behaving like a Loony Tunes cartoon.
A jump should take you no more than eighteen inches in the air, and totally ruin your aim during and for a few moments aft
Re:Classics never die (Score:4, Insightful)
This is also in a game where you can get hit by a rocket and live if you have enough health. And take a few hundred bullets from a simple 'machine gun'. And jumping from a ledge 6 times your height? No problem.
If it was realistic, you'd be dead from the first
Re: (Score:2)
Also, you're much better off going for the insta CQC knife kill than pulling out a pistol in any video game. You know, because knife fights are quick and clean, but handguns take forever.
Re:Classics never die (Score:5, Insightful)
The groundbreaking REAL 3d game was Ultima Underworld. Amazing story, great music and paced to the action (due to midi synthesis) and total 3d immersion.
Pay your respects to Looking Glass.
Re: (Score:2, Insightful)
Re: (Score:2)
Before any of that, Elite for Acorn BBC Micro. First 3D game, and also used triangles for shapes. Now that is ground breaking.
Re: (Score:2)
I was just thinking about that, it looked so amazing for it's time. It pipped DOOM to the post by over a year and a half! Not a bad effort, a dungeon crawling RPG, in 3d, using the familar pots of health and mana as a visual - now commonly stolen.
Re: (Score:2)
I've heard many good things about this game and have wondered why no one has ever ported it to a console. Wait a minute...checking wikipedia... it WAS ported to the PSone, but only in Japan, darn it! Too bad the early Elder Scrolls games were never ported either.
Re: (Score:2)
I did neither like fantasy, nor role playing games.
But you are right: Looking Glass was THE studio, back then.
I love cyberpunk, horror, and sci-fi stuff. So for me it was their System Shock, that won all trophies.
Single. Best. Game. Of. All. Time.
Re: (Score:2)
Re: (Score:2)
Back under your rock, Apple boy!
(just kidding, I was dead envious at my Mac-owning friends when I saw Marathon for the first time)
Re: (Score:2)
Doom and Quake were groundbreaking in different regards. Doom was the first popular multiplayer FPS (LAN games). Quake was the first popular fully-3D FPS, and also provided the ability to play games over IP..
Also, as far as bunnyhopping, that is an artifact introduced in the QuakeWorld engine with its predictive networking model. In classic NetQuake (the original IP quake protocol), bunnyhopping had no effect.
-molo
Re: (Score:2)
Also, as far as bunnyhopping, that is an artifact introduced in the QuakeWorld engine with its predictive networking model. In classic NetQuake (the original IP quake protocol), bunnyhopping had no effect.
That doesn't make sense. The prediction is done by the client, and it is not authoritative, only a guess. You might be thinking one mod vs. another, or maybe the client side prediction enabled you to time a rocket jump properly because it is hard as sh*t to do on a modem with 300ms latency and no client side tricks.
Re: (Score:2)
It was the first FPS to do real 3D
Nope, it wasn't. Descent and Terminator: Future Shock both came earlier. Probably some other stuff too.
I'll grant you that GLQuake was most likely the first FPS to do accelerated 3D.
Re: (Score:2)
I think System Shock, which came out in the same year as Doom, kicked Doom’s ass!
It’s weird that the whole world seems to remember Doom.
System Shock was a wonderful piece of very creepy art. And it will always be one of the best games ever made.
Re: (Score:2)
Re: (Score:3, Funny)
it's story line is simple and not drug out
Unlike, say, Pacman in which the main character spends the entire game eating pills.
I think the word you're looking for is 'dragged'.
Re: (Score:2)
The engine used for Marathon 2 and Infinity is available as Aleph One; the fi
Re: (Score:2)
Mind you I think Wolf3D and Quake SP is boring too so my gaming taste isn't exactly mainstream.
Re: (Score:2)
Re: (Score:2)
I remember playing Doom in the mid-90's on my friend's Gateway 2000 Pentium 100Mhz.
And that was way over powered for Doom. I played Half-life for the first time (all the way through) on a P133. Yeah it sucked, but not as much as not playing Half-Life. Doom was certainly playable with a 386, and a 486 was more than enough. These days I can even play Doom on my Sansa C250 with Rockbox, and my printer has a faster processor than the computer I first played Half-Life on.
Re: (Score:2)
Hmmm... Doom was okay on a 33MHz 486DX with 128KB of ecache for single player (stayed above 15 FPS), but for network death match with DEC tulip based ISA NICs using thin coax it would lag and play at 10-12 FPS on that box. The 50MHz 486DX2 and 75MHz 486DX4 did okay. Also there was a 40MHz 386 with a 3COM NIC ISA card that could hold it's own, it did have a Paradise 16-bit ISA SVGA card, the others were Trident and Cirrus Logic, and it did not lag but the frame rate was in the 10-12 FPS range too in deathmat
Re: (Score:2)
Meh. Your friend had a P100?
I remember playing it on a friend's parents' 386 DX, which we had covertly over-clocked to something like 44MHz.
Kids these days, they get everything...
Bloody Hell (Score:2, Funny)
I thought it was "Code Review of Doom" for the iPhone not "Code Review" of "Doom for the iPhone".
I've seen some "code reviews of doom". I was looking forward to some juicy ApplePain.
Oh well.
Re: (Score:2)
I read it the same way. I thought perhaps they were reviewing the source code for the OS or something and then I find "Doom"... which being an interesting game, isn't as great as reviewing the source code to the iPhone OS would be.
He's wrong though (Score:5, Interesting)
Doom 1993's perspective was also faked, it was actually closer to an orthogonal projection than a perspective projection
Not remotely true; DOOM's perspective is/was perfectly correct (apart from the monsters being billboards, of course - but they were perspective-correct billboards).
The method for achieving perspective is rather unconventional, but the maths works out the same.
Matching up floor and ceiling in an animated view with fake perspective is basically impossible.
[I did a port of DOOM before it was open-source, so I know a thing or two about this.]
Re:He's wrong though (Score:5, Informative)
You are correct. What TFA probably means is that walls, floors and ceilings are drawn in strips, and that for every strip all the texels are looked up according to a straight line. But that doesn't mean at all that hence Doom just uses an orthogonal projection, since it actually let's things diminish in the distance properly. A lot of real three dimensional games actually linearised texel lookup, but that says nothing at all about the overall projection a game uses. If you want to know what an orthogonal projection looks like, go play Age of Empires. As an added comparison, take a look at Mode 7 tricks on the SNES. You can actually perspectively correctly display a flat surface on it. How is this done? By setting a different orthogonal projection for each (in this case horizontal) line. That does not mean however that games using this therefore use an orthogonal projection, because the parameters are different for each scanline and the overall projection is perspective.
Re: (Score:2)
In a true perspective view different parts of a wall vertex will be different distances from your viewpoint, therefore they will not be a straight vertical line. In the psuedo perspective that doom and duke used a wall vertex is always a straight vertical line.
This is more noticable in duke than in doom because duke lets you move your view up and down and therefore see angles further from the vertical than doom does.
Re: (Score:2)
Go try Heretic or Hexen - the originals based on Doom, and then make your call. Doom restricted things so you couldn't look up or down, and simplified the perspective issue. Heretic (followed by Hexen) added the ability to look up and down, and showed pretty bad perspective distortion.
I'd like to read this article (Score:4, Funny)
But it won't fit on a 800 pixel wide screen. WTF? I thought it was a code review, not a flash game.
Re: (Score:2)
I'd like to read this article (Score:1)
1) This is Slashdot
Please read and at least attempt to understand comment before replying, kthxbye.
2) See point 1.
Re:I'd like to read this article (Score:5, Informative)
You need the Readability bookmarklet [arc90.com].
Re: (Score:2)
I'd like to believe that this is a solution, but I've gone to that site and the sample text is off my screen unless I allow scripts from two domains. Also, I don't use the bookmarks toolbar, to save screen real estate on my netbook, where I need it. I don't even use the menu bar...
These are implementation notes, not a code review (Score:4, Insightful)
This isn't a "code review" -- it's a short monograph (with Quicktime movies!) that talks about how Id got DOOM working well on the iPhone. A "code review" is, well, a critique of code, and the style, correctness, and efficiency, thereof.
</pedant>
What's with this CoreSurface licensing restriction (Score:5, Insightful)
Now this is what really annoys me. Here are tools. Appropriate tools. But you aren't allowed to use the tools, because what you're going to use them for offends The Gods.
What was that RMS was saying again?
Re:What's with this CoreSurface licensing restrict (Score:5, Insightful)
What was that RMS was saying again?
Don't bring attention to RMS's pragmatism. It confuses those who prefer to think of him as a hippy.
Re:What's with this CoreSurface licensing restrict (Score:5, Interesting)
Re: (Score:2)
Yea...But no. I appreciate their decision to limit their supported frameworks: it's basically the same decision as a console makers. They want a stable, easy to support platform that is still robust enough to allow people to do interesting things.
It's not their job to support every conceivable framework. It's your job to develop within the boundaries that they've set, same as people have been doing with consoles and embedded devices for years.
Doom is still incredible (Score:2, Interesting)
Heh, I remember playing Doom in my uncle's computer back in 94 as as 9 year old boy, and loved it, adored it.
16 years later, now an employed programmer, I still think it is made of black sorcery and an ingenious amount of coding. That's awesome!
Does Carmack /id Soft have a donation paypal-esque account? I'd love to give them what is due for all those early years of pure fun.
Re: (Score:2)
Does Carmack /id Soft have a donation paypal-esque account? I'd love to give them what is due for all those early years of pure fun.
How about just buying one of their more recent games?
Re: (Score:2)
Just buy their games. Go buy some copies of doom, quake or Doom 3 or wait for RAGE and buy a bunch of those.
Re: (Score:3, Informative)
You can still buy id classics on e.g. Steam.
Re: (Score:2)
I'd take his 16 years experience backed code over your 3 year college degree in Visual Basic anytime.
Doom via phone, like most iPhone stuff, is not new (Score:2)
The Sony Ericson P800 and the Motorola A920 had Doom ports that were very true to the Doom experience... in 2003.
As an unlocked A920 user, there is very little on the iPhone that I didn't see on that device. Apple's real accomplishment has been wrestling control away from the carriers who {locked down/disabled/walled gardened/made crappy} all of the devices that they sold.
I am happy for what Apple has done. It has allowed me to buy a Motorola Droid from Verizon without all of the restrictions it would other
Code Review of DOOM (Score:4, Funny)
New iPhone Doom Feature: (Score:2)
Jump using accelerometer!
Just like the unintentional Nintendo and Mario Bros. Which they should seriously do by the way!
Good Job (Score:2)
That's a fine hack, well done old chap.
Quake 3 code is mostly ready for iPhone now. (Score:3, Interesting)
A long time ago, I ported Quake 3 to windows mobile. Tedious, but it worked reasonably at around 30fps (and deathmatch worked) with OpenGLES acceleration on the Dell Axim x50v enabled with the intel 2700g coprocessor. The code is still out there, but frankly, it wouldn't be kosher for me to push a copy of Quake 3 to the iphone store since i dont have copyright access to the 'assets' of the game and i dont need to get sued or something.
it's a bit useless to gpl your game and not the assets. If iD software wants to use the code for a quake 3 for iphone, they can do so at http://code.google.com/p/q3ce/source/checkout. Should save them some time. Open invite, go right ahead, i can't do anything with it these days anyway.
(and yes, i converted the whole thing from floating point to fixed point using some fun c++ templates, poke around the code to see how it works, it's kinda neat.)
Re: (Score:2)
I'm not sure what rendering API it used, but I had Doom on my Nokia 7650 running just fine around 2002 as well. I think it's been ported most places in many different ways.
Re: (Score:2)
How is the gaming experience of DOOM on your nokia? On the PC, are you a mouse+keyboard gamer? I remember it being close to being intuitive on the PC, but then it has keys AND a mouse. I can imagine a game like Tetris being easily playable, but an FPS? (As you can see I'm having a major disconnect here :) )
Re: (Score:2)
Did you actually play doom in the era when it came out or have you only played modern ports with default controls set to match modern expectations?
Games from that era (up to and including duke and quake) were designed to be playable with just a keyboard.
IIRC doom really only had five main controls, forward, backward, turn left, turn right and fire. Plus weapon select controls of course but you didn't need to have your hands on those all the time. In those days players weren't expected to aim vertically or t
Re: (Score:2)
Re: (Score:2)
Duke nukem 3D could be configured to modern settings but the default control setup was clearly designed for keyboard only play (jump duck and fire were on keys a long distance from the arrow keys and the sideways arrows were set up to turn not strafe).
Re: (Score:2)
adding there was a way to look up and down in the default keyboard controls but it was in the block of keys above the arrow keys, e.g. about the most inconviniant place possible. I think there was a strafe button as well but again I don't think it was in a particulally conviniant position.
Re: (Score:2)
I don't think you're remembering correctly. Decent and Duke Nukem 3D sucked ass with a mouse. Keyboard was king back then, but the later half of Quake's lifetime was ruled by mice. I'll even posit that the mouse didn't take off in Quake, but in QuakeWorld.
In Decent, you had to manhandle a dozen keys to rotate and strafe on all axes. All the mouse was good for was pulling off a steady, long distance shot, hardly a common event in that game. All three of these were DOS games, and in those, the mouse nev
Re: (Score:2)
Doom supported keyboard strafing left/right, iirc.
Re: (Score:2)
There is a difference between supporting something and putting that thing on easilly accessible keys in the default control setup and expecting people to use it.
Re: (Score:2)
Wow - it's been a long time, but my recollection is that strafe keys were supported by default and were used heavily by almost everyone I knew who played the game. I remember some players who also used mouselook in Doom, but they were fringe, as opposed to when Quake arrived and everyone could see that mouselookers had a huge multiplayer advantage (since looking up was so much easier - something not possible in doom).
Is your recollection that doom didn't provide strafe keys mapped by default?
Re: (Score:2)
Well keep in mind that Doom doesn't really require mouse look, it played pretty well- this is a fairly old phone, that had a keypad (again we're going back to 2002) and a small stick controller on it, so really it gave you all the back, forward, turn left, turn right, strafe, shoot, change weapon keys you wanted just fine.
I certainly wouldn't want to play anything that required mouselook on a phone like Quake onwards. In fact, I had Quake on my old iPaq back around 2004 - 2005 and although it ran well, and
Re: (Score:2)
wow thanks for the replies, including the fellas above (I was in such a rush to reply I forgot DOOM didn't have mouselook) and yes I did play DOOM keyboard only on a 486 and it almost had me stuck using that on Quake.
It seems that now we have hardware to which Quake and other FPSes *could* be ported, since we have more than adequate horsepower, but we have gotten to the point where 'What would be the point' is the louder question, and only because of the limitations that the touch screen presents.
Re: (Score:2)
Re: (Score:2)
iPhone doom is a port from an existing GL port of doom (namely prboom) back to idsoftware and onto the iphone. So yes, someone has done it years ago, and yes, id leveraged that.
Re: (Score:2, Funny)
When in slashdot, nerds dont RTFA.
Re:Already done (Score:5, Funny)
did you even read the article?
You must be new here...
Re: (Score:3, Funny)
What makes articles slashdotted anyway?...
Or is that some mystery not approachable "even" by 6-digiters?
Re: (Score:3, Funny)
Re: (Score:2)
That's unpossible. A true /.-er wouldn't bother to rtfa, thus leaving the server unmolested.
Re: (Score:2)
As a fellow 6-digiter, I have to ask, what's an article?
Re: (Score:2)
As a fellow 6-digiter I have to tell you, you really ought to know that an article is a word that combines with a noun to indicate the type of reference being made by the noun. [wikipedia.org]
Re: (Score:2)
Oh, they'd click the link perhaps. But take the time to actually READ it?
Re: (Score:2)
My guess is that we open the link in another tab or window, read the first paragraph, and when many of us realize TFS is the same as that paragraph, we already have the relevant information.
That or the bizzaro edition of this site .\ reads the articles, resulting in it not being available, but they have hardly anything to say about it.
Re: (Score:2, Funny)
Re: (Score:2)
Antislashdot?
Let us never meet, for the resulting release of energy will catastrophically disrupt the lithosphere (considering basements...)
Re: (Score:2)
(Slashdot will not let me just post symbols apparently>)
Re: (Score:3, Insightful)
There are those who read (and create the /. effect) and those who post. The intersection of those groups is vanishingly small.
Re: (Score:2)
Re: (Score:2)
Well that is in beta, sounds looks like it was ported from the OpenGL version. It also doesn't address iPhone specific issues such as the event timer. Not that I know what state of release the iPhone version is in the article or even its source material, as I don't have any need of it or any desire to look it up.
Re: (Score:2)
idspispopd
Re: (Score:2)
idspispopd
Somehow I don't see that being easy to enter on an iphone while playing doom...
Although the important one was really IDKFA
Re: (Score:2)
idspispopd
Somehow I don't see that being easy to enter on an iphone while playing doom...
Wasn't easy to enter on a keyboard while playing Doom. Hell, wasn't easy to remember (I'd need to recite the full name and use that as a mnemonic). Made worse because usually you had to type it twice in fairly quick succession. All likely reasons for why it was changed to IDCLIP for Doom 2.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Not sure, but I have Quake for my Nokia n900. It uses the tilt sensor for mouse-look, which is impressively usable too.