Blood 3DFX ALPHA 1.20 Notes from 3DFX 3Dfx Build Engine Version 1.0 Author: Scott Alden from 3DFX Implementation Notes -------------------- I had a lot of fun and challenges on working on the Build engine, not everything went as I wanted it and many things are workarounds. Sloped floors were especially fun ;-) An ideal thing to happen is this engine is converted to true polygon rendering system. This could greatly enhance the speed for the 3Dfx hardware. I currently have the raster layer of the build engine rendering spans to the 3Dfx hardware. Thus a wall that fills the entire screen would be made up of X triangles where X = the horizontal resolution of the screen. You can set the BUILD_TRICOUNT (see below) environment variable to see how many triangles are being drawn on the previous frame. This is more for seeing how the tricount affects the framerate. All of the tiles in the game are downloaded to the hardware as texture maps, and the span is converted to the 3Dfx format for rendering. There are 3 types of primitives that I use: horizontal triangles for horizontal spans, vertical triangles for vertical spans, and quads for drawing unclipped sprites. Also, the lighting/palette effects that the game uses are achieved by downloading a new palette to the 3Dfx hardware. This palette downloading happens on a span by span basis. Fog and other lighting effects are all achieved by palette changing. ----------------------------------------------------------- Here are some extra things to know about for additions I have made to the build engine which can be set in your environment before running the game: Environment Variables --------------------- The BUILD_640X480 environment variable is used to run the game in the 640x480 resolution. The default setting is 0, and the default resolution is 512x384. e.g. set BUILD_640x480=1 The BUILD_RESAMPLE environment variable is used to control how the game and animation textures are converted to 3Dfx format. If you set this variable, the slower method of sampling and blending is used. This gives a more desirable image however it takes a long time to run, and it gives a dark halo effect surrounding sprites (i.e. the fists and some menu bar things). The faster way uses point sampling, it provides a more grainy conversion, but is a lot faster than the previous method. You only need to convert the textures the first time you run the program, and if you want to recreate them, delete the "tx3dfx" and animxxxx directories which contain all the .3df files. The BUILD_BRIGHTNESS environment variable is used to brighten the colors of the textures that are used in the game engine. The colors will be brightened by this factor, and will saturate to white. The default setting is 2.5. e.g. set BUILD_BRIGHTNESS=2.8 The BUILD_NOPAL environment variable is used to turn on palette downloading on a per-span basis. !!!Warning!!! This will affect the color palette of the game and the colors may not be correct! This is only provided as a speed boost. The default setting is 0. e.g. set BUILD_NOPAL=1 The BUILD_NOFOG environment variable allows the game fog to be turned on/off. This is provided as a speed boost. The default setting is 0. e.g. set BUILD_NOFOG=1 The BUILD_CONVTEXTURES environment variable is used to control whether or not textures are cached to disk. If BUILD_CONVTEXTURES is set to 1, then the textures will not be cached to disk and will be converted in memory. If you are running the game under Windows 95, then this setting is not recommended. If you are running the game under DOS, then this setting may help out because disk I/O access is slower on some DOS machines than others. The default setting is 0. e.g. set BUILD_CONVTEXTURES=1 The BUILD_TRICOUNT environment variable shows the number of triangles drawn in the last frame. The default setting is 0. e.g. set BUILD_TRICOUNT=1 The BUILD_FPS environment variable shows the current clock settings, frame number, and a (rough)FPS count. The default setting is 0. e.g. set BUILD_FPS=1 The BUILD_VERSION environment variable shows the current version number of the 3Dfx Version of the Build Engine and the current version of Glide you are using below that. The default setting is 0. e.g set BUILD_VERSION=1 BUILD_MRED, BUILD_MGREEN, BUILD_MBLUE set the colors of mirrors in the game respectively. Their range is from 0-255. Their default settings are 200, 200, and 255 respectively (gives a blue tinge to all mirrors) e.g. for dark blue mirrors: set BUILD_MRED=0 set BUILD_MGREEN=0 set BUILD_MBLUE=200 ------------------------------------------------------------ When you start up Blood 3Dfx version, the program will begin converting the textures in the game to the 3Dfx format. This only needs to be done once, and if you want to recreate the process, then delete the subdirectories called tx3dfx and animxxxx where xxxx will be a number and the directory will contain .3df files. This takes quite a while to convert so be patient :-) See the above environment variable BUILD_RESAMPLE for more information on this. Note: Cranking up the intensity with BUILD_BRIGHTNESS will cause less of the textures to be transparent, since the level of opacity is based on their intensity.