m2m : upgrade Quake1 maps -> Quake2  | files included : m2m.exe , textures.m2m
32bit freeware converter by PiRaMidA | params.m2m , m2m.txt , format.txt + ...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

version 0.6b, February 10

What is it?
-=-=-=-=-=-
m2m allows you automatically, with no pain, convert ANY quake1 map
into quake2 map, even mission packs / TCs maps. It doesn't work with
.bsp's, only source .maps. Runs on 32bit DOSlike platforms: Win95/NT
Syntax for use:
       m2m.exe -[p|t] <q1 map> [q2 map]
if you don't specify output file name, m2m would create default output
file (your q1 map with .new extension).
-p: Only process parameters, not changing textures
-t: Only process textures, not changing parameters
this two params are not necessary, and normally you shouldn't use them.

Another use (except q1->q2 conversion) for m2m would be, for example,
cutting out light_torch_small_walltorch and other useless models from
DM Quake 1/2 maps, which increases speed dramatically.
(NOTE: see Examples in format.txt for howto).

Converting Maps Step-by-step:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This small tutorial will attempt to guide you through the process
of converting your quake1 map to quake2.
What you MUST have before you start:
1. registered Quake2 (local soft. store) - to check your map;
2. latest version of m2m (http://www.planetquake.com/5thD/);
3. map compiling tools from id (ftp://ftp.idsoftware.com), these
   include qbsp3, qvis3 and qrad3. You must have some knowledge
   on how to compile Quake2 maps, also. DON'T ASK ME!
4. some text editor or quake2 map editor

Let's assume your quake1 map is called "mymap.map".

1. Start the DOS prompt and change to the directory with m2m

2. (skip if unsure - optional step)
   m2m is very flexible util, thus it allows some adjustment, if
   you want to convert custom maps. Two files, textures.m2m and
   params.m2m, contain modifiable portion of m2m. By editing this
   files, you can convert ANY quake1 map in the way that you like.

   ! Please see format.txt for detailed description of format used !
   ! in this files.                                                !

3. Run "m2m.exe mymap.map mynewmap.map"

If any errors occured during compilation, email piramida@usa.net
with detailed description; otherwise proceed to step 4

4. View automatically generated file "textures.bad". It contains
   those textures which do not have mapping in "textures.m2m" file.
   You have two choices: either add the mapping from those textures
   to standard quake2 textures, or extract .pcx files with those
   textures from a quake1 map "mymap.bsp", convert then to .wal
   (quake2 texture) by pcx2wal2 by Fingers (http://www.planetquake.com/5thD/),
   then put them into baseq2/textures dir. (note that you would have to distribute 
   those textures with your map, as textures are no longer included in .bsp)

5. Quick-compile your new map "qbsp3 mynewmap". If the source map was
   error-free and compiled right new map should also compile fine.

6. Put the file "mynewmap.bsp" into "quake2/baseq2/maps" directory. Start
   Quake2. Type "map mynewmap" at console, and check the map thoroughly.
   Things you should look for: errors (warnings) during map load,
   teleporters and entities positions and offsets.

If everything is right, proceed to step 9. If there were some errors
during map load, go to step 7. If there were some mispositioned
brushes or entities, go to step 8.

7. Write down all the warnings that appeared during map load. Open
   "mynewmap.map" in your text editor or map editor, find offending
   items and correct their position. If there were errors "unknown entity"
   then please edit "params.m2m" and add mappings for this entities.
   After that, go to step 3 and continue from there. If the only errors
   were mispositioned entities, repeat from step 5.

8. Open "mynewmap.map" in your map editor and correct positions of offending
   items (most probably that would be teleporters, due to the different
   teleporter nature in Quake2. Though m2m tries to guess new position
   automatically it could get it wrong). After that, go to step 5 and repeat
   the procedure.

9. Congratulations, you have converted your map to Quake2! Now you must
   finish compiling your map. Run "qvis3 -level 4 mynewmap" and "qrad3 mynewmap". 
   You can safely  go to bed now, as this could be a very lengthy process :)

Note: if you get any errors during compilation with qbsp3, qvis3 or qrad3, please
refer to their documentation and make sure that you use them correctly. If you
are absolutely (100%) sure that the error was caused by invalid work of m2m,
then please email me with the description of error or a copy of source quake1
map which causes the error (ZIPPED), whichever is appropriate in this situation.
DO NOT ask me any questions regarding running and compiling maps, as I wouldn't 
answer them, and you'll just somewhat increase overall Internet traffic.

Credits
-=-=-=-
id Software: for getting me started once more :)
Kayos (steve@hmsg.gwent.sch.uk): texture mapping table.
      You should thank him, as it was a really hard job.
Iikka 'Fingers' Keranen (iikka@ionstorm.com): help with parameter
      mappings and, as usual, great suggestions. Thanks pal!
John 'Tattoo' Schultz (tattoo@enteract.com): for some initial
      help with q2 map format.

and bug reporting crowd:
Jarno Paanen (jpaana@s2.org)
Dragon Zelgadis aka Vermillion]DP[ (zeromous@concentric.net)
Disastry (disastry@saiknes.lv)
ZOo (axa@usa.net)
and others

People listed above contributed their time and knowledge
to make this program what it is now.

Development info:
-=-=-=-=-=-=-=-=-
(you can skip this section ofcourse)
m2m is not based on anyone's work, even id's qbsp code which they generously
made available. Map parser in m2m was made from scratch by PiRaMidA. Machine used was
P100/133, 24Mb RAM, MS VC++ 4.2, running Win98 beta3 (yes, MSDN). Later development 
was performed on P200MMX, 64Mb RAM, running WinNT 4.0, still MSVC++ 4.2.
Development time, including mapping tables and docs writing ( :) ) is about two weeks 
(that is, ~8 hours per day. I'm not that fanatic to work 24h+ per day as I used to)
Tested on a variety of Win32 platforms.

Memory that m2m would allocate depends on .map's size being processed,
usually it would take 1.5 times the size of map without comments. Needs two available file
handles (i.e., m2m keeps up to 2 files open simultaneously). Video mode does not matter, as
it is purely console application (I could never understand why some people are doing nice
graphical interfaces to such kind of programs, spending time on it instead of writing
actual code, making program big and buggy, etc, etc. Imagine qbsp being a MFC app :))

