Title    : FrikBot Way Studio
Filename : frikway1.zip
Version  : 1.2
Date     : 7-3-2000
Author   : Ryan "Frika C" Smith
Email    : frika-c@earthling.net
Credits  : Raymond Martineau for the original Waypoint Editor for the Frikbot

Type of Mod
-----------
Quake C  : yes
Sound    : no
MDL      : yes (optional bolt.mdl to make editing easier)
Level    : no

Format of QuakeC (if a Quake C Mod)
-----------------------------------
unified diff  : no
context diff  : no
.qc files     : yes 
progs.dat     : yes


Contents
--------
I. Description
II. How to install the Modification
III. About the Bolt.mdl
IV. Basic Edtor Concepts
  A. Waypoints
  B. Links
V. Menu Options and What They Mean
  A. Main Menu
      1. Waypoint Management
      2. Link Management
      3. Bot Management
      4. Waygrid Management
      5. Set Noclip Mode
      6. Teleport to Way #
      7. Set Hold Select
      8. Set God Mode
      9. Waypoint Info
      10. Close Menu
  B. Waypoint Management
      1. Move Current Waypoint
      2. Delete Current Way
      3. Create Waypoint
      4. Delete waypoint from path
      5. Create Waypoint in path
      6. Toggle Door flag
      7. Make Way + Link
      8. Make Way + Link X2
      9. Link Management
      10. Main Menu
  C. Link Management
      1. Unlink current Way
      2. Create link
      3. Create Telelink
      4. Delete Link
      5. Create Link X2
      6. Delete Link X2
      7. Create Waypoint
      8. Waypoint Management
      9. Main Menu
  D. Bot Management
      1. Add Bot
      2. Order Bot here
      3. Remove Test Bot
      4. Stop Test Bot
      5. Teleport Bot here
      6. Teleport Command
      7. Main Menu
  E. Waygrid Management
      1. Delete All Ways
      2. Waypoint Dump
      3. Check for Errors
      4. Save Waypoints
      5. Dynamic Mode toggle
      6. Dynamic Link Toggle
      7. Main Menu
VI. Impulses
VII. Info for Mod Authors
VIII. Advanced/Misc
  A. Savedgamecfg Options
  B. Hotkeys
IX. Known Bugs
X. Technical Problems
  A. D_SurfCacheGuard: failed
  B. Ed_Alloc: No Free Edicts
  C. Cbuf_AddText: Overflow
XI. Revision History
XII. Availability

I. Description of the Modification
----------------------------------

When I finally got to use my own editor in actually attempting to create good
waypoint maps for the FrikBot, I found it even more cumbersome than I had
anticipated. This update to Way Studio is an attempt at improving usability
and efficiency. 

The primary purpose of this mod is editing of waypoints for FrikBot, Frik-TF
and any other mod that includes the FrikBot version 0.09+. If you don't know
what I'm talking about, this is probably not for you. Please visit
http://www.mdqnet.net/frikbot/ for more details.

A waypoint represents a single spot on the map a bot can reach. Without a
pre-made .way file of a map when playing FrikBot, the player spawns waypoints
behind him. A good demonstration of this is to run FrikBot and issue the
console command "developer 2". If you do try this, you will notice that the
waypoint map is, well, very inefficient and sloppy. Because of the limitations
placed on the code, this waypoint editor, and others like it, have been created.

II. How to Install the Modification
-----------------------------------

Make a sub directory (called a sub folder on some systems) of your Quake
directory entitled "frikway", then place all files in this archive, using
your favorite un-zip utility, in that folder.

Create a "maps" folder directly under that to contain the maps you want to
waypoint for and your completed waypoint maps.

Run Quake with the command line "-game frikway -condebug -listen 16"
(without quotes). Change map to the map you want to edit the waypoints for.
When you're finished editing, use the Dump Waypoints command, then quit
Quake. Next, Locate the qconsole.log file in your frikway folder. Using a
text editor, cut or copy the text between

// begin waypoint dump - maps/dm6.way

and

// end waypoint dump

Place the text into a file with the filename of that first line ("maps/"
means in the maps folder, that is not part of the filename), you now have
waypoints that will run with FrikBot (or any FrikBot mod).

