# APGRoboCop/foxbot

Devised by Tom "RedFox" Simpson
Switch branches/tags
Nothing to show
Latest commit e045ed4 Aug 6, 2018
 Failed to load latest commit information. .build-release Nov 26, 2016 .idea Jul 14, 2018 .vs/FoXBot Aug 6, 2018 Release Aug 6, 2018 _UpgradeReport_Files Feb 12, 2018 art May 22, 2017 cmake-build-debug/CMakeFiles Dec 22, 2017 documentation Feb 12, 2018 .gitattributes Aug 17, 2016 .gitignore Aug 6, 2018 CMakeLists.txt May 22, 2017 FoXBot.VC.db May 22, 2017 FoXBot.cbp Jun 29, 2018 FoXBot.cbp.save-failed Jul 28, 2018 FoXBot.def Feb 12, 2018 FoXBot.dsp Feb 12, 2018 FoXBot.dsw Feb 12, 2018 FoXBot.layout May 22, 2017 FoXBot.layout.save Jul 28, 2018 FoXBot.mk Feb 12, 2018 FoXBot.opt May 22, 2017 FoXBot.plg Feb 12, 2018 FoXBot.sln Feb 12, 2018 FoXBot.suo May 22, 2017 FoXBot.txt Feb 12, 2018 FoXBot.vcproj Feb 12, 2018 FoXBot.vcxproj Aug 6, 2018 FoXBot.vcxproj.filters Aug 6, 2018 FoXBot.vcxproj.user Feb 12, 2018 FoXBot_borland.def Feb 12, 2018 GPL.txt May 22, 2017 Makefile Jul 28, 2018 Makefile_backup Jul 14, 2018 Makefile_win32 May 22, 2017 Readme.txt May 22, 2017 Rules.depend May 22, 2017 UpgradeLog.XML Feb 12, 2018 bot.cpp Aug 6, 2018 bot.cpp.save Jul 28, 2018 bot.h Aug 6, 2018 bot_client.cpp Jul 28, 2018 bot_client.h Jul 28, 2018 bot_combat.cpp Jul 28, 2018 bot_func.h Jul 28, 2018 bot_job_assessors.cpp May 22, 2017 bot_job_assessors.h May 22, 2017 bot_job_functions.cpp May 22, 2017 bot_job_functions.h May 22, 2017 bot_job_think.cpp Aug 6, 2018 bot_job_think.h May 22, 2017 bot_navigate.cpp Jul 28, 2018 bot_navigate.h May 22, 2017 bot_start.cpp Jul 28, 2018 bot_weapons.h Jul 28, 2018 botcam.cpp Jul 28, 2018 botcam.h Jul 28, 2018 cbase.bkup.h Jul 28, 2018 cbase.cpp Jul 28, 2018 cbase.h Jul 28, 2018 changelog.txt Aug 6, 2018 dll.cpp Aug 6, 2018 dll.h Jul 28, 2018 engine.cpp Aug 6, 2018 engine.h Jul 28, 2018 extdll.h Jul 28, 2018 foxbot_mm.so Aug 6, 2018 foxbot_private.h Jul 28, 2018 foxbot_private.rc Feb 12, 2018 fsubs.cpp Jul 28, 2018 fworld.cpp Jul 28, 2018 globals.cpp May 22, 2017 h_export.cpp May 22, 2017 hl_baseentity.cpp May 22, 2017 hl_weapons.cpp May 22, 2017 linkfunc.cpp May 22, 2017 list.h May 22, 2017 list.h.rej May 22, 2017 makefile_borland May 22, 2017 meta_api.cpp Aug 6, 2018 miscellany.cpp May 22, 2017 new util.cpp May 22, 2017 osdep.h Jul 28, 2018 player.cpp May 22, 2017 player.h May 22, 2017 res_fox.aps Jul 14, 2018 res_fox.rc Aug 6, 2018 resource.h May 22, 2017 sdk_util.cpp Jul 28, 2018 sdk_util.h Jul 28, 2018 util.cpp Jul 28, 2018 util.h Jul 28, 2018 vector.h Jul 28, 2018 vers_fox.h Aug 6, 2018 version.cpp Jul 28, 2018 version.h Aug 6, 2018 waypoint.cpp Aug 6, 2018 waypoint.h Jul 28, 2018

