m2m : upgrade Quake1 maps -> Quake2  | files included : m2m.exe , textures.m2m , params.m2m , m2m.txt , format.txt ,
32bit freeware converter by PiRaMidA | readme.txt , m2mtorch.zip. (pcx2wal2.zip & bspview.exe - additional programs)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

version 1.1 release, August 13

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
Has built-in support for standard entities&textures, CTF entities, and
all editor's map formats (even QuArK with floating points).

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 easily converting your quake1 map to quake2 with m2m.

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 occur (like program is causing General Protection Fault,
or somehow else terminates without prompting you to press any key)
email piramida@ars.ml.org with detailed description; otherwise proceed to step 4

4. View automatically generated file "m2m.err". It contains many information
   usefull to track problems, and though it doesn't cover all possible
   errors, it does a fair bit of it. By looking through internal structures
   dump in that file you can easily locate the source of errors.
  Most common:
   4.1. No mapping for a texture:
    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 (use "bspview.exe mymap.bsp"), convert
    them to .wal (quake2 texture) by pcx2wal.exe by Fingers, 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)
   4.2. No mapping for an entity:
    Edit "params.m2m" and add mappings for the entities mentioned. The
    mappings set is not yet complete, because there are many different TCs
    out there, with their own entities. If that's the case, you'll have
    to find correspondence yourself. After that, go to step 3.
   4.3. Everything else:
    Probably source map had an error. Find in the source map the place which
    should appear in the DUMP section, and correct it. (such places in most
    cases are marked with line "kill-the-bitch protection"). Go to step 3.

    When it says "no errors compiling map" then you can proceed to Step 5.

5. Quick-compile your new map "qbsp3 -nofill -nodetail mynewmap". If
   the source quake1 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, texture offsets and scale.
   (NOTE that the poor quality of your map at this stage is caused by a very
   non-optimizing compilation. It'll get MUCH better soon :))

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 (use PGUP).
   If there were errors like "no spawn function for..." then please
   correct 'params.m2m' and go to Step 3.
   Else, open 'mynewmap.map' in your text editor or map editor,
   find offending items and correct their position, then go to Step 5.

8. Open 'mynewmap.map' in your map editor and correct positions of offending
   items (though m2m performs teleporters and spawn pads positioning
   automatically, in some cases you would like to adjust some of them by hand).
   After that, go to Step 5.

9. Congratulations, you have converted your map to Quake2! Now you must
   finish compiling your map. Run "qvis3 -level 4 mynewmap" and
   "qrad3 -bounce 40 -extra 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)
Spectre <jallison@wavecom.net>
Cat Zimmermann <catmandoo@virginia.edu>
Jonathan C. Forster <jforster@u.arizona.edu>
KamiKazie <kabes@golden.net>
Daniel -Axe Redrum- Pierce <ab134@oak-web.washington-ch.oh.us>
Alexander Kohen <shogun@gem.overhere.org>
Giles Bathgate <giles@caburn-1.demon.co.uk>
nextday <nextday@qni.com>
Luca Guerri <mc0693@mclink.it>
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. Latest build was done using MS VC 5.0. Development time, 
including mapping tables and docs writing is about four 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, plus all
.m2m files sizes. Needs three available file handles (i.e., m2m keeps
up to 3 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. Some textures in texture.m2m do need some adjustment, please see comments in
 the file. Please correct (rescale/reposition) this textures yourself.
 (only about 15 textures need adjustment)
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. Please submit!...

Version histery :-)
-=-=-=-=-=-=-=-=-=-
1.1 : 	   !extended maximum number of brushes to 64
	   !corrected "plane with no normal" bug, sorry guys, and big 
	    thanks Luca Guerri <mc0693@mclink.it> and everybody else,
            who finally made me understand that this is my fault, not
            their map's. Seems that 3 months testing period didn't 
            generate any other serious bug reports, so... it was fun guys :)
            Now I'm off to continue our GSM project, get it at 5thD homepage.
	   !oh yeah, m2m_os2.exe is also here, as you can guess, it's m2m for 
	    OS/2, though it's not supported by me.
            Compiled by James Mckenzie, Team OS/2, <os2support@theriver.com>
           
1.0 :      !QuArK and all other floating-point editors are now supported
	   !included another variant of params.m2m for some special cases 
	    (supposingly for q2->q2 maps conversion & entity tweaking) 
	    (thanks nextday <nextday@qni.com>)
	   !textures.m2m was not parsed correctly for some cases of
            custom spacing. Thanks Alexander Kohen <shogun@gem.overhere.org>
           !maps generated by some map enhancers/converters/generators
            with lots of comments in various places were not parsed correctly.
            Enhanced object parser a lot.
            Thanks Axe Redrum <ab134@oak-web.washington-ch.oh.us>
	   !some more corrections, thanks to all who helped, this version
	    seems to be the last version of m2 I'd be releasing.
0.8 beta:  !!Main bug was killed. "plane with no normal" was generated out of
            nowhere. You can kill me, but it was a bug in my vector math. bah.
            Thanks Kayos, Spectre <jallison@wavecom.net>, Cat Zimmermann
            <catmandoo@virginia.edu>, and everyone else who pointed that out.
           !Comments generated in .map are changed from ';' to '//', because
            QERadiant didn't like ';'.
            Thanks Jonathan C. Forster <jforster@u.arizona.edu>
           !Extensive (I mean it) error output to m2m.err file. No more
            "press any key", just view the file after everything is done.
            Should be VERY helpfull, dumps internal structures involved in
            the error. No more textures.bad, everything goes to m2m.err
           !CTF entities support. Pretty straightforward mappings added.
           !Drop-to-floor now drops through water and all non-solids, doh.
           !Added ~ mapping, showing that the entity is not to be mapped.
           !Some more stuff that's not too important, but enhances output.
0.7 beta:  !Implemented "drop-to-floor" feature which positions the teleports and
            spawn pads (actually, any entity) on the floor. See '^' mapping.
           !Extended ASCII names are now being transferred into normal ASCII.
           !Corrected lava/water/slime flags, they should be transparent now,
            by popular demand.
           !Ambient sounds are now converted into more or less similar quake2
            sounds (go ahead and find a better correspondence :) ).
           !Corrected many texture and parameter bugs.
           Should work *very* clean now :)
0.61 beta: !Oops, seems that lava/water/slime that should be working didn't,
            due to a simple .exe mistake and wrong texture mapping.. Corrected
            (thanks Kayos for pointing out)
            !More ideas and corrections are coming, so probably there will be another
            final version in about a week or two.
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 legal crap.

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

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

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, 3am, March 4th, 1998