=============================================================================================================================
Primary purpose         : To enable Doom demos to be watched "automagically" by simply clicking on the lmp file
Update to               : this is release 10a
Advanced engine needed  : works with Prboom-plus 2.4.8.2 test version 30-Jan-07 or later (but please use the current version
                          - that is, 2.4.8.4 or the 2.4.8.5 test version)
Note                    : This text-file is best viewed in a wide window and with a small fixed-width font
Important note          : Don't force a complevel for playback. This is only necessary in rare cases, so don't do so unless 
                          you know it is needed. Forcing a wrong complevel is liable to cause desyncs.
=============================================================================================================================
Title                   : Demo watching patterns
Filename                : lmpwatch.zip (lmpwatch.txt and patterns.txt)
Release date            : 28-September-2008 (release 10a)
Author                  : Graham "Grazza" Burgess
Email Address           : gkburgess_at-compuserve|dot\com
Other Files By Author   : lots of demos, etc.
Misc. Info              : You can get very nice hats for $30 in Arctic Bay, Nunavut.

Description             : A large set of patterns to be placed in the cfg file for prboom-plus (prboom-plus.cfg and/or glboom-plus.cfg)
                          This enables a very large proportion of publically-released Doom demos to be played back directly just by clicking on the file.
                          As long as the wads are present and in the location it expects to find them, they will be loaded automatically.
                          The program will look for wads in the current directory, the exe directory (i.e. where the program is) and in the %doomwaddir% if you have defined one.

Usage and notes         : Firstly, if you don't already have it, download the current version of Prboom-plus.
                          Extract it, and make sure it is working OK and is finding your iwads. Placing them in the same folder is one way to do so.
                          If you have been using a previous version, I recommend using your existing cfg files and just checking through the menus for anything new or changed.
                          If you are using prboom-plus for the first time, then you may prefer to use one of the supplied cfg files and customize it in line with your preferences.
                          Depending on which version of prboom-plus you have downloaded, the current version of these patterns may already be included in some of the cfg files included.
                          In that case, if you are happy to use this version of the cfg, rather than edit your current one, you don't need to do anything in Notepad, and can skip to "You will be able...".

                          Open patterns.txt in a text editor such as Notepad.
                          Select and copy the whole of the text (Ctrl-A + Ctrl-C in Windows)
                          Open your prboom-plus.cfg or glboom-plus.cfg in a text editor. Find where it says "# Prboom-plus demo patterns list. Put your patterns here".
                          Replace this (and the list of patterns that follow it) with the text copied from patterns.txt. Save. The new cfg file will be about 209KB.

                          You will be able to play a lot of demos directly by clicking on them - the launcher will appear and the wads will be automatically selected.

                          In order to watch demos without going via the launcher, we need to change the default action for files with the lmp extension to:

                          prboom-plus "%1%" -auto

                                    or

                          glboom-plus "%1%" -auto

                         [I imagine most of you will know how to do that. For any who don't, here is a step-by-step guide for non-Vista Windows users.
                          1) In Windows Explorer, go to Tools - Folder Options... - File Types (in an older OS, it will be in a slightly different place).
                          2) Click on "New". Type lmp into the box. Click on OK.
                          3) Scroll down to LMP in the list. Highlight it (by clicking on it) and Click on "Advanced".
                          4) Click on "New...". Where it says "Action:" type in anything you feel like. I'd suggest "Play with glboom-plus -auto".
                          5) click on "Browse..." and locate the exe you want to use (either prboom-plus or glboom-plus). Once you've selected it, click on OK.
                          6) The exe (including its path) should now appear in the "Application used to perform action:" window.
                          7) You now need to add a little text after that. Type in (after the exe name and with a space between, and including the quotes): "%1" -auto
                          8) (In my case this would now read: c:\doom2\glboom-plus.exe "%1" -auto ). Click on OK.
                          9) If you have other actions already defined for the LMP file type, then highlight the one you have just created, and click on "Set Default".
                          10) Click on OK and then on Close.]

                          [Vista users: sadly, this simple method is no longer available, so it is necessary to edit the Registry. Andrey Budko has provided some tools to assist with this,
                          but they are not helpful if you have already associated the lmp file-type with prboom-plus.exe or glboom-plus.exe. So, I recommend the following:
                          1) Associate the lmp file-type with either prboom-plus.exe or glboom-plus.exe, whichever you prefer. This can be done via the launcher, which you can then disable.
                          2) Start RegEdit - BE CAREFUL AS ERRORS USING REGEDIT CAN SCREW THINGS UP!
                          3) Search (Ctrl-F) for prboom-plus.exe or glboom-plus.exe
                          4) Once you have found the place where the command-line for playing lmps is stored, edit it by adding " -auto" at the end.
                          5) Exit RegEdit.]

                          Done. You can now click on lmp files and the program will automatically load the necessary wads, as long as the file-name is recognized by the patterns, and it find the wads.

