Rise limit of waypoints to 3072. Need compatability testing.

This change invalidates all 'learned' bot data, such as visibility, pathmatrices and experiences, so file versions of them are bumped.

Tweaked yb_quota_mode.
Allowed low-skill bots to throw grenades.
This commit is contained in:
jeefo 2019-05-05 01:01:12 +03:00
commit 8456bb57cb
7 changed files with 24 additions and 33 deletions

View file

@ -1925,7 +1925,7 @@ void Bot::setConditions (void) {
}
// check for grenades depending on difficulty
if (rng.getInt (0, 100) < m_difficulty * 25) {
if (rng.getInt (0, 100) < cr::max (25, m_difficulty * 25)) {
checkGrenadesThrow ();
}
@ -5633,7 +5633,7 @@ void Bot::checkBurstMode (float distance) {
}
void Bot::checkSilencer (void) {
if (((m_currentWeapon == WEAPON_USP && m_difficulty < 2) || m_currentWeapon == WEAPON_M4A1) && !hasShield ()) {
if ((m_currentWeapon == WEAPON_USP || m_currentWeapon == WEAPON_M4A1) && !hasShield ()) {
int prob = (m_personality == PERSONALITY_RUSHER ? 35 : 65);
// aggressive bots don't like the silencer

View file

@ -884,7 +884,7 @@ void execBotConfigs (bool onlyMain) {
}
enum Lang { LANG_ORIGINAL, LANG_TRANSLATED, LANG_UNDEFINED } langState = static_cast <Lang> (LANG_UNDEFINED);
char buffer[1024] = { 0, };
char buffer[MAX_PRINT_BUFFER] = { 0, };
Pair<String, String> lang;
while (fp.gets (lineBuffer, 255)) {
@ -917,11 +917,11 @@ void execBotConfigs (bool onlyMain) {
else {
switch (langState) {
case LANG_ORIGINAL:
strncat (buffer, lineBuffer, 1024 - 1 - strlen (buffer));
strncat (buffer, lineBuffer, MAX_PRINT_BUFFER - 1 - strlen (buffer));
break;
case LANG_TRANSLATED:
strncat (buffer, lineBuffer, 1024 - 1 - strlen (buffer));
strncat (buffer, lineBuffer, MAX_PRINT_BUFFER - 1 - strlen (buffer));
break;
case LANG_UNDEFINED:
@ -2723,7 +2723,7 @@ int pfnRegUserMsg (const char *name, int size) {
void pfnAlertMessage (ALERT_TYPE alertType, char *format, ...) {
va_list ap;
char buffer[1024];
char buffer[MAX_PRINT_BUFFER];
va_start (ap, format);
vsnprintf (buffer, cr::bufsize (buffer), format, ap);

View file

@ -393,27 +393,17 @@ void BotManager::maintainQuota (void) {
if (!engine.isDedicated () && !totalHumansInGame) {
return;
}
int desiredBotCount = yb_quota.integer ();
int botsInGame = getBotCount ();
bool halfRoundPassed = g_gameWelcomeSent && g_timeRoundMid > engine.timebase ();
if (stricmp (yb_quota_mode.str (), "fill") == 0) {
if (halfRoundPassed) {
desiredBotCount = botsInGame;
}
else {
desiredBotCount = cr::max <int> (0, desiredBotCount - humanPlayersInGame);
}
botsInGame += humanPlayersInGame;
}
else if (stricmp (yb_quota_mode.str (), "match") == 0) {
if (halfRoundPassed) {
desiredBotCount = botsInGame;
}
else {
int quotaMatch = yb_quota_match.integer () == 0 ? yb_quota.integer () : yb_quota_match.integer ();
desiredBotCount = cr::max <int> (0, quotaMatch * humanPlayersInGame);
}
int detectQuotaMatch = yb_quota_match.integer () == 0 ? yb_quota.integer () : yb_quota_match.integer ();
desiredBotCount = cr::max <int> (0, detectQuotaMatch * humanPlayersInGame);
}
if (yb_join_after_player.boolean () && humanPlayersInGame == 0) {

View file

@ -1211,11 +1211,11 @@ void Bot::searchShortestPath (int srcIndex, int destIndex) {
// this function finds the shortest path from source index to destination index
if (!waypoints.exists (srcIndex)){
logEntry (true, LL_ERROR, "Pathfinder source path index not valid (%d)", srcIndex);
logEntry (false, LL_ERROR, "Pathfinder source path index not valid (%d)", srcIndex);
return;
}
else if (!waypoints.exists (destIndex)) {
logEntry (true, LL_ERROR, "Pathfinder destination path index not valid (%d)", destIndex);
logEntry (false, LL_ERROR, "Pathfinder destination path index not valid (%d)", destIndex);
return;
}
clearSearchNodes ();
@ -1444,11 +1444,11 @@ void Bot::searchPath (int srcIndex, int destIndex, SearchPathType pathType /*= S
// this function finds a path from srcIndex to destIndex
if (!waypoints.exists (srcIndex)) {
logEntry (true, LL_ERROR, "Pathfinder source path index not valid (%d)", srcIndex);
logEntry (false, LL_ERROR, "Pathfinder source path index not valid (%d)", srcIndex);
return;
}
else if (!waypoints.exists (destIndex)) {
logEntry (true, LL_ERROR, "Pathfinder destination path index not valid (%d)", destIndex);
logEntry (false, LL_ERROR, "Pathfinder destination path index not valid (%d)", destIndex);
return;
}
clearSearchNodes ();
@ -3040,7 +3040,7 @@ void Bot::processLookAngles (void) {
float stiffness = 200.0f;
float damping = 25.0f;
if ((m_aimFlags & (AIM_ENEMY | AIM_ENTITY | AIM_GRENADE)) && m_difficulty > 2) {
if ((m_aimFlags & (AIM_ENEMY | AIM_ENTITY | AIM_GRENADE)) && m_difficulty > 3) {
accelerate += 800.0f;
stiffness += 320.0f;
damping -= 8.0f;