Next Previous Contents

2. LMPC, The Little Movie Processing Centre

2.1 Introduction

With LMPC you can get information about a LMP, DMO, DEM, QWD or DM2 file, change the version and viewing player's number, add some wait tics at the end, remove the pause tics, clear the ``Save Game'' tics in LMP files and (this is the main part) you can compile and decompile a LMP, DMO, DEM, QWD or DM2 from and to a LS file. LS stands for ``LMP Source''. To reduce the amount of new abbreviations I call the ``DMO Source'' LS too. The language is similar and will be treated in the same way. The real LS language is documented at full length in the section LS format. The ``DEM Source'' (see section DEM source format) and all the more the ``QWD Source'' (see section QWD source format) is totally different but I call it LS anyway. The same holds for Quake II DM2 (see section DM2 source format) files.

2.2 Command line parameters

LMPC is a command line oriented program. It uses the getopt_long() function for the command line parsing.

The LMP file convert options (--change-version, --change-player, --add-WT, --remove-pause and --clear-save) can be used together.

Syntax description

Syntax:

lmpc

Description:

If you start LMPC without any command line parameters you receive the following syntax message:

Little Movie Processing Centre
LMPC (c) U. Girlich, 1994-2000, Release 3.3.0 1/23/2000 (public release)
lmpc [option ...] filename [filename ...]
-h, --help                   display this help and exit.
-V, --version                output version information and exit.
-i, --info                   prints out information about the LMP-files.
-s, --to-txt                 binary/text to text conversion.
-l, --to-bin                 binary/text, ... to binary conversion.
-v, --change-version VERSION changes the version of a LMP-file to VERSION
                             (0 means old DOOM).
-p, --change-player PLAYER   changes the recording player of a LMP-file to
                             PLAYER (0..3).
-w, --add-WT SECONDS         adds SECONDS (int) WT game tics to the LMP file
-r, --remove-pause           removes the game tics between PS and PE.
-c, --clear-save             clears SG tics.
-f, --fix-multi              fixes multi-level DEM and DM2 files.
-t, --tic FROM(,|:)TO        converts only a part of the LMP-file
                             (in connection with -s only).
-g, --game GAME              forces game (GAME=DOOM,DOOM2,HERETIC,HEXEN,
                             STRIFE,DUKE,REDNECK,QUAKE,QUAKEWORLD,QUAKE2)
                             short: D2HXSNRQWq (only with -(i|s|v|p|w|r|c)).
-m, --mark-step STEP         marks every STEPth tic in the LS file (-s only)
                             STEP=0 doesn't mark any game tic; default: STEP=1.

Information about a LMP, DMO, DEM, QWD or DM2 file

Syntax:

lmpc [--info|-i] infile [infile ...]

Input File:

infiles

Description:

LMPC reads each infile and prints out some information like game, version number, episode, map, skill, number of players, deathmatch/altdeath, nomonsters etc. Please note: in the old DOOM format there is no version information, so if you check e.g. a 1.2 LMP file you receive only the vague information v<1.4 instead of v1.2. LMPC doesn't report any version for HERETIC and HEXEN LMP files.

This option works for DMO files too. They will be detected automatically but you can use the --game DUKE option as well.

This option works for DEM, QWD and DM2 files too. They will be detected automatically but you can use the --game QUAKE, --game QUAKEWORLD and --game QUAKE2 option as well. The information on DEM, QWD and DM2 files nearly zero beside the information that it is actually a DEM, QWD or DM2 file and the number of frames in binary DEM, QWD or DM2 files.

To get more information of a DEM file convert it into a text file and use DEMA, The DEM Text File Analyser.

LMP/DMO/DEM/QWD/DM2 text converter (decompiler)

Syntax:

lmpc (--to-txt|-s) [(--tic|-t) FROM(,|:)TO] [(--mark-step|-m) STEP] infile txtfile

Input File:

infile

Output File:

txtfile

Description:

LMPC reads the file infile, converts it to the corresponding text format and stores the result in the text file txtfile. infile may be a LMP binary, DMO binary, DEM binary, DEM text, QWD binary, QWD text, DM2 binary or DM2 text file. Most of the additional options do work with binary LMP files only.

