home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 October / enter-2005-10.iso / files / turbosliders.exe / README-ai.txt < prev    next >
Encoding:
Text File  |  2005-09-25  |  8.1 KB  |  162 lines

  1. Turbo Sliders AI Information
  2. ----------------------------
  3.  
  4.   This document explains how you can modify the AI players in
  5. Turbo Sliders and how you can make new driving lines for the
  6. AI players. AI support was added in version 1.0.6.
  7.  
  8.  
  9. MODIFYING AI PLAYERS
  10.  
  11.   File ai/aiplayers.dat defines all the AI players in the game.
  12. You can change the name, color or skill for every player or 
  13. add your own new players. A new AI player is added with a line
  14. "AIPlayer <name>". It gets these properties:
  15.  
  16. * Skill: The skill group to which the player belongs to. When AI players 
  17. are added to a race, they are picked among the players that belong 
  18. to the right skill group. Skill value does not define as such how 
  19. good a driver the player is, and if you want, you may make some skill 
  20. groups have both good and bad players.
  21.  
  22. * SpeedFactor <val>: This value is multiplicated by the optimal
  23. speed value given by driving line files. If you make this value less
  24. than 1.00, the player drives slower than it should. Some tracks with
  25. jumps may override this value to make the players be able to complete
  26. critical jumps.
  27.  
  28. * LapClass <val1> <val2>: These values define how good driving lines the
  29. car picks. When a new lap is started, one new driving line is selected
  30. by random. The first value is the proportion of the best laps that are 
  31. not possible. The second value defines the other end, the greater it
  32. is the more bad laps are possible. For example, if the values are 
  33. 0.0 and 1.0, any driving line can be taken. If the values are 0.0 and 0.5, 
  34. only the best half of the laps are considered. If the values are 0.9 1.0, 
  35. only the worst tenth of the laps are possible.
  36.  
  37. * BestCarProb <val>: This is the probability (in percentage) for the
  38. AI player to select the best car (according to driving lines) for a race
  39. if it can choose which car to take.
  40.  
  41. * MaxSpeedUp <val>: The AI player can decide to increase SpeedFactor at most 
  42. by this value if a human player is ahead of it. The addition cannot make the
  43. value more than 1.00, though. Valid range from 0.0 to 0.5.
  44.  
  45. * MaxSpeedDown <val>: The AI player can decide to decrease SpeedFactor 
  46. at most by this value if a human player is behind it. Valid range is from 
  47. 0.0 to 0.5.
  48.  
  49. * MaxLapClassChange <val>: If this is more than 0, AI player can decide
  50. to prefer better or worse laps than normally (to make the race tighter 
  51. against human players). The valid range is from 0 to 0.5. If the value 
  52. is 0, all laps within LapClass are possible. If it is 0.5, only half 
  53. of the laps may sometimes be possible.
  54.  
  55. * Color <color>: This defines the color of the player. The color is
  56. defined either in a short or long form. In the short form, there
  57. is only one solid color (given in hexadecimal number). In a long form,
  58. there is first a number defining color mode and then three colors.
  59.  
  60.   When any of these values is defined in the file, all the following
  61. players will have the previous value until a new value is given.
  62. By default, all players in the same skill level have the same values
  63. for SpeedFactor, LapClass, BestCarProb etc. but if you want, you can
  64. change them anywhere.
  65.  
  66.  
  67. CREATING DRIVING LINES
  68.  
  69.   AI players can only drive in a race if they have driving lines
  70. made for the track and their car. If you want to drive against
  71. AI with a new car or track, you need either to get a new driving line
  72. file from someone else or make one yourself. The driving lines are 
  73. defined in the lap files under the ai directory. The game first
  74. tries to find <trackname>.lap.gz, then <trackname>.lap, then
  75. <trackname>.lap.new.gz and finally <trackname>.lap.new. If the
  76. file ends with gz, it is packed with GNU zip. You can get it from
  77. http://www.gzip.org/ but many other unpacker programs can open gz files,
  78. too. The unpacked version of the lap file is a text file but generating
  79. laps manually is virtually impossible. Below is explained what you should
  80. do instead.
  81.  
  82.   To make new driving lines, you must run the game with the command
  83. line option "-airecord 1". See the bottom of this document on
  84. how to do this if you don't know. If you run the game with this option
  85. and drive a track alone without any AIs or other players, your laps 
  86. are recorded. You will see text "AIRec" in the corner and all other laps 
  87. but the very first one will be appended to file ai/<trackname>.lap.new. 
  88. After you have recorded a set of laps, you can open the file with a text 
  89. editor and remove laps that were bad. A lap definition is started with "Lap"
  90. and ended with "End" so remove them and everything between them to get
  91. rid of the lap. The recorded laps of a session are ordered by time. Note 
  92. that if there already is a lap file, the new additions in lap.new are not 
  93. taken into use until you either remove the lap file or append the laps
  94. in lap.new to it. 
  95.  
  96.   One big problem is that if you drive very close to obstacles, it is
  97. very probably that the AI drivers will often hit them. This is
  98. especially true with cars like Slider which require lots of sliding.
  99. The AI can't follow the lines exactly and it will result in
  100. problems. There is a special command line option that can be used to
  101. test which driving lines are working.  If you run the game with
  102. "-lapdebug 1", the game runs in the windowed mode, AI Fill is 20 and
  103. an accelerated ghost race is driven. All laps are tested in order
  104. (ignoring LapClass). Debug information about laps is put to output.txt
  105. and by searching lines which do not contain "coll: 0" you can find
  106. which laps caused the AI to collide on obstacles. If you want to make
  107. your lines as good as possible, set AI skill to 5/5 and the number of
  108. laps to something big like 20, and then make the AI drive a
  109. race. Then, check output.txt, open the lap.new file and remove the
  110. laps that caused collisions. This can be very painful since some
  111. tracks can require you to remove many good lines and drive new lines
  112. until you finally find working ones. Try not to go very close to
  113. obstacles especially in inner curves.
  114.  
  115.   About 10-20 laps per a track and a car is probably a good number. The
  116. default driving lines were usually done so that about 50 % of the laps
  117. are good ones and the rest get gradually worse. This way, the high skill
  118. AIs will get the best laps and the lower skill AIs get slower laps and
  119. more variation. 
  120.  
  121.   If the track contains jumps that must not be missed (like Westleap),
  122. you can set MinSpeedFactor by adding a line like "MinSpeedFactor 0.95"
  123. in the lap file. All driving lines that follow that line will be marked
  124. such that even bad AI players cannot have speed factor less than that. 
  125. This way, even low skill AIs should be able to get over the jumps. 
  126.  
  127.   If you are making driving lines for a set of cars for a track, it
  128. is usually best to work with one car at a time. Save the finished lap.new 
  129. files for certain cars to different directories and finally, when every
  130. car is finished, combine them all to one lap file. If you want, you can
  131. then pack the file with gzip to save space (as was done with the default
  132. lap files).
  133.  
  134.  
  135. RUNNING THE GAME WITH DIFFERENT COMMAND LINE OPTIONS
  136.  
  137.   In Windows, there are at least two ways on how you can run
  138. the game with different command line options. The first one
  139. is to use command prompt (assuming Windows XP or similar):
  140.  
  141. 1) Select Start->Run... and write cmd.exe and press enter.
  142. 2) Go to the Turbo Sliders directory, for example like this:
  143.    cd "C:\Program Files\JollygoodGames\Turbo Sliders\"
  144.    (or wherever you installed the game).
  145. 3) Run the game by adding your command line options after sliders.exe.
  146.    For example, if you want to use "-airecord 1", write
  147.    "sliders.exe -airecord 1" and press enter.
  148.  
  149.   Another possibility is to create a new shortcut of sliders.exe
  150. using Windows Explorer. To do this, go to the Turbo Sliders
  151. directory, right-click sliders.exe and select "Create Shortcut".
  152. Now right-click the new "Shortcut to sliders.exe" and select
  153. "Properties". Now, add your command line parameters in the end of
  154. the target line. For example, make it like this:
  155.  
  156. "C:\Program Files\JollygoodGames\Turbo Sliders\sliders.exe" -airecord 1
  157.  
  158.   Click Ok. Now you can run the game with the given command line
  159. parameters by double-clicking the shortcut. You can also rename 
  160. the shortcut to something else, like "sliders_airecord.exe" 
  161. to know what it is (and make new ones for other command line options).
  162.