Slashdot is powered by your submissions, so send in your scoop

 



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

Code Review of Doom For the iPhone 161

Posted by Soulskill
from the old-dogs-new-tricks dept.
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:
  • Pushing pixels (Score:5, Interesting)

    by MtHuurne (602934) on Thursday February 04, 2010 @07:09AM (#31020820) Homepage
    Forgive my ignorance, but couldn't you have the original software renderer write to an in-memory buffer and then upload that using glTexSubImage2D()?
  • Re:Pushing pixels (Score:3, Interesting)

    by Lord Pillage (815466) on Thursday February 04, 2010 @07:16AM (#31020862)
    Or glWritePixels() would work too. Might be a little bit closer to the original method. But then again, I didn't RTFA, so I wouldn't know.
  • by goldaryn (834427) on Thursday February 04, 2010 @07:28AM (#31020932) Homepage

    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:Pushing pixels (Score:5, Interesting)

    by RedK (112790) on Thursday February 04, 2010 @07:30AM (#31020940)
    glDrawPixels is not supported under OpenGL ES which is what the iPhone uses. An in-memory buffer used as a texture is about the only way for fullscreen images (vertex arrays drawn using GL_POINTS is another solution but would not be fast enough).
  • by goldaryn (834427) on Thursday February 04, 2010 @07:33AM (#31020954) Homepage

    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.

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

    by Anonymous Coward on Thursday February 04, 2010 @07:33AM (#31020956)

    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.]

  • by jaggeh (1485669) on Thursday February 04, 2010 @07:39AM (#31020996)

    It was S.E.A.L. Quake not Action Quake

    Although my favorite quake mod was malice.

  • Re:Pushing pixels (Score:1, Interesting)

    by Anonymous Coward on Thursday February 04, 2010 @07:41AM (#31021020)

    I'm sure they thought of that.

    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.

    I know that sending data to GPU's is hideously slow, can anybody tell us how well a raycaster blitted via OpenGL would perform on the iPhone?

  • by renrutal (872592) <renrutal@gmail.com> on Thursday February 04, 2010 @08:04AM (#31021146)

    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.

  • by Fahrvergnuugen (700293) on Thursday February 04, 2010 @08:38AM (#31021412) Homepage
    Disallowing the use of private APIs ensures that your software will continue to function with new versions of the iPhone OS. The private APIs might change, but the public ones will not. The real questions is whether or not there should be a public API for CoreSurface.
  • by Anonymous Coward on Thursday February 04, 2010 @09:30AM (#31021976)

    Disagree, it was the first game that realized how fun wolfenstein was and made it better (Ken's Labyrinth etc doesn't count) Also, made people learn about BBS's just to play it over modem (which it did rather well). Quake was cool that it moved people to polygons (which turned to 3D accelerators and gaming today) but it was so dark, and even when it came out had dated graphics. (almost turning people off to the polygon idea in the first place, guess they knew it was ugly so made it as dark as they could to hide it) Remember lots of friends learning to make Doom levels, quake wasn't worth the time...

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

    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.)

: is not an identifier

Working...