Lewcid.com
Site-Cube

(this Subject)
#Games
(this Time)
#2/2/2006
(this Place)
download/SIRD/q2/
(this Lewey Geselowitz)

 

Quake II AbSIRD
The Full Quake II in SIRDS!

You finally saw the yacht in the seemingly random bunch of dots! You can see the dinosaurs and dolphins in the Magic-Eye books! Now use your skills to free yourself from your evil extra-dimensional zombie oppressors! Welcome to Quake II as it was never meant to be.

Quake II AbSIRD is a modification of the Quake II graphics engine to produce SIRDS instead of standard 3D images.

Featured on the front page of GameDev.net, PlanetQuake, and SlashDot Games

On this page: Screen Shots, General Info, Install, Downloads, View the Source Code, QuIRD, FAQ

Be sure to check out my general AbSIRD page dedicating to putting SIRDS into new and interesting places such as the Pocket PC, Tablet PC, and even using pixel shaders.

General Info

What is it?
Quake II AbSIRD is a modification of the standard Quake II rendering engine so that it can create SIRDS instead of normal 3D environments. This means that you can play Quake II just as you normally would (single player, network play, most mods, etc) except all the 3d objects and characters will jump out at you with the full 3D power of SIRDS.

Why?
First of all, Quake II is a great game, and a shining example of purity in design. Secondly, I have wanted to play a 3D game in SIRDS for a LONG time, and this lets me do just that without having to design a full game by myself. Also I think now that everyone can see that it is not only possible, but a lot fun, and not difficult to impliment, we will start seeing this in more games. Remember that Quake II was not designed for this type of visualization at all, and yet it still plays pretty well, I believe is a sign that if a game were actually designed for this, it would be simply amazing.
The other reason is that it was easy. See the source code to see what I mean.

How does it work? (a little technical)
For a discussion on how the actual SIRDS algorithum can be applied in real-time, check out my general SIRDS page which includes an essay on the algorithum. Suffice to say, the software only algorithum merely requires a height map and a texture to render the SIRDS onto. In the case of Quake II AbSIRD inserting the SIRDS code into the software rendering engine was extremely easy. It works by first letting the scene be drawn normally, which of course fills the z-buffer with the depth of each pixel. The z-buffer is then interpreted as the height map required by the SIRDS algorithumn, and the resulting SIRDS is written into the screen buffer. The only real tricky part is translating the z-value into a height offset (primarily because the stored value is an integer equivalent of 1 over the real z value). For this transformation I found the best approximation was to use the log of the given z value (and then mess with it a bit). That's about it really, the source is shown below, as you can see it's pretty simple once you figure how to scale the z values correctly.
Also, yes I know this could be optimized, but my goal here was to show that this technique works, and makes for good gameplay. This isn't a professional product (which is why I'm not charging for it), it is more a prototype, just to get the word out that this is possible. Secondly, I'm a lazy bastard so as long as it runs fine on my computer, I'm pretty happy.


How to Install

How to install it (Easy way) (Windows only)
0) Install Quake II, either buy it (you should it is really good), or download the free demo.
1) Find your Quake II directory (usually "C:/Quake2"), and make a copy of "ref_soft.dll" somewhere on your computer.
2) Download the "ref_soft.dll" file shown below and put it in your Quake 2 directory.
3) Run Quake II, go into the "Video" settings and change the renderer to "software", then set the resolution to 640x480 for best viewing (it does work on all resolutions, I just think it looks best at this size).
4) Thats it! The next game you start should be in full SIRDS! If you have trouble, give me a yell. There is NO gaurntee on my part that I'll help you (I will try though).

Optional (all platforms)
5) If you want to turn the SIRDS off you can either change the renderer back (which is kind of slow) or you can hit the "~" key to bring down the console and type "set sw_sird 0" to turn it off, and "set sw_sird 1" to turn it back on. Hit the "~" to make the console go away.
6) If you are feeling fancy and want to be able to turn it off and on with the press of a button: go into the baseq2 folder in your QuakeII directory, and open config.cfg with Notepad or Wordpad. Then change one of the "alias" arguments to "set sw_sird 1" or 0. For example, the following two lines make PageUp turn SIRDS on, and PageDown turn SIRDS off:
alias PGUP "set sw_sird 1"
alias PGDN "set sw_sird 0".

Mac OS X Install (Easy Way)
0) Install the Classic Mac OS (or PC) verson of Quake II
1) Download the Quake 2 AbSIRD for Mac OS X package below
2) Move the content of "Into 'baseq2' folder" (which comes with this package) into the installed "baseq2" folder
3) Move the 'Quake 2 AbSIRD' app into the same folder as the normal Quake 2 app.
3) Run it, then go into the "Video" settings and change the renderer to "software", then set the resolution to 640x480 for best viewing (it does work on all resolutions, I just think it looks best at this size).
4) Thats it! The next game you start should be in full SIRDS! If you have trouble, give me a yell. There is NO gaurntee on my part that I'll help you (I will try though).

Linux Install
As I'm not the Linux type I'll refer you too Michael Jepson's fairly simple README on the subject.

