******************************
*       Makebrush v0.4       *
******************************
*    (c) by Lars Bensmann    *
******************************

Introduction
------------

This utility is for everyone who wants to try making a Quake MAP-file.
It will make the most difficult part way easier. You don't have to care
about those numbers in the brushes anymore.


How does it work?
-----------------

Well, it's really easy.
Just type:

	makebrush [option] [texture]    (Linux version)
	makeb [option] [texture]        (DOS version)

Makebrush will then ask you how many points your object has. Just enter
the correct value and then enter the coordinates from all the corner
points of your object.

Because cubes and planes are pretty common in level design, makebrush has
to special modes to handle them (Of course can you use the regular mode for
those as well if you like typing).

And last but not least, there are two room modes. It's pretty much like the
regular room mode, but 'makebrush' will enclose your defined object with walls.


Defining cubes
--------------

Enter '1' to the first question to define a cube. You need to know one point
of your cube with all 3 neighboring points.

	+---------+   So if you enter P1 as you first point, the next points
       /|        /|   need to be P2, P3, and P4 (order is not important for
   P4 / |       / |   the last three points).
     +--+------+  +
     | / P3    | /    Actually, you can define cubes in the plane mode pretty
     |/        |/     simple as well. So have a look which mode you like
     +---------+      better.
    P1         P2


Defining planes
---------------

Now let's get to the plane mode. Typing '2' at the beginning will put makebrush
into the plane enter mode.

In plane mode you can define any shapes that have the same thickness at every
point (including cubes). First of all you have to tell makebrush how many
corners the 2D plane has and then you have to enter a vector for the thickness.
Because it is a vector, you are not restricted to horizontal planes.

After this, you just have enter all the corner points of the 2D plane.


Rooms
-----

Now the fun begins. You always had this level in mind with the 50 sided room?
Well, no problem anymore, just use 'makebrush'.
'Makebrush' knows two different room modes. The regular 'room mode' and the 
'funny room mode'. The funny mode was my first try, but didn't generate the
results I wanted, but I left it in anyway, because the objects looked kind
of funny. (Well, now you know, why I called it this way :-)
Making a room is as simple as a regular object. Just enter the thickness of
the walls, and then enter the inner corner points of the room. You can also
specify a negativ thickness and the walls will go inside, so you have to
enter the outer corners.
Let me give you a brief descrition, of what the 'funny room mode' is.
Let's say you have two planes A and B:

     
     |\
     | \
     |  \
     |   \
    A    B

That's what it should look like (regular 'room mode'):

 positive walls:

    |\           negative walls:
    | \
    ||\\           |\
    || \\          | \
    ||  \\         ||\\
    ||   \\        || \\
    A    B         A    B

That's what the 'funny room mode' looks like:

 positive walls:

		 negative walls:
     |\
    ||\\            Sorry, I can't draw this :-)
    || \\
    ||  \\
    ||   \\
    A    B

Oh, I hate ASCII graphics, but I hope you get the idea. If didn't just try
the following:

'makebrush /mr /q > test1 < 20sides' and
'makebrush /mf /q > test2 < 20sides'.

This will generate twenty brushes for a 20 sided room in the files test1
and test2. Just compile them with QBSP and look what the difference is.
(Hint: Type 'NOCLIP' at the console to look at the room from the outside,
because 'rooms' and 'funny rooms' look the same from the inside.)
If you want to see the effect of negative walls, change the second number in
the file '20sides' from '50' to '-50', and do the whole thing all over again.


And what happens now?
---------------------

About 0.1 sec after entering the last value you will see your brush on
the screen (if you entered points that make sense, e.g. if all points
were on the same plane you had a pretty flat 3D-object or entering
the same point more than once is also a pretty stupid thing to do.)

If you specified 'texture' on the command line your brush will have the
right texture already. If you didn't specify it, the field will default
to 'BRICKA2_2'.

I wrote this utility under Linux, so I just cut and paste the brush into
my MAP-file. Maybe you can use it the same way in a Win95 DOS-box, but
at least for all DOS users it is a little more complicated (for more
information look at option '-q').


Options
-------

Makebrush knows a few options entered from the command line:

	-h        Gives you a pretty help screen
	-m[ocpr]  Specify mode:      o  Regular object mode
				     c  Cube mode
				     p  Plane mode
				     r  Room mode
				     f  Funny room mode

	-v#       Set verbose mode:  0   Quiet mode
				     1   Regular mode
				     2   Debugging information
				     3   Who wants to read all this?
	-q        Quiet mode (same as -v0)

The Quiet mode is especially useful for DOS users, because 'makebrush'
won't print any information except the actual brush. If you send the output
of 'makebrush' to a file ('makeb /q [texture] > FILENAME') you get a file
you can directly import in your MAP-file.
The only problem with this mode is that you won't be prompted to enter any
information. But after using 'makebrush' a couple of times in the regular
mode, it shouldn't be a problem to enter the information blindly.
All the mode option does, is to go directly to the specified mode, without
asking you first.


Future
------
- Add a 'stairs mode'. Just enter the first and the last step and 'makebrush'
  should do the rest.
- Add a couple of new input modes like simple cubes (aligned to the axes).
  Maybe let it rotate as well.
- Let rooms be defined in plane and cube mode as well.
- Add a file parser, so you can create a level in a simple script language.
- ??? Any idea from YOU?

I won't probably continue work on this program, when a working Quake editor
is released (one that doesn't require Win95, I won't downgrade just to edit
Quake levels).


Thanks
------
This whole thing was just made possible by the great Quake MAP Specs from
Nicholas Dwarkanath. If you're interested in making a MAP-file get
the latest version from http://www.infi.net/~nichd/qmapspec.html.


Bugs
----
Well, this program isn't too user-friendly, but it should do it's work.
So please don't tell me that you cannot get back to correct your last entry
or whatever, but if you find anything that produces wrong results, please
tell me (lars@b-man.ruhr.de).
When trying to generate larger brushes, I sometimes got an errors from
'QBSP' (AddBrushPlane: numbrushfaces == MAX_FACES). Well, I thought maybe
the object has to many faces, but I got this error even on an object with
just seven planes. And my object with the most faces that compiled correctly
had 9 planes. If anybody has an idea if this is a limitation of the
Quake engine or QBSP or a bug in makebrush, please tell me.
There is also a bug in the room mode when calculating the outer corner points.
It does work, but generates too many planes, so QBSP might not compile the
brush anymore. You have to use the 'funny room mode' instead, although the
outside of your room doesn't look right then.


History
-------

0.1     First release

0.2     Added command line switches

0.3     Added cube and plane mode

0.4     Added room and funny room mode


Legal stuff
-----------

I don't promise this program will do anything useful. It may work for you or
it may not. It works for me that's all I can tell you.
