Added bot code.

This commit is contained in:
Justin Marshall
2026-05-19 18:34:55 -07:00
parent b97127f038
commit af56d4bfeb
166 changed files with 22251 additions and 297 deletions
+6
View File
@@ -3256,6 +3256,12 @@ idActor::Event_SetState
=====================
*/
void idActor::Event_SetState( const char *name ) {
if (HasNativeFunction(name))
{
stateThread.SetState(name);
return;
}
idealState = GetScriptFunction( name );
if ( idealState == state ) {
state = NULL;
+2
View File
@@ -252,6 +252,8 @@ protected:
idAnimState torsoAnim;
idAnimState legsAnim;
rvStateThread stateThread;
bool allowPain;
bool allowEyeFocus;
bool finalBoss;
+2
View File
@@ -395,6 +395,8 @@ public:
{
return GetLocalCoordinates(GetPhysics()->GetOrigin());
}
virtual void InflictedDamageEvent(idEntity* target) {}
protected:
renderEntity_t renderEntity; // used to present a model to the renderer
int modelDefHandle; // handle to static renderer model
+4 -2
View File
@@ -118,7 +118,7 @@ public:
virtual void CacheDictionaryMedia( const idDict *dict ) = 0;
// Spawns the player entity to be used by the client.
virtual void SpawnPlayer( int clientNum ) = 0;
virtual void SpawnPlayer( int clientNum, bool isBot ) = 0;
// Runs a game frame, may return a session command for level changing, etc
virtual gameReturn_t RunFrame( const usercmd_t *clientCmds ) = 0;
@@ -146,7 +146,9 @@ public:
virtual void ServerClientConnect( int clientNum, const char *guid ) = 0;
// Spawns the player entity to be used by the client.
virtual void ServerClientBegin( int clientNum ) = 0;
virtual void ServerClientBegin( int clientNum, bool isBot ) = 0;
virtual bool GetRandomBotName(int clientNum, idStr& botName) = 0;
// Disconnects a client and removes the player entity from the game.
virtual void ServerClientDisconnect( int clientNum ) = 0;
+39 -2
View File
@@ -316,6 +316,19 @@ void idGameLocal::Init( void ) {
kv = dict->MatchPrefix( "type", kv );
}
// load in the bot itemtable.
botItemTable = FindEntityDef("bot_itemtable", false);
if (botItemTable == NULL)
{
common->FatalError("Failed to find bot_itemtable decl!\n");
}
// init all the bot systems.
botCharacterStatsManager.Init();
botFuzzyWeightManager.Init();
botWeaponInfoManager.Init();
botGoalManager.BotSetupGoalAI();
gamestate = GAMESTATE_NOMAP;
Printf( "...%d aas types\n", aasList.Num() );
@@ -909,6 +922,13 @@ void idGameLocal::LoadMap( const char *mapName, int randseed ) {
spawnArgs.Clear();
for (int i = 0; i < aasNames.Num(); i++)
{
aasList[i]->Init(idStr(mapFileName).SetFileExtension(aasNames[i]).c_str(), mapFile->GetGeometryCRC());
}
bot_aas = GetAAS("aas48");
skipCinematic = false;
inCinematic = false;
cinematicSkipTime = 0;
@@ -1186,6 +1206,11 @@ void idGameLocal::InitFromNewMap( const char *mapName, idRenderWorld *renderWorl
// free up any unused animations
animationLib.FlushUnusedAnims();
if (isMultiplayer && isServer)
{
botGoalManager.InitLevelItems();
}
gamestate = GAMESTATE_ACTIVE;
Printf( "--------------------------------------\n" );
@@ -1821,7 +1846,7 @@ void idGameLocal::InitScriptForMap( void ) {
idGameLocal::SpawnPlayer
============
*/
void idGameLocal::SpawnPlayer( int clientNum ) {
void idGameLocal::SpawnPlayer( int clientNum, bool isBot ) {
idEntity *ent;
idDict args;
@@ -1830,7 +1855,14 @@ void idGameLocal::SpawnPlayer( int clientNum ) {
args.SetInt( "spawn_entnum", clientNum );
args.Set( "name", va( "player%d", clientNum + 1 ) );
args.Set( "classname", isMultiplayer ? "player_doommarine_mp" : "player_doommarine" );
if (isBot)
{
args.Set("classname", "player_doommarine_mp_bot");
}
else
{
args.Set("classname", isMultiplayer ? "player_doommarine_mp" : "player_doommarine");
}
if ( !SpawnEntityDef( args, &ent ) || !entities[ clientNum ] ) {
Error( "Failed to spawn player as '%s'", args.GetString( "classname" ) );
}
@@ -2169,6 +2201,11 @@ gameReturn_t idGameLocal::RunFrame( const usercmd_t *clientCmds ) {
}
#endif
if (isMultiplayer && isServer)
{
RunBotFrame();
}
player = GetLocalPlayer();
for (int i = 0; i < delayRemoveEntities.Num(); i++)
+24 -2
View File
@@ -340,7 +340,8 @@ public:
virtual void SaveGame( idFile *saveGameFile );
virtual void MapShutdown( void );
virtual void CacheDictionaryMedia( const idDict *dict );
virtual void SpawnPlayer( int clientNum );
virtual void SpawnPlayer( int clientNum, bool isBot );
virtual bool GetRandomBotName(int clientNum, idStr& botName);
virtual gameReturn_t RunFrame( const usercmd_t *clientCmds );
virtual bool Draw( int clientNum );
virtual escReply_t HandleESC( idUserInterface **gui );
@@ -349,7 +350,7 @@ public:
virtual void HandleMainMenuCommands( const char *menuCommand, idUserInterface *gui );
virtual allowReply_t ServerAllowClient( int numClients, const char *IP, const char *guid, const char *password, char reason[MAX_STRING_CHARS] );
virtual void ServerClientConnect( int clientNum, const char *guid );
virtual void ServerClientBegin( int clientNum );
virtual void ServerClientBegin( int clientNum, bool isBot);
virtual void ServerClientDisconnect( int clientNum );
virtual void ServerWriteInitialReliableMessages( int clientNum );
virtual void ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &msg, byte *clientInPVS, int numPVSClients );
@@ -378,6 +379,9 @@ public:
void DelayRemoveEntity(idEntity* entity, int delay);
void AddBot(void);
idPlayer* GetClient(int i) const { assert(i >= 0 && i < MAX_CLIENTS); return reinterpret_cast<idPlayer*>(entities[i]); }
void LocalMapRestart( void );
void MapRestart( void );
static void MapRestart_f( const idCmdArgs &args );
@@ -389,6 +393,17 @@ public:
{
return MS2SEC(time - previousTime);
}
idAAS* GetBotAAS(void)
{
return bot_aas;
}
int TravelTimeToGoal(const idVec3& origin, const idVec3& goal);
int GetBotItemEntry(const char* name);
void Trace(trace_t& results, const idVec3& start, const idVec3& end, int contentMask, int passEntity);
void AlertBots(idPlayer* player, idVec3 alert_position);
bool NextMap( void ); // returns wether serverinfo settings have been modified
static void NextMap_f( const idCmdArgs &args );
@@ -457,6 +472,8 @@ public:
const idVec3 & GetGravity( void ) const;
void RunBotFrame(void);
// added the following to assist licensees with merge issues
int GetFrameNum() const { return framenum; };
int GetTime() const { return time; };
@@ -593,6 +610,8 @@ private:
void GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] );
idList<rvmGameDelayRemoveEntry_t> delayRemoveEntities;
const idDeclEntityDef* botItemTable;
idAAS* bot_aas;
};
//============================================================================
@@ -703,6 +722,7 @@ typedef enum {
#define MASK_OPAQUE (CONTENTS_OPAQUE)
#define MASK_SHOT_RENDERMODEL (CONTENTS_SOLID|CONTENTS_RENDERMODEL)
#define MASK_SHOT_BOUNDINGBOX (CONTENTS_SOLID|CONTENTS_BODY)
#define MASK_SHOT (CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_CORPSE)
const float DEFAULT_GRAVITY = 1066.0f;
#define DEFAULT_GRAVITY_STRING "1066"
@@ -777,4 +797,6 @@ const int CINEMATIC_SKIP_DELAY = SEC2MS( 2.0f );
#include "weapons/Weapon_chainsaw.h"
#include "weapons/Weapon_grabber.h"
#include "bots/Bot.h"
#endif /* !__GAME_LOCAL_H__ */
+162 -3
View File
@@ -303,7 +303,7 @@ void idGameLocal::ServerClientConnect( int clientNum, const char *guid ) {
idGameLocal::ServerClientBegin
================
*/
void idGameLocal::ServerClientBegin( int clientNum ) {
void idGameLocal::ServerClientBegin( int clientNum, bool isBot ) {
idBitMsg outMsg;
byte msgBuf[MAX_GAME_MESSAGE_SIZE];
@@ -317,7 +317,7 @@ void idGameLocal::ServerClientBegin( int clientNum ) {
networkSystem->ServerSendReliableMessage( clientNum, outMsg );
// spawn the player
SpawnPlayer( clientNum );
SpawnPlayer( clientNum, isBot );
if ( clientNum == localClientNum ) {
mpGame.EnterGame( clientNum );
}
@@ -331,6 +331,16 @@ void idGameLocal::ServerClientBegin( int clientNum ) {
networkSystem->ServerSendReliableMessage( -1, outMsg );
}
/*
================
idGameLocal::GetRandomBotName
================
*/
bool idGameLocal::GetRandomBotName(int clientNum, idStr& botName) {
botName = "TestBot";
return true;
}
/*
================
idGameLocal::ServerClientDisconnect
@@ -1325,7 +1335,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m
int client = msg.ReadByte();
int spawnId = msg.ReadLong();
if ( !entities[ client ] ) {
SpawnPlayer( client );
SpawnPlayer( client, false );
entities[ client ]->FreeModelDef();
}
// fix up the spawnId to match what the server says
@@ -1751,3 +1761,152 @@ void idEventQueue::Enqueue( entityNetEvent_t *event, outOfOrderBehaviour_t behav
}
end = event;
}
/*
======================
idGameLocal::RunBotFrame
======================
*/
void idGameLocal::RunBotFrame(void) {
for (int i = 0; i < MAX_CLIENTS; i++) {
idPlayer* botPlayer = GetClient(i);
if (botPlayer == NULL) {
continue;
}
rvmBot* bot = botPlayer->Cast< rvmBot >();
if (bot == NULL) {
continue;
}
bot->BotInputFrame();
}
}
/*
======================
idGameLocal::AddBot
======================
*/
void idGameLocal::AddBot(void) {
int clientNum;
if (aasList.Num() == 0) {
common->Warning("idGameLocal::AddBot: No AAS file loaded for map\n");
return;
}
clientNum = networkSystem->AllocateClientSlotForBot(8);
if (clientNum == -1) {
return;
}
// idPlayer* newPlayer = gameLocal.GetClient(clientNum);
}
/*
================
idGameLocal::TravelTimeToGoal
================
*/
int idGameLocal::TravelTimeToGoal(const idVec3& origin, const idVec3& goal)
{
idAAS* aas = bot_aas;
if (aas == NULL)
{
gameLocal.Error("idGameLocal::TraveTimeToGoal: No AAS loaded...\n");
return NULL;
}
//int originArea = aas->PointAreaNum(origin);
//idVec3 _goal = goal;
//int goalArea = aas->AdjustPositionAndGetArea(_goal);
//return aas->TravelTimeToGoalArea(originArea, origin, goalArea, TFL_WALK);
idVec3 org = origin;
int curAreaNum = aas->AdjustPositionAndGetArea(org);
int goalArea = aas->PointAreaNum(goal);
int travelTime;
idReachability* reach;
if (!aas->RouteToGoalArea(curAreaNum, org, goalArea, TFL_WALK | TFL_AIR, travelTime, &reach))
{
return NULL;
}
//int goalArea = aas->PointAreaNum(goal);
//aas->ShowWalkPath(origin, goalArea, goal);
return travelTime;
}
/*
===============
idGameLocal::GetBotItemEntry
===============
*/
int idGameLocal::GetBotItemEntry(const char* name)
{
const idKeyValue* keyvalue = botItemTable->dict.FindKey(name);
if (!keyvalue)
{
gameLocal.Warning("GetBotItemModelIndex: Doesn't have key %s\n", name);
return 9;
}
return botItemTable->dict.GetInt(name);
}
/*
===============
idGameLocal::Trace
===============
*/
void idGameLocal::Trace(trace_t& results, const idVec3& start, const idVec3& end, int contentMask, int passEntity)
{
idMat3 axis;
axis.Identity();
if (passEntity == -1)
{
clip.Translation(results, start, end, NULL, axis, CONTENTS_SOLID, NULL);
}
else
{
clip.Translation(results, start, end, NULL, axis, CONTENTS_SOLID, entities[passEntity]);
}
}
/*
===================
idGameLocal::AlertBots
===================
*/
void idGameLocal::AlertBots(idPlayer* player, idVec3 alert_position)
{
for (int i = 0; i < MAX_CLIENTS; i++)
{
rvmBot* bot = NULL;
if (entities[i] == NULL)
{
continue;
}
bot = entities[i]->Cast<rvmBot>();
if (bot == NULL)
{
continue;
}
trace_t tr;
Trace(tr, alert_position, bot->GetRenderEntity()->origin, CONTENTS_SOLID, 0);
if (tr.fraction == 1.0f)
{
bot->SetEnemy(player, player->GetOrigin());
}
}
}
+2
View File
@@ -288,6 +288,8 @@ void idItem::Spawn( void ) {
GetPhysics()->SetContents( CONTENTS_TRIGGER );
}
modelindex = gameLocal.GetBotItemEntry(spawnArgs.GetString("modelindex"));
giveTo = spawnArgs.GetString( "owner" );
if ( giveTo.Length() ) {
ent = gameLocal.FindEntity( giveTo );
+8
View File
@@ -55,6 +55,12 @@ public:
virtual void Think( void );
virtual void Present();
int GetModelIndex() const
{
return modelindex;
}
enum {
EVENT_PICKUP = idEntity::EVENT_MAXEVENTS,
EVENT_RESPAWN,
@@ -75,6 +81,8 @@ private:
bool pulse;
bool canPickUp;
int modelindex;
// for item pulse effect
int itemShellHandle;
const idMaterial * shellMaterial;
+38
View File
@@ -6819,6 +6819,11 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
int oldHealth = health;
health -= damage;
if (attacker->IsType(rvmBot::Type))
{
attacker->InflictedDamageEvent(this);
}
if ( health <= 0 ) {
if ( health < -999 ) {
@@ -8519,3 +8524,36 @@ bool idPlayer::NeedsIcon( void ) {
// local clients don't render their own icons... they're only info for other clients
return entityNumber != gameLocal.localClientNum && ( isLagged || isChatting );
}
/*
===============
idPlayer::GetViewHeight
==============
*/
float idPlayer::GetViewHeight(void)
{
float newEyeOffset = 0;
if (spectating)
{
newEyeOffset = 0.0f;
}
else if (health <= 0)
{
newEyeOffset = pm_deadviewheight.GetFloat();
}
else if (physicsObj.IsCrouching())
{
newEyeOffset = pm_crouchviewheight.GetFloat();
}
else if (GetBindMaster() && GetBindMaster()->IsType(idAFEntity_Vehicle::Type))
{
newEyeOffset = 0.0f;
}
else
{
newEyeOffset = pm_normalviewheight.GetFloat();
}
return newEyeOffset;
}
+14 -1
View File
@@ -338,7 +338,7 @@ public:
void SetupWeaponEntity( void );
void SelectInitialSpawnPoint( idVec3 &origin, idAngles &angles );
void SpawnFromSpawnSpot( void );
void SpawnToPoint( const idVec3 &spawn_origin, const idAngles &spawn_angles );
virtual void SpawnToPoint( const idVec3 &spawn_origin, const idAngles &spawn_angles );
void SetClipModel( void ); // spectator mode uses a different bbox size
void SavePersistantInfo( void );
@@ -512,6 +512,19 @@ public:
bool SelfSmooth( void );
void SetSelfSmooth( bool b );
virtual bool IsBot(void)
{
return false;
}
bool IsShooting(void)
{
return AI_ATTACK_HELD;
}
float GetViewHeight(void);
idStr netname;
private:
jointHandle_t hipJoint;
jointHandle_t chestJoint;
+13
View File
@@ -273,3 +273,16 @@ void idAASLocal::GetEdge( int edgeNum, idVec3 &start, idVec3 &end ) const {
start = file->GetVertex( v[INTSIGNBITSET(edgeNum)] );
end = file->GetVertex( v[INTSIGNBITNOTSET(edgeNum)] );
}
/*
============
idAASLocal::AdjustPositionAndGetArea
============
*/
int idAASLocal::AdjustPositionAndGetArea(idVec3& origin)
{
int area = PointReachableAreaNum(origin, DefaultSearchBounds(), AREA_REACHABLE_WALK);
PushPointIntoAreaNum(area, origin);
return area;
}
+6 -1
View File
@@ -67,7 +67,7 @@ typedef struct aasObstacle_s {
class idAASCallback {
public:
virtual ~idAASCallback() {};
virtual bool TestArea( const class idAAS *aas, int areaNum ) = 0;
virtual bool AreaIsGoal( const class idAAS *aas, int areaNum ) = 0;
};
typedef int aasHandle_t;
@@ -136,6 +136,11 @@ public:
virtual void ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const = 0;
// Find the nearest goal which satisfies the callback.
virtual bool FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 origin, const idVec3 &target, int travelFlags, aasObstacle_t *obstacles, int numObstacles, idAASCallback &callback ) const = 0;
virtual int AdjustPositionAndGetArea(idVec3& origin) = 0;
virtual void ShowArea(const idVec3& origin) const = 0;
virtual idAASFile* GetAASFile(void) = 0;
virtual const idBounds& DefaultSearchBounds(void) const = 0;
};
#endif /* !__AAS_H__ */
@@ -0,0 +1,126 @@
// Copyright (C) 2007 Id Software, Inc.
//
#pragma hdrstop
#include "precompiled.h"
#include "AAS_local.h"
#include "../Game_local.h" // for print and error
#include "AASCallback_AvoidLocation.h"
/*
============
idAASCallback_AvoidLocation::idAASCallback_AvoidLocation
============
*/
idAASCallback_AvoidLocation::idAASCallback_AvoidLocation()
{
avoidLocation.Zero();
avoidDist = 0.0f;
obstacles = NULL;
numObstacles = 0;
}
/*
============
idAASCallback_AvoidLocation::~idAASCallback_AvoidLocation
============
*/
idAASCallback_AvoidLocation::~idAASCallback_AvoidLocation()
{
}
/*
============
idAASCallback_AvoidLocation::SetAvoidLocation
============
*/
void idAASCallback_AvoidLocation::SetAvoidLocation( const idVec3& start, const idVec3& avoidLocation )
{
this->avoidLocation = avoidLocation;
this->avoidDist = ( avoidLocation - start ).Length();
}
/*
============
idAASCallback_AvoidLocation::SetObstacles
============
*/
void idAASCallback_AvoidLocation::SetObstacles( const idAAS* aas, const idAASObstacle* obstacles, int numObstacles )
{
this->obstacles = obstacles;
this->numObstacles = numObstacles;
for( int i = 0; i < numObstacles; i++ )
{
obstacles[i].expAbsBounds[0] = obstacles[i].absBounds[0] - aas->GetSettings()->boundingBoxes[0][1];
obstacles[i].expAbsBounds[1] = obstacles[i].absBounds[1] - aas->GetSettings()->boundingBoxes[0][0];
}
}
/*
============
idAASCallback_AvoidLocation::PathValid
============
*/
bool idAASCallback_AvoidLocation::PathValid( const idAAS* aas, const idVec3& start, const idVec3& end )
{
// path may not go through any obstacles
for( int i = 0; i < numObstacles; i++ )
{
// if the movement vector intersects the expanded obstacle bounds
if( obstacles[i].expAbsBounds.LineIntersection( start, end ) )
{
return false;
}
}
return true;
}
/*
============
idAASCallback_AvoidLocation::AdditionalTravelTimeForPath
============
*/
int idAASCallback_AvoidLocation::AdditionalTravelTimeForPath( const idAAS* aas, const idVec3& start, const idVec3& end )
{
if( avoidDist <= 0.0f )
{
return 0;
}
// project avoidLocation origin onto movement vector
idVec3 v1 = end - start;
v1.Normalize();
idVec3 v2 = avoidLocation - start;
idVec3 p = start + ( v2 * v1 ) * v1;
// get the point on the path closest to the avoidLocation
int i;
for( i = 0; i < 3; i++ )
{
if( ( p[i] > start[i] + 0.1f && p[i] > end[i] + 0.1f ) ||
( p[i] < start[i] - 0.1f && p[i] < end[i] - 0.1f ) )
{
break;
}
}
float dist;
if( i >= 3 )
{
dist = ( avoidLocation - p ).Length();
}
else
{
dist = ( avoidLocation - end ).Length();
}
// avoid moving closer to the avoidLocation
if( dist < avoidDist )
{
return idMath::Ftoi( ( avoidDist - dist ) * 10.0f );
}
return 0;
}
@@ -0,0 +1,41 @@
// Copyright (C) 2007 Id Software, Inc.
//
#ifndef __AASCALLBACK_AVOIDLOCATION_H__
#define __AASCALLBACK_AVOIDLOCATION_H__
/*
===============================================================================
idAASCallback_AvoidLocation
===============================================================================
*/
struct idAASObstacle
{
idBounds absBounds; // absolute bounds of obstacle
mutable idBounds expAbsBounds; // expanded absolute bounds of obstacle
};
class idAASCallback_AvoidLocation : public idAASCallback
{
public:
idAASCallback_AvoidLocation();
~idAASCallback_AvoidLocation();
void SetAvoidLocation( const idVec3& start, const idVec3& avoidLocation );
void SetObstacles( const idAAS* aas, const idAASObstacle* obstacles, int numObstacles );
virtual bool PathValid( const idAAS* aas, const idVec3& start, const idVec3& end );
virtual int AdditionalTravelTimeForPath( const idAAS* aas, const idVec3& start, const idVec3& end );
virtual bool AreaIsGoal( const idAAS* aas, int areaNum ) = 0;
private:
idVec3 avoidLocation;
float avoidDist;
const idAASObstacle* obstacles;
int numObstacles;
};
#endif /* !__AASCALLBACK_AVOIDLOCATION_H__ */
@@ -0,0 +1,49 @@
// Copyright (C) 2007 Id Software, Inc.
//
#pragma hdrstop
#include "precompiled.h"
#include "AAS_local.h"
#include "../Game_local.h" // for print and error
#include "AASCallback_FindAreaOutOfRange.h"
/*
============
idAASCallback_FindAreaOutOfRange::idAASCallback_FindAreaOutOfRange
============
*/
idAASCallback_FindAreaOutOfRange::idAASCallback_FindAreaOutOfRange( const idVec3& targetPos, float maxDist )
{
this->targetPos = targetPos;
this->maxDistSqr = maxDist * maxDist;
}
/*
============
idAASCallback_FindAreaOutOfRange::AreaIsGoal
============
*/
bool idAASCallback_FindAreaOutOfRange::AreaIsGoal( const idAAS* aas, int areaNum )
{
const idVec3& areaCenter = aas->AreaCenter( areaNum );
if( maxDistSqr > 0.0f )
{
float dist = ( targetPos.ToVec2() - areaCenter.ToVec2() ).LengthSqr();
if( dist < maxDistSqr )
{
return false;
}
}
trace_t trace;
gameLocal.clip.TracePoint( trace, targetPos, areaCenter + idVec3( 0.0f, 0.0f, 1.0f ), MASK_OPAQUE, NULL );
if( trace.fraction < 1.0f )
{
return false;
}
return true;
}
@@ -0,0 +1,29 @@
// Copyright (C) 2007 Id Software, Inc.
//
#ifndef __AASCALLBACK_FINDAREAOUTOFRANGE_H__
#define __AASCALLBACK_FINDAREAOUTOFRANGE_H__
#include "AASCallback_AvoidLocation.h"
/*
===============================================================================
idAASCallback_FindAreaOutOfRange
===============================================================================
*/
class idAASCallback_FindAreaOutOfRange : public idAASCallback_AvoidLocation
{
public:
idAASCallback_FindAreaOutOfRange( const idVec3& targetPos, float maxDist );
virtual bool AreaIsGoal( const idAAS* aas, int areaNum );
private:
idVec3 targetPos;
float maxDistSqr;
};
#endif /* !__AASCALLBACK_FINDAREAOUTOFRANGE_H__ */
@@ -0,0 +1,76 @@
#pragma hdrstop
#include "precompiled.h"
#include "AAS_local.h"
#include "../Game_local.h"
#include "AASCallback_FindAttackPosition.h"
/*
============
idAASFindAttackPosition::idAASFindAttackPosition
============
*/
idAASFindAttackPosition::idAASFindAttackPosition(const idAI* self, const idMat3& gravityAxis, idEntity* target, const idVec3& targetPos, const idVec3& fireOffset) {
int numPVSAreas;
this->target = target;
this->targetPos = targetPos;
this->fireOffset = fireOffset;
this->self = self;
this->gravityAxis = gravityAxis;
excludeBounds = idBounds(idVec3(-64.0, -64.0f, -8.0f), idVec3(64.0, 64.0f, 64.0f));
excludeBounds.TranslateSelf(self->GetPhysics()->GetOrigin());
// setup PVS
idBounds bounds(targetPos - idVec3(16, 16, 0), targetPos + idVec3(16, 16, 64));
numPVSAreas = gameLocal.pvs.GetPVSAreas(bounds, PVSAreas, idEntity::MAX_PVS_AREAS);
targetPVS = gameLocal.pvs.SetupCurrentPVS(PVSAreas, numPVSAreas);
}
/*
============
idAASFindAttackPosition::~idAASFindAttackPosition
============
*/
idAASFindAttackPosition::~idAASFindAttackPosition() {
gameLocal.pvs.FreeCurrentPVS(targetPVS);
}
/*
============
idAASFindAttackPosition::TestArea
============
*/
bool idAASFindAttackPosition::AreaIsGoal(const idAAS* aas, int areaNum) {
idVec3 dir;
idVec3 local_dir;
idVec3 fromPos;
idMat3 axis;
idVec3 areaCenter;
int numPVSAreas;
int PVSAreas[idEntity::MAX_PVS_AREAS];
areaCenter = aas->AreaCenter(areaNum);
areaCenter[2] += 1.0f;
if (excludeBounds.ContainsPoint(areaCenter)) {
// too close to where we already are
return false;
}
numPVSAreas = gameLocal.pvs.GetPVSAreas(idBounds(areaCenter).Expand(16.0f), PVSAreas, idEntity::MAX_PVS_AREAS);
if (!gameLocal.pvs.InCurrentPVS(targetPVS, PVSAreas, numPVSAreas)) {
return false;
}
// calculate the world transform of the launch position
dir = targetPos - areaCenter;
gravityAxis.ProjectVector(dir, local_dir);
local_dir.z = 0.0f;
local_dir.ToVec2().Normalize();
axis = local_dir.ToMat3();
fromPos = areaCenter + fireOffset * axis;
return self->GetAimDir(fromPos, target, self, dir);
}
@@ -0,0 +1,19 @@
#pragma once
class idAASFindAttackPosition : public idAASCallback {
public:
idAASFindAttackPosition(const idAI* self, const idMat3& gravityAxis, idEntity* target, const idVec3& targetPos, const idVec3& fireOffset);
~idAASFindAttackPosition();
virtual bool AreaIsGoal(const idAAS* aas, int areaNum);
private:
const idAI* self;
idEntity* target;
idBounds excludeBounds;
idVec3 targetPos;
idVec3 fireOffset;
idMat3 gravityAxis;
pvsHandle_t targetPVS;
int PVSAreas[idEntity::MAX_PVS_AREAS];
};
@@ -0,0 +1,58 @@
// Copyright (C) 2007 Id Software, Inc.
//
#pragma hdrstop
#include "precompiled.h"
#include "AAS_local.h"
#include "../Game_local.h" // for print and error
#include "AASCallback_FindCoverArea.h"
/*
============
idAASCallback_FindCoverArea::idAASCallback_FindCoverArea
============
*/
idAASCallback_FindCoverArea::idAASCallback_FindCoverArea( const idVec3& hideFromPos )
{
int numPVSAreas;
idBounds bounds( hideFromPos - idVec3( 16, 16, 0 ), hideFromPos + idVec3( 16, 16, 64 ) );
// setup PVS
numPVSAreas = gameLocal.pvs.GetPVSAreas( bounds, PVSAreas, MAX_PVS_AREAS );
hidePVS = gameLocal.pvs.SetupCurrentPVS( PVSAreas, numPVSAreas );
}
/*
============
idAASCallback_FindCoverArea::~idAASCallback_FindCoverArea
============
*/
idAASCallback_FindCoverArea::~idAASCallback_FindCoverArea()
{
gameLocal.pvs.FreeCurrentPVS( hidePVS );
}
/*
============
idAASCallback_FindCoverArea::AreaIsGoal
============
*/
bool idAASCallback_FindCoverArea::AreaIsGoal( const idAAS* aas, int areaNum )
{
idVec3 areaCenter;
int numPVSAreas;
int PVSAreas[ MAX_PVS_AREAS ];
areaCenter = aas->AreaCenter( areaNum );
areaCenter[ 2 ] += 1.0f;
numPVSAreas = gameLocal.pvs.GetPVSAreas( idBounds( areaCenter ).Expand( 16.0f ), PVSAreas, MAX_PVS_AREAS );
if( !gameLocal.pvs.InCurrentPVS( hidePVS, PVSAreas, numPVSAreas ) )
{
return true;
}
return false;
}
@@ -0,0 +1,32 @@
// Copyright (C) 2007 Id Software, Inc.
//
#ifndef __AASCALLBACK_FINDCOVERAREA_H__
#define __AASCALLBACK_FINDCOVERAREA_H__
#include "AASCallback_AvoidLocation.h"
/*
===============================================================================
idAASCallback_FindCoverArea
===============================================================================
*/
class idAASCallback_FindCoverArea : public idAASCallback_AvoidLocation
{
public:
idAASCallback_FindCoverArea( const idVec3& hideFromPos );
~idAASCallback_FindCoverArea();
virtual bool AreaIsGoal( const idAAS* aas, int areaNum );
private:
static const int MAX_PVS_AREAS = 4;
pvsHandle_t hidePVS;
int PVSAreas[ MAX_PVS_AREAS ];
};
#endif /* !__AASCALLBACK_FINDCOVERAREA_H__ */
+2 -2
View File
@@ -31,7 +31,7 @@ If you have questions concerning this license or the applicable additional terms
#include "AAS_local.h"
#include "../Game_local.h" // for cvars and debug drawing
#include "AASCallback_FindCoverArea.h"
/*
============
@@ -372,7 +372,7 @@ void idAASLocal::ShowHideArea( const idVec3 &origin, int targetAreaNum ) const {
DrawCone( target, idVec3(0,0,1), 16.0f, colorYellow );
idAASFindCover findCover( target );
idAASCallback_FindCoverArea findCover( target );
if ( FindNearestGoal( goal, areaNum, origin, target, TFL_WALK|TFL_AIR, obstacles, numObstacles, findCover ) ) {
DrawArea( goal.areaNum );
ShowWalkPath( origin, goal.areaNum, goal.origin );
+4 -3
View File
@@ -118,7 +118,10 @@ public:
virtual void ShowWalkPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const;
virtual void ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const;
virtual bool FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 origin, const idVec3 &target, int travelFlags, aasObstacle_t *obstacles, int numObstacles, idAASCallback &callback ) const;
virtual int AdjustPositionAndGetArea(idVec3& origin);
virtual void ShowArea(const idVec3& origin) const;
virtual idAASFile* GetAASFile(void) { return file; }
virtual const idBounds& DefaultSearchBounds(void) const;
private:
idAASFile * file;
idStr name;
@@ -172,13 +175,11 @@ private: // pathing
idVec3 SubSampleFlyPath( int areaNum, const idVec3 &origin, const idVec3 &start, const idVec3 &end, int travelFlags, int &endAreaNum ) const;
private: // debug
const idBounds & DefaultSearchBounds( void ) const;
void DrawCone( const idVec3 &origin, const idVec3 &dir, float radius, const idVec4 &color ) const;
void DrawArea( int areaNum ) const;
void DrawFace( int faceNum, bool side ) const;
void DrawEdge( int edgeNum, bool arrow ) const;
void DrawReachability( const idReachability *reach ) const;
void ShowArea( const idVec3 &origin ) const;
void ShowWallEdges( const idVec3 &origin ) const;
void ShowHideArea( const idVec3 &origin, int targerAreaNum ) const;
bool PullPlayer( const idVec3 &origin, int toAreaNum ) const;
+2 -2
View File
@@ -1182,7 +1182,7 @@ bool idAASLocal::FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 ori
}
// if the first area is valid goal, just return the origin
if ( callback.TestArea( this, areaNum ) ) {
if ( callback.AreaIsGoal( this, areaNum ) ) {
goal.areaNum = areaNum;
goal.origin = origin;
return true;
@@ -1330,7 +1330,7 @@ bool idAASLocal::FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 ori
if ( !bestTravelTime || t < bestTravelTime ) {
// if the area is not visible to the target
if ( callback.TestArea( this, reach->toAreaNum ) ) {
if ( callback.AreaIsGoal( this, reach->toAreaNum ) ) {
bestTravelTime = t;
bestAreaNum = reach->toAreaNum;
}
+6 -150
View File
@@ -30,6 +30,10 @@ If you have questions concerning this license or the applicable additional terms
#pragma hdrstop
#include "../Game_local.h"
#include "AASCallback_AvoidLocation.h"
#include "AASCallback_FindAreaOutOfRange.h"
#include "AASCallback_FindAttackPosition.h"
#include "AASCallback_FindCoverArea.h"
static const char* moveCommandString[NUM_MOVE_COMMANDS] = {
"MOVE_NONE",
@@ -128,154 +132,6 @@ void idMoveState::Restore(idRestoreGame* savefile) {
savefile->ReadInt(anim);
}
/*
============
idAASFindCover::idAASFindCover
============
*/
idAASFindCover::idAASFindCover(const idVec3& hideFromPos) {
int numPVSAreas;
idBounds bounds(hideFromPos - idVec3(16, 16, 0), hideFromPos + idVec3(16, 16, 64));
// setup PVS
numPVSAreas = gameLocal.pvs.GetPVSAreas(bounds, PVSAreas, idEntity::MAX_PVS_AREAS);
hidePVS = gameLocal.pvs.SetupCurrentPVS(PVSAreas, numPVSAreas);
}
/*
============
idAASFindCover::~idAASFindCover
============
*/
idAASFindCover::~idAASFindCover() {
gameLocal.pvs.FreeCurrentPVS(hidePVS);
}
/*
============
idAASFindCover::TestArea
============
*/
bool idAASFindCover::TestArea(const idAAS* aas, int areaNum) {
idVec3 areaCenter;
int numPVSAreas;
int PVSAreas[idEntity::MAX_PVS_AREAS];
areaCenter = aas->AreaCenter(areaNum);
areaCenter[2] += 1.0f;
numPVSAreas = gameLocal.pvs.GetPVSAreas(idBounds(areaCenter).Expand(16.0f), PVSAreas, idEntity::MAX_PVS_AREAS);
if (!gameLocal.pvs.InCurrentPVS(hidePVS, PVSAreas, numPVSAreas)) {
return true;
}
return false;
}
/*
============
idAASFindAreaOutOfRange::idAASFindAreaOutOfRange
============
*/
idAASFindAreaOutOfRange::idAASFindAreaOutOfRange(const idVec3& targetPos, float maxDist) {
this->targetPos = targetPos;
this->maxDistSqr = maxDist * maxDist;
}
/*
============
idAASFindAreaOutOfRange::TestArea
============
*/
bool idAASFindAreaOutOfRange::TestArea(const idAAS* aas, int areaNum) {
const idVec3& areaCenter = aas->AreaCenter(areaNum);
trace_t trace;
float dist;
dist = (targetPos.ToVec2() - areaCenter.ToVec2()).LengthSqr();
if ((maxDistSqr > 0.0f) && (dist < maxDistSqr)) {
return false;
}
gameLocal.clip.TracePoint(trace, targetPos, areaCenter + idVec3(0.0f, 0.0f, 1.0f), MASK_OPAQUE, NULL);
if (trace.fraction < 1.0f) {
return false;
}
return true;
}
/*
============
idAASFindAttackPosition::idAASFindAttackPosition
============
*/
idAASFindAttackPosition::idAASFindAttackPosition(const idAI* self, const idMat3& gravityAxis, idEntity* target, const idVec3& targetPos, const idVec3& fireOffset) {
int numPVSAreas;
this->target = target;
this->targetPos = targetPos;
this->fireOffset = fireOffset;
this->self = self;
this->gravityAxis = gravityAxis;
excludeBounds = idBounds(idVec3(-64.0, -64.0f, -8.0f), idVec3(64.0, 64.0f, 64.0f));
excludeBounds.TranslateSelf(self->GetPhysics()->GetOrigin());
// setup PVS
idBounds bounds(targetPos - idVec3(16, 16, 0), targetPos + idVec3(16, 16, 64));
numPVSAreas = gameLocal.pvs.GetPVSAreas(bounds, PVSAreas, idEntity::MAX_PVS_AREAS);
targetPVS = gameLocal.pvs.SetupCurrentPVS(PVSAreas, numPVSAreas);
}
/*
============
idAASFindAttackPosition::~idAASFindAttackPosition
============
*/
idAASFindAttackPosition::~idAASFindAttackPosition() {
gameLocal.pvs.FreeCurrentPVS(targetPVS);
}
/*
============
idAASFindAttackPosition::TestArea
============
*/
bool idAASFindAttackPosition::TestArea(const idAAS* aas, int areaNum) {
idVec3 dir;
idVec3 local_dir;
idVec3 fromPos;
idMat3 axis;
idVec3 areaCenter;
int numPVSAreas;
int PVSAreas[idEntity::MAX_PVS_AREAS];
areaCenter = aas->AreaCenter(areaNum);
areaCenter[2] += 1.0f;
if (excludeBounds.ContainsPoint(areaCenter)) {
// too close to where we already are
return false;
}
numPVSAreas = gameLocal.pvs.GetPVSAreas(idBounds(areaCenter).Expand(16.0f), PVSAreas, idEntity::MAX_PVS_AREAS);
if (!gameLocal.pvs.InCurrentPVS(targetPVS, PVSAreas, numPVSAreas)) {
return false;
}
// calculate the world transform of the launch position
dir = targetPos - areaCenter;
gravityAxis.ProjectVector(dir, local_dir);
local_dir.z = 0.0f;
local_dir.ToVec2().Normalize();
axis = local_dir.ToMat3();
fromPos = areaCenter + fireOffset * axis;
return self->GetAimDir(fromPos, target, self, dir);
}
/*
=====================
idAI::idAI
@@ -1839,7 +1695,7 @@ bool idAI::MoveOutOfRange(idEntity* ent, float range) {
pos = ent->GetPhysics()->GetOrigin();
}
idAASFindAreaOutOfRange findGoal(pos, range);
idAASCallback_FindAreaOutOfRange findGoal(pos, range);
if (!aas->FindNearestGoal(goal, areaNum, org, pos, travelFlags, &obstacle, 1, findGoal)) {
StopMove(MOVE_STATUS_DEST_UNREACHABLE);
AI_DEST_UNREACHABLE = true;
@@ -1990,7 +1846,7 @@ bool idAI::MoveToCover(idEntity* entity, const idVec3& hideFromPos) {
// consider the entity the monster tries to hide from as an obstacle
obstacle.absBounds = entity->GetPhysics()->GetAbsBounds();
idAASFindCover findCover(hideFromPos);
idAASCallback_FindCoverArea findCover(hideFromPos);
if (!aas->FindNearestGoal(hideGoal, areaNum, org, hideFromPos, travelFlags, &obstacle, 1, findCover)) {
StopMove(MOVE_STATUS_DEST_UNREACHABLE);
AI_DEST_UNREACHABLE = true;
-39
View File
@@ -195,46 +195,7 @@ public:
int anim;
};
class idAASFindCover : public idAASCallback {
public:
idAASFindCover(const idVec3& hideFromPos);
~idAASFindCover();
virtual bool TestArea(const idAAS* aas, int areaNum);
private:
pvsHandle_t hidePVS;
int PVSAreas[idEntity::MAX_PVS_AREAS];
};
class idAASFindAreaOutOfRange : public idAASCallback {
public:
idAASFindAreaOutOfRange(const idVec3& targetPos, float maxDist);
virtual bool TestArea(const idAAS* aas, int areaNum);
private:
idVec3 targetPos;
float maxDistSqr;
};
class idAASFindAttackPosition : public idAASCallback {
public:
idAASFindAttackPosition(const idAI* self, const idMat3& gravityAxis, idEntity* target, const idVec3& targetPos, const idVec3& fireOffset);
~idAASFindAttackPosition();
virtual bool TestArea(const idAAS* aas, int areaNum);
private:
const idAI* self;
idEntity* target;
idBounds excludeBounds;
idVec3 targetPos;
idVec3 fireOffset;
idMat3 gravityAxis;
pvsHandle_t targetPVS;
int PVSAreas[idEntity::MAX_PVS_AREAS];
};
class idAI : public idActor {
public:
+12 -12
View File
@@ -23,7 +23,7 @@ rvmBot::rvmBot()
{
//bs.action = NULL;
hasSpawned = false;
gameLocal.RegisterBot( this );
//gameLocal.RegisterBot( this );
}
/*
@@ -33,7 +33,7 @@ rvmBot::~rvmBot
*/
rvmBot::~rvmBot()
{
gameLocal.UnRegisterBot( this );
//gameLocal.UnRegisterBot( this );
}
/*
@@ -71,12 +71,12 @@ void rvmBot::BotUpdateInventory( void )
bs.inventory[INVENTORY_PLASMAGUN] = HasWeapon( weapon_plasmagun );
bs.inventory[INVENTORY_BFG10K] = 0;
bs.inventory[INVENTORY_GRAPPLINGHOOK] = 0;
bs.inventory[INVENTORY_SHELLS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_shells" )].Get();
bs.inventory[INVENTORY_BULLETS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_clip" )].Get();
bs.inventory[INVENTORY_SHELLS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_shells" )];
bs.inventory[INVENTORY_BULLETS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_clip" )];
bs.inventory[INVENTORY_GRENADES] = 0;
bs.inventory[INVENTORY_CELLS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_cells" )].Get();
bs.inventory[INVENTORY_CELLS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_cells" )];
bs.inventory[INVENTORY_LIGHTNINGAMMO] = 0;
bs.inventory[INVENTORY_ROCKETS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_rockets" )].Get();
bs.inventory[INVENTORY_ROCKETS] = inventory.ammo[idWeapon::GetAmmoNumForName( "ammo_rockets" )];
bs.inventory[INVENTORY_SLUGS] = 0;
bs.inventory[INVENTORY_BFGAMMO] = 0;
bs.inventory[INVENTORY_HEALTH] = health;
@@ -108,7 +108,7 @@ void rvmBot::Spawn( void )
idPlayer::Spawn();
if( common->IsServer() )
if( gameLocal.isServer )
{
weapon_machinegun = SlotForWeapon( "weapon_machinegun" );
weapon_shotgun = SlotForWeapon( "weapon_shotgun" );
@@ -120,7 +120,7 @@ void rvmBot::Spawn( void )
WP_PLASMAGUN = weapon_plasmagun;
WP_ROCKET_LAUNCHER = weapon_rocketlauncher;
botName = spawnArgs.GetString( "botname" );
botName = "dark";// spawnArgs.GetString("botname");
aas = gameLocal.GetBotAAS();
if( aas == NULL )
@@ -209,7 +209,7 @@ void rvmBot::SpawnToPoint( const idVec3& spawn_origin, const idAngles& spawn_ang
{
idPlayer::SpawnToPoint( spawn_origin, spawn_angles );
if( common->IsServer() )
if( gameLocal.isServer )
{
bs.ltg_time = 0;
stateThread.SetState("state_SeekLTG");
@@ -388,7 +388,7 @@ void rvmBot::Think( void )
return;
}
if( common->IsServer() )
if( gameLocal.isServer )
{
ServerThink();
@@ -400,10 +400,10 @@ void rvmBot::Think( void )
color = idVec4(1, 0, 0, 1);
idBounds bounds = idBounds( idVec3( -10, -10, -10 ), idVec3( 10, 10, 10 ) );
common->RW()->DebugBounds( color, bounds, GetOrigin() );
gameRenderWorld->DebugBounds( color, bounds, GetOrigin() );
idMat3 axis = viewAngles.ToMat3();
common->RW()->DrawTextA(stateThread.GetState()->state.c_str(), GetOrigin(), 1.0f, color, axis);
gameRenderWorld->DrawTextA(stateThread.GetState()->state.c_str(), GetOrigin(), 1.0f, color, axis);
}
}
+6 -1
View File
@@ -848,9 +848,14 @@ public:
virtual void InflictedDamageEvent(idEntity* target) override;
virtual void StateThreadChanged(void) override;
virtual bool IsBot(void) override
{
return true;
}
void SetEnemy( idPlayer* player, idVec3 origin );
void BotInputFrame( idUserCmdMgr& cmdMgr );
void BotInputFrame( void );
void Bot_ResetUcmd( usercmd_t& ucmd );
static void PresenceTypeBoundingBox( int presencetype, idVec3& mins, idVec3& maxs );
+37 -10
View File
@@ -1135,19 +1135,46 @@ int rvmBot::BotNearbyGoal( bot_state_t* bs, int tfl, bot_goal_t* ltg, float rang
rvmBot::BotGetRandomPointNearPosition
=======================
*/
void rvmBot::BotGetRandomPointNearPosition( idVec3 point, idVec3& randomPoint, float radius )
{
idAAS* aas = gameLocal.GetBotAAS();
idAASFile* file = aas->GetAASFile();
void rvmBot::BotGetRandomPointNearPosition(const idVec3 point, idVec3& randomPoint, float radius) {
randomPoint = point;
int areaNum = aas->PointAreaNum(point);
const aasArea_t& area = file->GetArea(areaNum);
int firstEdge = area.firstEdge;
int i = rvRandom::irand(0, area.numEdges);
idAAS* aas = this->aas;
if (!aas) {
return;
}
const aasEdge_t &edge = file->GetEdge(abs(file->GetEdgeIndex(firstEdge + i)));
const int areaNum = aas->PointAreaNum(point);
if (areaNum <= 0) {
return;
}
randomPoint = file->GetVertex(edge.vertexNum[0]);
if (radius <= 0.0f) {
randomPoint = aas->AreaCenter(areaNum);
aas->PushPointIntoAreaNum(areaNum, randomPoint);
return;
}
for (int i = 0; i < 16; i++) {
const float angle = gameLocal.random.RandomFloat() * idMath::TWO_PI;
const float dist = gameLocal.random.RandomFloat() * radius;
idVec3 testPoint = point;
testPoint.x += idMath::Cos(angle) * dist;
testPoint.y += idMath::Sin(angle) * dist;
const int testAreaNum = aas->PointAreaNum(testPoint);
if (testAreaNum <= 0) {
continue;
}
aas->PushPointIntoAreaNum(testAreaNum, testPoint);
randomPoint = testPoint;
return;
}
randomPoint = aas->AreaCenter(areaNum);
aas->PushPointIntoAreaNum(areaNum, randomPoint);
}
/*
+2 -2
View File
@@ -83,8 +83,8 @@ stateResult_t rvmBot::state_Chase(stateParms_t* parms)
// goal.areanum = bs.lastenemyareanum;
VectorCopy( bs.lastenemyorigin, goal.origin );
goal.mins = idMath::CreateVector( -8, -8, -8 );
goal.maxs = idMath::CreateVector( 8, 8, 8 );
goal.mins = idVec3( -8, -8, -8 );
goal.maxs = idVec3( 8, 8, 8 );
// jmarshall - goal origin is last visible position
{
+5 -4
View File
@@ -5,6 +5,7 @@
#pragma hdrstop
#include "../Game_local.h"
#include "../../../engine/framework/UsercmdGen.h"
/*
==============
@@ -110,8 +111,8 @@ void rvmBot::BotInputToUserCommand(bot_input_t* bi, usercmd_t* ucmd, int time)
}
//jump/moveup
if (bi->actionflags & ACTION_JUMP)
ucmd->buttons |= BUTTON_JUMP;
//if (bi->actionflags & ACTION_JUMP)
// ucmd->buttons |= BUTTON_JUMP;
// ucmd->upmove += 127;
//
@@ -149,12 +150,12 @@ void rvmBot::Bot_ResetUcmd( usercmd_t& ucmd )
rvmBot::BotInputFrame
========================
*/
void rvmBot::BotInputFrame( idUserCmdMgr& cmdMgr )
void rvmBot::BotInputFrame( void )
{
usercmd_t botcmd = { }; //(usercmd_t&)cmdMgr.GetUserCmdForPlayer(entityNumber); // gameLocal.usercmds[entityNumber];
Bot_ResetUcmd( botcmd );
BotInputToUserCommand( &bs.botinput, &botcmd, gameLocal.time );
cmdMgr.PutUserCmdForPlayer( entityNumber, botcmd );
networkSystem->ServerSetBotUserCommand(entityNumber, gameLocal.framenum, botcmd);
}
+143
View File
@@ -4312,6 +4312,9 @@ intptr_t idItem::Invoke(const char *functionName, void *param1) {
Present();
return 0;
};
if(functionNameHash == 161386) { // GetModelIndex
return (intptr_t)GetModelIndex();
};
if(functionNameHash == 278761) { // ClientPredictionThink
ClientPredictionThink();
return 0;
@@ -4343,6 +4346,9 @@ bool idItem::HasNativeFunction(const char *functionName) {
if(functionNameHash == 90014) { // Present
return true;
};
if(functionNameHash == 161386) { // GetModelIndex
return true;
};
if(functionNameHash == 278761) { // ClientPredictionThink
return true;
};
@@ -4784,6 +4790,17 @@ intptr_t idPlayer::Invoke(const char *functionName, void *param1) {
if(functionNameHash == 127139) { // SelfSmooth
return (intptr_t)SelfSmooth();
};
if(functionNameHash == 58283) { // IsBot
IsBot();
return 0;
};
if(functionNameHash == 127519) { // IsShooting
return (intptr_t)IsShooting();
};
if(functionNameHash == 162753) { // GetViewHeight
GetViewHeight();
return 0;
};
if(functionNameHash == 127156) { // StopFiring
StopFiring();
return 0;
@@ -5157,6 +5174,15 @@ bool idPlayer::HasNativeFunction(const char *functionName) {
if(functionNameHash == 127139) { // SelfSmooth
return true;
};
if(functionNameHash == 58283) { // IsBot
return true;
};
if(functionNameHash == 127519) { // IsShooting
return true;
};
if(functionNameHash == 162753) { // GetViewHeight
return true;
};
if(functionNameHash == 127156) { // StopFiring
return true;
};
@@ -9287,3 +9313,120 @@ bool rvmWeaponGrabber::HasNativeFunction(const char *functionName) {
};
intptr_t rvmBot::Invoke(const char *functionName, void *param1) {
int functionNameHash = idStr::Hash(functionName);
if(functionNameHash == 63102) { // Spawn
Spawn();
return 0;
};
if(functionNameHash == 61762) { // Think
Think();
return 0;
};
if(functionNameHash == 228837) { // StateThreadChanged
StateThreadChanged();
return 0;
};
if(functionNameHash == 58283) { // IsBot
IsBot();
return 0;
};
if(functionNameHash == 164171) { // BotInputFrame
BotInputFrame();
return 0;
};
if(functionNameHash == 141568) { // ServerThink
ServerThink();
return 0;
};
if(functionNameHash == 240097) { // BotUpdateInventory
BotUpdateInventory();
return 0;
};
if(functionNameHash == 207135) { // MoveToCoverPoint
MoveToCoverPoint();
return 0;
};
if(functionNameHash == 139244) { // state_Chase
state_Chase((stateParms_t *)param1);
return 0;
};
if(functionNameHash == 221136) { // state_BattleFight
return (intptr_t)state_BattleFight((stateParms_t *)param1);
};
if(functionNameHash == 183184) { // state_BattleNBG
return (intptr_t)state_BattleNBG((stateParms_t *)param1);
};
if(functionNameHash == 170832) { // state_Retreat
return (intptr_t)state_Retreat((stateParms_t *)param1);
};
if(functionNameHash == 172007) { // state_Respawn
return (intptr_t)state_Respawn((stateParms_t *)param1);
};
if(functionNameHash == 155264) { // state_SeekNBG
return (intptr_t)state_SeekNBG((stateParms_t *)param1);
};
if(functionNameHash == 157346) { // state_SeekLTG
return (intptr_t)state_SeekLTG((stateParms_t *)param1);
};
if(functionNameHash == 180698) { // state_Attacked
return (intptr_t)state_Attacked((stateParms_t *)param1);
};
return __super::Invoke(functionName, param1);
};
bool rvmBot::HasNativeFunction(const char *functionName) {
int functionNameHash = idStr::Hash(functionName);
if(functionNameHash == 63102) { // Spawn
return true;
};
if(functionNameHash == 61762) { // Think
return true;
};
if(functionNameHash == 228837) { // StateThreadChanged
return true;
};
if(functionNameHash == 58283) { // IsBot
return true;
};
if(functionNameHash == 164171) { // BotInputFrame
return true;
};
if(functionNameHash == 141568) { // ServerThink
return true;
};
if(functionNameHash == 240097) { // BotUpdateInventory
return true;
};
if(functionNameHash == 207135) { // MoveToCoverPoint
return true;
};
if(functionNameHash == 139244) { // state_Chase
return true;
};
if(functionNameHash == 221136) { // state_BattleFight
return true;
};
if(functionNameHash == 183184) { // state_BattleNBG
return true;
};
if(functionNameHash == 170832) { // state_Retreat
return true;
};
if(functionNameHash == 172007) { // state_Respawn
return true;
};
if(functionNameHash == 155264) { // state_SeekNBG
return true;
};
if(functionNameHash == 157346) { // state_SeekLTG
return true;
};
if(functionNameHash == 180698) { // state_Attacked
return true;
};
return __super::HasNativeFunction(functionName);
};
+366 -43
View File
@@ -7,9 +7,9 @@
This file has been generated with the Type Info Generator v1.1 (c) 2004 id Software
1172 constants
130 enums
556 classes/structs/unions
1182 constants
132 enums
578 classes/structs/unions
38 templates
7 max inheritance level for 'idAI_Vagary'
@@ -103,7 +103,8 @@ static constantInfo_t constantInfo[] = {
{ "int", "NA_BAD", "0" },
{ "int", "NA_LOOPBACK", "1" },
{ "int", "NA_BROADCAST", "2" },
{ "int", "NA_IP", "3" },
{ "int", "NA_BOT", "3" },
{ "int", "NA_IP", "4" },
{ "int", "THREAD_NORMAL", "0" },
{ "int", "THREAD_ABOVE_NORMAL", "1" },
{ "int", "THREAD_HIGHEST", "2" },
@@ -1219,6 +1220,15 @@ static constantInfo_t constantInfo[] = {
{ "int", "OP_BREAK", "121" },
{ "int", "OP_CONTINUE", "122" },
{ "int", "NUM_OPCODES", "123" },
{ "int", "NULLMOVEFLAG", "-1" },
{ "int", "MOVE_PRONE", "0" },
{ "int", "MOVE_CROUCH", "1" },
{ "int", "MOVE_WALK", "2" },
{ "int", "MOVE_RUN2", "3" },
{ "int", "MOVE_SPRINT", "4" },
{ "int", "MOVE_JUMP", "5" },
{ "int", "KILL", "0" },
{ "int", "DEATH", "1" },
{ NULL, NULL, NULL }
};
@@ -1311,7 +1321,8 @@ static enumValueInfo_t netadrtype_t_typeInfo[] = {
{ "NA_BAD", 0 },
{ "NA_LOOPBACK", 1 },
{ "NA_BROADCAST", 2 },
{ "NA_IP", 3 },
{ "NA_BOT", 3 },
{ "NA_IP", 4 },
{ NULL, 0 }
};
@@ -2703,6 +2714,23 @@ static enumValueInfo_t enum_129_typeInfo[] = {
{ NULL, 0 }
};
static enumValueInfo_t botMoveFlags_t_typeInfo[] = {
{ "NULLMOVEFLAG", -1 },
{ "MOVE_PRONE", 0 },
{ "MOVE_CROUCH", 1 },
{ "MOVE_WALK", 2 },
{ "MOVE_RUN2", 3 },
{ "MOVE_SPRINT", 4 },
{ "MOVE_JUMP", 5 },
{ NULL, 0 }
};
static enumValueInfo_t botChat_t_typeInfo[] = {
{ "KILL", 0 },
{ "DEATH", 1 },
{ NULL, 0 }
};
static enumTypeInfo_t enumTypeInfo[] = {
// { "BITT< unsigned int B >::bitValue_t", BITT_unsigned_int_B__bitValue_t_typeInfo },
{ "cpuid_t", cpuid_t_typeInfo },
@@ -2834,6 +2862,8 @@ static enumTypeInfo_t enumTypeInfo[] = {
{ "moveStatus_t", moveStatus_t_typeInfo },
{ "stopEvent_t", stopEvent_t_typeInfo },
{ "enum_129", enum_129_typeInfo },
{ "botMoveFlags_t", botMoveFlags_t_typeInfo },
{ "botChat_t", botChat_t_typeInfo },
{ NULL, NULL }
};
@@ -3306,6 +3336,10 @@ static classVariableInfo_t idLexer_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t rvmScopedLexerBaseFolder_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t define_t_typeInfo[] = {
{ "char *", "name", (intptr_t)(&((define_t *)0)->name), sizeof( ((define_t *)0)->name ) },
{ "int", "flags", (intptr_t)(&((define_t *)0)->flags), sizeof( ((define_t *)0)->flags ) },
@@ -3988,9 +4022,9 @@ static classVariableInfo_t glRaytracingVec3_t_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t glRaytracingLight_s_class_172_typeInfo[] = {
// { "float", "pad1", (intptr_t)(&((glRaytracingLight_s::class_172 *)0)->pad1), sizeof( ((glRaytracingLight_s::class_172 *)0)->pad1 ) },
// { "float", "volumetricScattering", (intptr_t)(&((glRaytracingLight_s::class_172 *)0)->volumetricScattering), sizeof( ((glRaytracingLight_s::class_172 *)0)->volumetricScattering ) },
static classVariableInfo_t glRaytracingLight_s_class_173_typeInfo[] = {
// { "float", "pad1", (intptr_t)(&((glRaytracingLight_s::class_173 *)0)->pad1), sizeof( ((glRaytracingLight_s::class_173 *)0)->pad1 ) },
// { "float", "volumetricScattering", (intptr_t)(&((glRaytracingLight_s::class_173 *)0)->volumetricScattering), sizeof( ((glRaytracingLight_s::class_173 *)0)->volumetricScattering ) },
{ NULL, 0 }
};
@@ -5107,11 +5141,11 @@ static classVariableInfo_t frameLookup_t_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t class_281_class_281_typeInfo[] = {
// { "const idSoundShader *", "soundShader", (intptr_t)(&((class_281::class_281 *)0)->soundShader), sizeof( ((class_281::class_281 *)0)->soundShader ) },
// { "const function_t *", "function", (intptr_t)(&((class_281::class_281 *)0)->function), sizeof( ((class_281::class_281 *)0)->function ) },
// { "const idDeclSkin *", "skin", (intptr_t)(&((class_281::class_281 *)0)->skin), sizeof( ((class_281::class_281 *)0)->skin ) },
// { "int", "index", (intptr_t)(&((class_281::class_281 *)0)->index), sizeof( ((class_281::class_281 *)0)->index ) },
static classVariableInfo_t class_282_class_282_typeInfo[] = {
// { "const idSoundShader *", "soundShader", (intptr_t)(&((class_282::class_282 *)0)->soundShader), sizeof( ((class_282::class_282 *)0)->soundShader ) },
// { "const function_t *", "function", (intptr_t)(&((class_282::class_282 *)0)->function), sizeof( ((class_282::class_282 *)0)->function ) },
// { "const idDeclSkin *", "skin", (intptr_t)(&((class_282::class_282 *)0)->skin), sizeof( ((class_282::class_282 *)0)->skin ) },
// { "int", "index", (intptr_t)(&((class_282::class_282 *)0)->index), sizeof( ((class_282::class_282 *)0)->index ) },
{ NULL, 0 }
};
@@ -5279,7 +5313,8 @@ static classVariableInfo_t idClipModel_typeInfo[] = {
};
static classVariableInfo_t idClip_typeInfo[] = {
{ ": int", "numClipSectors", (intptr_t)(&((idClip *)0)->numClipSectors), sizeof( ((idClip *)0)->numClipSectors ) },
{ ": cmHandle_t", "worldCollisionModel", (intptr_t)(&((idClip *)0)->worldCollisionModel), sizeof( ((idClip *)0)->worldCollisionModel ) },
{ "int", "numClipSectors", (intptr_t)(&((idClip *)0)->numClipSectors), sizeof( ((idClip *)0)->numClipSectors ) },
{ "clipSector_s *", "clipSectors", (intptr_t)(&((idClip *)0)->clipSectors), sizeof( ((idClip *)0)->clipSectors ) },
{ "idBounds", "worldBounds", (intptr_t)(&((idClip *)0)->worldBounds), sizeof( ((idClip *)0)->worldBounds ) },
{ "idClipModel", "temporaryClipModel", (intptr_t)(&((idClip *)0)->temporaryClipModel), sizeof( ((idClip *)0)->temporaryClipModel ) },
@@ -5541,6 +5576,8 @@ static classVariableInfo_t idGameLocal_typeInfo[] = {
{ "idStrList", "shakeSounds", (intptr_t)(&((idGameLocal *)0)->shakeSounds), sizeof( ((idGameLocal *)0)->shakeSounds ) },
{ "byte[16384]", "lagometer", (intptr_t)(&((idGameLocal *)0)->lagometer), sizeof( ((idGameLocal *)0)->lagometer ) },
{ "idList < rvmGameDelayRemoveEntry_t >", "delayRemoveEntities", (intptr_t)(&((idGameLocal *)0)->delayRemoveEntities), sizeof( ((idGameLocal *)0)->delayRemoveEntities ) },
{ "const idDeclEntityDef *", "botItemTable", (intptr_t)(&((idGameLocal *)0)->botItemTable), sizeof( ((idGameLocal *)0)->botItemTable ) },
{ "idAAS *", "bot_aas", (intptr_t)(&((idGameLocal *)0)->bot_aas), sizeof( ((idGameLocal *)0)->bot_aas ) },
{ NULL, 0 }
};
@@ -6672,6 +6709,7 @@ static classVariableInfo_t idActor_typeInfo[] = {
{ "idAnimState", "headAnim", (intptr_t)(&((idActor *)0)->headAnim), sizeof( ((idActor *)0)->headAnim ) },
{ "idAnimState", "torsoAnim", (intptr_t)(&((idActor *)0)->torsoAnim), sizeof( ((idActor *)0)->torsoAnim ) },
{ "idAnimState", "legsAnim", (intptr_t)(&((idActor *)0)->legsAnim), sizeof( ((idActor *)0)->legsAnim ) },
{ "rvStateThread", "stateThread", (intptr_t)(&((idActor *)0)->stateThread), sizeof( ((idActor *)0)->stateThread ) },
{ "bool", "allowPain", (intptr_t)(&((idActor *)0)->allowPain), sizeof( ((idActor *)0)->allowPain ) },
{ "bool", "allowEyeFocus", (intptr_t)(&((idActor *)0)->allowEyeFocus), sizeof( ((idActor *)0)->allowEyeFocus ) },
{ "bool", "finalBoss", (intptr_t)(&((idActor *)0)->finalBoss), sizeof( ((idActor *)0)->finalBoss ) },
@@ -6928,6 +6966,7 @@ static classVariableInfo_t idItem_typeInfo[] = {
{ "bool", "spin", (intptr_t)(&((idItem *)0)->spin), sizeof( ((idItem *)0)->spin ) },
{ "bool", "pulse", (intptr_t)(&((idItem *)0)->pulse), sizeof( ((idItem *)0)->pulse ) },
{ "bool", "canPickUp", (intptr_t)(&((idItem *)0)->canPickUp), sizeof( ((idItem *)0)->canPickUp ) },
{ "int", "modelindex", (intptr_t)(&((idItem *)0)->modelindex), sizeof( ((idItem *)0)->modelindex ) },
{ "int", "itemShellHandle", (intptr_t)(&((idItem *)0)->itemShellHandle), sizeof( ((idItem *)0)->itemShellHandle ) },
{ "const idMaterial *", "shellMaterial", (intptr_t)(&((idItem *)0)->shellMaterial), sizeof( ((idItem *)0)->shellMaterial ) },
{ "mutable bool", "inView", (intptr_t)(&((idItem *)0)->inView), sizeof( ((idItem *)0)->inView ) },
@@ -7183,6 +7222,7 @@ static classVariableInfo_t idPlayer_typeInfo[] = {
{ "idVec3", "firstPersonViewOrigin", (intptr_t)(&((idPlayer *)0)->firstPersonViewOrigin), sizeof( ((idPlayer *)0)->firstPersonViewOrigin ) },
{ "idMat3", "firstPersonViewAxis", (intptr_t)(&((idPlayer *)0)->firstPersonViewAxis), sizeof( ((idPlayer *)0)->firstPersonViewAxis ) },
{ "idDragEntity", "dragEntity", (intptr_t)(&((idPlayer *)0)->dragEntity), sizeof( ((idPlayer *)0)->dragEntity ) },
{ "idStr", "netname", (intptr_t)(&((idPlayer *)0)->netname), sizeof( ((idPlayer *)0)->netname ) },
{ ": jointHandle_t", "hipJoint", (intptr_t)(&((idPlayer *)0)->hipJoint), sizeof( ((idPlayer *)0)->hipJoint ) },
{ "jointHandle_t", "chestJoint", (intptr_t)(&((idPlayer *)0)->chestJoint), sizeof( ((idPlayer *)0)->chestJoint ) },
{ "jointHandle_t", "headJoint", (intptr_t)(&((idPlayer *)0)->headJoint), sizeof( ((idPlayer *)0)->headJoint ) },
@@ -7835,30 +7875,6 @@ static classVariableInfo_t idMoveState_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t idAASFindCover_typeInfo[] = {
{ ": pvsHandle_t", "hidePVS", (intptr_t)(&((idAASFindCover *)0)->hidePVS), sizeof( ((idAASFindCover *)0)->hidePVS ) },
{ "int[4]", "PVSAreas", (intptr_t)(&((idAASFindCover *)0)->PVSAreas), sizeof( ((idAASFindCover *)0)->PVSAreas ) },
{ NULL, 0 }
};
static classVariableInfo_t idAASFindAreaOutOfRange_typeInfo[] = {
{ ": idVec3", "targetPos", (intptr_t)(&((idAASFindAreaOutOfRange *)0)->targetPos), sizeof( ((idAASFindAreaOutOfRange *)0)->targetPos ) },
{ "float", "maxDistSqr", (intptr_t)(&((idAASFindAreaOutOfRange *)0)->maxDistSqr), sizeof( ((idAASFindAreaOutOfRange *)0)->maxDistSqr ) },
{ NULL, 0 }
};
static classVariableInfo_t idAASFindAttackPosition_typeInfo[] = {
{ ": const idAI *", "self", (intptr_t)(&((idAASFindAttackPosition *)0)->self), sizeof( ((idAASFindAttackPosition *)0)->self ) },
{ "idEntity *", "target", (intptr_t)(&((idAASFindAttackPosition *)0)->target), sizeof( ((idAASFindAttackPosition *)0)->target ) },
{ "idBounds", "excludeBounds", (intptr_t)(&((idAASFindAttackPosition *)0)->excludeBounds), sizeof( ((idAASFindAttackPosition *)0)->excludeBounds ) },
{ "idVec3", "targetPos", (intptr_t)(&((idAASFindAttackPosition *)0)->targetPos), sizeof( ((idAASFindAttackPosition *)0)->targetPos ) },
{ "idVec3", "fireOffset", (intptr_t)(&((idAASFindAttackPosition *)0)->fireOffset), sizeof( ((idAASFindAttackPosition *)0)->fireOffset ) },
{ "idMat3", "gravityAxis", (intptr_t)(&((idAASFindAttackPosition *)0)->gravityAxis), sizeof( ((idAASFindAttackPosition *)0)->gravityAxis ) },
{ "pvsHandle_t", "targetPVS", (intptr_t)(&((idAASFindAttackPosition *)0)->targetPVS), sizeof( ((idAASFindAttackPosition *)0)->targetPVS ) },
{ "int[4]", "PVSAreas", (intptr_t)(&((idAASFindAttackPosition *)0)->PVSAreas), sizeof( ((idAASFindAttackPosition *)0)->PVSAreas ) },
{ NULL, 0 }
};
static classVariableInfo_t idAI_typeInfo[] = {
{ ": idAAS *", "aas", (intptr_t)(&((idAI *)0)->aas), sizeof( ((idAI *)0)->aas ) },
{ "int", "travelFlags", (intptr_t)(&((idAI *)0)->travelFlags), sizeof( ((idAI *)0)->travelFlags ) },
@@ -8200,6 +8216,291 @@ static classVariableInfo_t rvmWeaponGrabber_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t fuzzyseperator_t_typeInfo[] = {
{ "bool", "inUse", (intptr_t)(&((fuzzyseperator_t *)0)->inUse), sizeof( ((fuzzyseperator_t *)0)->inUse ) },
{ "int", "index", (intptr_t)(&((fuzzyseperator_t *)0)->index), sizeof( ((fuzzyseperator_t *)0)->index ) },
{ "int", "value", (intptr_t)(&((fuzzyseperator_t *)0)->value), sizeof( ((fuzzyseperator_t *)0)->value ) },
{ "int", "type", (intptr_t)(&((fuzzyseperator_t *)0)->type), sizeof( ((fuzzyseperator_t *)0)->type ) },
{ "float", "weight", (intptr_t)(&((fuzzyseperator_t *)0)->weight), sizeof( ((fuzzyseperator_t *)0)->weight ) },
{ "float", "minweight", (intptr_t)(&((fuzzyseperator_t *)0)->minweight), sizeof( ((fuzzyseperator_t *)0)->minweight ) },
{ "float", "maxweight", (intptr_t)(&((fuzzyseperator_t *)0)->maxweight), sizeof( ((fuzzyseperator_t *)0)->maxweight ) },
{ "fuzzyseperator_t *", "child", (intptr_t)(&((fuzzyseperator_t *)0)->child), sizeof( ((fuzzyseperator_t *)0)->child ) },
{ "fuzzyseperator_t *", "next", (intptr_t)(&((fuzzyseperator_t *)0)->next), sizeof( ((fuzzyseperator_t *)0)->next ) },
{ NULL, 0 }
};
static classVariableInfo_t weight_t_typeInfo[] = {
{ "idStr", "name", (intptr_t)(&((weight_t *)0)->name), sizeof( ((weight_t *)0)->name ) },
{ "fuzzyseperator_t *", "firstseperator", (intptr_t)(&((weight_t *)0)->firstseperator), sizeof( ((weight_t *)0)->firstseperator ) },
{ NULL, 0 }
};
static classVariableInfo_t weightconfig_t_typeInfo[] = {
{ "bool", "inUse", (intptr_t)(&((weightconfig_t *)0)->inUse), sizeof( ((weightconfig_t *)0)->inUse ) },
{ "int", "numweights", (intptr_t)(&((weightconfig_t *)0)->numweights), sizeof( ((weightconfig_t *)0)->numweights ) },
{ "weight_t[128]", "weights", (intptr_t)(&((weightconfig_t *)0)->weights), sizeof( ((weightconfig_t *)0)->weights ) },
{ "idStr", "filename", (intptr_t)(&((weightconfig_t *)0)->filename), sizeof( ((weightconfig_t *)0)->filename ) },
{ NULL, 0 }
};
static classVariableInfo_t cvalue_typeInfo[] = {
{ "int", "integer", (intptr_t)(&((cvalue *)0)->integer), sizeof( ((cvalue *)0)->integer ) },
{ "float", "_float", (intptr_t)(&((cvalue *)0)->_float), sizeof( ((cvalue *)0)->_float ) },
{ "idStr", "string", (intptr_t)(&((cvalue *)0)->string), sizeof( ((cvalue *)0)->string ) },
{ NULL, 0 }
};
static classVariableInfo_t bot_characteristic_t_typeInfo[] = {
{ "char", "type", (intptr_t)(&((bot_characteristic_t *)0)->type), sizeof( ((bot_characteristic_t *)0)->type ) },
{ "cvalue", "value", (intptr_t)(&((bot_characteristic_t *)0)->value), sizeof( ((bot_characteristic_t *)0)->value ) },
{ NULL, 0 }
};
static classVariableInfo_t bot_character_t_typeInfo[] = {
{ "idStr", "filename", (intptr_t)(&((bot_character_t *)0)->filename), sizeof( ((bot_character_t *)0)->filename ) },
{ "bool", "inUse", (intptr_t)(&((bot_character_t *)0)->inUse), sizeof( ((bot_character_t *)0)->inUse ) },
{ "float", "skill", (intptr_t)(&((bot_character_t *)0)->skill), sizeof( ((bot_character_t *)0)->skill ) },
{ "bot_characteristic_t[80]", "c", (intptr_t)(&((bot_character_t *)0)->c), sizeof( ((bot_character_t *)0)->c ) },
{ NULL, 0 }
};
static classVariableInfo_t bot_input_t_typeInfo[] = {
{ "float", "thinktime", (intptr_t)(&((bot_input_t *)0)->thinktime), sizeof( ((bot_input_t *)0)->thinktime ) },
{ "idVec3", "dir", (intptr_t)(&((bot_input_t *)0)->dir), sizeof( ((bot_input_t *)0)->dir ) },
{ "float", "speed", (intptr_t)(&((bot_input_t *)0)->speed), sizeof( ((bot_input_t *)0)->speed ) },
{ "idAngles", "viewangles", (intptr_t)(&((bot_input_t *)0)->viewangles), sizeof( ((bot_input_t *)0)->viewangles ) },
{ "int", "actionflags", (intptr_t)(&((bot_input_t *)0)->actionflags), sizeof( ((bot_input_t *)0)->actionflags ) },
{ "int", "weapon", (intptr_t)(&((bot_input_t *)0)->weapon), sizeof( ((bot_input_t *)0)->weapon ) },
{ "int", "lastWeaponNum", (intptr_t)(&((bot_input_t *)0)->lastWeaponNum), sizeof( ((bot_input_t *)0)->lastWeaponNum ) },
{ "bool", "respawn", (intptr_t)(&((bot_input_t *)0)->respawn), sizeof( ((bot_input_t *)0)->respawn ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmBotUtil_typeInfo[] = {
{ NULL, 0 }
};
static classVariableInfo_t idBotCharacterStatsManager_typeInfo[] = {
{ "bot_character_t *", "default_char_profile", (intptr_t)(&((idBotCharacterStatsManager *)0)->default_char_profile), sizeof( ((idBotCharacterStatsManager *)0)->default_char_profile ) },
{ "bot_character_t[256]", "charStatsList", (intptr_t)(&((idBotCharacterStatsManager *)0)->charStatsList), sizeof( ((idBotCharacterStatsManager *)0)->charStatsList ) },
{ NULL, 0 }
};
static classVariableInfo_t idBotFuzzyWeightManager_typeInfo[] = {
{ "weightconfig_t[128]", "weightFileList", (intptr_t)(&((idBotFuzzyWeightManager *)0)->weightFileList), sizeof( ((idBotFuzzyWeightManager *)0)->weightFileList ) },
{ "fuzzyseperator_t[8192]", "fuzzyseperators", (intptr_t)(&((idBotFuzzyWeightManager *)0)->fuzzyseperators), sizeof( ((idBotFuzzyWeightManager *)0)->fuzzyseperators ) },
{ NULL, 0 }
};
static classVariableInfo_t projectileinfo_t_typeInfo[] = {
{ "idStr", "name", (intptr_t)(&((projectileinfo_t *)0)->name), sizeof( ((projectileinfo_t *)0)->name ) },
{ "idStr", "model", (intptr_t)(&((projectileinfo_t *)0)->model), sizeof( ((projectileinfo_t *)0)->model ) },
{ "int", "flags", (intptr_t)(&((projectileinfo_t *)0)->flags), sizeof( ((projectileinfo_t *)0)->flags ) },
{ "float", "gravity", (intptr_t)(&((projectileinfo_t *)0)->gravity), sizeof( ((projectileinfo_t *)0)->gravity ) },
{ "int", "damage", (intptr_t)(&((projectileinfo_t *)0)->damage), sizeof( ((projectileinfo_t *)0)->damage ) },
{ "float", "radius", (intptr_t)(&((projectileinfo_t *)0)->radius), sizeof( ((projectileinfo_t *)0)->radius ) },
{ "int", "visdamage", (intptr_t)(&((projectileinfo_t *)0)->visdamage), sizeof( ((projectileinfo_t *)0)->visdamage ) },
{ "int", "damagetype", (intptr_t)(&((projectileinfo_t *)0)->damagetype), sizeof( ((projectileinfo_t *)0)->damagetype ) },
{ "int", "healthinc", (intptr_t)(&((projectileinfo_t *)0)->healthinc), sizeof( ((projectileinfo_t *)0)->healthinc ) },
{ "float", "push", (intptr_t)(&((projectileinfo_t *)0)->push), sizeof( ((projectileinfo_t *)0)->push ) },
{ "float", "detonation", (intptr_t)(&((projectileinfo_t *)0)->detonation), sizeof( ((projectileinfo_t *)0)->detonation ) },
{ "float", "bounce", (intptr_t)(&((projectileinfo_t *)0)->bounce), sizeof( ((projectileinfo_t *)0)->bounce ) },
{ "float", "bouncefric", (intptr_t)(&((projectileinfo_t *)0)->bouncefric), sizeof( ((projectileinfo_t *)0)->bouncefric ) },
{ "float", "bouncestop", (intptr_t)(&((projectileinfo_t *)0)->bouncestop), sizeof( ((projectileinfo_t *)0)->bouncestop ) },
{ NULL, 0 }
};
static classVariableInfo_t weaponinfo_t_typeInfo[] = {
{ "int", "valid", (intptr_t)(&((weaponinfo_t *)0)->valid), sizeof( ((weaponinfo_t *)0)->valid ) },
{ "int", "number", (intptr_t)(&((weaponinfo_t *)0)->number), sizeof( ((weaponinfo_t *)0)->number ) },
{ "idStr", "name", (intptr_t)(&((weaponinfo_t *)0)->name), sizeof( ((weaponinfo_t *)0)->name ) },
{ "idStr", "model", (intptr_t)(&((weaponinfo_t *)0)->model), sizeof( ((weaponinfo_t *)0)->model ) },
{ "int", "level", (intptr_t)(&((weaponinfo_t *)0)->level), sizeof( ((weaponinfo_t *)0)->level ) },
{ "int", "weaponindex", (intptr_t)(&((weaponinfo_t *)0)->weaponindex), sizeof( ((weaponinfo_t *)0)->weaponindex ) },
{ "int", "flags", (intptr_t)(&((weaponinfo_t *)0)->flags), sizeof( ((weaponinfo_t *)0)->flags ) },
{ "idStr", "projectile", (intptr_t)(&((weaponinfo_t *)0)->projectile), sizeof( ((weaponinfo_t *)0)->projectile ) },
{ "int", "numprojectiles", (intptr_t)(&((weaponinfo_t *)0)->numprojectiles), sizeof( ((weaponinfo_t *)0)->numprojectiles ) },
{ "float", "hspread", (intptr_t)(&((weaponinfo_t *)0)->hspread), sizeof( ((weaponinfo_t *)0)->hspread ) },
{ "float", "vspread", (intptr_t)(&((weaponinfo_t *)0)->vspread), sizeof( ((weaponinfo_t *)0)->vspread ) },
{ "float", "speed", (intptr_t)(&((weaponinfo_t *)0)->speed), sizeof( ((weaponinfo_t *)0)->speed ) },
{ "float", "acceleration", (intptr_t)(&((weaponinfo_t *)0)->acceleration), sizeof( ((weaponinfo_t *)0)->acceleration ) },
{ "idVec3", "recoil", (intptr_t)(&((weaponinfo_t *)0)->recoil), sizeof( ((weaponinfo_t *)0)->recoil ) },
{ "idVec3", "offset", (intptr_t)(&((weaponinfo_t *)0)->offset), sizeof( ((weaponinfo_t *)0)->offset ) },
{ "idVec3", "angleoffset", (intptr_t)(&((weaponinfo_t *)0)->angleoffset), sizeof( ((weaponinfo_t *)0)->angleoffset ) },
{ "float", "extrazvelocity", (intptr_t)(&((weaponinfo_t *)0)->extrazvelocity), sizeof( ((weaponinfo_t *)0)->extrazvelocity ) },
{ "int", "ammoamount", (intptr_t)(&((weaponinfo_t *)0)->ammoamount), sizeof( ((weaponinfo_t *)0)->ammoamount ) },
{ "int", "ammoindex", (intptr_t)(&((weaponinfo_t *)0)->ammoindex), sizeof( ((weaponinfo_t *)0)->ammoindex ) },
{ "float", "activate", (intptr_t)(&((weaponinfo_t *)0)->activate), sizeof( ((weaponinfo_t *)0)->activate ) },
{ "float", "reload", (intptr_t)(&((weaponinfo_t *)0)->reload), sizeof( ((weaponinfo_t *)0)->reload ) },
{ "float", "spinup", (intptr_t)(&((weaponinfo_t *)0)->spinup), sizeof( ((weaponinfo_t *)0)->spinup ) },
{ "float", "spindown", (intptr_t)(&((weaponinfo_t *)0)->spindown), sizeof( ((weaponinfo_t *)0)->spindown ) },
{ "projectileinfo_t", "proj", (intptr_t)(&((weaponinfo_t *)0)->proj), sizeof( ((weaponinfo_t *)0)->proj ) },
{ NULL, 0 }
};
static classVariableInfo_t bot_weaponstate_t_typeInfo[] = {
{ "bool", "inUse", (intptr_t)(&((bot_weaponstate_t *)0)->inUse), sizeof( ((bot_weaponstate_t *)0)->inUse ) },
{ "weightconfig_t *", "weaponweightconfig", (intptr_t)(&((bot_weaponstate_t *)0)->weaponweightconfig), sizeof( ((bot_weaponstate_t *)0)->weaponweightconfig ) },
{ "int[32]", "weaponweightindex", (intptr_t)(&((bot_weaponstate_t *)0)->weaponweightindex), sizeof( ((bot_weaponstate_t *)0)->weaponweightindex ) },
{ NULL, 0 }
};
static classVariableInfo_t idBotWeaponInfoManager_typeInfo[] = {
{ ": idList < projectileinfo_t >", "projectileinfo", (intptr_t)(&((idBotWeaponInfoManager *)0)->projectileinfo), sizeof( ((idBotWeaponInfoManager *)0)->projectileinfo ) },
{ "bot_weaponstate_t[33]", "botweaponstates", (intptr_t)(&((idBotWeaponInfoManager *)0)->botweaponstates), sizeof( ((idBotWeaponInfoManager *)0)->botweaponstates ) },
{ "weaponinfo_t[32]", "weaponinfo", (intptr_t)(&((idBotWeaponInfoManager *)0)->weaponinfo), sizeof( ((idBotWeaponInfoManager *)0)->weaponinfo ) },
{ NULL, 0 }
};
static classVariableInfo_t bot_goal_t_typeInfo[] = {
{ "int", "framenum", (intptr_t)(&((bot_goal_t *)0)->framenum), sizeof( ((bot_goal_t *)0)->framenum ) },
{ "idVec3", "origin", (intptr_t)(&((bot_goal_t *)0)->origin), sizeof( ((bot_goal_t *)0)->origin ) },
{ "int", "areanum", (intptr_t)(&((bot_goal_t *)0)->areanum), sizeof( ((bot_goal_t *)0)->areanum ) },
{ "idVec3", "mins", (intptr_t)(&((bot_goal_t *)0)->mins), sizeof( ((bot_goal_t *)0)->mins ) },
{ "idVec3", "maxs", (intptr_t)(&((bot_goal_t *)0)->maxs), sizeof( ((bot_goal_t *)0)->maxs ) },
{ "int", "entitynum", (intptr_t)(&((bot_goal_t *)0)->entitynum), sizeof( ((bot_goal_t *)0)->entitynum ) },
{ "int", "number", (intptr_t)(&((bot_goal_t *)0)->number), sizeof( ((bot_goal_t *)0)->number ) },
{ "int", "flags", (intptr_t)(&((bot_goal_t *)0)->flags), sizeof( ((bot_goal_t *)0)->flags ) },
{ "int", "iteminfo", (intptr_t)(&((bot_goal_t *)0)->iteminfo), sizeof( ((bot_goal_t *)0)->iteminfo ) },
{ NULL, 0 }
};
static classVariableInfo_t maplocation_t_typeInfo[] = {
{ "idVec3", "origin", (intptr_t)(&((maplocation_t *)0)->origin), sizeof( ((maplocation_t *)0)->origin ) },
{ "int", "areanum", (intptr_t)(&((maplocation_t *)0)->areanum), sizeof( ((maplocation_t *)0)->areanum ) },
{ "idStr", "name", (intptr_t)(&((maplocation_t *)0)->name), sizeof( ((maplocation_t *)0)->name ) },
{ "maplocation_t *", "next", (intptr_t)(&((maplocation_t *)0)->next), sizeof( ((maplocation_t *)0)->next ) },
{ NULL, 0 }
};
static classVariableInfo_t campspot_t_typeInfo[] = {
{ "idVec3", "origin", (intptr_t)(&((campspot_t *)0)->origin), sizeof( ((campspot_t *)0)->origin ) },
{ "int", "areanum", (intptr_t)(&((campspot_t *)0)->areanum), sizeof( ((campspot_t *)0)->areanum ) },
{ "idStr", "name", (intptr_t)(&((campspot_t *)0)->name), sizeof( ((campspot_t *)0)->name ) },
{ "float", "range", (intptr_t)(&((campspot_t *)0)->range), sizeof( ((campspot_t *)0)->range ) },
{ "float", "weight", (intptr_t)(&((campspot_t *)0)->weight), sizeof( ((campspot_t *)0)->weight ) },
{ "float", "wait", (intptr_t)(&((campspot_t *)0)->wait), sizeof( ((campspot_t *)0)->wait ) },
{ "float", "random", (intptr_t)(&((campspot_t *)0)->random), sizeof( ((campspot_t *)0)->random ) },
{ NULL, 0 }
};
static classVariableInfo_t levelitem_t_typeInfo[] = {
{ "idStr", "name", (intptr_t)(&((levelitem_t *)0)->name), sizeof( ((levelitem_t *)0)->name ) },
{ "int", "number", (intptr_t)(&((levelitem_t *)0)->number), sizeof( ((levelitem_t *)0)->number ) },
{ "int", "iteminfo", (intptr_t)(&((levelitem_t *)0)->iteminfo), sizeof( ((levelitem_t *)0)->iteminfo ) },
{ "int", "flags", (intptr_t)(&((levelitem_t *)0)->flags), sizeof( ((levelitem_t *)0)->flags ) },
{ "float", "weight", (intptr_t)(&((levelitem_t *)0)->weight), sizeof( ((levelitem_t *)0)->weight ) },
{ "idVec3", "origin", (intptr_t)(&((levelitem_t *)0)->origin), sizeof( ((levelitem_t *)0)->origin ) },
{ "idVec3", "goalorigin", (intptr_t)(&((levelitem_t *)0)->goalorigin), sizeof( ((levelitem_t *)0)->goalorigin ) },
{ "idItem *", "item", (intptr_t)(&((levelitem_t *)0)->item), sizeof( ((levelitem_t *)0)->item ) },
{ "float", "timeout", (intptr_t)(&((levelitem_t *)0)->timeout), sizeof( ((levelitem_t *)0)->timeout ) },
{ "levelitem_t *", "prev", (intptr_t)(&((levelitem_t *)0)->prev), sizeof( ((levelitem_t *)0)->prev ) },
{ "levelitem_t *", "next", (intptr_t)(&((levelitem_t *)0)->next), sizeof( ((levelitem_t *)0)->next ) },
{ NULL, 0 }
};
static classVariableInfo_t iteminfo_t_typeInfo[] = {
{ "idStr", "classname", (intptr_t)(&((iteminfo_t *)0)->classname), sizeof( ((iteminfo_t *)0)->classname ) },
{ "idStr", "name", (intptr_t)(&((iteminfo_t *)0)->name), sizeof( ((iteminfo_t *)0)->name ) },
{ "idStr", "model", (intptr_t)(&((iteminfo_t *)0)->model), sizeof( ((iteminfo_t *)0)->model ) },
{ "int", "modelindex", (intptr_t)(&((iteminfo_t *)0)->modelindex), sizeof( ((iteminfo_t *)0)->modelindex ) },
{ "int", "type", (intptr_t)(&((iteminfo_t *)0)->type), sizeof( ((iteminfo_t *)0)->type ) },
{ "int", "index", (intptr_t)(&((iteminfo_t *)0)->index), sizeof( ((iteminfo_t *)0)->index ) },
{ "float", "respawntime", (intptr_t)(&((iteminfo_t *)0)->respawntime), sizeof( ((iteminfo_t *)0)->respawntime ) },
{ "idVec3", "mins", (intptr_t)(&((iteminfo_t *)0)->mins), sizeof( ((iteminfo_t *)0)->mins ) },
{ "idVec3", "maxs", (intptr_t)(&((iteminfo_t *)0)->maxs), sizeof( ((iteminfo_t *)0)->maxs ) },
{ "int", "number", (intptr_t)(&((iteminfo_t *)0)->number), sizeof( ((iteminfo_t *)0)->number ) },
{ NULL, 0 }
};
static classVariableInfo_t itemconfig_t_typeInfo[] = {
{ "int", "numiteminfo", (intptr_t)(&((itemconfig_t *)0)->numiteminfo), sizeof( ((itemconfig_t *)0)->numiteminfo ) },
{ "iteminfo_t[256]", "iteminfo", (intptr_t)(&((itemconfig_t *)0)->iteminfo), sizeof( ((itemconfig_t *)0)->iteminfo ) },
{ NULL, 0 }
};
static classVariableInfo_t bot_goalstate_t_typeInfo[] = {
{ "weightconfig_t *", "itemweightconfig", (intptr_t)(&((bot_goalstate_t *)0)->itemweightconfig), sizeof( ((bot_goalstate_t *)0)->itemweightconfig ) },
{ "int *", "itemweightindex", (intptr_t)(&((bot_goalstate_t *)0)->itemweightindex), sizeof( ((bot_goalstate_t *)0)->itemweightindex ) },
{ "int", "client", (intptr_t)(&((bot_goalstate_t *)0)->client), sizeof( ((bot_goalstate_t *)0)->client ) },
{ "int", "lastreachabilityarea", (intptr_t)(&((bot_goalstate_t *)0)->lastreachabilityarea), sizeof( ((bot_goalstate_t *)0)->lastreachabilityarea ) },
{ "bot_goal_t[8]", "goalstack", (intptr_t)(&((bot_goalstate_t *)0)->goalstack), sizeof( ((bot_goalstate_t *)0)->goalstack ) },
{ "int", "goalstacktop", (intptr_t)(&((bot_goalstate_t *)0)->goalstacktop), sizeof( ((bot_goalstate_t *)0)->goalstacktop ) },
{ "int[256]", "avoidgoals", (intptr_t)(&((bot_goalstate_t *)0)->avoidgoals), sizeof( ((bot_goalstate_t *)0)->avoidgoals ) },
{ "float[256]", "avoidgoaltimes", (intptr_t)(&((bot_goalstate_t *)0)->avoidgoaltimes), sizeof( ((bot_goalstate_t *)0)->avoidgoaltimes ) },
{ NULL, 0 }
};
static classVariableInfo_t idBotGoalManager_typeInfo[] = {
{ ": bot_goalstate_t[33]", "botgoalstates", (intptr_t)(&((idBotGoalManager *)0)->botgoalstates), sizeof( ((idBotGoalManager *)0)->botgoalstates ) },
{ "itemconfig_t", "itemconfiglocal", (intptr_t)(&((idBotGoalManager *)0)->itemconfiglocal), sizeof( ((idBotGoalManager *)0)->itemconfiglocal ) },
{ "itemconfig_t *", "itemconfig", (intptr_t)(&((idBotGoalManager *)0)->itemconfig), sizeof( ((idBotGoalManager *)0)->itemconfig ) },
{ "levelitem_t[256]", "levelitemheap", (intptr_t)(&((idBotGoalManager *)0)->levelitemheap), sizeof( ((idBotGoalManager *)0)->levelitemheap ) },
{ "levelitem_t *", "freelevelitems", (intptr_t)(&((idBotGoalManager *)0)->freelevelitems), sizeof( ((idBotGoalManager *)0)->freelevelitems ) },
{ "levelitem_t *", "levelitems", (intptr_t)(&((idBotGoalManager *)0)->levelitems), sizeof( ((idBotGoalManager *)0)->levelitems ) },
{ "int", "numlevelitems", (intptr_t)(&((idBotGoalManager *)0)->numlevelitems), sizeof( ((idBotGoalManager *)0)->numlevelitems ) },
{ "idList < maplocation_t >", "maplocations", (intptr_t)(&((idBotGoalManager *)0)->maplocations), sizeof( ((idBotGoalManager *)0)->maplocations ) },
{ "idList < campspot_t >", "campspots", (intptr_t)(&((idBotGoalManager *)0)->campspots), sizeof( ((idBotGoalManager *)0)->campspots ) },
{ NULL, 0 }
};
static classVariableInfo_t bot_state_t_typeInfo[] = {
{ "bot_character_t *", "character", (intptr_t)(&((bot_state_t *)0)->character), sizeof( ((bot_state_t *)0)->character ) },
{ "int", "gs", (intptr_t)(&((bot_state_t *)0)->gs), sizeof( ((bot_state_t *)0)->gs ) },
{ "int", "ws", (intptr_t)(&((bot_state_t *)0)->ws), sizeof( ((bot_state_t *)0)->ws ) },
{ "int", "enemy", (intptr_t)(&((bot_state_t *)0)->enemy), sizeof( ((bot_state_t *)0)->enemy ) },
{ "int", "client", (intptr_t)(&((bot_state_t *)0)->client), sizeof( ((bot_state_t *)0)->client ) },
{ "idEntity *", "attackerEntity", (intptr_t)(&((bot_state_t *)0)->attackerEntity), sizeof( ((bot_state_t *)0)->attackerEntity ) },
{ "int", "lasthealth", (intptr_t)(&((bot_state_t *)0)->lasthealth), sizeof( ((bot_state_t *)0)->lasthealth ) },
{ "int", "entitynum", (intptr_t)(&((bot_state_t *)0)->entitynum), sizeof( ((bot_state_t *)0)->entitynum ) },
{ "int", "setupcount", (intptr_t)(&((bot_state_t *)0)->setupcount), sizeof( ((bot_state_t *)0)->setupcount ) },
{ "int", "ltg_time", (intptr_t)(&((bot_state_t *)0)->ltg_time), sizeof( ((bot_state_t *)0)->ltg_time ) },
{ "int", "flags", (intptr_t)(&((bot_state_t *)0)->flags), sizeof( ((bot_state_t *)0)->flags ) },
{ "int", "weaponnum", (intptr_t)(&((bot_state_t *)0)->weaponnum), sizeof( ((bot_state_t *)0)->weaponnum ) },
{ "bool", "useRandomPosition", (intptr_t)(&((bot_state_t *)0)->useRandomPosition), sizeof( ((bot_state_t *)0)->useRandomPosition ) },
{ "float", "thinktime", (intptr_t)(&((bot_state_t *)0)->thinktime), sizeof( ((bot_state_t *)0)->thinktime ) },
{ "float", "chase_time", (intptr_t)(&((bot_state_t *)0)->chase_time), sizeof( ((bot_state_t *)0)->chase_time ) },
{ "float", "attackjump_time", (intptr_t)(&((bot_state_t *)0)->attackjump_time), sizeof( ((bot_state_t *)0)->attackjump_time ) },
{ "float", "attackcrouch_time", (intptr_t)(&((bot_state_t *)0)->attackcrouch_time), sizeof( ((bot_state_t *)0)->attackcrouch_time ) },
{ "float", "attackstrafe_time", (intptr_t)(&((bot_state_t *)0)->attackstrafe_time), sizeof( ((bot_state_t *)0)->attackstrafe_time ) },
{ "float", "attackchase_time", (intptr_t)(&((bot_state_t *)0)->attackchase_time), sizeof( ((bot_state_t *)0)->attackchase_time ) },
{ "float", "firethrottlewait_time", (intptr_t)(&((bot_state_t *)0)->firethrottlewait_time), sizeof( ((bot_state_t *)0)->firethrottlewait_time ) },
{ "float", "firethrottleshoot_time", (intptr_t)(&((bot_state_t *)0)->firethrottleshoot_time), sizeof( ((bot_state_t *)0)->firethrottleshoot_time ) },
{ "float", "nbg_time", (intptr_t)(&((bot_state_t *)0)->nbg_time), sizeof( ((bot_state_t *)0)->nbg_time ) },
{ "float", "entergame_time", (intptr_t)(&((bot_state_t *)0)->entergame_time), sizeof( ((bot_state_t *)0)->entergame_time ) },
{ "float", "weaponchange_time", (intptr_t)(&((bot_state_t *)0)->weaponchange_time), sizeof( ((bot_state_t *)0)->weaponchange_time ) },
{ "float", "check_time", (intptr_t)(&((bot_state_t *)0)->check_time), sizeof( ((bot_state_t *)0)->check_time ) },
{ "float", "teleport_time", (intptr_t)(&((bot_state_t *)0)->teleport_time), sizeof( ((bot_state_t *)0)->teleport_time ) },
{ "float", "enemyvisible_time", (intptr_t)(&((bot_state_t *)0)->enemyvisible_time), sizeof( ((bot_state_t *)0)->enemyvisible_time ) },
{ "int", "enemysuicide", (intptr_t)(&((bot_state_t *)0)->enemysuicide), sizeof( ((bot_state_t *)0)->enemysuicide ) },
{ "float", "enemysight_time", (intptr_t)(&((bot_state_t *)0)->enemysight_time), sizeof( ((bot_state_t *)0)->enemysight_time ) },
{ "float", "enemydeath_time", (intptr_t)(&((bot_state_t *)0)->enemydeath_time), sizeof( ((bot_state_t *)0)->enemydeath_time ) },
{ "float", "aggressiveAttackTime", (intptr_t)(&((bot_state_t *)0)->aggressiveAttackTime), sizeof( ((bot_state_t *)0)->aggressiveAttackTime ) },
{ "idVec3", "origin", (intptr_t)(&((bot_state_t *)0)->origin), sizeof( ((bot_state_t *)0)->origin ) },
{ "idVec3", "aimtarget", (intptr_t)(&((bot_state_t *)0)->aimtarget), sizeof( ((bot_state_t *)0)->aimtarget ) },
{ "idVec3", "random_move_position", (intptr_t)(&((bot_state_t *)0)->random_move_position), sizeof( ((bot_state_t *)0)->random_move_position ) },
{ "idVec3", "last_enemy_visible_position", (intptr_t)(&((bot_state_t *)0)->last_enemy_visible_position), sizeof( ((bot_state_t *)0)->last_enemy_visible_position ) },
{ "idAngles", "viewangles", (intptr_t)(&((bot_state_t *)0)->viewangles), sizeof( ((bot_state_t *)0)->viewangles ) },
{ "idVec3", "enemyorigin", (intptr_t)(&((bot_state_t *)0)->enemyorigin), sizeof( ((bot_state_t *)0)->enemyorigin ) },
{ "idVec3", "eye", (intptr_t)(&((bot_state_t *)0)->eye), sizeof( ((bot_state_t *)0)->eye ) },
{ "idVec3", "lastenemyorigin", (intptr_t)(&((bot_state_t *)0)->lastenemyorigin), sizeof( ((bot_state_t *)0)->lastenemyorigin ) },
{ "int[256]", "inventory", (intptr_t)(&((bot_state_t *)0)->inventory), sizeof( ((bot_state_t *)0)->inventory ) },
{ "bot_goal_t", "currentGoal", (intptr_t)(&((bot_state_t *)0)->currentGoal), sizeof( ((bot_state_t *)0)->currentGoal ) },
{ "bot_input_t", "botinput", (intptr_t)(&((bot_state_t *)0)->botinput), sizeof( ((bot_state_t *)0)->botinput ) },
{ NULL, 0 }
};
static classVariableInfo_t rvmBot_typeInfo[] = {
{ ": bot_state_t", "bs", (intptr_t)(&((rvmBot *)0)->bs), sizeof( ((rvmBot *)0)->bs ) },
{ "bool", "hasSpawned", (intptr_t)(&((rvmBot *)0)->hasSpawned), sizeof( ((rvmBot *)0)->hasSpawned ) },
{ ": int", "weapon_machinegun", (intptr_t)(&((rvmBot *)0)->weapon_machinegun), sizeof( ((rvmBot *)0)->weapon_machinegun ) },
{ "int", "weapon_shotgun", (intptr_t)(&((rvmBot *)0)->weapon_shotgun), sizeof( ((rvmBot *)0)->weapon_shotgun ) },
{ "int", "weapon_plasmagun", (intptr_t)(&((rvmBot *)0)->weapon_plasmagun), sizeof( ((rvmBot *)0)->weapon_plasmagun ) },
{ "int", "weapon_rocketlauncher", (intptr_t)(&((rvmBot *)0)->weapon_rocketlauncher), sizeof( ((rvmBot *)0)->weapon_rocketlauncher ) },
{ ": idAAS *", "aas", (intptr_t)(&((rvmBot *)0)->aas), sizeof( ((rvmBot *)0)->aas ) },
{ NULL, 0 }
};
static classTypeInfo_t classTypeInfo[] = {
// { "BITT< unsigned int B >", "", sizeof(BITT< unsigned int B >), BITT_unsigned_int_B__typeInfo },
{ "sysEvent_t", "", sizeof(sysEvent_t), sysEvent_t_typeInfo },
@@ -8293,6 +8594,7 @@ static classTypeInfo_t classTypeInfo[] = {
{ "idToken", "idStr", sizeof(idToken), idToken_typeInfo },
{ "punctuation_t", "", sizeof(punctuation_t), punctuation_t_typeInfo },
{ "idLexer", "", sizeof(idLexer), idLexer_typeInfo },
{ "rvmScopedLexerBaseFolder", "", sizeof(rvmScopedLexerBaseFolder), rvmScopedLexerBaseFolder_typeInfo },
{ "define_t", "", sizeof(define_t), define_t_typeInfo },
{ "indent_t", "", sizeof(indent_t), indent_t_typeInfo },
{ "idParser", "", sizeof(idParser), idParser_typeInfo },
@@ -8373,7 +8675,7 @@ static classTypeInfo_t classTypeInfo[] = {
{ "glRaytracingMeshDesc_t", "", sizeof(glRaytracingMeshDesc_t), glRaytracingMeshDesc_t_typeInfo },
{ "glRaytracingInstanceDesc_t", "", sizeof(glRaytracingInstanceDesc_t), glRaytracingInstanceDesc_t_typeInfo },
{ "glRaytracingVec3_t", "", sizeof(glRaytracingVec3_t), glRaytracingVec3_t_typeInfo },
// { "glRaytracingLight_s::class_172", "", sizeof(glRaytracingLight_s::class_172), glRaytracingLight_s_class_172_typeInfo },
// { "glRaytracingLight_s::class_173", "", sizeof(glRaytracingLight_s::class_173), glRaytracingLight_s_class_173_typeInfo },
{ "glRaytracingLight_t", "", sizeof(glRaytracingLight_t), glRaytracingLight_t_typeInfo },
{ "glRaytracingLightingPassDesc_t", "", sizeof(glRaytracingLightingPassDesc_t), glRaytracingLightingPassDesc_t_typeInfo },
{ "QD3D12NeuralPOMImageRGBA8", "", sizeof(QD3D12NeuralPOMImageRGBA8), QD3D12NeuralPOMImageRGBA8_typeInfo },
@@ -8482,7 +8784,7 @@ static classTypeInfo_t classTypeInfo[] = {
{ "jointAnimInfo_t", "", sizeof(jointAnimInfo_t), jointAnimInfo_t_typeInfo },
{ "jointMod_t", "", sizeof(jointMod_t), jointMod_t_typeInfo },
{ "frameLookup_t", "", sizeof(frameLookup_t), frameLookup_t_typeInfo },
// { "class_281::class_281", "", sizeof(class_281::class_281), class_281_class_281_typeInfo },
// { "class_282::class_282", "", sizeof(class_282::class_282), class_282_class_282_typeInfo },
{ "frameCommand_t", "", sizeof(frameCommand_t), frameCommand_t_typeInfo },
{ "animFlags_t", "", sizeof(animFlags_t), animFlags_t_typeInfo },
{ "idModelExport", "", sizeof(idModelExport), idModelExport_typeInfo },
@@ -8731,9 +9033,6 @@ static classTypeInfo_t classTypeInfo[] = {
{ "predictedPath_t", "", sizeof(predictedPath_t), predictedPath_t_typeInfo },
{ "particleEmitter_t", "", sizeof(particleEmitter_t), particleEmitter_t_typeInfo },
{ "idMoveState", "", sizeof(idMoveState), idMoveState_typeInfo },
{ "idAASFindCover", "idAASCallback", sizeof(idAASFindCover), idAASFindCover_typeInfo },
{ "idAASFindAreaOutOfRange", "idAASCallback", sizeof(idAASFindAreaOutOfRange), idAASFindAreaOutOfRange_typeInfo },
{ "idAASFindAttackPosition", "idAASCallback", sizeof(idAASFindAttackPosition), idAASFindAttackPosition_typeInfo },
{ "idAI", "idActor", sizeof(idAI), idAI_typeInfo },
{ "idCombatNode", "idEntity", sizeof(idCombatNode), idCombatNode_typeInfo },
{ "idAI_Vagary", "idAI", sizeof(idAI_Vagary), idAI_Vagary_typeInfo },
@@ -8757,6 +9056,30 @@ static classTypeInfo_t classTypeInfo[] = {
{ "rvmWeaponHandgrenade", "rvmWeaponObject", sizeof(rvmWeaponHandgrenade), rvmWeaponHandgrenade_typeInfo },
{ "rvmWeaponChainsaw", "rvmWeaponObject", sizeof(rvmWeaponChainsaw), rvmWeaponChainsaw_typeInfo },
{ "rvmWeaponGrabber", "rvmWeaponObject", sizeof(rvmWeaponGrabber), rvmWeaponGrabber_typeInfo },
{ "fuzzyseperator_t", "", sizeof(fuzzyseperator_t), fuzzyseperator_t_typeInfo },
{ "weight_t", "", sizeof(weight_t), weight_t_typeInfo },
{ "weightconfig_t", "", sizeof(weightconfig_t), weightconfig_t_typeInfo },
{ "cvalue", "", sizeof(cvalue), cvalue_typeInfo },
{ "bot_characteristic_t", "", sizeof(bot_characteristic_t), bot_characteristic_t_typeInfo },
{ "bot_character_t", "", sizeof(bot_character_t), bot_character_t_typeInfo },
{ "bot_input_t", "", sizeof(bot_input_t), bot_input_t_typeInfo },
{ "rvmBotUtil", "", sizeof(rvmBotUtil), rvmBotUtil_typeInfo },
{ "idBotCharacterStatsManager", "", sizeof(idBotCharacterStatsManager), idBotCharacterStatsManager_typeInfo },
{ "idBotFuzzyWeightManager", "", sizeof(idBotFuzzyWeightManager), idBotFuzzyWeightManager_typeInfo },
{ "projectileinfo_t", "", sizeof(projectileinfo_t), projectileinfo_t_typeInfo },
{ "weaponinfo_t", "", sizeof(weaponinfo_t), weaponinfo_t_typeInfo },
{ "bot_weaponstate_t", "", sizeof(bot_weaponstate_t), bot_weaponstate_t_typeInfo },
{ "idBotWeaponInfoManager", "", sizeof(idBotWeaponInfoManager), idBotWeaponInfoManager_typeInfo },
{ "bot_goal_t", "", sizeof(bot_goal_t), bot_goal_t_typeInfo },
{ "maplocation_t", "", sizeof(maplocation_t), maplocation_t_typeInfo },
{ "campspot_t", "", sizeof(campspot_t), campspot_t_typeInfo },
{ "levelitem_t", "", sizeof(levelitem_t), levelitem_t_typeInfo },
{ "iteminfo_t", "", sizeof(iteminfo_t), iteminfo_t_typeInfo },
{ "itemconfig_t", "", sizeof(itemconfig_t), itemconfig_t_typeInfo },
{ "bot_goalstate_t", "", sizeof(bot_goalstate_t), bot_goalstate_t_typeInfo },
{ "idBotGoalManager", "", sizeof(idBotGoalManager), idBotGoalManager_typeInfo },
{ "bot_state_t", "", sizeof(bot_state_t), bot_state_t_typeInfo },
{ "rvmBot", "idPlayer", sizeof(rvmBot), rvmBot_typeInfo },
{ NULL, NULL, 0, NULL }
};
+14
View File
@@ -265,6 +265,19 @@ void Cmd_KillRagdolls_f( const idCmdArgs &args ) {
KillEntities( args, idAFEntity_WithAttachedHead::Type );
}
/*
===============
Cmd_AddBot_f
===============
*/
void Cmd_AddBot_f(const idCmdArgs& args) {
if (!gameLocal.isServer) {
common->Warning("You can't add a bot because you aren't the server!\n");
return;
}
gameLocal.AddBot();
}
/*
==================
Cmd_Give_f
@@ -2292,6 +2305,7 @@ so it can perform tab completion
=================
*/
void idGameLocal::InitConsoleCommands( void ) {
cmdSystem->AddCommand("addbot", Cmd_AddBot_f, CMD_FL_GAME, "adds a bot to the game.");
cmdSystem->AddCommand( "game_memory", idClass::DisplayInfo_f, CMD_FL_GAME, "displays game class info" );
cmdSystem->AddCommand( "listClasses", idClass::ListClasses_f, CMD_FL_GAME, "lists game classes" );
cmdSystem->AddCommand( "listThreads", idThread::ListThreads_f, CMD_FL_GAME|CMD_FL_CHEAT, "lists script threads" );
+30 -3
View File
@@ -682,7 +682,6 @@ idClip::Init
===============
*/
void idClip::Init( void ) {
cmHandle_t h;
idVec3 size, maxSector = vec3_origin;
// clear clip sectors
@@ -691,8 +690,8 @@ void idClip::Init( void ) {
numClipSectors = 0;
touchCount = -1;
// get world map bounds
h = collisionModelManager->LoadModel( "worldMap", false );
collisionModelManager->GetModelBounds( h, worldBounds );
worldCollisionModel = collisionModelManager->LoadModel( "worldMap", false );
collisionModelManager->GetModelBounds(worldCollisionModel, worldBounds );
// create world sectors
CreateClipSectors_r( 0, worldBounds, maxSector );
@@ -1664,3 +1663,31 @@ bool idClip::DrawModelContactFeature( const contactInfo_t &contact, const idClip
return true;
}
/*
============
idClip::PointContents
============
*/
int idClip::PointContents(const idVec3 p)
{
int contents = -1;
contents = collisionModelManager->PointContents(p, worldCollisionModel);
if (contents > 0)
{
return contents;
}
//for (int i = 0; i < collisionModelManager->GetNumInlinedProcClipModels(); i++)
//{
// idCollisionModel* cm = collisionModelManager->GetCollisionModel(i + 1);
// if (cm == NULL)
// continue;
//
// contents = collisionModelManager->PointContents(p, cm);
//}
return contents;
}
+3
View File
@@ -306,7 +306,10 @@ public:
void DrawClipModels( const idVec3 &eye, const float radius, const idEntity *passEntity );
bool DrawModelContactFeature( const contactInfo_t &contact, const idClipModel *clipModel, int lifetime ) const;
int PointContents(const idVec3 p);
private:
cmHandle_t worldCollisionModel;
int numClipSectors;
struct clipSector_s * clipSectors;
idBounds worldBounds;