If the --tic option is used, only the part between gametic FROM and TO (inclusive) will be stored in the LS file. A missing FROM means the start of the LMP file and a missing TO means the end of the LMP file. FROM and TO are separated by a comma (,) or a colon (:). The MS-DOS version may have difficulties with comma as a separator because COMMAND.COM (4dos as well) splits a command line at spaces and commas. The TO part will become a different argument and might be interpreted as a file name.

LMPC appends at the end of the LS file some useful additional information. For each player there is a statistics about his favourite movement codes and the portion of WT. Since you can achieve with keyboard/joystick only a few special movement codes, is is very easy to detect, if the player used a keyboard or a mouse. Some newbies don't use strafe, so LMPC shows also this handicap. The statistic takes in account always the full LMP file.

From the favourite movement codes you can easily deduce the number behind a prospective -turbo parameter.

If the --mark-step option is used LMPC will mark every STEPth game tic with the tic-number and the current time. The default STEP value is 1. If STEP=0 no marks are printed at all.

Any --mark-step option in conjunction with a binary DEM, QWD and DM2 files is a special debug-option. It includes in the text file the frame number and the starting address of all messages. This option may be removed or changed in future releases.

The --fix-multi option can be used together with --to-txt to repair the broken multi-level DEM and DM2 files.

LMP/DEM/QWD/DM2 binary converter (compiler)

Syntax:

lmpc (--to-bin|-l) infile [infile ...] binfile

Input File:

infiles

Output File:

binfile

Description:

LMPC reads the first file, determines the game type and compiles a binary file out of all the files on the command line. The binary (destination) file is always the last argument.

This option works with LMP text files, DEM text, DEM binary, QWD text, QWD binary, DM2 text and DM2 binary files as input files only. LMPC can handle more than 1 input file with LMP text files only.

For combination of DEM files use DEMcut.

The --fix-multi option can be used together with --to-bin to repair the broken multi-level DEM and DM2 files.

LMP file version change

Syntax:

lmpc (--change-version|-v) VERSION lmpfile1 [lmpfile2]

Input File:

lmpfile1

Output File:

lmpfile1 or [lmpfile2]

Description:

LMPC reads the binary LMP file lmpfile1, changes the version number byte in lmpfile1 to the appropriate value or stores the result in lmpfile2.

The VERSION can be the version byte itself (0 for the old LMP files) or anything like 1.4beta, 1.9 or whatever.

There is no guarantee for a special LMP file to work with the new version!!

LMP file player's view change

Syntax:

lmpc (--change-player|-p) PLAYER lmpfile1 [lmpfile2]

Input File:

lmpfile1

Output File:

lmpfile1 or [lmpfile2]

Description:

LMPC reads the LMP file lmpfile1, changes the number of the player (0..3: new DOOM, DOOM ][; 0..7: STRIFE) with the main view (status bar, sound) in lmpfile1 or stores the result in lmpfile2.

To change only the main player byte works only with new LMP files, since old ones are always recorded from the view of the first player (no. 0) and there is no information about this in the header.

LMP file ``Wait'' (WT) tics addition

Syntax:

lmpc (--add-WT|-w) SECONDS lmpfile1 [lmpfile2]

Input File:

lmpfile1

Output File:

lmpfile1 or [lmpfile2]

Description:

LMPC reads the lmpfile1 and adds at the end

SECONDS * 35 * player number

empty (WT) game tics. This results in a SECONDS seconds longer LMP file.

With lmpfile2 the result will be written in lmpfile2. Without this parameter, lmpfile1 will be changed.

This option is very useful for contest LMP files with a long visible summary screen.

LMP file clean-up: ``Pause'' (PS, PE) tics

Syntax:

lmpc (--remove-pause|-r) lmpfile1 [lmpfile2]

Input File:

lmpfile1

Output File:

[lmpfile2]

Description:

LMPC reads the lmpfile1 and copies all game tics to lmpfile2. During the copy process LMPC scans the contents for Pause Start game tics (PS) and Pause End game tics (PE).

The PS game tic will be copied to lmpfile2 but with an empty ``use byte''; the game tics between PS and PE (inclusive PE) wont be copied.

Without the second filename LMPC will write to a temporary file and replaces at the end lmpfile1.

The game tic numbers of PS and PE are printed during the conversion.

