--------------------------------------
Object : OcamlDoom v 1.0 February 1997
Author : Francois PESSAUX
Contrib : Jun FURUSE
Used gif loader : David Koblas
--------------------------------------

* WHAT IS IT ?
Here is the first official release of OcamlDoom, a pseudo-3D renderer
written is Objective Caml 1.03. This engine is able to render worlds
like Doom's, that's to say worlds with different sector heights, and
vertical walls with any angular orientation (i.e. the engine it not
limited to perpendicular or parallel walls as Wolfenstein was).
Rendering is done using SVGALib under Linux.


* WHAT DOES IT CONTAIN ?
This package contains sources and Makefiles to build :
	- The renderer (the engine)
	- The level editor
	- The bsp compiler for levels
I also added a binary version of executables (native code) for Pentium
under Linux with SVGALib in case where someone couldn't compile all
this "thing".

These 3 programs can be compiled either in bytecode or in native mode
(for CPU which are supported by native code generation oc Objective
Caml).


* HOW TO MAKE ?
There are 2 makefiles:
	- The main Makefile in the ocamldoom/ directory
	- The gif interface Makefile in the ocamldoom/gif/ directory

You'll have to edit each of makefiles. You must looak for the sentence
"# **** READ THIS ****". An explanation follows in the makefiles.

So can compile OcamlDoom package either in native mode (this produces
a faster exectuable) or in bytecode (for machine wich are not
supported by native code generation of Objective Caml).

To make native version : make opt
To make bytecode version : make nopt


* HOW TO RUN THE ENGINE ?
In the distribution, there is a test world named big.world
You have to build the bsp, by applyging to it the bsp compiler (named
"bspcompopt" for native version and "bspcompnopt" for the bytecode
version). This'll create in the directory 2 new files named :
	- big.world.bsp (real level for the C version of the
		engine. It is mainly a textual description of the level)
	- big.world.bsp.bin (real level for the OCaml version of the
		renderer. It's binary dump of the world)

NOTE: Binary versions of worlds are not compatible between the
bytecode and native version (due to OCaml). So you can't use the
"big.world.bsp.bin" make in native mode with a bytecode version of the
engine. In this case, you'll have to re-build the bsp part of the level.

Then, go to root (because of SVGALib). >>Save all your work<<, in case
where there would be a problem ;-) Type : "renderopt big.world.bsp.bin"
(if you are using bytecode version, type "rendernopt big.world.bsp.bin").

It sould work. To move, use arrows, to strafe, press left Alt and the
wanted direction arrow (like in Doom). To escape, press ESC.

in the "textures" directory, a file named "config" can be found. It
describes the gif files to use as texture. First line is texture 0,
second line is texture 1, and so on... You can modify it. You can use
whatever GIF you want, of whatever size, of whatever palette...


* HOW TO EDIT A LEVEL ?
You'll have to use the program "editlevel". I'll give here very short
explanations, not a complete buil-level-tutorial. This builder is very
little, but it was only designed to make tests for me. I include it in
the distrib, but I know it isn't very easy to use ;-)

It uses OCamlTk, so you need to have it installed. When you launch it,
you find a drawing surface. It works with a similar philosophy as DEU
or whatever Doom-level-editor you want. That's to say you have to
insert vertices, to connect them to make a sector.

	- To insert vertices : go in "Vertex mode". Press the right
		button of the mouse where you want to insert the vertex.
	- To make a sector : go to "Sector mode". Click (with the
		right button of the mouse)on each vertex you want to
		add to the sector, in counter-clockwise order. When
		you click on the first added vertex, the builder knows
		you have finished with this sector.

When you click left on an object (vertex, linedef, sector, depending
of the current mode), infos are displayed in the bottom right window.

When you double click, you can edit the thing.

Note that player start position is fixed (oh yes, I left it hard coded
in the engine. Bad bad bad ;-), So always make a sector in the upper
left part of the world, in order to make the player live ;-)
Player start position is (250,250) and the window is 800 per 600, so
make a good approximation ;-)

A last note is about linedefs properties (when double-click on to
them). Several fields are filable.
	- Passable : indicates if the linedef can be traversed
	- Textures : 255 indicates NO TEXTURES. For the moment, the
		render assume 10 textures (0-9), so don't use a higher
		number than 9 or change the value of "availableTextures"
		in the file "renderextern.ml" ;-)
	  * maintx : texture needed on ly if you wall is plain (not
		transparent)
          * uppertx : used for walls separating 2 sectors. This is
		needed if the sector which the linedef belongs to has
		a higher celing altitude as the adjecent sector.
	  * lowerrx : as uppertx, but in the case where the sector
		which the linedef belongs to has a lower floor
		altitude as the adjecent sector.

If you forget some needed textures, so the renderer will give
unreliable view of your world.


* HOW TO JOIN THE AUTHOR ?
Simply E-mail me at Francois.Pessaux@inria.fr


* ACKNOWLEDGMENT
	- To Jun FURUSE. He interfaced a gif loader with OCaml in
		order to permit the use of gif files for textures.

	- To David Koblas. He coded the C routines for loading
		GIFS. These routines are those that Jun interfaced.

* COPYRIGHT
These sources are freely distribuable, but this README MUST ALWAYS BE
PRESENT. You can use them for your own programs. Please if you use
them, drop me a mail, I'll glad to know that it's useful for someone ;-)


	Francois
(*                                                                   *)
(*                      Francois PESSAUX (Francois.Pessaux@inria.fr) *)
(*                               (http://pauillac.inria.fr/~pessaux) *)
(*                                                                   *)
;;
