RoboRoute 0.3
=============

AUTHORS: SquirrelOfDeath, {BEE}Shoddy[KE]


DESCRIPTION:

RoboRoute.vl2 contains a client- and server-side script to record sets 
of routes and have bots play them back for you.  You might find this
useful for practicing your chasing, shocklancing, shrike ramming, 
body-blocking, etc.

You might also find it useful for showing routes to your tribemates,
although the bot won't replay things as precisely as a demo would.
However, your teammate can run right behind the bot rather than try to
remember which bit of terrain you hit in a demo.


***DISCLAIMER***

While I think these scripts are safe, and have not had reports of any
serious problems caused by running these scripts, there may be
unintended side-effects.  In particular, I would not load this on a
server you use for matches.


INSTALLATION

Copy RoboRoute.vl2 to your <Tribes2>/GameData/base directory.  The
server-side script requires no additional scripts to run; however the
client-side script requires the support.vl2 package.

The script creates the following new keybinds:

    Robo Spawn Bot
    Robo Setup Record
    Robo Start Record
    Robo End Record
    Robo Delete Bot
    Robo Options


RECORDING CONCEPTS

Each route recorded using RoboRoute must be assigned to a "group".
RoboRoute uses the following directory structure when saving routes:

    RoboRoute/<MapName>/<TeamNumber>/<GroupName>/<RouteName>.cs

For example:

    RoboRoute/Katabatic/2/Back Cap Routes/Down Middle.cs

is route on Katabatic, Inferno Side, in the group "Back Cap Routes",
with the name "Down Middle".


RECORDING A ROUTE

To record a route, switch to the appropriate team and suit up (the bot
will spawn using the gear you are wearing when you start recording).
Use the "Robo Setup Record" command to choose a group for the route
(you can create a new group if necessary using the "New" button), and
give the route a name.  When you're ready to start recording, hit the
"Robo Start Record" key.  Note: you must be a SuperAdmin on the server
to record routes.

When you have completed the route, hit the "Robo End Record" key to
save the route. 

Note that if you are in a vehicle when you start recording, the entire
route will be played back using that vehicle (even if you jump out).

If you die while recording (or if your vehicle dies if you're
recording a vehicle route), then recording will be aborted and nothing
will be saved. 

Only one person on the server can record at a time.


REPLAYING ROUTES

To have a bot replay a route, hit the "Robo Spawn Bot" key.  You will
be able to choose from routes that have been recorded for the enemy
team.  Choose a group, and a specific route if desired (or let the
script pick a random route for the bot).  By default the bot will loop
its route indefinely until it is deleted. 

If you do not specify a name for the bot, a name will be automatically
assigned.

There is no limit to the number of bots that can run at the same time
(other than the server's player limit).  Turning off bot AI should
help reduce server load if you plan on having a large number of bots.


DELETING BOTS

Use the "Robo Delete Bot" command to bring up a GUI that will allow
you to delete specific bots.


OPTIONS

Use the "Robo Options" command to display an options dialog.  From this
dialog you can set the following options:
- Bot AI On/Off
- Bot AI Skill Level
- Lethal Bodyblocks On/Off
- Bodyblock Sound On/Off
- Minimum Bodyblock Speed (this is the minimum speed that a bot must
  be travelling in order for a collision to be recognized as a
  "bodyblock")

You must be an admin on the server to change any of these options.


HOW IT WORKS

A recorded route remembers your starting position and velocity, then
takes a snapshot of your velocity 20 times per second. A bot plays it
back by having the recorded velocities applied to them (also 20 times
per second). 

The route also takes a snapshot of your position and orientation every
second.  When a bot plays the route back, the script compares the
bot's position to the recorded position, and applies a correction to
the bot's velocity in order to bring it back to the correct position
at the next position snapshot.  If the error in the bot's position 
becomes greater than 10 m, the bot is warped to the correct position.

Bodyblocks are detected by comparing the player's velocity relative to
the bot's.  The player must hit the bot in a direction opposite to
the bot's direction of travel for the collision to count as a
bodyblock.  Also, the bot must be travelling at a certain minimum
speed (set in the options dialog).


USING ROUTES RECORDED WITH VERSION 0.1

While the route format has changed, this version can still read the
old route format.  You will need to move the route's .cs file to the
appropriate group directory, however.


OTHER NOTES

- Don't bother trying to ELF a bot. These don't jet using their own
  energy, they are just dragged along according to the route.

- If you want to adjust the shot accuracy of the bot, you can open
  the console and set $RoboRoute::Skill = 0.5; or whatever number you
  like between 0 and 1. The default value is 0.75. This will not work
  if you are just a client connected to a server.

- Recording a long route makes the server have to remember a lot of
  velocity snapshots.  Also, the server may freeze up momentarily the
  first time it tries to load a long route.

- If the bot AI is enabled, the bots tend to face towards their flag
  while following the route.  To avoid this (to practice shocklancing
  HO, for example), disable the bot AI.


CHANGELOG

Version 0.3 - SquirrelOfDeath
- Added Options Dialog
- Added body-blocking options (lethal BBs, BB sound)

Version 0.2.1 - SquirrelOfDeath
- Bots now gradually correct their route when they are off course; 
  results in better route tracking
- Fixed a bug that caused a UE when the bots capped out

Version 0.2 - SquirrelOfDeath
- Named groups and routes 
- A GUI for recording, spawning, and deleting bots 
- Bots can "loop" their routes 
- Can have multiple bots running simultaneously 
- Basic vehicle support (if you start recording in a vehicle, the
  route will be played back using that vehicle)
- If bots get too far off course, they "warp" back to the correct position 
- Clients can toggle the bot AI on/off 
- Bots spawn with the loadout you had when you recorded the route 
- If you create bots in a pre-match countdown, they won't spawn until the 
  match starts 

Version 0.1 - {BEE}Shoddy[KE]
- Initial release
