First Person Shooter

I've serched around a bit but I don't think anyone here has made (well, at least posted) a first person shooter. I'm curious to know because I'm working on one and would like to see some of the code used. If anyone has made one or has code to one (in C++ please) let me know.

What is it specifically about an FPS that concerns you? Off the top of my head the only difference between an FPS and a top-down isometric is the way the camera is managed. And for that, there are probably as many answers as there are people willing to ask.

For my game, ( it isn't really an FPS; rather a chase-camera 3rd person driving/shooting game ) the camera mechanics would work just as well for FPS.

My approach is to have a look-at point in 3d space and a camera-location. Both are in coordinates relative to the game body being tracked, in my case the position of the car chassis. Those points are projected into world space and the camera is moved to the camera-location point and oriented to look at the look-at point. With some averaging code, I get smooth movement and with collision detection on the rays from the chassis to those points the camera always can see the vehicle and in general everything is peachy.

Specifically the use and positioning of models for the gun being held. I'm still looking for tutorials and such which might help. I'm also trying to figure out terrain handling (collisions with the ground) as well as clipping. Right now my camera just moves around on a plane but does not go up and down with the ground. I also need to find a more efficient way of making the "world" than using OpenGL primitives but without access to a lab that has 3ds Max or Maya I really am without assets. There are free programs but considering that next summer I'm moving to Chicago to go to school to make video games that use 3dsm and Maya for modeling, I don't know if I want to spend the time learning how to use other formats.

I guess a lot of this is just general programming issues but I also was curious to see the code for something similar to what I'm working on. Just to see how they set up health, collisions, game logic, etc in a FPS rather than, say, a sidescroller. Logically they could be set up the same, but curiousity I guess.

David of Wolfire has also apparently been working on a Lugaru-powered first-person shooter, Soul of Steel (scroll down for a link to a playable); I'm not sure on the status of the project though, although obviously the source isn't available...

I forgot to mention, but Quake series have all been open-sourced (well, except the release of Quake 3's source, which has been delayed so as not to irritate a recent licensee); here's fRuitz oF doJo's port.

[There's also the source to a lot of older projects out there (Doom, Rise of the Triad, Marathon, etc. â€“ sorry, too tired to be bothered providing links) but you haven't mentioned what kind of technology/techniques you're looking for.]

I've learned a lot from Fruitz of dojo's port of quake 1. Nice, different, Objective-C coding style. If you don't like ObjC, you can check out porkrind.org (maybe it was porkgrind.org) 's carbon source code of Quake 1. I haven't browsed through much of that.

maaaaark Wrote:I've learned a lot from Fruitz of dojo's port of quake 1. Nice, different, Objective-C coding style. If you don't like ObjC, you can check out porkrind.org (maybe it was porkgrind.org) 's carbon source code of Quake 1. I haven't browsed through much of that.

That moved to sourceforge long ago: <http://macglquake.sourceforge.net/>. The original porkrind.org port was OS 9 only and later abandoned, but a few of us went on to carbonize and use it as a base for GLHexen II.

The code's a bit of a mess though - keep in mind that at the time my main machine was running OS9 with a hacked PC Voodoo3 card (so I had to support that), and I was testing occasionally in OS X 10.1, where fullscreen support was a crap shoot. Hence, major hackolas. FoD's obj-c port is much cleaner...