Yes i try to do that. That isn’t easy to sort out what is absolutely needed into this Quake3 & RTCW Bot code.
Most of the things that are handled are inherited from the Q3 bot system and i don’t want to be dependant of this mechanics.
Because the developer who want to build an original AI will do it his own way.
example of what i don’t want to use : i think that is not vital.
//g_bot.c
// get the botinfo from bots.txt
botinfo = G_GetBotInfoByName( "wolfbot" );
//bots.txt
{
name WolfBot
model wolfbot
aifile bots/default_c.c
}
//===========================================================================
//
// Name: default_c.c
// Programmer: Ryan Feltrin (ryan@gmistudios.com)
// version: 1
// Tab Size: 4 (real tabs)
//===========================================================================
#include "botfiles/chars.h"
skill 1
{
CHARACTERISTIC_NAME "WolfBot"
CHARACTERISTIC_GENDER "male"
CHARACTERISTIC_ATTACK_SKILL 0.15
CHARACTERISTIC_WEAPONWEIGHTS "bots/default_w.c"
CHARACTERISTIC_AIM_SKILL 0.5
CHARACTERISTIC_AIM_ACCURACY 0.5
CHARACTERISTIC_VIEW_FACTOR 0.25
CHARACTERISTIC_VIEW_MAXCHANGE 100
CHARACTERISTIC_REACTIONTIME 0.6
CHARACTERISTIC_FIRETHROTTLE 0.4
CHARACTERISTIC_AIM_ACCURACY_ROCKETLAUNCHER 0.7
CHARACTERISTIC_AIM_SKILL_ROCKETLAUNCHER 1.0
CHARACTERISTIC_AIM_ACCURACY_SNIPERRIFLE 0.7
CHARACTERISTIC_AIM_SKILL_SNIPERRIFLE 0.4
CHARACTERISTIC_AIM_ACCURACY_FLAMETHROWER 0.2
CHARACTERISTIC_AIM_ACCURACY_GRENADELAUNCHER 0.7
CHARACTERISTIC_AIM_SKILL_GRENADELAUNCHER 0.7
Alll what i use in the Q3 BOTLIB at this time is trap_BotAllocateClient (0);
When the game creates his own bots he knows he must not ask the client for something. As the game thinks they are human players i have to stop all these calls.
I don’t send the trap_SendServerCommand and trap_GetTag that have bots clientNum (the clientNum -1 is a problem).
But something is missing because the server isn’t still pleased.
Perhaps something need to be done into the bot g_entity.
That is a problem because it is shared. If i put r.svFlags |= SVF_BOT the game could execute a part of bot code and crash.
example :
//g_active.c
void ClientThink_real( gentity_t *ent ) {
int msec, oldEventSequence, monsterslick = 0;
pmove_t pm;
usercmd_t *ucmd;
gclient_t *client = ent->client;
[...]
// server cursor hints
// TAT 1/10/2003 - bots don't need to check for cursor hints
if ( !(ent->r.svFlags & SVF_BOT) && ent->lastHintCheckTime < level.time )
{
G_CheckForCursorHints(ent);
ent->lastHintCheckTime = level.time + FRAMETIME;
}
I wonder if i really can say to the game they are humans AND to the server they are bots.