===================================
===================================

Introduction
------------

Foxbot is primarily a bot for the Half-Life mod Team Fortress Classic(AKA TFC).
This guide should provide you with some basic information on how to
compile and/or modify the Foxbot source code.
Most of the guide is Operating System independant but there is also
a section specifically about compiling the Linux version of Foxbot.

____________________________________________________________

Compiling the source code
-------------------------

Although there are a number of .cpp files in the Foxbot source code directory
you may not need to compile them all to make the Foxbot Metamod plugin.

Source files used when compiling:
bot.cpp
botcam.cpp
bot_client.cpp
bot_combat.cpp
bot_job_assessors.cpp
bot_job_functions.cpp
bot_job_think.cpp
bot_navigate.cpp
bot_start.cpp
dll.cpp
engine.cpp
h_export.cpp
meta_api.cpp
sdk_util.cpp
util.cpp
version.cpp
waypoint.cpp

Directories to include when compiling:
\hlsdk\metamod\metamod\
\hlsdk\multiplayer\cl_dll\
\hlsdk\multiplayer\common\
\hlsdk\multiplayer\dlls\
\hlsdk\multiplayer\engine\
\hlsdk\multiplayer\pm_shared\
____________________________________________________________

Compiling a Linux version of Foxbot
-----------------------------------

The Linux version of Foxbot isn't hugely different from the Windows version.
But here are some important differences:

First of all, there is only a dedicated Half-Life server available for Linux.
As opposed to the choice of dedicated and listen servers you get with Windows.

Secondly, Foxbot uses a number of plain text configuration files and
scripts when running.
Windows text files use line endings of the type CRLF, whereas Linux text
files use line endings of the type LF.
So ideally you should make sure that all the text files that Foxbot uses
are in the right format for your Operating System.
There is a program available on Linux, called dos2unix, that can convert
several text files to the right format for you in one big batch.

You will also need a C++ compiler installed on your Linux machine.
The one most commonly used on Linux is part of GCC - the Gnu Compiler Collection.
You can test if you have it installed by typing this command at the console:
g++ --version
If you you are told that there is no such file or directory then you
will probably need to install it.

Finally, you will need a Linux Makefile in order to compile the Linux
version of the bots.
One is provided that should hopefully work on your machine without any
serious problems.
Just type the command 'make' from the main foxbot source code directory.

____________________________________________________________

Notes on the Windows Version
----------------------------

With Windows there is a fairly wide variety of C++ compilers available.
A big problem is that the Half-Life SDK isn't compatible with a
number of them.

Compilers that have been known to work with the Half-Life SDK:
Bloodshed's Dev-cpp 4.9.9.2(which is a free compiler).
Microsofts Visual C++.
Mingw(I've heard this works but haven't tried it myself).

Compilers that complained about the Half-Life SDK:
Borlands free command line compiler(version 5.0).
Open Watcom C/C++ Version 1.8.

____________________________________________________________

Useful Notes
------------

If you modify stuff in bot.h then you may want to re-compile _ALL_ the
source files.
Adding/modifying variables in the bot_t struct without a full re-compile
has been known to make the bots start acting really weird or for a crash
to occur.

If you are compiling both Windows and Linux versions of Foxbot then you
should be aware that the object files(files with an .o extension) from
each version are incompatible and may clash with each other.
For example the Linux GCC compiler will probably spit out errors if it
finds object files from the Windows version sitting around in the
source directory.

____________________________________________________________

Other sources of information
----------------------------

Foxbot was built using Botmans HPB Bot source code as a basis.
So you might also find the HPB Bot source code and readme.txt file useful.

Also you might want to check out the Bots-United website at:
www.bots-united.com
It's a site geared towards bot development.