Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
First Person Shooters (Games) Programming Games

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...)."
This discussion has been archived. No new comments can be posted.

Code Review of Doom For the iPhone

Comments Filter:
  • Already done (Score:1, Informative)

    by ultranova ( 717540 ) on Thursday February 04, 2010 @07:50AM (#31020748)

    Doom was ported [wikipedia.org] to OpenGL a long time ago.

  • by slim ( 1652 ) <john@hartnupBLUE.net minus berry> on Thursday February 04, 2010 @09:03AM (#31021142) Homepage

    You need the Readability bookmarklet [arc90.com].

  • Re:He's wrong though (Score:5, Informative)

    by Anonymous Coward on Thursday February 04, 2010 @09:08AM (#31021164)

    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.

  • by Anonymous Coward on Thursday February 04, 2010 @10:53AM (#31022274)

    Actually, I think it is "drawn".

  • by shutdown -p now ( 807394 ) on Thursday February 04, 2010 @11:59AM (#31023068) Journal

    You can still buy id classics on e.g. Steam.

  • by Anonymous Coward on Thursday February 04, 2010 @12:07PM (#31023184)

    Doom was groundbreaking in ATMOSPHERICS. Come on, in the second level that corridor with the lights out except the bust light flickering down the bottom with (unbeknownst to you at the time) Imp just out of sight under it?

    Atmospheric.

    Quake brought us Brown.

    If it is considered groundbreaking, then the ground it broke was one that gave us Ubuntu.

    It also, unlike Quake (and not repeated again until Serious Sam), gave us HORDES of enemies. Better yet, they'd start fighting. One much later level had a diagonal corridor that had the walls drop and scores of various demons were hiding. You ran through and the Imp missiles hit Cacofiends or whatever and they became pissed off, fighting Imps. Meanwhile, other monsters got in the crossfire and THEY got pissed off.

    If you were careful in your aim, you could get rid of them all and only have had to shoot a handful of them. Just don't miss 'cos that might spoil the personal barney going on between two demons, who hate you more than they hate each other.

    Tactical too.

    Quake? No. Quake 2 got a lot closer in playability and lost the brown mostly.

It is easier to write an incorrect program than understand a correct one.

Working...