Note for Vista users    : Currently I have no idea at all how to make this work in Windows Vista. Any specific assistance (from someone who has actually got it to work in Vista) with this would 
                          be greatly appreciated.

What is included?       : I have included patterns for:
                          All compet-n demos - yes, including the messy matter of Final Doom demos (tell me if any don't work)
                          Almost all the demos at DSDA (i.e. I believe I have tested them all, and supported them except for cases described below under "What won't work")
                          Almost all DW forum demos (including those by Kristian, Donce, cack-handed and Belial, that they uploaded to their own webspace and linked to from there)
                          All the major demo-packs that I know of (including e1contest.wad, but the demos will need to be renamed)
                          Lots of deathmatch demos: those from doom2.net (including ~dev and rockisland), challenge-tv, DSDA, Czech-N, idoom.cz and a great many others
                          DANG demos are covered pretty well - the defaults will pick up those where the naming isn't specifically supported, and I have supported ad hoc naming as far as I can
                          DHT exams are covered as far as possible - there are many naming clashes (esp. "free.lmp", which I can't do much about), and some lmps need differing versions of the iwads
                          TAS demos (new and old) - done as much as I can to make them play back without additional command-line parameters. Try -complevel 5 first for any that fail.
                          DSF demos
                          Mirra demos
                          Compet-n contests
                          DANG contests
                          All of Ledmeister's demos
                          All the demos at Vroomer's site
                          Contests from Czech-N and a number of other sites
                          Patterns that will cover future demos on popular (and many other) wads, as long as the naming adheres to current (or natural) conventions
                          "Default" patterns that should catch a lot of iwad demos with relatively ad hoc naming, based on a bit of handwaving
                          Almost all of the demos in the \lmps section of the idgames archive (both the current archive and the old defunct Korean mirror of cdrom.com from 1997)
                          Almost all of the demos (normally packaged together with wads) in the \levels and \themes sections of the idgames archive
                          Almost all of the demos (normally packaged together with wads) in the various old shovelware collections at cd.textfiles.com
                          "Conflict avoidance" lists where naming conventions clash, or in the case of conflictive naming, or if there are demos on more than one version of a wad
                          Demos from a variety of rather obscure websites
                          Quite a lot of other stuff

                          If you notice something that doesn't work or that should be supported, let me know. There will either be a good reason, or I will be able to fix it quite easily.

Where to get the wads   : Pretty much all the wads required by the demos supported by these patterns can be found in the following locations:
                          http://www.doomworld.com/idgames - The database for the Doom Community Archive, with links to the mirror sites (search for the wad name, omitting the .wad extension)
                          http://www.3ddownloads.com/doomworld/sda/wad - you need to have cookies enables and javascript on
                          http://www.doom2.net/~wads/
                          http://www.doom2.net/doom2/wadindex.html
                          http://www.doom2.net/~dev/wad.html
                          http://www.doom2.net/~compet-n/class_ep.zip (this is the compet-n version)
                          http://kotogoto.ko.funpic.de/kotogoto/downloads/ - but site now down (temporary link to files: http://www.doomworld.com/sda/dwdemo/tobym.zip )
                          http://cd.textfiles.com/ (see http://www.doomworld.com/vb/showthread.php?s=&threadid=32849 for a content guide; use a search engine to find specific files)
                          http://www.hair.spb.ru/games/doom2/
                          Wads for contests will generally be available from the same place as the demos.
                          Sometimes the wad is included with the demo (e.g. maikl's demos), particularly if it has been modified or fixed in some way.
                          The DSDA page for demos on a pwad will generally include a link to the wad.
                          Many demo text-files include a link to any wads required.
                          You can search using http://www.google.com or http://www.filewatcher.com
                          And if you find a dead link, you can try http://www.archive.org/index.php
                          If all else fails, ask in the Doomworld forums, or contact me directly. But don't ask for commercial wads, as you won't like the response.

Where to get demos      : 
                        : 
Main archives/sites     : http://www.doomworld.com/sda
                        : http://www.doomworld.com/sda/dwdemo/
                        : http://www.doomworld.com/vb/forumdisplay.php?s=&forumid=37
                        : http://competn.doom2.net/pub/sda/
                        : http://competn.doom2.net/pub/compet-n/
                        : http://competn.doom2.net/incoming/compet-n/
                        : http://competn.doom2.net/pub/dang/
                        : http://www.doomworld.com/tas
                        : http://www.doomworld.com/sda/tas
                        : http://lmp.netfirms.com (and follow the instructions to access the FTP site)
                        : http://www.slimy.com/mirra
                        : http://www.doomworld.com/sda/id/
                        : http://gamers.org/pub/idgames/ (some lmps are included with pwads)
                        : 
Older                   : http://gamers.org/pub/idgames/lmps/
Older still             : ftp://ftp.sogang.ac.kr/.3/msdos_games/ftp.cdrom.com/id-mirror/lmps/
                        : http://cd.textfiles.com/ (some lmps are included with pwads)
                        : 
DM                      : http://www.doom2.net/doom2/lmps/
                        : http://www.doom2.net/~ocelot
                        : http://www.doom2.net/~dev/demo.html
                        : http://www.doomworld.com/sda/dnav.htm
                        : http://www.challenge-tv.com/index.php?mode=demos&game=50
                        : http://home3.highway.ne.jp/Jason/index.htm
                        : http://www.yeti.co.uk (demos included with some of the DM wads)
                        : http://www.hair.spb.ru/games/doom2/
                        : 
Opulent's demo links    : http://www.doomworld.com/sda/x2.htm
                        : http://www.doomworld.com/sda/x7.htm
                        : 
Personal/Regional,      : http://www.doom2.net/~compet-n/index.cgi?action=contest
contests, etc.          : http://www.czech-n.wz.cz
                        : http://www.czech-n.wz.cz/contest.php
                        : http://www.idoom.cz
                        : http://www.classicdoom.com/
                        : http://www.dense13.com/presage/vrmr/demos.html
                        : http://visionsofdoom.us/reviews.html
                        : http://www.emil.vbox.co.uk/
                        : http://dtamonis.puslapiai.lt/lmps/
                        : http://www.student.nada.kth.se/~d99-kro/demos/
                        : http://www.geocities.com/e6y/doom.html
                        : http://lsvc.free.fr/CFD/

What won't work         : The autoloading will fail in the following cases:
                          1) The pattern isn't recognized. I haven't catered for every single demo ever recorded or highly conflictive naming.
                          2) If the wads are not found. Any pwads (or deh) that a demo requires must be unzipped and in one of the folders where the program looks for them, and named as it expects.
                          Note that if any wads are not found, the program will provide an error message to this effect. Check if they are in the right place, and download them if necessary.

                          Other cases where playback will fail:
                          3) Most cases where the file-name is just 1, 2 or 3 digits. I have generally not included these in the patterns due to the high probability of conflicts.
                          4) Those rare demos that require a special command-line setting in order to play back. Though this can be added after "-auto" on the command line/default action.
                          5) Deathmatch demos recorded with the -timer xx parameter will play back, but the stats screen won't appear (see point '4' immediately above).
                          6) Cases where there are two different demos with the same name that require different wads. Not much I can do there...
                          7) In cases where two wads have the same name, you'll need to rename one of them or it won't work. In the list of patterns I indicate the names that are needed.
                          8) Demos for Doom 1.2 very often desync. Improvements in compatibility have been made, but solving the remaining problems may well be difficult.
                          9) Obviously, demos of a type not supported at all by Prboom-plus will fail. If you click on, e.g., a Zdoom or Legacy demo the program will exit with an error message.

