                             LP-Editor version 4.0
                           =========================

**********************************
  BACKGROUND INFORMATIONS:
**********************************
  1. What do LP-files contain?
  2. The structure of an LP-file.
  3. What is the Coriolis Force?
**********************************



1. WHAT DO LP-FILES CONTAIN ?
==============================

Each racetrack has 9 LP-file. In NASCAR Racing 2 there are 10. These tell the
program, in different situations how to drive AI-cars:

  maxpanic - During an accident on the track, if the car is left-hand side
             from the center line, PROBABLY. Does not known correctly.
  minpanic - During an accident on the track, if the car is right-hand side
             from the center line, PROBABLY. Does not known correctly.

  (I discovered that panic laps are also used under yellow flags, when you
   should be in front of an AI-car -but somehow you stacked behind him-,
   AI-cars use the low speed, which is stored in this file, and you can get
   in front of them. After it they probably get back the 'pace.lp' file.)

  maxrace - During passing other car on the left, PROBABLY. Does not known
            correctly.
  minrace - During passing other car on the right, PROBABLY. Does not known
            correctly.
  pace - Under yellow flag conditions, if car is not blocked by the pacecar.
         If temporary speed stored in this file, is below the pace speed-
         limit then pacecar drive as fast as this file allows, otherwise
         pacecar drives at the maximum available pace speed-limit. This speed
         is not altered by the opponents' strength percentage, and this
         speed-limit is coded in the track's TXT-file, at the TTYPE keyword.
  (You have to think when edit this file, that pacecar is also uses this
   file, so you should not give too high speed values in the corners, because
   pacecar's driving will be unreal - you also have to know, that during
   pacelap cars drive in two conwoys, so you cannot use the racing-line
   trajectory in this file because AI-cars will drive off the track and this
   will be unreal too. I also recommend because of these, that reduce the
   horsepower values of the pacecar to 200...250, and also the traction and
   aggression values of the pacecar in the 'drivers2.txt' file to drive just
   like my granny.)

  pass1 - During being passed by other car on the left.
  pass2 - During being passed by other car on the right.
  pit - During a lap which ends by a pit entrance, and the next lap starts
        by a pit exit - it is quite similar to 'race.lp' where car not
        running in the pitlane.

  (I do not know, when the game decides that a car will enter into the pit
   at the end of a lap, how the game decides, that when have to switch from
   'race.lp' to 'pit.lp', and also after exiting the pit, when have to switch
   from 'pit.lp' back to race.lp'. This also should be clear for correctly
   editing this lap.)

  race - During green flag, it is the ideal racing-line trajectory and speed
         on the track, and probably this file is used under qualifying, and
         practice session too.
  spot1 - This only appears in NASCAR Racing 2. I have not got this game, so
          I have only idea what it is for: maybe used for badly damaged cars
          towed into the pits.

If you have discovered much more about these files, I would be very glad if
you have transmitted it to me, and I could add more infos to this
documentation.



2. THE STRUCTURE OF AN LP-FILE.
================================

Each file starts with a header. It is a long integer data (4 byte), which
contains the length of the file (the number of records following). Each
record equal 1 Unit length of the track. 1 Unit is about 11 feet, 3.35
metres. For example, Elkhart Lake: 4.0 miles = 1935 Units (records).

  If you want to understand the HEX datas, here is the procedure:
  Each 4 byte-long value is stored in this form: "ABCD". 'D' is the highest
  digit (256^3) and 'A' is the lowest digit (256^0 ==1). If you use a HEX-
  editor, or a HEX >>> DEC calculator then you should type this: "DCBAh",
  where A,B,C,D are the HEX digits, and 'h' means the HEX-system. The
  calculator and also the game produces DEC value from LP-files' HEX datas
  by reading together four bytes, which means together a HEX number, and
  this is converted into a DEC number. If you have not got a special HEX-
  editor, I recommend the DOS Navigator's VIEW > HEX, and CALCULATOR options
  to discover much about these datas, or editing.

After the header there come the records. The records start&end near at the
start/finish line, so the first and last record is always the same. Each
record contains three fields, which are coded into signed long integer
(4 byte) values. The fields are:

SPEED: The ideal speed, which AI-cars try to reach at that point of the
  racetrack; if it is too much in a corner they maybe spin out. Speed datas
  should be multiply by a 0.0017 constant to get the data in [mph].
  (I calculated it from 'pit.lp' > the speed in the pitlane will be correct
  by this 0.0017 constant).

?????: I do not know what it is, but I have some ideas - I think it is the
  "Coriolis Force", much about it later. I simply divide these datas by 1000
  to get manageable values.

POSITION: The transversal position on the track, where AI-cars heading toward
  at the next point of the track. Position is more positive, when the car
  is left from the centerline, and more negative, when right. I multiplied
  these values by a 0.00017 constant to get values in [ft]. (I get this
  number from the comparison of LP-files and SealSoft's TLMetry program,
  available on The US Pits Website: www.uspits.com/workshop.html )

  Position numbers do not match always with the track's boundaries. Of course
  in the pitlane, or in some LP-files this number could be higher, for
  example in 'panic' files. These kick on probably, when you stop on the
  track, in front of an AI-car. AI-cars get the 'maxpanic.lp' or 'minpanic.lp'
  when they reach that point on the track, and they start revolving by
  staying in one place. It is done, because you blocking them, and the
  POSITION field in the 'panic' files are about 1000(! it is well off the
  track) in some place, which gives the chance to AI-cars to drive round you
  if they can. But mostly they have no room for this maneuvre and they just
  keep revolving stupidly. These values should be maximally the width of the
  track and then maybe AI-cars move more real. As I saw NASCAR2's LP-files
  already programmed this way.

  These infos come mainly from Corey Rueckheim's website (Thanx a lot!) and
  from testing my program > LP-Editor, and also by playing the games itself.



3. WHAT A HELL IS THE CORIOLIS FORCE?
======================================

As we know in phisics, the Force=Mass*Acceleration (Thanx a lot Mr. NEWTON).
In a spinning coordinate system there are several forces effect on a Mass,
spinning together with the coordinate system. If the Mass changes its
distance from the spinning centerpoint -I mean it is accelerating-, an
additional force is appearing. This is the Coriolis Force:

                        2 * speed of radius change
  coriolis acceleretion=-------------------------- * circumferential speed
                            temporary radius

  coriolis force=mass*coriolis acceleration

It is the same, when a car taking a corner by changing the radius of
cornering during the maneuver - like real racing cars do. In the game the
second fields of records in an LP-file contain something similar like the
coriolis force, because these datas significant only when the AI-car
cornering, and it depends on car come closer or farther from the centerpoint
of a corner. If I am right about this field of records in LP-files, I think
these values are used by the game to HELP deciding whether AI-cars spin out
at that point of the track or not. So in the game:

                        2 * transversal speed on the track
  coriolis acceleretion=---------------------------------- * driving speed
                                radius of cornering




--------------------- from the author :

Sziksz Rbert, as Sierra.  -  e.szikszo@sc.bme.hu
Technical University of Budapest (BME), Hungary.
1997.nov.10.