How to install it (Programmer way, any platform)
0): Get Quake II, and install it.
1) Get the source code, and get to the point when you can build a working version of ref_soft.dll (try the debug version, it seems to work more easily). If your not using Windows, you may want to find a guide online which tells you how to build for your OS (or you could do the smart thing and just get Windows).
2) Once you've got it working, look in the ref_soft folder, and either replace your r_main.cpp with my one below, or go through my one and copy and paste all the parts that say "Start Added by Lewey" into your version. NOTE: I have posted the full source with my modifications (which compiles fine with Visual C++ 6.0), so you can just get that if you like.
3) Rebuild and copy ref_soft.dll into your real QuakeII directory. Now follow from step 3 of "How to install it (Easy Way)". (above).


Downloads

NOTE: By downloading any of the files from this site you are agreeing that I (Lewey Geselowitz) or anyone else related to this project are not in any way laible for any damages that your computer or person may incur through their use. So if your eyes feel strained after playing Quake II in SIRDS for hours on end, it's not my fault! I don't want to end up like Steve Martin in 'The Jerk' and be liable for making half the country cross eyed. Now I should meantion that I don't know of any damages that using SIRDS can cause (actually some doctors say it's pretty good for you), and I myself have looked at more than most people with no notable concequences.

Requires either Quake II or the (free) Quake II demo

ref_soft.dll

Platform: Windows 9.x
Requires: Quake II or Quake II demo
Usage: see 'How to install it (Easy way)'

inverted_ref_soft.dll

Platform: Windows 9.x
Requires: Quake II or Quake II demo
Usage: This is a modification of the above
for if SIRDS appear inverted to you (it will make
it inverted to start with so that they appear 'normal' to you).
Download, rename to 'ref_soft.dll' and then
see 'How to install it (Easy way)'

quake2-absird-macosx.zip

Platform: Mac OS X
Requires: Quake II game content
Usage: see 'Mac OS X Install (Easy Way)'
Note: This build is based on the fRuitz of doJo
Mac OS X port of the Quake II source.
Thanks go to Audun Wilhelmsen for updating
it to the latest XCode, adding the AbSIRD mod,
and creating this file. If you have any problems
with it, he would be the one to contact
(skyfex AT gmail DOT com).

quake2-absird.zip

Platform: Many (this is the source code)
Requires: Quake II game content
Usage: see 'How to install it (Programmer way)'

quake2-absird-linux.zip

Platform: GNU/Linux
Usage: Read the README
Note: Thanks go to Michael Jepson for
writing the Linux port and the associated README.
If you have any questions or comments, you
can contact him at 'mjepson AT gmail DOT com'
(I know very little about Linux so don't ask me)


View the Source Code

The file below shows all the changes I made (which only affect r_main.cpp in the ref_soft directory). All my additions have 'Start Added by Lewey' before them and 'End Added by Lewey' after them. I've also commented it way more than I usually comment my code (that is I commented it at all). Hopefully this will help people trying to add SIRDS to their own apps. Enjoy.

r_main.c

How to Invert the SIRDS: a few people out there have the strange occurence of seeing the SIRDS 'inverted' that is with far objects closer and close object further. This I believe has to do with the way in which they bend their eyes to see the SIRDS. Anyway, if you'd like to have Quake II AbSIRD invert the SIRDS for you this is very easily done from the source code. Simply make a small change to line 1225 of the r_main.cpp in the ref_soft directory. I have tested this and it works fine, although it of course looks inverted and rather strange to me.

FROM
  cz = R_SIRDZFunc(lastz);
TO
  cz = R_SIRDmaxDiff - R_SIRDZFunc(lastz);


QuIRD

QuIRD is a project to develop a Quake II mod specifically designed for use with Quake II AbSIRD. The idea being levels, gameplay, items and weapons which work well within a SIRD environment. This project will explore what can really be done within a dedicated SIRD game, and will hopefully expand our knowledge of what is possible in real 3D. It is currently being developed in the highly qualified hands of Rhy ("The meanest violinist in Southern California. Not good, just mean."). Please contact Rhy if you are interested in working on this project.


FAQ

Why is it moving? It looks like static! - The reason the background has to change every frame is basically because most points on the screen affect other points, and so if only a part of the image changes then the eye gets distracted by these strange shapes appearing all over the screen. If you randomize the background each time, your eye doesn't notice that each change is affecting other areas because everything is changing. Read my short essay on the algorithum to learn more. Best to just trust me you couldn't play it without that.

Why is it called Quake II AbSIRD? AbSIRD is my little project for putting SIRDS into all types of different places they don't really belong. Currently I have a SIRDS drawing app on Pocket PC, Pong in SIRDS, hardware accelerated SIRDS, a Quake II mod (obviously), a Tablet PC SIRDS drawing tool (uses the pressure of the pen as the height), and a few more which can be found on the main AbSIRD page

Why doesn't it use hardware acceleration? Didn't you figure out a way to create SIRDS on the graphics card? - Yes I did figure out a way to do it, and I will hopefully get around to doing that eventually, but it's a lot more complex to mess with the hardware renderer than the software renderer in an application such as Quake II. Plus this is just a demo to see if SIRDS can be used in 3D, it's not a professional app.

Hey! This isn't a very good FAQ, I still have questions Feel free to email me with any questions you have: lewey@lewcid.com

Quake II in SIRDS, WTF? Yeah alot of people have thought that. Here is a collection of comments I recieved regarding this mod:
"Yeah this definitely falls into the crazy &*$# category"
"What are you on?"
"This would be amazing if you were high"
"LOL" (I get that one alot)