Skip to content
Permalink
Browse files

Version update for r486-apg

  • Loading branch information...
APGRoboCop committed Mar 24, 2018
1 parent 9753db7 commit a2de5a87615ae645b4e95b0713c71ff1f0dbaeec
@@ -21,3 +21,4 @@ utils/RCBot2_meta/HPB_Bot2.sdf
/linux_sdk/obj/HPB_bot2_meta_i486/utilCBot2_metmeta
/linux_sdk/obj/vcpm
/utils/RCBot2/Debug
/linux_sdk/obj/RCBot2MetaDebug_i486/utils/RCBot2_meta
@@ -10,11 +10,24 @@ This repository is mainly used for the Linux release of his plugin, but it also
A complete guide for installing this plugin can be found at the official RCBot2 forums over [here](http://rcbot.bots-united.com/forums/index.php?showtopic=1967). <br />
This thread is also maintained by me.

### How to compile for Linux
### Build
* Go to `linux_sdk`
* Type `make -f Makefile.rcbot2 vcpm`
* Type `make -f Makefile.rcbot2 genmf` (this will generate the Makefiles)
* Edit `Makefile.rcbot2` and `Makefile.HPB_bot2_*` according to your needs
* Most of the time you will only need to modify Line 21 and 55 of `Makefile.rcbot2`
* Type `make -f Makefile.rcbot2 all -j4 2> error.log`
* Check the `error.log`

### Changelog
* Fixed a bug in getNextRoutePoint, which destroyed bot aiming, because of invalid vLook
* Fixed reading of files with windows line ending (\r\n)
* Fixed all offsets for Linux
* Added "master offset" settings for TF2
* Fixed a typo while reading bot configs (visionticksclients -> visionticks_clients)
* Fixed macro in bot_profile.cpp
* Fixed consecutive use of "addbot"
* Added debug messages in chat (rcbot debug chat 1)
* Added automatic bot quota, based on human players
* You can now edit the path of where you have installed RCBot by writing it in the rcbot2.vdf
* (relative paths to the mod folder are also supported)
@@ -16,12 +16,12 @@ MOD_PROJ=../dlls/server_scratch-2005.vcproj
MOD_CONFIG=server_sdk_ReleaseSDKWin32

# the directory the base binaries (tier0_i486.so, etc) are located
GAME_DIR=~/srcds
GAME_DIR=/home/desktop/steamcmd/steamapps/common/sdk2007/bin

# compiler options (gcc 3.4.1 or above is required)
CC=/usr/bin/gcc
CPLUS=/usr/bin/g++
CLINK=/usr/bin/gcc
CC=/usr/bin/gcc-4.9
CPLUS=/usr/bin/g++-4.9
CLINK=/usr/bin/gcc-4.9
CPP_LIB="/usr/lib/libstdc++.a /usr/lib/libgcc_eh.a"

# put any compiler flags you want passed here
@@ -57,7 +57,7 @@ CHOREO_PROJ=../choreoobjects/choreoobjects-2005.vcproj

# the CPU target for the build, must be i486 for now
ARCH=i486
ARCH_CFLAGS=-mtune=generic -march=i686 -msse2 -O2
ARCH_CFLAGS=-mtune=i686 -march=pentium3 -mmmx -O3

BASE_CFLAGS=-D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Wno-invalid-offsetof
SHLIBEXT=so
@@ -1,5 +1,5 @@
UTILS_RCBOT2_META_SRC_DIR=../utils/RCBot2_meta
UTILS_RCBOT2_META_OBJ_DIR=obj/$(NAME)_$(ARCH)/utilCBot2_metmeta
UTILS_RCBOT2_META_OBJ_DIR=obj/$(NAME)_$(ARCH)/utils/RCBot2_meta


INCLUDES=-I../utils/RCBot2_meta/../../public/mathlib -I../utils/RCBot2_meta/../../public -I../utils/RCBot2_meta/../../public/engine -I../utils/RCBot2_meta/../../public/tier0 -I../utils/RCBot2_meta/../../public/tier1 -I../utils/RCBot2_meta/../../dlls -I../utils/RCBot2_meta/../../game_shared -I../utils/RCBot2_meta/../../game/shared -I../utils/RCBot2_meta/../../game/server -I../utils/RCBot2_meta/../../public/game/server -I../utils/RCBot2_meta/../mmsource/public -I../utils/RCBot2_meta/../mmsource/core -I../utils/RCBot2_meta/../mmsource/core/sourcehook -D_DEBUG -DHOMEFOLDER
@@ -1,5 +1,5 @@
UTILS_RCBOT2_META_SRC_DIR=../utils/RCBot2_meta
UTILS_RCBOT2_META_OBJ_DIR=obj/$(NAME)_$(ARCH)/utilCBot2_metmeta
UTILS_RCBOT2_META_OBJ_DIR=obj/$(NAME)_$(ARCH)/utils/RCBot2_meta


INCLUDES=-I../utils/RCBot2_meta/../../public/mathlib -I../utils/RCBot2_meta/../../public -I../utils/RCBot2_meta/../../public/engine -I../utils/RCBot2_meta/../../public/tier0 -I../utils/RCBot2_meta/../../public/tier1 -I../utils/RCBot2_meta/../../dlls -I../utils/RCBot2_meta/../../game_shared -I../utils/RCBot2_meta/../../game/shared -I../utils/RCBot2_meta/../../game/server -I../utils/RCBot2_meta/../../public/game/server -I../utils/RCBot2_meta/../mmsource/public -I../utils/RCBot2_meta/../mmsource/core -I../utils/RCBot2_meta/../mmsource/core/sourcehook -DNDEBUG -DHOMEFOLDER
@@ -1,5 +1,5 @@
UTILS_RCBOT2_META_SRC_DIR=../utils/RCBot2_meta
UTILS_RCBOT2_META_OBJ_DIR=obj/$(NAME)_$(ARCH)/utilCBot2_metmeta
UTILS_RCBOT2_META_OBJ_DIR=obj/$(NAME)_$(ARCH)/utils/RCBot2_meta


INCLUDES=-I../utils/RCBot2_meta/../../public/mathlib -I../utils/RCBot2_meta/../../public -I../utils/RCBot2_meta/../../public/engine -I../utils/RCBot2_meta/../../public/tier0 -I../utils/RCBot2_meta/../../public/tier1 -I../utils/RCBot2_meta/../../dlls -I../utils/RCBot2_meta/../../game_shared -I../utils/RCBot2_meta/../../game/shared -I../utils/RCBot2_meta/../../game/server -I../utils/RCBot2_meta/../../public/game/server -I../utils/RCBot2_meta/../mmsource/public -I../utils/RCBot2_meta/../mmsource/core -I../utils/RCBot2_meta/../mmsource/core/sourcehook -DNDEBUG
@@ -9,7 +9,9 @@

# the name of the mod binary (_i486.so is appended to the end)
#NAME=server
NAME=HPB_bot2_meta
#NAME=HPB_bot2_meta
NAME=RCBot2Meta
#NAME=RCBot2MetaDebug

# the location of the vcproj that builds the mod
#MOD_PROJ=../game/server/server_hl2mp-2005.vcproj
@@ -20,41 +22,37 @@ MOD_PROJ=../utils/RCBot2_meta/HPB_Bot2.vcproj
MOD_CONFIG=HPB_bot2_Release_NonHomeFolderWin32
#MOD_CONFIG=HPB_bot2_DebugWin32

# the directory the base binaries (tier0.so, etc) are located
# the directory the base binaries (tier0_i486.so, etc) are located
# this should point to your orange box subfolder of where you have srcds installed.
#GAME_DIR=~/srcds/orangebox
GAME_DIR=./gamedir
#GAME_DIR=
GAME_DIR=/home/desktop/steamcmd/steamapps/common/sdk2007/bin

# the path to your mods directory
# set this so that 'make install' or 'make installrelease' will copy your binary over automatically.
#MOD_DIR=$(GAME_DIR)/SampleMod
MOD_DIR=$(GAME_DIR)

# compiler options
#C=/usr/lbin/gcc-5
#CPLUS=/usr/bin/g++-5
#CLINK=/usr/bin/gcc-5
#CPP_LIB=" /usr/lib/gcc/i686-linux-gnu/5/libstdc++.a /usr/lib/gcc/i686-linux-gnu/5/libgcc_eh.a"
C=/usr/bin/gcc-4.9
CPLUS=/usr/bin/g++-4.9
CLINK=/usr/bin/gcc-4.9
CPP_LIB=" /usr/lib/gcc/i686-linux-gnu/4.9/libstdc++.a /usr/lib/gcc/i686-linux-gnu/4.9/libgcc_eh.a"
#C = /usr/bin/clang --gcc-toolchain=c48
#CPLUS = /usr/bin/clang++ --gcc-toolchain=c48
#CLINK = /usr/bin/clang --gcc-toolchain=c48
MOD_DIR=$(GAME_DIR)/

# compiler options (gcc 3.4.1 will work - 4.2.2 recommended)
#CC=/usr/local/bin/gcc
#CPLUS=/usr/local/bin/g++
#CLINK=/usr/local/bin/gcc
#CPP_LIB="/usr/local/lib/libstdc++.a /usr/local/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_eh.a"
#CC=/usr/bin/gcc
#CPLUS=/usr/bin/g++-4.1
#CLINK=/usr/bin/gcc-4.1
CPP_LIB=" /usr/lib/gcc/i586-linux-gnu/4.9/libstdc++.a /usr/lib/gcc/i586-linux-gnu/4.9/libgcc_eh.a"
C = /usr/bin/gcc-4.9
CPLUS = /usr/bin/g++-4.9
CLINK = /usr/bin/gcc-4.9
#CPP_LIB = "libstdc++.a libgcc_eh.a"

# GCC 4.2.2 optimization flags, if you're using anything below, don't use these!
#OPTFLAGS=-O1 -fomit-frame-pointer -ffast-math -fforce-addr -funroll-loops -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -fexpensive-optimizations -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fschedule-insns2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -finline-functions -funswitch-loops -fgcse-after-reload

#Only compatible for GCC onwards
OPTFLAGS=-O1 -fomit-frame-pointer -fforce-addr -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fschedule-insns2 -fsched-interblock -fsched-spec -fregmove -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -finline-functions -funswitch-loops -fgcse-after-reload

#Only compatible for Clang
#OPTFLAGS=-O1 -fomit-frame-pointer -fforce-addr -foptimize-sibling-calls -fgcse -fcaller-saves -fschedule-insns2 -fsched-interblock -fdelete-null-pointer-checks -freorder-blocks -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -finline-functions -funswitch-loops -fgcse-after-reload
OPTFLAGS=-O2 -fomit-frame-pointer -fforce-addr -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fschedule-insns2 -fsched-interblock -fsched-spec -fregmove -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -finline-functions -funswitch-loops -fgcse-after-reload -funsafe-math-optimizations

# put any compiler flags you want passed here
USER_CFLAGS= -std=c++11 -w -D__linux -g # -D_DEBUG -DDEBUG -DSH_DEBUG -DTF2_HOOKS
USER_CFLAGS= -std=c++11 -w -D__linux # -g -D_DEBUG -DDEBUG -DSH_DEBUG -DTF2_HOOKS

# Link Libraries
#LIBFILES= \
@@ -102,7 +100,7 @@ SRC_DIR=~/Documents/rcbot-svn/rcbot2-code-468

# the CPU target for the build, must be i486 for now
ARCH=i486
ARCH_CFLAGS=-mtune=generic -march=i686 -mmmx -msse -msse2 -pipe -m32
ARCH_CFLAGS=-mtune=generic -march=i686 -msse -msse2 -m32

# -fpermissive is so gcc 3.4.x doesn't complain about some template stuff
BASE_CFLAGS=-DVPROF_LEVEL=1 -DSWDS -D_LINUX -DLINUX -DNDEBUG -fpermissive -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -D__linux__ -DSOURCE_ENGINE=4 -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 -DSE_LEFT4DEAD2=6 -DSE_ALIENSWARM=7
@@ -169,3 +167,4 @@ install:
installrelease:
cp -f $(NAME)_$(ARCH).so $(MOD_DIR)/bin/$(NAME)_$(ARCH).so
strip $(MOD_DIR)/bin/$(NAME)_$(ARCH).so

@@ -22,7 +22,6 @@ TINYXML_OBJ_DIR=$(BUILD_OBJ_DIR)/vcpm/tinyxml
CFLAGS= -m32 -w -fpermissive -D_LINUX -DNDEBUG -U_DEBUG $(ARCH_CFLAGS)

INCLUDEDIRS=-I$(PUBLIC_SRC_DIR) -I$(UTIL_COMMON_SRC_DIR) -I$(TIER1_PUBLIC_SRC_DIR) -I$(TIER0_PUBLIC_SRC_DIR) -I$(TINYXML_SRC_DIR)
#LDFLAGS_VC= -m32 -lpthread -lm -ldl -Wl,-rpath . -l:libtier0_srv.so -l:libvstdlib_srv.so -Wl,-rpath-link .
LDFLAGS_VC= -m32 -lpthread -lm -ldl -Wl,-rpath . libtier0_srv.so libvstdlib_srv.so -Wl,-rpath-link .

DO_CC=$(CPLUS) $(INCLUDEDIRS) -w $(CFLAGS) -U_DEBUG -DARCH=$(ARCH) -o $@ -c $<
Binary file not shown.
Binary file not shown.
@@ -1,5 +0,0 @@
obj/HPB_bot2_meta_i486/utilCBot2_metmeta/bot.o: In function `memset':
/usr/include/i386-linux-gnu/bits/string3.h:86: undefined reference to `__warn_memset_zero_len'
collect2: error: ld returned 1 exit status
make[1]: *** [HPB_bot2_meta_i486.so] Error 1
make: *** [server] Error 2
BIN -852 KB (31%) linux_sdk/vcpm
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -43,7 +43,7 @@ ConVar bot_avoid_radius("rcbot_avoid_radius","80",0,"radius in units for bots to
ConVar bot_avoid_strength("rcbot_avoid_strength","100",0,"strength of avoidance (0 = disable)");
ConVar bot_messaround("rcbot_messaround","1",0,"bots mess around at start up");
ConVar bot_heavyaimoffset("rcbot_heavyaimoffset","0.1",0,"fraction of how much the heavy aims at a diagonal offset");
ConVar bot_aimsmoothing("rcbot_aimsmooting","1",0,"(0 = no smoothing)");
ConVar bot_aimsmoothing("rcbot_aimsmoothing","1",0,"(0 = no smoothing)");
ConVar bot_bossattackfactor("rcbot_bossattackfactor","1.0",0,"the higher the more often the bots will shoot the boss");
ConVar rcbot_enemyshootfov("rcbot_enemyshootfov","0.97",0,"the fov dot product before the bot shoots an enemy 0.7 = 45 degrees");
ConVar rcbot_enemyshoot_gravgun_fov("rcbot_enemyshoot_gravgun_fov","0.98",0,"the fov dot product before the bot shoots an enemy 0.98 = 11 degrees");
@@ -59,7 +59,7 @@ ConVar rcbot_demo_runup_dist("rcbot_demo_runup","99.0",0,"distance the demo bot
ConVar rcbot_demo_jump("rcbot_enable_pipejump","1",0,"Enable experimental pipe jumping at rocket jump waypoints");
ConVar rcbot_move_tele_time("rcbot_move_tele_time","120",0,"seconds for bots to start thinking about moving teleporters");
ConVar rcbot_move_tele_tpm("rcbot_move_tele_tpm","1",0,"if no of players teleported per minute is less than this, bot will move the teleport");
ConVar rcbot_tf2_protect_cap_time("rcbot_tf2_prot_cap_time","12.5",0,"time that the bots will spen more attention to the cap point if attacked");
ConVar rcbot_tf2_protect_cap_time("rcbot_tf2_prot_cap_time","12.5",0,"time that the bots will spend more attention to the cap point if attacked");
ConVar rcbot_tf2_protect_cap_percent("rcbot_tf2_protect_cap_percent","0.25",0,"the percentage that bots defend the capture point by standing on the point");
ConVar rcbot_tf2_spy_kill_on_cap_dist("rcbot_tf2_spy_kill_on_cap_dist","200.0",0,"the distance for spy bots to attack players capturing a point");
ConVar rcbot_move_dist("rcbot_move_dist","800",0,"minimum distance to move objects to");
@@ -78,7 +78,7 @@ ConVar rcbot_debug_iglev("rcbot_debug_iglev","0",0,"bot think ignores functions
ConVar rcbot_dont_move("rcbot_dontmove","0",0,"if 1 , bots will all move forward");
ConVar rcbot_runplayercmd_dods("rcbot_runplayer_cmd_dods","417",0,"offset of the DOD:S PlayerRunCommand function");
ConVar rcbot_runplayercmd_tf2("rcbot_runplayer_cmd_tf2","418",0,"offset of the TF2 PlayerRunCommand function");
ConVar rcbot_runplayercmd_hookonce("rcbot_runplayer_hookonce","1",0,"function will hook only once, if 0 it will unook and rehook after every map");
ConVar rcbot_runplayercmd_hookonce("rcbot_runplayer_hookonce","1",0,"function will hook only once, if 0 it will unhook and rehook after every map");
ConVar rcbot_ladder_offs("rcbot_ladder_offs","42",0,"difference in height for bot to think it has touched the ladder waypoint");
ConVar rcbot_ffa("rcbot_ffa","0",0,"Free for all mode -- bots shoot everyone");
ConVar rcbot_prone_enemy_only("rcbot_prone_enemy_only","1",0,"if 1 bots only prone in DOD:S when they have an enemy");
@@ -745,7 +745,7 @@ class CGameEventInterface2 : public IBotEventInterface
{
return m_pEvent->GetString(keyName,defaultValue);
}

//Arguments needing filled? [APG]RoboCop[CL]
const char *getName ()
{
return m_pEvent->GetName();
@@ -803,8 +803,8 @@ bool RCBotPluginMeta::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxle
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, gameclients, this, &RCBotPluginMeta::Hook_ClientSettingsChanged, false);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, gameclients, this, &RCBotPluginMeta::Hook_ClientConnect, false);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, gameclients, this, &RCBotPluginMeta::Hook_ClientCommand, false);
//Hook FireEvent to our function
SH_ADD_HOOK_MEMFUNC(IGameEventManager2, FireEvent, gameevents, this, &RCBotPluginMeta::FireGameEvent, false);
//Hook FireEvent to our function - but unstable? [APG]RoboCop[CL]
//SH_ADD_HOOK_MEMFUNC(IGameEventManager2, FireEvent, gameevents, this, &RCBotPluginMeta::FireGameEvent, false);


#if SOURCE_ENGINE >= SE_ORANGEBOX
@@ -1010,16 +1010,16 @@ bool RCBotPluginMeta::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxle
return true;
}


bool RCBotPluginMeta::FireGameEvent(IGameEvent * pevent, bool bDontBroadcast)
// This script dangerous and unstable? [APG]RoboCop[CL]
/*bool RCBotPluginMeta::FireGameEvent(IGameEvent * pevent, bool bDontBroadcast)
{
static char szKey[128];
static char szValue[128];
CBotEvents::executeEvent((void*)pevent,TYPE_IGAMEEVENT);
RETURN_META_VALUE(MRES_IGNORED, true);
}
}*/

bool RCBotPluginMeta::Unload(char *error, size_t maxlen)
{
@@ -1478,7 +1478,7 @@ const char *RCBotPluginMeta::GetLicense()

const char *RCBotPluginMeta::GetVersion()
{
return "1.00 (r475)";
return "1.00 (r486-apg)";
}

const char *RCBotPluginMeta::GetDate()
@@ -1493,12 +1493,12 @@ const char *RCBotPluginMeta::GetLogTag()

const char *RCBotPluginMeta::GetAuthor()
{
return "Cheeseh, [APG]RoboCop[CL]";
return "Cheeseh, RoboCop";
}

const char *RCBotPluginMeta::GetDescription()
{
return "Bot for HL2DM TF2 and DOD:S";
return "Bot for HL2DM, TF2 and DOD:S";
}

const char *RCBotPluginMeta::GetName()
@@ -39,6 +39,10 @@
#include <ISmmAPI.h>
#include <ISmmPluginExt.h>

#ifndef META_NO_HL2SDK
#include <tier1/interface.h>
#endif

// Interface return status, binary-compatible with HL2SDK's IFACE_OK and IFACE_FAILED.
enum
{
@@ -437,18 +441,30 @@ using namespace SourceMM;
* you should not pass a pointer to your plugin's
* singleton.
*/
#define PLUGIN_EXPOSE(name, var) \
ISmmAPI *g_SMAPI = NULL; \
ISmmPlugin *g_PLAPI = NULL; \
PluginId g_PLID = (PluginId)0; \
SourceHook::ISourceHook *g_SHPtr = NULL; \
#ifdef META_NO_HL2SDK
#define PL_EXPOSURE_FUNC(name, var) \
SMM_API void *PL_EXPOSURE(const char *name, int *code) { \
if (name && !strcmp(name, METAMOD_PLAPI_NAME)) { \
return static_cast<void *>(&var); \
} \
return NULL; \
}

#else
// First param should be actual classname, not iface name, but we don't have that and it doesn't matter here.
#define PL_EXPOSURE_FUNC(name, var) EXPOSE_SINGLE_INTERFACE_GLOBALVAR(ISmmPlugin, ISmmPlugin, METAMOD_PLAPI_NAME, var);
#endif

#define PLUGIN_EXPOSE(name, var) \
ISmmAPI *g_SMAPI = NULL; \
ISmmPlugin *g_PLAPI = NULL; \
PluginId g_PLID = (PluginId)0; \
SourceHook::ISourceHook *g_SHPtr = NULL; \
PL_EXPOSURE_FUNC(name, var)





/**
* @brief This should be in one of your header files, if you wish

0 comments on commit a2de5a8

Please sign in to comment.
You can’t perform that action at this time.