Known Bugs:
-=-=-=-=-=-
1. When teleporters are mapped from q1 style to q2 style they are positioned
 at the center of old q1-style teleport brush, you'll (in some cases)
 would have to reposition it on z axis to be on the floor (or use '^' mapping).
2. Comments in the outcome .map are lost, and so is some valuable information
 that BSP editor stores in them... Probably wouldn't be fixed (requires
 total remake of object parser :( ). Thanks Disastry (disastry@saiknes.lv)
3. Some textures in texture.m2m do need some adjustment, please see comments in 
 the file. Would be corrected in the following version(s), for now please correct
 (rescale/reposition) this textures yourself. There ain't all that much of them.
4. Please submit!

Version histery :-)
-=-=-=-=-=-=-=-=-=-
0.6 beta:  !Kayos, a mapper whom you should recall by kysdeath and other great
            levels from the end of 1996, has done texture correspondense table.
            Now you can just rely on his talent as a texture artist and let m2m do
            all the texture conversion! (this is true only for standard Quake1 textures)
           !m2m now supports water, lava and slime brushes - please check the very
            begginning of textures.m2m. Again, you wouldn't not have to modify anything
            for standard-Quake-textured levels
            (suggestion by  Dragon Zelgadis (Vermillion]DP[) - zeromous@concentric.net)
           !Iikka 'Fingers' Kernen (iikka@ionstorm.com) suggested the ability to add
            shotgun to Quake2 maps, so for this reason alone I added '#' mapping,
            please see params.m2m, infos section.
           !As usual, interface corrections and speed optimizations, inspired by my new
            machine :)
	   !Corrected bug with "couldn't change to directory" error on some WinNT machines
	    (thanks myself :) )
0.52 beta: !Iikka 'Fingers' Kernen (ikeranen@raita.oulu.fi) have sent along
            corrected and extended version of params.m2m, which now covers
            quake1->quake2 standard conversion. Hypnotic and other entity
            mapping are not done yet, maybe you would go for it?...
           !Got a bug report from Disastry, who pointed me that BSP stores
            some additional info inside comments in .map. Tried my best to preserve
            comments, but they just don't fit into my object parser. If I find
            a way, I'll fix that. For now, comments are lost.
0.51 beta: !fixed brush parse bug... that's where last minute changes take
            you - I didn't bother myself to check output maps with qbsp3
            after simple program restructuring, and missed one space. dumb.
            Thanks to Jarno Paanen (jpaana@s2.org) for pointing that out.
0.5 beta: !removed default texture, you can just extract the textures
           from .bsp manually (or set your custom mappings).
          !added '^' mapping, to move entity's origin.
          !almost completed parameter mappings q1->q2,
           all that is left is texture mappings - textures.m2m.
           For now, just extract all the textures you need and set mappings
           (i.e. "MYWALL MYTEXS/MYWALL", after you put MYWAL.wal into MYTEXS dir)
0.4 beta: !fixed many smaller bugs, added -p/-b command line params.
          !created torch removing params.m2m (for Quake1 maps).
          !added '%' mapping, which allows automatically convert
           teleporters to the new style (see format.txt).
0.3 beta: !easier to run from win (just drug-and-drop your q1 map
          on the m2m.exe).
          !Added conditions (...), that will allow to easily map
           health boxes and other parameter-depending entities.
0.2 beta: !minor bugfixes (well, forgot to add code for *, so
           entities were not actually deleted; plus better
           multi-rules-for-one-entity case handling)
0.1 beta: !got a working .exe but no tables (mappings) ->
           thus, hardly usable. If you consider yourself a
           talented mapper, please spend some time and create
           good tables textures.m2m and params.m2m (latter is
           easier, it's almost obvious how to map, though I don't
           have time for it either :( )

Feedback:
-=-=-=-=-
Please report me any bugs in executable and submit your tables,
if you find them working better than default. Any (even small) additions
are welcome.
This release contains no source code, but if you need my map parsing
codebit (yeah whatever), I can send it to you.

Legal
-=-=-
                                            to Actura
"If you f*ck with the best you will die like the rest!"

That means, distribute freely provided that you'll keep all the
files in the original .zip intact.
See the top of this document for the list of files that should
be in this .zip file.
If this program destroys the Universe, I don't give a sh*t.
If you distribute maps that you made with it, give me credit,
or your maps will stop loading.

If you're going to include this file in any CD compilation,
a) give me credit
b) send me the CD (see below for contact)
That's all of the boresome legal crap.

Availability:
-=-=-=-=-=-=-
ftp.cdrom.com (when it reaches release stage)

5thD homepages : always latest version:
http://www.planetquake.com/5thD/
http://www.portal.ru/quake2/

Contact
-=-=-=-
EMails:
home: piramida@usa.net
work: IvanM@AstroSoft.spb.ru (in case I'll get workaholic)
piramida@rocketmail.com (I don't really check this one... be sure to send your flames there)

ICQ UIN: 3335090

IRCNet #quake, #quake2, leave a msg.

//PiRaMidA aka Ivan S. Manida, 2am, February 10, 1998