\/\/\/\/\/\]/\/\/\/\/
=\====/==\====/==\====/==\====/==\====/==\====/==\====/==\====/==\====/==\====/=
--\--/----\--/----\--/----\--/----\--/----\--/----\--/----\--/----\--/----\--/--
   \/      \/      \/      \/      \/      \/      \/      \/      \/      \/

   3D Land, version 0.something

   By Carl Olsson

   December 2000

--------------------------------------------------------------------------------
Contact
-------
   You got any issues with this program, you speak to me!
   Mail: carljolsson@yahoo.com
   Web:  http://www.geocities.com/carljolsson

--------------------------------------------------------------------------------
Lisence
-------
   If you use any of this code then give due credit.

--------------------------------------------------------------------------------
Disclaimer
----------
   No matter what, I'm not responsible.

--------------------------------------------------------------------------------
Aim
---
   To make a simple Magic Carpet or Populous: The Beginning style 3D engine
   (ie. dynamic tri-mesh landscape), except with simple poly objects rather
   than sprites, that runs at a decent speed. Possibly to use in a future
   game.
   It is also very tempting to use it for Deity, though I will try to stick
   by my decision for iso.

--------------------------------------------------------------------------------
Todo
----
 * Use iteration of rotated grid instead of sort for terrain squares,
   should be heaps faster for large numbers of squares. Limit to
   visibility range.
 * Draw decent textures including fringes.
 * Create decent height and texture maps. Random generation.
 * Seperate cameras and objects.
 * Multiple views. Behind, top-down, eye, etc.
 * Physicaly responsive objects. (velocity, gravity, col det, etc.)
 * Simple poly objects. Trees, player, enemies, missiles, etc.
 * BSP for objects.
 * View clip before sort, use inverse view matrix.
 * Seamlessly tile landscape, as in MC and PTB.
 * Varible grid resolution, so high resolution close up, lower resolution
   further into the distance, like Delta Force, but with polys. Difficult
   with textures, maybe use first texture of high-resolution range, or use
   average colour of textures (like DF does with voxels).
   Perhaps use ROAM or Adaptive Quadtrees, though they seem quite complex.
 * Colour lit texture mapping. So I can have black shadows, and sky blue
   fogging. Also pretty coloured lighting.
 * Try to find faster texture-mapped poly filler. Accuracy not a great
   issue. Perhaps a specialised tri filler, or quad filler. Quad filler
   would be best, so I can render deformed (non-flat) quads in one fill,
   rather than two or four seperate tri fills.
 * Colour interpolating rect fill, for map drawing, lots faster than using
   poly. Done but no where near faster.
 * Make mouse feel right. It feels funny at the moment.
 * Make it work in all colour depths. Not yet 8-bit.
 * Faked world curvature and sphere mapping as in PTB.
 * Occlusion culling/clipping.
 * HUD with fake horizon, movement vector.
 * 3D line drawer. ie. thickness.
 * Shadows. Mountains cast shadows.
 * Torque and torsional velocity.
 * Alpha for texture fringes. So water fringes on top, blending to full
   alpha.
 * Make tris in two tris per square pick best direction like in PTB.
 * Make fringing just greyscale alpha. And apply to textures. Have a few
   different types, then can any number of textures and it dosen't use any
   extra memory for storing fringes.
 * Have a bumpmap layer for fringe as well, so height changes between
   terrain types can be displayed with lighting. Or a pregenerated
   light/shade layer.
 * Scrap 8-bit, too fiddly, too ugly.
 * Use OpenGL for 3D. Allegro's 3D functionality is just too limited.
   Problem is that my card is a load of shit when handling OpenGL if it
   uses any textures at all. Will allow me to use Z buffers, so I can scrap
   all the sorting crap.

--------------------------------------------------------------------------------
Problems
--------
 * Generally obscene slowness.
 * Can't convert the textures for 8-bit. Now I can, why I don't know. But
   not with pale shade colours. Also, garbage colours at edge of lit polys
   in 8-bit.
 * Gouraud rect filling for map is way too slow.
 * Garbage colours at edge of lit polys in 15 and 16-bit, using MMX
   blending. An Allegro bug maybe?
 * Fringe component masking not woking in 8-bit.
 * Fringe corners drawn when allready handled by fringe sides.
 * Incorrect clipping when clipped vertices more than doubles.
 * Polygons only draw half of texels at edges. I've worked around this
   limitation for PTEX types in DJGPP, but I don't like it, and it dosn't
   work in Mingw32, or in ATEX modes.
 * Allegro clipper dosn't handle triangles correctly. Triangles can clip to
   7 vertices, but it only clips up to six.

--------------------------------------------------------------------------------
Controls
--------
   I'm to lazy to write this at the moment. Don't you be lazy, look at the
   sources it you want to know. Try FPS style, mouse-keyboard combination.

--------------------------------------------------------------------------------
Using
-----
   (Allegro_WIP_3933 && (DJGPP || Mingw32))

--------------------------------------------------------------------------------
Credits
-------
 * Font loading stuff nicked from Allegro Dat/Grabber. I really think it
   should be part of the lib, it seems pointless to use datafiles just so
   you can load fonts.
 * Possibly some fragments of Allegro example EXCAMERA in the code.

--------------------------------------------------------------------------------
Thanks
------
 * Magic Carpet (I and II) (Bullfrog), for the primary inspiration.
 * Populous: The Beginning (Bullfrog), for further inspiration.
 * Delta Force (I and II) (Nova Logic), for further inspiration.
 * Allegro 3D examples, for getting me started.
      http://www.talula.demon.co.uk/allegro
 * All the docs on the web, for learnin' me stuff.
    - Win95PCGPE's 3D stuff
         http://www.geocities.com/siliconvalley/2151
    - Steel's 3D stuff
         http://www.geocities.com/siliconvalley/horizon/6933
    - Handling Terrain Transitions by David Michael
         http://www.gamedev.net
    - etc.

\      /\      /\      /\      /\      /\      /\      /\      /\      /\      /
-\----/--\----/--\----/--\----/--\----/--\----/--\----/--\----/--\----/--\----/-
==\==/====\==/====\==/====\==/====\==/====\==/====\==/====\==/====\==/====\==/==
\/\/\/\/\/\/\/\/\/\/
