Skip to content

Commit

Permalink
goal selection tweaks, v1.40beta5
Browse files Browse the repository at this point in the history
  • Loading branch information
jkivilin committed Dec 3, 2011
1 parent 5a05dae commit c4fae2b
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 153 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BASEFLAGS =
ifeq ($(DBG_FLGS),1)
OPTFLAGS = -O0 -g
else
OPTFLAGS = -O2 -fomit-frame-pointer -ffast-math -funroll-loops
OPTFLAGS = -O2 -fomit-frame-pointer -ffast-math
endif

INCLUDES = -I"./metamod" \
Expand Down Expand Up @@ -77,6 +77,9 @@ distclean:
rm -f Rules.depend ${TARGET}.dll ${TARGET}_i386.so addons/jk_botti/dlls/* zlib/*.exe
(cd zlib; make distclean; cd ..)

waypoint.o: waypoint.cpp
${CPP} ${CPPFLAGS} -funroll-loops -c $< -o $@

%.o: %.cpp
${CPP} ${CPPFLAGS} -c $< -o $@

Expand Down
7 changes: 5 additions & 2 deletions addons/jk_botti/jk_botti_readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ CPU intensive operation this can only be done on map change.
--------------------
1.40:
* Add support for Opposing Force Deathmatch.
* Bugfixes to goal selection and weapon selection.
* Tuned skill 1 bot to be more leet, skill 2 is now about same as old skill 1.
* Bugfixes to goal selection and weapon selection, results huge improvement
how bot work on when not given good weapons on spawn (which is typical on
Severian's MOD).
* Bot now understands that it can get more ammo by picking up same weapon
again.
* Bot avoids combat if it doesn't have good weapon or doesn't have enough
health.
* Changed optimization flags from '-O3' to '-O2'.
* Changed optimization flags from '-O3 -funroll-loops' to '-O2'.
* Output warning message when model given for bot creation is replaced by
team-balance code.
* Changed to only check existance of player model file on listenserver
Expand Down
7 changes: 5 additions & 2 deletions bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void BotSpawnInit( bot_t &pBot )
pBot.b_in_water = 0;
pBot.b_ducking = 0;
pBot.b_has_enough_ammo_for_good_weapon = 0;
pBot.b_low_health = 0;

pBot.f_last_time_attacked = 0;

Expand Down Expand Up @@ -2063,6 +2064,8 @@ void BotThink( bot_t &pBot )
pBot.b_on_ladder = pEdict->v.movetype == MOVETYPE_FLY;
pBot.b_in_water = pEdict->v.waterlevel == 2 || pEdict->v.waterlevel == 3;
pBot.b_ducking = (pEdict->v.flags & FL_DUCKING) == FL_DUCKING;

pBot.b_low_health = BotLowHealth(pBot);

// does bot need to say a message and time to say a message?
if ((pBot.b_bot_say) && (pBot.f_bot_say < gpGlobals->time))
Expand Down Expand Up @@ -2176,7 +2179,7 @@ void BotThink( bot_t &pBot )
// Only need to check ammo, since ammo check for weapons includes weapons ;)
pBot.b_has_enough_ammo_for_good_weapon = !BotAllWeaponsRunningOutOfAmmo(pBot, TRUE);

if((pBot.b_has_enough_ammo_for_good_weapon && !BotLowHealth(pBot)) || pBot.f_last_time_attacked < gpGlobals->time + 3.0f)
if((pBot.b_has_enough_ammo_for_good_weapon && !pBot.b_low_health) || pBot.f_last_time_attacked < gpGlobals->time + 3.0f)
{
// get enemy
pBot.pBotEnemy = (b_botdontshoot == 0) ? BotFindEnemy( pBot ) : NULL; // clear enemy pointer (no ememy for you!)
Expand Down Expand Up @@ -2212,7 +2215,7 @@ void BotThink( bot_t &pBot )
// does have an enemy?
if (pBot.pBotEnemy != NULL)
{
if(BotWeaponCanAttack(pBot, FALSE) && (!BotLowHealth(pBot) || pBot.f_last_time_attacked < gpGlobals->time + 3.0f))
if(BotWeaponCanAttack(pBot, FALSE) && (!pBot.b_low_health || pBot.f_last_time_attacked < gpGlobals->time + 3.0f))
{
BotShootAtEnemy( pBot ); // shoot at the enemy
DidShootAtEnemy = (pBot.pBotEnemy != NULL);
Expand Down
1 change: 1 addition & 0 deletions bot.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ typedef struct
qboolean b_in_water;
qboolean b_ducking;
qboolean b_has_enough_ammo_for_good_weapon;
qboolean b_low_health;

int eagle_secondary_state;

Expand Down
3 changes: 2 additions & 1 deletion bot_combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,8 @@ qboolean BotFindSoundEnemy( bot_t &pBot )
{
pCurrentSound = CSoundEnt::SoundPointerForIndex( iSound );
if ( pCurrentSound &&
( pCurrentSound->m_vecOrigin - pEdict->v.origin ).Length() <= pCurrentSound->m_iVolume * hearingSensitivity )
( pCurrentSound->m_vecOrigin - pEdict->v.origin ).Length() <= pCurrentSound->m_iVolume * hearingSensitivity &&
!FVisible(pCurrentSound->m_vecOrigin, pEdict, (edict_t**)NULL) )
{
// can hear this sound, find enemy nearest sound
edict_t * pMonsterOrPlayer = FindEnemyNearestToPoint(pCurrentSound->m_vecOrigin, 100*skill_settings[pBot.bot_skill].hearing_sensitivity, pEdict);
Expand Down
Loading

0 comments on commit c4fae2b

Please sign in to comment.