			QuakeBot C/S

                        V.80  beta

                        Jim Rorie
			jfrorie@uncc.edu

                        John Simmerman
                        jksimmer@uncc.edu


QuakeBot C/S is a Client/Server Bot core for creating functional 
deathmatch bots. It does NOT provide AI.  That's your department.  
We handle everything else.

Running:

QuakeBot C/S uses a syntax similar to Quake.  To connect to a server from the
command line, type:

	QuakeBot +connect <Server Address>

Some command line options:
	
	+name <BotName>		// Changes your name from the "QuakeBot"
                                        default
	+color <shirt> <Pant>	// Changes your color from the 3 3 default

	-noproxy		// disables the Server Proxy



Compiling:

MSC V4.X:

The program uses winsock calls under MS Visual C++ v4.X.  It should compile
under most PC compilers. I made it as portable as I could.  

To get MS VC++ V4.X to compile this properly, do the following:

A) create a console application project.
B) In the project, go to Build->Settings.  Click the C/C++ Tab.
	Change "category" to "code generation".  The options will change.
	Change "use runtime library:" to "Debug Multithreaded"
C) Go to Build->Link
D) Add wsock32.lib to Object/Library Modules


Borland C++ V5.0:

This was accomplished by Luke Harless who was kind enough to send me his
procedure:

1.  Select New Project from the File Menu.
2.  Type the directory information and name for the project
3.  Select Win32 for the platform information
4.  Select Console for the Target Module
5.  Select Static from the Libraries radio buttons.
6.  Check the Multithreaded box.
7.  Click the Advanced button, and deselect .rc and .def options
8.  Click on ok to create the project.

I have not tried this yet so I can;t really be of any help to you.  
But I expect in time to test and verify that all works well.
If anyone has problems with bot crashes after a compile under BC++, 
fire them off to me.


UNIX:

I have added some conditionals supplied by a couple of gurus. They should
make your life a little easier.  But there are no guarantees.  If you
get it working under your OS, fire your changes back to me and I will
incorporate them, and give due credit.

Other:

Other compilers.....Your on your own.  If you get it to compile under 
something else, mail me so I can document the procedure.

	
What it does:

This module will log you into a quake server and perform everything necessary
in the game initialization.  Runtime packets are decoded and the data stored
in the server and player objects.  You give commands to the Bot via the
AI objects CycleEvent() function. The supplied runtime function will 
pursue a player and fire if he is in a defined range.  The bot will also 
respawn after death.  It is It's pretty damn stupid.  Objects will trip
it up if they are in its path.

The runtime console allows you to bring up certain information 
by command.  The following commands are implemented:

Alias <Name> <Value> - Creates an alias
AI <arg> - Send a command to the AI. On and off are directly implemented.
                Other commands are passed tot he AI Object.
Color <Shirt> <Pant> - Changes Bot Color.
Say - Broadcast message to server.  All console says are differentiated from
        bot says by prepending "(Console)" to all messages.
Net - Network Statistics.
Game - Game Stats, Players, etc.
Player - Extended player Info.
Model # - The name of model # entry in the Precache.
Static # - Static entity information.
Dynamic # - Baseline entity information.
Defined - All entities model references defined int he current game.
Quit - Quit Client.
Help - Help List
Connect - Connect to server
Disconnect - Disconnect from server

I usually miss one or two.  The help function will tell you the rest.


What's NEW:

I finally got around to adding support for hostnames.  You no longer have to
find the numeric IP for a server.

Speed increase due to some optimization.  Should result in cleaner console
operation.

The navigation code is pre-pre-alpha.  It moves a little.  This release
is just to let people get caught up on bug fixes.  If you just
run the bot, my suggestion is to NOT erase V0.7 until you decide which 
one that you like more.


Limitations:

Some systems are having trouble with severe lag.  It is a packet queueing
problem I am looking at.

Some messages are not forwarded to the proxy. i.e. Print Commands and color
changes. This requires a little more work.

My suggestion for future compatibility is to create your own AI and navigation
objects so that they can be easily incorporated in newer releases.  This
core is still pretty crude and will see much more changes.  If you see a need
to modify my core to correct a bug, MAIL ME!!!  I will incorporate the changes
in the next release.

The handshake is pretty clean now, and I don't expect any problems.  It 
has been tested on several servers with many different patches.
Unfortunately, there are about a billion different combinations.  If you
have a problem with a particular server, send me the name and the patch
it is running, if possible. I will look into it.  

My technique for determining player death hasn't been tested fully, so it 
may have problems.  Currently, I check to see if the player's model frame
is within a certain range.  If it is, I assume the player is dead. I really,
really would like suggestions in this area. I know I can parse the console
say strings, but there must be something a little slicker to solve this
problem.

Specifying an invalid IP address will cause it to puke on the bind().
This can also happen in certain circumstances when a server times out
and you attempt to reconnect.


What I want:

FEEDBACK!!!!  I need some people to play with this thing and tell me what is
needed. I am not a Quake specialist, more of a hack. Therefore I am
learning as I go along.

Also, if you use this code for building your own bot, I require that you
either leave the "QuakeBot C/S(c)" broadcast message or modify it to show that
it is based on the core.  i.e. "Based on QuakeBot C/S(c) core", etc.  Other
than that, hack away.  


The current version of QuakeBot C/S can always be found at:
http://www.coe.uncc.edu/~jfrorie


						Have Fun,
						Jim
  

Known Bugs:



Fixes:

Fixed Backspace bug in console

Corrected proxy protocol.

Fixed major speed problem.

Fixed Ping time, I hope.

Bot recognizes teamplay.

Cleaned up console output.

Server rules are now retrived.

Entity updates are now correctly performed.

Corrected level change bug that was crashing on mod'ed servers.

RuntimeThread() moved to separate file. Should make updates easier.

Restructured files to correct format. (Don't ask why they were like that)

Level change MAY have been fixed.  Let me know.

Fixed massive memory leaks.

Entities are fully tracked.

Respawn problem taken care of.

Some conditionals to support unix compilation.  Little endian only, currently.

Full tracking of all entities. Finally!!!

The player objects now have their inventory, stats, etc. updated.

Corrected a bug that was sending duplicate packets.

Corrected the ACK sequences.  Previous version would desync if the server
missed an ACK and would no longer receive reliable messages.

Cleaned up the display, A LOT.