More technical points   : You can edit and extend these patterns if you wish, but be careful.
                          The patterns use "Regular Expressions" (wikipedia has a page on them that will get you started).
                          This is a powerful syntax, but also unforgiving. One bracket in the wrong place can lead to a lot of fiddly debugging.
                          *NEVER* include a # character followed by a space. Back up your patterns if you're doing extensive work.
                          You can edit the list of wads that are loaded in each case, if for instance you want a different music wad loaded together with something.
                          The order of the patterns is important in some cases. The "defaults" have to come last, or else they would "eat" all or many of the preceding patterns.
                          Where I have described something as "conflict avoidance", this is a list of file-names that would otherwise be wrongly matched by another pattern.
                          These conflict-avoidance entries (e.g. the old Alien Vendetta) have to be placed before the pattern that would otherwise match them (e.g. new AV).
                          If you don't want to have a doom.wad in the same folder as doom2.wad, no problem. Rename doom.wad to udoom.wad and do a search/replace in the patterns accordingly.
                          I don't know if a massive list of patterns can hurt perfomance. I have got to 1600 without any obvious problems though, on hardware from 2004.

Additional Credits to   : Andrey Budko for Prboom-plus, without which this would be of no use at all. Also for some tips on using Regular Expressions (RegExp).
                          Opulent for DSDA and for supplying a large amount of files to me personally at the Prague LAN.
                          The demo recorders and contest organizers over the years who have adhered to consistent conventions for demo naming.