III. About the bolt.mdl
-----------------------
Included is a small bolt.mdl file, a bright red beam. Placing it in a sub
directory of frikway called "progs" makes editing slightly easier, as you can
better see where each waypoint is when dealing with the links. If you are
using GLQuake and decide to use this, it will look odd unless you remove
the glquake meshes by deleting any glquake folder in your frikway/ or id1/
folders.

IV. Basic Editor Concepts
-------------------------
A. Waypoints
============
Waypoints, which are used to define an are (in the loosest sense) are
represented by "bubble" sprites. When you get close to a waypoint, in the
default mode, the waypoint will become "selected" (sometimes referred to as
"current way" or just simply "here"), and will appear. Once selected, a
waypoint can be modified using the menu commands.

B. Links
========
Once selected, a waypoint will display it's links as bolts of lightning to
other, nearby waypoints. A link represents a one directional path exists
from the current waypoint to the waypoint it links to. There are two
types of links: normal and telelinks. Teleinks mean that a trigger_teleport
exists between the two waypoints, and also signifies to the pathing code
that it should not try to measure the distance between the waypoints, since
the bot can travel between them near-instantly. A waypoint can have 4 links
and no more. There is no limit to the number of waypoints that can link to 
a single waypoint however. In other words, 4 out-bound links maximum, unlimited
in-bound links. [There are ways around this, however, using two waypoints in
relatively close proximity, linked to one another can yield more out bound
links for example.]

V. Menu Options and What They Mean
-----------------------------------

A. Main Menu
============
1. Waypoint Management - Takes you to the waypoint management menu. The menu
contains functions for moving, modifying and handling waypoints.

2. Link Management - Takes you to the link management menu. This menu contains
options for changing the links between waypoints.

3. Bot Management - Displays the bot management menu, which allows you to add,
remove and control Test Bots.