You may have difficulties with the play back of such a patched LMP file. This is the case if you patch a LMP file of a level with a revenant (skeleton). The revenant uses a random number generator to choose between a self controlled rocket and a normal rocket. The input of this generator are the last two bits of the game tic number. This means you have to make sure that you cut a number of game tics divisible by 4. In general this is impossible so do not use pause in levels with a revenant. An arch vile makes similar difficulties but I don't even know how to prevent it.

LMP file clean-up: ``Save Game'' (SG) tics

Syntax:

lmpc (--clear-save|-c) lmpfile1 [lmpfile2]

Input File:

lmpfile1

Output File:

[lmpfile2]

Description:

LMPC reads the lmpfile1 and copies all game tics to lmpfile2. During the copy process LMPC scans the contents for Save Game game tics (SG). Every SG command will be cleared. With lmpfile2 the result will be written in lmpfile2. Without this parameter, lmpfile1 will be changed.

DEM/DM2 file repair: multi-level files

Syntax:

lmpc (--fix-multi|-f) demofile

Input File:

demofile

Output File:

demofile

Description:

Quake and Quake II have problems with the playback of multi-level recordings. They usually stopp at the first level change.

Read more about the background in the recording FAQ.

If the --fix-multi parameter comes without any conversion option on the command-line, LMPC repairs the demo file in question "in-place". This means LMPC overwrites the bad commands with nop or print.

The --fix-multi option can be used together with --to-bin and --to-txt. LMPC removes the offending commands in this case.

Game type determination

Syntax:

lmpc (--info|
      --change-version|
      --change-player|
      --to-txt|
      --add-WT|
      --remove-pause) (--game|-g) GAME binfile [filename ...]
Input File:

binfile

Output File:

action dependent

Description:

LMPC determines the game type of a LMP (binary), DMO (binary), DEM (text and binary), QWD (text and binary) or DM2 (text and binary) file very good. But it can't good distinguish between HERETIC/HEXEN and old DOOM LMP files. Moreover it can't distinguish at all between DOOM ][ Map 1-9 and new DOOM Episode 1 LMP files. The latter case is not very important but the first is more severe. To force LMPC to use a particular game type use --game. GAME can be DOOM, DOOM2, HERETIC, HEXEN, STRIFE, DUKE, REDNECK, QUAKE, QUAKEWORLD or QUAKE2 or the short form D, 2, H, X, S, N, R, Q, W or q.

2.3 Bugs and limitations

To distinguish between old DOOM, HERETIC and HEXEN LMP files I use a simple turn-byte-average algorithm. This fails, if the LMP file is too short or you turn always in the same direction and never go forward. Due to the header change in HEXEN 1.1, it is nearly impossible to distinguish fast between HERETIC and HEXEN 1.1 LMP files. LMPC looks then at the file date and treats files with an creation year >=1996 as HEXEN and all others as HERETIC files. This is totally stupid but what else can I do?

LMPC supports client side recorded DM2 files, DM2 files recorded by the console command serverrecord (working from Quake II version 3.15) and the RLA file used by the Quake II Relay project. One single DM2 file can even contain parts from all these sides. Quake II may only playback client side recordings.

If you produced a good recording file (at least some minutes and with some action) and LMPC can not detect the game type, please send it to me. Up to a corrected version make sure to use the --game option. Some hints to solve the problem are welcome as well.

The *number repeat code in LS files really repeats this line number times and does not care about multi player-game tics.

The MS-DOS binary of LMPC converts all file names to lower case to simplify the name handling. The tolower C-function doesn't converts any kind of special characters like ö or è. This can cause some severe data lost.

I use a redundancy in DEM files to detect Quake cheaters. My simple check will fail if the player gets hit and he gets a medikit at the very same time. This can happen, if a player is standing over a medikit, when the hit comes.

Some versions of Quake use a slightly different DEM format. LMPC/DEMcut can read this ``new'' format but they write the old 1.06 format. SQuake 1.07 for Linux behaves similar: it writes the old format but can play back the old and the new format.

Keygrip 2 writes DM2 files with non-conform bit mask values in sound, spawnbaseline and packetentities messages. LMPC tries its best to decompile even such bad files too but it may well be, that some other messages with bit masks have the same problem.


Next Previous Contents