-------------------------------------------------------------------------------
Table of Contents
-------------------------------------------------------------------------------

1.0   Introduction
  1.1   Standard Disclaimer
  1.2   Copyright Notice
2.0   What's new in v1.1
  2.1   Bug fixes
  2.2   New features
3.0   Hints and tips for using IDBSP
4.0   Known bugs, limitations, etc.


------------------------------------------------------------------------------
1.0   Introduction
------------------------------------------------------------------------------

This is the documentation for IDBSP11.ZIP, version 1.1 of my port of id's BSP
builder to DOS.  The package consists of two programs, IDBSP.EXE and
WAD_DWD.EXE; full source for both is included.  Hopefully, the source is a
little cleaner in this version, to contrast my uglieness in v1.0.

Programs are 32-bit DOS-extended, compiled with DJGPP v1.11m5.  The DOS extender
(GO32) is prepended to the executable, so no support files (other than EMU387
for those without a coprocessor) are required.  Both IDBSP and WAD_DWD should be
able to handle the largest PWADs without problems, provided your machine has
sufficient memory (real and virtual).

Send comments, requests, etc. to Ron Rossbach at ej070@cleveland.freenet.edu.  I
usually respond within 2 days, except during extended absences from the net due
to vacations, etc.  Please be patient!

Thanks go to (in no particular order):
	- id Software, Inc.
				for developing DOOM and releasing their BSP source
	- Matt Fell (matt.burnett@acebbs.com)
				for developing the Unofficial Doom Specs
	- Colin Reed and Raphael Quinet (colin@argonaut.com and
																	 quinet@montefiore.ulg.ac.be)
				for developing BSP, the first BSP builder
	- Antony Suter (antony@werple.apana.org.au)
				for providing a "radius" value which corrects id's original "slime
				column" bug
	- Gregg Anderson (cadman@krypton.mankata.msus.edu)
				Beta testing and encouragement

along with apologies for anyone I've missed.

1.1   Standard Disclaimer
===============================================================================

This program is provided with NO WARRANTY, though I hope you will find it
useful.  Use at your own risk.  You may not use this code to develop levels which
work with the shareware version of DOOM.  I assume no responsibility or
liability, direct or indirect, for the use, misuse, or abuse of this program.
DOOM and DOOM 2 are registered trademarks of id Software, Inc.  IDBSP is not a
product of id Software, Inc., and id will not provide support for this program.

It is illegal (not to mention immoral) to distribute the components of
registered DOOM and/or DOOM 2 in either original or modified form.

1.2   Copyright Notice
===============================================================================

IDBSP is copyright (c) 1994 by Ron Rossbach (ej070@cleveland.freenet.edu).  All
rights reserved.  You are granted the following rights:

	-   You may modify and re-distribute the program, as long as you call it
			something else, and give credit for IDBSP being the basis of your work.
			This includes using the source in your own level editor or other
			derivative work.  You may NOT distribute modified versions of this program
			under its original name.  Submit any suggestions, bug fixes, etc. to Ron
			Rossbach at ej070@cleveland.freenet.edu, and they will be included (with
			full credit) in any future versions of IDBSP.

	-   You may distribute un-modified versions of the program, under its original
			name, as long as you distribute the original zip file unmodified.  This
			includes utility authors who wish to include IDBSP in their distributions,
			CD-ROM publishers, etc. Simply include the IDBSP zip file in your
			distribution, and all is well.

	-		If you modify and re-distribute the program, or use the program as a basis
			for a derivative work, you must include the full source code of your work
			(excluding any third-party libraries which prohibit the distribution of
			their source) in your distribution.  This is to uphold the spirit of free
			software and allow others to learn from your work.