4. Waygrid Management - Brings you to the way map management menu. This menu
contains various commands that take effect through the map (and also contains
a few seldom used commands that didn't fit anywhere else)

5. Set Noclip Mode ON - This is the same as the "noclip" console command, but
due to the fact that FrikBot Waypoint Studio is meant to be run in multiplayer
mode, where the noclip console command is disabled, it has been added here.

6. Teleport to Waypoint # - This option allows you to type in the number of a
waypoint, after pressing whatever key you have bound to impulse 105, you will
instantly appear there. Please make sure you have turned of Dynamic mod before
using this command.

7. Set Hold Select ON - Turns on "hold selection", which allows you to move away
from your selected waypoint while still keeping it selected. Note, do not use
this when creating/deleting links, you will not be able to select the second
waypoint to which you want to create/delete the link from.

8. Set God Mode ON - Turns on god mode, which is identical to the regular Quake
cheat "god". It's available here due FBWS running in multiplayer (deathmatch)
mode and for greater convenience.

9. Show Waypoint Info - Prints some information about the current waypoint,
including what it's linked to, it's waypoint number and status of the door flag.

10. Close Menu - This will dismiss the menu, allowing you to play the mod
normally. You will need to use impulse 101 to bring the menu back.


B. Waypoint Management Menu
---------------------------

1. Move Current Way - Brings the current waypoint (indicated by the yellow
"light ball") to your position. Nothing else about the waypoint is changed.

2. Delete Waypoint - Deletes the current waypoint. Note: this will alter the
waypoint numbers of all other waypoints on the map.

3. Create Waypoint - Makes a new waypoint at your current position.

4. Delete Way from Path - This is an advanced command, it deletes the selected
waypoint and transfers all inbound links to the selected waypoint to all
outbound links. This can be used to "tidy up" long hallways where a lot of
waypoints are created along the path, connected one to the next (You only
need waypoints at corners and junctions, really)

5. Create Way in path - Another advanced command, when pressed, the selected
waypoint will become the first in the path you want to add to. You need to
select a second waypoint to create the new one between. The new waypoint
automatically connects itself to both waypoints you chose, based on how the
original two were related. The original two are then disconnected from
one another. This would be used to add a joint in a path that the original
waypoint map didn't have enough waypoints to make adequately. This is hard to
explain, just use it and you'll understand.

6. Toggle Door flag - There should be little reason to toggle the door flag,
but it's here if you need it. The door flag indicates to the bot that a
func_door was below the waypoint when it spawned. The bot will attempt to
activate the func_door if there is no func_door present now. This is useful
for platforms that extend over a surface (DM1, DM2), and certain types of
elevators.

7. Make Way + Link - This is a very useful command that speeds up the
waypointing job considerably. It, as the Create Waypoint command does, creates
a waypoint at your current location, but it also creates a link from your
selected waypoint to the new waypoint. (Also since you're closest to the new
waypoint, after creating and linking it, unless set hold select is on, it
will become selected).

8. Make Way + Link X2 - Like it's sister command, Make Way + Link, this
command creates a new waypoint and links it to the old selected waypoint.
The difference is that 2 links are created, one from the new waypoint back
to the old one, and one from the old one to the new waypoint. (Two way
linking, see Create Link X2)

9. Link Management - This command brings you to the Link Management menu,
I found that when creating a waypoint set, I often flipped between both menus
far too often, and this has been added here for convenience.

10. Main Menu - Brings you back to the main menu.

C. Link Management Menu
-----------------------

1. Unlink Current Way - removes all links from the current waypoint. Note -
There is no "are you sure" on this, it just does it, so be careful.

2. Create Link - Allows you to create a link from the current waypoint to
another. The program will prompt you to move to another point and press 1 to
create the link. Note the link you create is one way, from the waypoint you
started at to the waypoint you ended up at.

3. Create Telelink - Just like Create Link but indicates a teleporter in the
middle. Telelinks are indicated by a thinner lightning than regular links.

4. Delete Link - Deletes a link (Tele or normal) between to waypoints. You
will be prompted to move from the waypoint that has the link to the waypoint
that receives the link and press 1.

5. Create Link X2 - Similar to 3, creates two links, both ways between two
waypoints.

6. Delete Link X2 - Similar to 4, deletes links both ways between two
waypoints.

7. Create Waypoint - Same command as the create waypoint on the Waypoint
Management Menu. Here for convenience.

8. Waypoint Management - - This command brings you to the Waypoint Management
menu, I found that when creating a waypoint set, I often flipped between both
menus far too often, and this has been added here for convenience.

9. Main Menu - Brings you back to the main menu.

D. Bot Management Menu
----------------------

1. Add a test bot - Connects a stripped down FrikBot that does little more than
follow waypoints.

2. Order Test Bot Here - Causes the test bot to come to your location. The bot
will announce each waypoint he's moving towards so that you may notice
problems in the way map even when you can't see the bot.

3. Remove Test Bot - This disconnects the bot (removes him from the server).
This is the same as the impulse command 102. It is recommended that you remove
test bots before dumping waypoints, as they may cause messages to appear that
will ruin the dump info.

4. Stop Test Bot - This causes the test bot to stop whatever he is doing and
stand still.

5. Teleport Bot here - Moves the test bot to your currently selected waypoint.
This can be useful in testing certain areas of the map, be careful not to be too
close to the selected waypoint, or you may become stuck inside the bot. If you
do, you can use the teleport and/or the noclip command to free yourself.

6. This is the same as the Main Menu Teleport to Way # command. It is useful
when dealing with bots, so it is here for convenience.

7. Main Menu - Brings you back to the main menu.

E. Waygrid Management Menu
--------------------------

1. Delete ALL Waypoints - Erases the entire waypoint map so you can start over.

2. Dump Waypoints - This dumps the waypoint data (in .way file format) to the
console. If you run Quake with -condebug as prescribed in the FrikBot readme,
you can save the waypoints as a way file to be used with FrikBot or when you
load the waypoint editor again.

3. Check for Errors - Checks every waypoint for "duds". These are waypoints 
with no outbound links. A waypoint should always have at least on outbound link
incase a bot reaches the waypoint, even if it is at a dead end. IF a situation
is inescapable, remove the dud waypoint for improved performance with the bot.

4. Save Waypoints - disabled. I coded this, but it had a tendency to crash, so it
was removed :(

5. Set Dynamic Mode ON - This will turn on the automatic spawning of waypoints.
This is a simple way to cover a large area of the map rapidly, however
problems can arise that will need to be fixed. Remember to turn off dynamic
mode before using other editor features, or else you might cause problems
with the way map.

6. Set Dynamic Link ON - This option allows you to use only the dynamic linking
portion of Dynamic mod to allow you to quickly link up an area of a map simply
by walking between the waypoints.

7. Main Menu - Brings you back to the main menu.

VI. Impulses
------------

100 - Add a test bot (Also on main menu)
101 - Bring up the menu (if it has been closed) Or dismiss & cancel current
prompt / menu
102 - Remove a test bot
103 - Bot cam cycle (not needed for Waypoint Studio)
104 - Dump waypoint data (also on main menu)
105 - Bring up waypoint warp !Bind to Enter! (also on main menu)
106 - Execute HotKey

!!!Bind 0 to impulse 10, you need it to navigate menus!!!

Any suggestions, please mail me at frika-c@earthling.net

VII. Info for Mod Authors
-------------------------

You can make a waypoint editor that will run your mod by installing the
FrikBot, then copying the included .qc files over the frikbot files of the
same name. The included progs.dat is exactly this over the v106qc.

FBWS must be compiled with frikqcc. See the Availability section of this
readme for where you can find it.

VIII. Advanced/Misc
-------------------
A. Savedgamecfg Options
-----------------------
1. Setting "savedgamecfg 1" will cause FBWS to print out a "signature"
comment at the top of a waypoint dump. This was added to make submission
to the FWD (http://www.mdqnet.net/frikway/) a bit easier. Contained in
this comment is the name of the map, the name of the author (you, taken
from your current netname on the server) as well as the filename of the
.way list.

2. Using "savedgamecfg 2" will prevent FBWS from indicating where breaks
should occur in the .way file. Normally, it will print "**** break here ****"
in a comment as well as an exec for the next part to flag to you to
separate the file. IF you prefer to do waypoints the old fashioned way,
you can disable the feature with this option.

Note: You can add these options together, for instance, if you wanted
the signature comment and no flagging of breaks, use savegamecfg 3, also
note that Quake will also save this configuration across sessions.

B. Hotkeys
----------
To make the editor even quicker to use, it was requested that a system
be added to allow you to bind your most used commands to separate keys.
I eventually landed on this hotkey system, which I think is pretty slick.
It allows you, through the use of the cvar "gamecfg", to specify the menu
and option you want to execute, making it pretty advanced and useful.

Below are the gamecfg numbers for each (ordinary) menu:

Main Menu = 16
Waypoint Management = 32
Link Management = 48
Bot Management = 160
Waygrid Management = 176

How this works is you add the number you would press for a particular
command on the menu to the menu number and then bind that, and impulse
106 to a key.

For instance, if you wanted the mouse1 button to create waypoints, Waypoint
Management, 32, plus menu option 3 is 35. So:

bind mouse1 "gamecfg 35; impulse 106"

It's difficult to explain, but thankfully you don't need it to run the
program :)

Technical Details
-----------------

Known Bugs
----------
"Save Waypoints" feature on the Waygrid Management menu is not yet available.

Bot has some odd behavior (not responding to "Order Bot Here" occasionally,
etc)

From Raymond Martineau's Frikway readme....

Technical Problems
==================

"D_SurfCacheGuard: failed"
--------------------------

This problem can occur when you look directly at a waypoint when it is
linked to another waypoint at point blank. To fix this, you will need
run the command line parameter "-surfcachesize 1500" when you run
quake. If you still get the message, increase the value until the error
disappears.


"Ed_Alloc: No Free Edicts"
--------------------------

This problem can occur with large maps that require a lot of waypoints.
The only way to fix this, is to use a more efficient waypoint list
(unlikely), or to recompile the Quake source code, after setting
MAX_EDICTS in quakedef.h to 1024 (or higher).


"Cbuf_AddText: Overflow"
-----------------------

If you receive this message, the waypoint list is too large for a single
file. You will need to do some black magic to get the waypoints working.
First, you will need to open up the waypoint file in a text editor.
Highlight all text from the middle of the waypoint list to the end of the
list.  Cut this text from this file, and paste it into a new file (such as
maps\dm1.wa1).  At the end of the first file, add the following line:

exec maps/dm1.wa1

You will need both maps/dm1.way and maps/dm1.wa1 to get the waypoint
list to work.


Revision History
----------------

Changes Since Version 1.0
-------------------------
* Added "signature" mode to waypoint dumping
* Added flagging for breaks to waypoint dumping
* Implemented Check For Errors
* Two-way link commands added, plus make way + link commands
* Changed the look & arrangement of the menus
* Additional test bot commands.
* Changed "Order bot here" to got to current way
* Added Hotkey system
* Added Dynamic Link feature

Availability
------------

This modification is available from the following places:

FrikBot homepage at http://www.mdqnet.net/frikbot/
