A guide to editing .RMP files for XCOM (UFO Defense) and TFTD

1) You will need a hex editor. I would suggest a windows based editor for ease
   of use.

2) As an example, I will edit UFO_110.RMP and replace all alien positions.
From MAPED, I want    row column level   In the RMP file,  row   col  lvl
new positions at:      4     5     1     these correspond   03    04   01
                       4     6     1     to the following:  03    05   01
                       5     3     1                        04    02   01
                        and so on...                         and so on...
Unfortunately, the MAPED and RMP coordinates are different. MAPED levels start
at ground level (1) and increase as you go up. In the RMP files, the level at
the roof of the UFO is usually zero (0) and increases AS YOU GO DOWN! In MAPED,
the upper left hand square is located at (01,01) (row,column). In the RMP
files, this corresponds to the location (00,00). Also, the MAPED numbering is
in decimal, but the RMP files are written in hex! So for a MAPED coordinate in
a battleship (four levels) located in the bridge (next to the nav units) just
before the door is: row=15 col=6 lvl=3
        To place into the RMP file, it translates to: row=0E col=05 lvl=1
(where 15 is 0F in hex, but subtract one due to upper left square difference,
so 15=0E; now for col=6, subtract one to get 05. Since this level is only one
level below the roof, lvl=1). 

Actual Editing:

3) Open UFO_110.RMP. The first few lines look like this:

00000000  0804 0100 FD05 OOFC 0100 FB05 0001 0202
00000010  0705 0004 0202 0001 0604 0100 0002 0202
00000020  0202 0302 02FF 0000 FF00 0000 0201 000A
00000030  0403 0100 0102 0204 0202 FF00 00FF 0000
AND SO ON...

To find all placements for aliens one level BELOW the roof search for the
hex string 0100. There are three such strings in the example above. They
correspond to placements at row=8 col=4 lvl=1 (line 0)
                            row=6 col=4 lvl=1 (line 10)
                            row=4 col=3 lvl=1 (line 30)

For UFO_110.RMP there are a total of seven placements for aliens WITHIN the
UFO. Now, to change the placements to those shown above, simply overwrite
(do NOT delete) the 0100 strings:

00000000  0304 0100 FD05 OOFC 0100 FB05 0001 0202
00000010  0705 0004 0202 0001 0305 0100 0002 0202
00000020  0202 0302 02FF 0000 FF00 0000 0201 000A
00000030  0402 0100 0102 0204 0202 FF00 00FF 0000
AND SO ON...

You will notice that there is an evident pattern to the location of these
strings. The remaining strings in this file are a mystery to me, but may
have to do with the path that each alien takes during play. I try not to
change the facings so that these files are easier to edit.

With some practice this all becomes second nature (believe it or not). When
dealing with the larger UFOs, you may end up replacing dozens of starting
locations, but it beats having aliens materialize within walls! (a la
Philadelphia Experiment)

Remember, have patience and always check your work!

Enjoy!
Robert (RFIOR@MSE.UFL.EDU)