===============================================================================================================
* What is included *

New levels              : None
Sounds                  : No
Music                   : No
Graphics                : No
Dehacked/BEX Patch      : No
Demos                   : No
Other                   : large list of patterns to be placed in the cfg file
Other files required    : Prboom-plus 2.4.8.2 (test version 30-Jan-2007) or later; I strongly recommend always using the current test version
                          (http://prboom-plus.sourceforge.net/history.html for latest version)
                          Some or all of the original Doom iwads (unmodified, other than official upgrade patches being applied)
                          Demos + any pwads they require
                          Notepad or similar basic text editor

* Play Information *

Game                    : DOOM / DOOM2 / Final Doom / many pwads
Map #                   : n/a
Single Player           : most of the demos this will match are single-player
Cooperative 2-4 Player  : coop demos are also supported
Cooperative 1 Player    : yes, but you'll need to add -solo-net to the command-line in addition to -auto
Deathmatch 2-4 Player   : very many DM pwad demos are supported, while Doom2 iwad DM demos will normally be picked up by the default patterns
Other game styles       : n/a
Difficulty Settings     : n/a


* Construction *

Base                    : The default patterns from Prboom-plus greatly extended
Build Time              : I dread to think, honestly. More than two hundred hours.
Editor(s) used          : Notepad, Winword, Internet Explorer, pkunzip, SeaRCHZIPRar, Winzip 7.0 & 9.0 SR-1 (registered), IZArc 3.7
Known Bugs              : I imagine there must be some conflicts, and some important things missing.
May Not Run With...     : Anything other than Prboom-plus 2.4.8.1 or later; 2.4.8.2 (or later) strongly recommended, as some patterns won't work as intended with earlier versions
                          Note that only test versions dated 01-Apr-2007 or later support patterns including bex files, and give user-friendly info when files are not found.
                          The regular Prboom does NOT currently support autoloading of wads according to the lmp file-name.
                          Whether future Prbooms or other compatible ports might support autoloading, I don't know. I note that RjY is working on something that uses the patterns though.


* Copyright / Permissions *

Authors MAY and are encouraged to use the contents of this file as a base for modification or reuse.

You MAY distribute this file.

If you wish to include this in some form in a piece of open-source software, then you may. All and any necessary permissions are hereby granted.


* Where to get the file that this text file describes *

Web sites: http://www.doomworld.com/sda/dwdemo/lmpwatch.zip

Check the DoomWorld Demos Forum for information and updates:
http://www.doomworld.com/vb/forumdisplay.php?s=&forumid=37