You are encouraged to build upon this program in your own editors, subject
to the conditions above.  If you would like rights in addition to those
mentioned above, contact Ron Rossbach at ej070@cleveland.freenet.edu. (Don't
worry, I'm not going to charge anything, I'd just like to be able to keep
track of things, that's all....)

DOOMBSP.ZIP (id's Objective-C source for the BSP builder) and DOOM itself are
copyright (c) 1993 by id Software, Inc.

-------------------------------------------------------------------------------
2.0   What's new in v1.1
-------------------------------------------------------------------------------

Well, several things, actually, aside from the additional legalese and support
for DOOM 2.

IDBSP v1.0 was a faithful port of id's original BSP builder, and as such,
behaved differently than the other BSP builders that everyone had gotten used
to.  It required rising staircases to have alternating sector tags as
described in the Unoffical Specs, did not allow multi-extent sectors, and would
align THINGS on a 16x16 grid.  IDBSP v1.1 corrects these while providing access
to most original v1.0 behavior via command line parameters.

2.1   Bug Fixes
===============================================================================

The following v1.0 bugs are fixed in v1.1:

- remove alignment of THINGS on a 16x16 grid.  Alignment is no longer available.

- a new EMU387 is provided, which actually works.

- v1.0 would print a message saying it was removing duplicate lines, while
	leaving the lines in the level.  Now the lines really ARE removed when IDBSP
  says they are.

- the "slime column" bug was fixed by using a value of 1.4143 in the radius
	calculations in function PointOnSide (thanks to Antony Suter to contributing
	this).  Use a radius of 2.0 to retain the original PointOnSide behavior.

- both WAD_DWD and IDBSP v1.0 had problems handling zero-length WAD resources,
	like P_START.  This is fixed.

- WAD_DWD had a string overwrite bug.  This is fixed.

- WAD_DWD would choke on a NULL resource, which DEU likes to include as the
	last entry in the WAD directory.  This is fixed.

2.2   New Features
===============================================================================

IDBSP v1.1 includes the following new features:

- the DWD format has been further extended to include a "sectors:" section at
	the beginning of each level.  DWD files created by WAD_DWD v1.0 will not work
	with IDBSP v1.1.  An updated WAD_DWD is included, but since IDBSP v1.1 can
	now use a WAD file as input, this extra step is no longer required.  The DWD
	format IS useful for picking apart levels with a standard text editor, though.

- support for a selectable level of sector handling (see below)

-	support for DOOM2 (DOOM II, DOOM ][, DOOM HOE, or whatever)

- IDBSP can now use a WAD file as input, so the DWD step is not necessary (see
	below)

- New command-line parameters:

The new command-line syntax is:
"idbsp [-fullreject | -radius=x | -sectopt=x | -duplines | -trace] [-wad]
	infile [outfile]"

Parameters may be included in any order, anywhere on the command line, with the
exception of the -wad parameter.

	-fullreject
			Includes all sectors in the REJECT calculations.  By default, small
			sectors (less than 64x64) are excluded from these calculations.

	-radius=x
			Specifies a new value for radius in the PointOnSide function.  Default is
			1.4143, contributed by Antony Suter.  id's original default is 2.0.  A
			radius of 2.0 will sometimes cause the "slime column" bug, while a radius
			of 1.4143 usually fixes this bug but may cause some sectors to be
			grouped incorrectly when used in conjunction with -sectopt=1.  Experiment
      to find values that best suit your own levels.

	-sectopt=x
      Selects the level of sector handling.  Valid values are 0 or 1.  A value
      of 0 (the default) simply leaves sectors alone.  A value of 1 will
      regroup sectors as in IDBSP v1.0.  "Regroup" means:  as sectors are read
      in from the DWD (or WAD) file, any duplicates are removed; hence the need
      for alternating sector tags on rising staircases when -sectopt=1.  This
			yields an "intermediate" list of sectors.  The final sector list is built
      by creating completely enclosed, single-polygon sectors by walking through
      the SEG list.  Hence the lack of support for "multi-extent", or
      multi-polygon, sectors when -sectopt=1.

  -duplines
      Allows duplicate and zero-length linedefs to be retained in the WAD file.
      By default, duplicate and zero-length linedefs are removed.  Note that
      IDBSP will consider two linedefs to be duplicates if they are within 8
      pixels of each other, due to floating point inaccuracy.

  -trace
			Displays debugging and tracing information while IDBSP is running.

  -wad
      Allows input directly from a WAD file, rather than a DWD file.  Default
      is still a DWD file. This parameter must immediately proceed the name of
      the WAD file on the command line.  For example:

      "idbsp -wad input.wad -radius=2.0 output.wad"

-------------------------------------------------------------------------------
3.0   Hints and Tips for using IDBSP
-------------------------------------------------------------------------------

1)  IDBSP reports removal of duplicate lines, but the lines aren't duplicated,
    just real close together.......solution? Run IDBSP with the -duplines
    parameter to suppress the removal of duplicate and zero-length lines.
    IDBSP thinks that any lines within 1 map unit (4 pixels) of each other are
    duplicates, due to floating-point inaccuracies.

