Polytex engine by Ken Silverman (http://advsys.net/ken)

For a description of keys, see POLYTEX.TXT

------------------------------ File description ------------------------------

GAME.EXE: My old executable compiled with some old version of Watcom C.
   (Uses PMODE/W DOS extender)
BOARDS.MAP: An old map from the Build Engine.
TILES000.ART: This is the same art data included with the Build Source code
   (KenBuild) I removed all textures that weren't used in BOARDS.MAP to
   reduce the size of the distribution.
PALETTE.DAT: Build Engine palette file: 32 shades, 64K translucent mix table.
TABLES.DAT: Math tables/fonts.
SETUP.DAT: Build Engine setup file: stores some keys and video mode options.

*.3D: 3D studio objects converted from .ASC to my more compact .3D format.
READ3DS.BAS: 3D Studio .ASC to .3D format converter.

POLYTEX_SRC.ZIP: Polytex source code. I fixed some things to make it
   compatible with Open Watcom 1.3.
POLYTEX.TXT: My original Polytex documentation. The keys are still the same.
readme.txt: this file.

-------------------------- History / Technical Info --------------------------

In 1994, Scott Miller was pushing me to write a new engine to compete with
Quake. So I played around with some stuff and called it "Polytex". A few
months later, the Build teams were complaining (to both Apogee and myself)
that I was not giving enough attention to Build. We all knew what our
priorities were.. and that was the end of Polytex.

Polytex never got past the test program stage. It generated a BSP tree on the
fly at startup and drew all surfaces in the map in back-to-front order.
Drawing this way avoids the need for hidden surface removal, but it suffers
from a ton of overdraw. It actually ran fast enough on medium-size Build maps.
To achieve this, I had to optimize my polygon drawing code as much as
possible. I used 2 unusual tricks to speed up the rendering:

1. Free-directional texture mapping. This method is very fast since it uses a
minimal number of divides. It is also very close to correct perspective.
Unfortunately, free directional mapping suffers from visible artifacts which
make textures not look so clean (I like to call them "sawtooth" marks).

2. 2-D texture cache. Instead of simply using malloc() when allocating space
for textures, I wrote a special system that would allocate rectangles for each
tile on a 2-dimensional (X * 256) space. This way, all textures could be
accessed simply by using the x86 byte registers (AL and AH for example) as U
and V texture coordinates directly. This makes for a much faster inner loop -
especially on 486's - because there is no need for shift operations. The 2D
cache saved a lot of memory on poorly sized textures, such as 65x129.

Probably the coolest thing is flying outside the board (easy to do with all
the collision bugs) and pressing the 'R' key.

Polytex had a lot of problems. Besides the obvious bugs and crashes
everywhere, I didn't have a clue on how to implement an editor. I tried to do
everything in 3D mode. In fact, the only editor function that remotely worked
was the 'T' key, but even that had problems because I had to re-generate the
BSP from scratch on every change. If I wrote a 6 degree of freedom polygon
engine from scratch today, I would never use a BSP. It would probably work a
lot more like my "Polymost" engine.

There was nothing special about my model renderer. It used painter's
algorithm. The sorting bugs were hidden only by the fact that most 3D models
happened to be convex. It was a quick hack just to satisfy Scott Miller's
request to see models in the engine. The models were all converted from the
3D modelling tools we had at the time - and that was 3D Studio.

I don't think I could have competed with Quake at the time. That demo is
lacking in almost every area except for texture mapping speed I guess. Back
then, I had no clue on how to implement all the big systems, such as collision
detection, lighting, model animation, model editor, and world editor. I had
a lot to learn, and I don't think I would have figured it all out in 2-3
years time, when the window for competing with Quake was open. If I could
take my knowledge today and go back in time to 1995, things would be
different... but that's not how history works.

-Ken S.
