2016-03-05 21:04:46 +03:00
//
2023-05-24 23:41:23 +03:00
// YaPB, based on PODBot by Markus Klinge ("CountFloyd").
// Copyright © YaPB Project Developers <yapb@jeefo.net>.
2014-09-09 18:30:40 +04:00
//
2020-11-03 08:57:12 +03:00
// SPDX-License-Identifier: MIT
2014-09-09 18:30:40 +04:00
//
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
# include <yapb.h>
2014-09-09 18:30:40 +04:00
2023-07-21 21:43:36 +03:00
ConVar cv_autovacate ( " autovacate " , " 1 " , " Kick bots to automatically make room for human players. " ) ;
2024-01-19 00:03:45 +03:00
ConVar cv_autovacate_keep_slots ( " autovacate_keep_slots " , " 1 " , " How many slots autovacate feature should keep for human players. " , true , 1.0f , 8.0f ) ;
2023-07-21 21:43:36 +03:00
ConVar cv_kick_after_player_connect ( " kick_after_player_connect " , " 1 " , " Kick the bot immediately when a human player joins the server (yb_autovacate must be enabled) . " ) ;
2014-09-09 18:30:40 +04:00
2023-07-21 21:43:36 +03:00
ConVar cv_quota ( " quota " , " 9 " , " Specifies the number bots to be added to the game. " , true , 0.0f , static_cast < float > ( kGameMaxPlayers ) ) ;
ConVar cv_quota_mode ( " quota_mode " , " normal " , " Specifies the type of quota. \n Allowed values: 'normal', 'fill', and 'match'. \n If 'fill', the server will adjust bots to keep N players in the game, where N is yb_quota. \n If 'match', the server will maintain a 1:N ratio of humans to bots, where N is yb_quota_match. " , false ) ;
ConVar cv_quota_match ( " quota_match " , " 0 " , " Number of players to match if yb_quota_mode set to 'match' " , true , 0.0f , static_cast < float > ( kGameMaxPlayers ) ) ;
2024-04-11 16:26:12 +03:00
ConVar cv_think_fps ( " think_fps " , " 30.0 " , " Specifies how many times per second bot code will run. " , true , 24.0f , 90.0f ) ;
2025-02-01 19:32:19 +03:00
ConVar cv_think_fps_disable ( " think_fps_disable " , " 1 " , " Allows to completely disable think fps on Xash3D. " , true , 0.0f , 1.0f , Var : : Xash3D ) ;
2023-06-24 21:38:34 +03:00
2023-07-21 21:43:36 +03:00
ConVar cv_autokill_delay ( " autokill_delay " , " 0.0 " , " Specifies amount of time in seconds when bots will be killed if no humans left alive. " , true , 0.0f , 90.0f ) ;
2014-09-09 18:30:40 +04:00
2023-07-21 21:43:36 +03:00
ConVar cv_join_after_player ( " join_after_player " , " 0 " , " Specifies whether bots should join server, only when at least one human player in game. " ) ;
ConVar cv_join_team ( " join_team " , " any " , " Forces all bots to join team specified here. " , false ) ;
ConVar cv_join_delay ( " join_delay " , " 5.0 " , " Specifies after how many seconds bots should start to join the game after the changelevel. " , true , 0.0f , 30.0f ) ;
ConVar cv_name_prefix ( " name_prefix " , " " , " All the bot names will be prefixed with string specified with this cvar. " , false ) ;
2020-09-16 13:07:47 +03:00
2023-07-21 21:43:36 +03:00
ConVar cv_difficulty ( " difficulty " , " 3 " , " All bots difficulty level. Changing at runtime will affect already created bots. " , true , 0.0f , 4.0f ) ;
2014-09-09 18:30:40 +04:00
2023-07-21 21:43:36 +03:00
ConVar cv_difficulty_min ( " difficulty_min " , " -1 " , " Lower bound of random difficulty on bot creation. Only affects newly created bots. -1 means yb_difficulty only used. " , true , - 1.0f , 4.0f ) ;
ConVar cv_difficulty_max ( " difficulty_max " , " -1 " , " Upper bound of random difficulty on bot creation. Only affects newly created bots. -1 means yb_difficulty only used. " , true , - 1.0f , 4.0f ) ;
ConVar cv_difficulty_auto ( " difficulty_auto " , " 0 " , " Allows each bot to balance their own difficulty based kd-ratio of team. " , true , 0.0f , 1.0f ) ;
ConVar cv_difficulty_auto_balance_interval ( " difficulty_auto_balance_interval " , " 30 " , " Interval in which bots will balance their difficulty. " , true , 30.0f , 240.0f ) ;
2020-09-16 13:07:47 +03:00
2024-05-24 14:17:37 +03:00
ConVar cv_show_avatars ( " show_avatars " , " 0 " , " Enables or disables displaying bot avatars in front of their names in scoreboard. Note, that is currently you can see only avatars of your steam friends. " ) ;
ConVar cv_show_latency ( " show_latency " , " 0 " , " Enables latency display in scoreboard. \n Allowed values: '0', '1', '2'. \n If '0', there is nothing displayed. \n If '1', there is a 'BOT' is displayed. \n If '2' fake ping is displayed. " , true , 0.0f , 2.0f ) ;
2023-07-21 21:43:36 +03:00
ConVar cv_save_bots_names ( " save_bots_names " , " 1 " , " Allows to save bot names upon changelevel, so bot names will be the same after a map change. " , true , 0.0f , 1.0f ) ;
2019-08-24 12:43:42 +03:00
2023-07-21 21:43:36 +03:00
ConVar cv_botskin_t ( " botskin_t " , " 0 " , " Specifies the bots wanted skin for Terrorist team. " , true , 0.0f , 5.0f ) ;
ConVar cv_botskin_ct ( " botskin_ct " , " 0 " , " Specifies the bots wanted skin for CT team. " , true , 0.0f , 5.0f ) ;
2024-01-19 00:03:45 +03:00
ConVar cv_preferred_personality ( " preferred_personality " , " none " , " Sets the default personality when creating bots with quota management. \n Allowed values: 'none', 'normal', 'careful', 'rusher'. \n If 'none' is specified personality chosen randomly. " , false ) ;
2020-10-01 11:42:51 +03:00
2023-07-21 21:43:36 +03:00
ConVar cv_quota_adding_interval ( " quota_adding_interval " , " 0.10 " , " Interval in which bots are added to the game. " , true , 0.10f , 1.0f ) ;
ConVar cv_quota_maintain_interval ( " quota_maintain_interval " , " 0.40 " , " Interval on which overall bot quota are checked. " , true , 0.40f , 2.0f ) ;
2023-03-13 16:08:29 +03:00
2023-07-21 21:43:36 +03:00
ConVar cv_language ( " language " , " en " , " Specifies the language for bot messages and menus. " , false ) ;
2019-07-01 21:10:00 +03:00
2023-07-21 21:43:36 +03:00
ConVar cv_rotate_bots ( " rotate_bots " , " 0 " , " Randomly disconnect and connect bots, simulating players join/quit. " ) ;
ConVar cv_rotate_stay_min ( " rotate_stay_min " , " 360.0 " , " Specifies minimum amount of seconds bot keep connected, if rotation active. " , true , 120.0f , 7200.0f ) ;
ConVar cv_rotate_stay_max ( " rotate_stay_max " , " 3600.0 " , " Specifies maximum amount of seconds bot keep connected, if rotation active. " , true , 1800.0f , 14400.0f ) ;
2023-03-25 04:36:21 +03:00
2025-02-15 13:51:45 +03:00
ConVar cv_restricted_weapons ( " restricted_weapons " , " " , " " , false ) ;
2020-06-12 18:52:38 +03:00
ConVar mp_limitteams ( " mp_limitteams " , nullptr , Var : : GameRef ) ;
ConVar mp_autoteambalance ( " mp_autoteambalance " , nullptr , Var : : GameRef ) ;
ConVar mp_roundtime ( " mp_roundtime " , nullptr , Var : : GameRef ) ;
ConVar mp_timelimit ( " mp_timelimit " , nullptr , Var : : GameRef ) ;
ConVar mp_freezetime ( " mp_freezetime " , nullptr , Var : : GameRef , true , " 0 " ) ;
2016-10-18 20:34:02 +03:00
2019-07-27 17:36:24 +03:00
BotManager : : BotManager ( ) {
2014-09-09 18:30:40 +04:00
// this is a bot manager class constructor
2019-07-27 17:36:24 +03:00
for ( int i = 0 ; i < kGameTeamNum ; + + i ) {
2016-09-13 22:40:06 +03:00
m_leaderChoosen [ i ] = false ;
m_economicsGood [ i ] = true ;
2019-09-14 23:13:55 +03:00
m_lastRadioTime [ i ] = 0.0f ;
2025-02-15 13:51:45 +03:00
m_lastRadio [ i ] = kInvalidRadioSlot ;
2016-09-13 22:40:06 +03:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
reset ( ) ;
2014-09-09 18:30:40 +04:00
2019-09-22 00:39:24 +03:00
m_addRequests . clear ( ) ;
2016-09-11 21:01:06 +03:00
m_killerEntity = nullptr ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2019-07-01 21:10:00 +03:00
initFilters ( ) ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : createKillerEntity ( ) {
2020-02-08 00:03:52 +03:00
// this function creates single trigger_hurt for using in Bot::kill, to reduce lags, when killing all the bots
2015-07-26 21:47:29 +03:00
2023-05-12 20:00:06 +03:00
m_killerEntity = engfuncs . pfnCreateNamedEntity ( " trigger_hurt " ) ;
2015-07-26 21:47:29 +03:00
2019-08-04 18:22:01 +03:00
m_killerEntity - > v . dmg = kInfiniteDistance ;
2015-07-26 21:47:29 +03:00
m_killerEntity - > v . dmg_take = 1.0f ;
m_killerEntity - > v . dmgtime = 2.0f ;
m_killerEntity - > v . effects | = EF_NODRAW ;
2019-08-04 18:22:01 +03:00
engfuncs . pfnSetOrigin ( m_killerEntity , Vector ( - kInfiniteDistance , - kInfiniteDistance , - kInfiniteDistance ) ) ;
2015-07-26 21:47:29 +03:00
MDLL_Spawn ( m_killerEntity ) ;
}
2019-07-27 17:36:24 +03:00
void BotManager : : destroyKillerEntity ( ) {
2019-07-01 21:10:00 +03:00
if ( ! game . isNullEntity ( m_killerEntity ) ) {
engfuncs . pfnRemoveEntity ( m_killerEntity ) ;
2020-07-15 21:58:57 +03:00
m_killerEntity = nullptr ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2015-07-26 21:47:29 +03:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : touchKillerEntity ( Bot * bot ) {
// bot is already dead.
2023-09-14 16:48:36 +03:00
if ( ! bot - > m_isAlive ) {
2015-07-26 21:47:29 +03:00
return ;
}
2016-01-03 22:03:02 +03:00
2019-07-01 21:10:00 +03:00
if ( game . isNullEntity ( m_killerEntity ) ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
createKillerEntity ( ) ;
2019-07-01 21:10:00 +03:00
if ( game . isNullEntity ( m_killerEntity ) ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
MDLL_ClientKill ( bot - > ent ( ) ) ;
return ;
}
}
2019-07-01 21:10:00 +03:00
const auto & prop = conf . getWeaponProp ( bot - > m_currentWeapon ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2023-05-12 20:00:06 +03:00
m_killerEntity - > v . classname = prop . classname . chars ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_killerEntity - > v . dmg_inflictor = bot - > ent ( ) ;
2020-11-10 13:23:55 +03:00
m_killerEntity - > v . dmg = ( bot - > pev - > health + bot - > pev - > armorvalue ) * 4.0f ;
2015-07-26 21:47:29 +03:00
2021-09-16 16:09:51 +03:00
KeyValueData kv { } ;
2023-05-12 20:00:06 +03:00
kv . szClassName = prop . classname . chars ( ) ;
2015-07-26 21:47:29 +03:00
kv . szKeyName = " damagetype " ;
2023-04-02 12:17:12 +03:00
kv . szValue = strings . format ( " %d " , cr : : bit ( 4 ) ) ;
2020-06-12 18:52:38 +03:00
kv . fHandled = HLFalse ;
2015-07-26 21:47:29 +03:00
MDLL_KeyValue ( m_killerEntity , & kv ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
MDLL_Touch ( m_killerEntity , bot - > ent ( ) ) ;
2015-07-26 21:47:29 +03:00
}
2020-06-12 18:52:38 +03:00
void BotManager : : execGameEntity ( edict_t * ent ) {
2014-09-09 18:30:40 +04:00
// this function calls gamedll player() function, in case to create player entity in game
2019-07-27 17:36:24 +03:00
if ( game . is ( GameFlags : : Metamod ) ) {
2023-05-12 20:00:06 +03:00
MUTIL_CallGameEntity ( PLID , " player " , & ent - > v ) ;
2014-09-09 18:30:40 +04:00
return ;
}
2024-01-19 00:03:45 +03:00
if ( ! entlink . callPlayerFunction ( ent ) ) {
for ( const auto & bot : m_bots ) {
if ( bot - > ent ( ) = = ent ) {
bot - > kick ( ) ;
break ;
}
}
}
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : forEach ( ForEachBot handler ) {
for ( const auto & bot : m_bots ) {
if ( handler ( bot . get ( ) ) ) {
return ;
}
}
}
2020-10-01 11:42:51 +03:00
BotCreateResult BotManager : : create ( StringRef name , int difficulty , int personality , int team , int skin ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// this function completely prepares bot entity (edict) for creation, creates team, difficulty, sets named etc, and
2014-09-09 18:30:40 +04:00
// then sends result to bot constructor
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2016-09-11 21:01:06 +03:00
edict_t * bot = nullptr ;
2024-05-16 21:15:41 +03:00
String resultName { } ;
2014-09-09 18:30:40 +04:00
2019-07-27 17:36:24 +03:00
// do not allow create bots when there is no graph
if ( ! graph . length ( ) ) {
2019-08-07 15:25:14 +03:00
ctrl . msg ( " There is no graph found. Cannot create bot. " ) ;
2019-07-27 17:36:24 +03:00
return BotCreateResult : : GraphError ;
2014-09-09 18:30:40 +04:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2019-07-27 17:36:24 +03:00
// don't allow creating bots with changed graph (distance tables are messed up)
2023-03-13 15:39:15 +03:00
else if ( graph . hasChanged ( ) ) {
2019-07-27 17:36:24 +03:00
ctrl . msg ( " Graph has been changed. Load graph again... " ) ;
return BotCreateResult : : GraphError ;
2014-09-09 18:30:40 +04:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
else if ( team ! = - 1 & & isTeamStacked ( team - 1 ) ) {
2019-07-27 17:36:24 +03:00
ctrl . msg ( " Desired team is stacked. Unable to proceed with bot creation. " ) ;
return BotCreateResult : : TeamStacked ;
2016-10-18 20:34:02 +03:00
}
2024-01-19 00:03:45 +03:00
if ( difficulty < Difficulty : : Noob | | difficulty > Difficulty : : Expert ) {
2024-04-25 15:03:39 +03:00
difficulty = cv_difficulty . as < int > ( ) ;
2014-09-09 18:30:40 +04:00
2024-01-19 00:03:45 +03:00
if ( difficulty < Difficulty : : Noob | | difficulty > Difficulty : : Expert ) {
2024-04-25 15:03:39 +03:00
difficulty = rg ( 3 , 4 ) ;
2020-06-12 18:52:38 +03:00
cv_difficulty . set ( difficulty ) ;
2016-10-18 20:34:02 +03:00
}
2015-06-04 11:52:48 +03:00
}
2014-09-09 18:30:40 +04:00
2024-01-19 00:03:45 +03:00
// try to set proffered personality
static HashMap < String , Personality > personalityMap {
{ " normal " , Personality : : Normal } ,
{ " careful " , Personality : : Careful } ,
{ " rusher " , Personality : : Rusher } ,
} ;
// set personality if requested
2019-07-27 17:36:24 +03:00
if ( personality < Personality : : Normal | | personality > Personality : : Careful ) {
2024-01-19 00:03:45 +03:00
// assign preferred if we're forced with cvar
2024-04-25 15:03:39 +03:00
if ( personalityMap . exists ( cv_preferred_personality . as < StringRef > ( ) ) ) {
personality = personalityMap [ cv_preferred_personality . as < StringRef > ( ) ] ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2024-01-19 00:03:45 +03:00
// do a holy random
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
else {
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 50 ) ) {
2024-01-19 00:03:45 +03:00
personality = Personality : : Normal ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
else {
2024-01-19 00:03:45 +03:00
if ( rg . chance ( 50 ) ) {
personality = Personality : : Rusher ;
}
else {
personality = Personality : : Careful ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
}
}
2016-09-15 13:26:13 +03:00
BotName * botName = nullptr ;
2015-06-20 13:38:13 +03:00
2014-09-09 18:30:40 +04:00
// setup name
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( name . empty ( ) ) {
2019-07-01 21:10:00 +03:00
botName = conf . pickBotName ( ) ;
2014-09-09 18:30:40 +04:00
2019-07-01 21:10:00 +03:00
if ( botName ) {
resultName = botName - > name ;
}
else {
2024-04-25 15:03:39 +03:00
resultName . assignf ( " %s_%d.%d " , product . nameLower , rg ( 100 , 10000 ) , rg ( 100 , 10000 ) ) ; // just pick ugly random name
2014-09-09 18:30:40 +04:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
else {
resultName = name ;
2014-09-09 18:30:40 +04:00
}
2024-04-25 15:03:39 +03:00
const bool hasNamePrefix = ! cv_name_prefix . as < StringRef > ( ) . empty ( ) ;
2014-09-09 18:30:40 +04:00
2022-03-10 09:38:53 +03:00
// disable save bots names if prefix is enabled
2024-04-25 15:03:39 +03:00
if ( hasNamePrefix & & cv_save_bots_names ) {
2022-03-10 09:38:53 +03:00
cv_save_bots_names . set ( 0 ) ;
}
if ( hasNamePrefix ) {
2024-05-16 21:15:41 +03:00
String prefixed { } ; // temp buffer for storing modified name
2024-04-25 15:03:39 +03:00
prefixed . assignf ( " %s %s " , cv_name_prefix . as < StringRef > ( ) , resultName ) ;
2014-09-09 18:30:40 +04:00
// buffer has been modified, copy to real name
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
resultName = cr : : move ( prefixed ) ;
2014-09-09 18:30:40 +04:00
}
2024-06-01 10:57:57 +03:00
bot = game . createFakeClient ( resultName ) ;
2014-09-09 18:30:40 +04:00
2019-07-01 21:10:00 +03:00
if ( game . isNullEntity ( bot ) ) {
2019-07-27 17:36:24 +03:00
return BotCreateResult : : MaxPlayersReached ;
2014-09-09 18:30:40 +04:00
}
2020-10-01 11:42:51 +03:00
auto object = cr : : makeUnique < Bot > ( bot , difficulty , personality , team , skin ) ;
2023-06-24 02:36:51 +03:00
const auto index = object - > index ( ) ;
2014-09-09 18:30:40 +04:00
2016-09-15 13:26:13 +03:00
// assign owner of bot name
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( botName ! = nullptr ) {
2019-07-27 17:36:24 +03:00
botName - > usedBy = index ; // save by who name is used
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2023-02-01 21:19:17 +03:00
else {
2023-03-13 15:39:15 +03:00
conf . setBotNameUsed ( index , resultName ) ;
2023-02-01 21:19:17 +03:00
}
2019-07-27 17:36:24 +03:00
m_bots . push ( cr : : move ( object ) ) ;
2014-09-09 18:30:40 +04:00
2019-07-27 17:36:24 +03:00
ctrl . msg ( " Connecting Bot... " ) ;
2014-09-09 18:30:40 +04:00
2019-07-27 17:36:24 +03:00
return BotCreateResult : : Success ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
Bot * BotManager : : findBotByIndex ( int index ) {
2014-09-09 18:30:40 +04:00
// this function finds a bot specified by index, and then returns pointer to it (using own bot array)
2019-07-27 17:36:24 +03:00
if ( index < 0 | | index > = kGameMaxPlayers ) {
2016-09-11 21:01:06 +03:00
return nullptr ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-08-04 18:22:01 +03:00
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
if ( bot - > m_index = = index ) {
return bot . get ( ) ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2020-08-22 17:01:16 +03:00
return nullptr ; // no bot
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
Bot * BotManager : : findBotByEntity ( edict_t * ent ) {
2014-09-09 18:30:40 +04:00
// same as above, but using bot entity
2019-07-27 17:36:24 +03:00
return findBotByIndex ( game . indexOfPlayer ( ent ) ) ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
Bot * BotManager : : findAliveBot ( ) {
2014-09-09 18:30:40 +04:00
// this function finds one bot, alive bot :)
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
2023-09-14 16:48:36 +03:00
if ( bot - > m_isAlive ) {
2019-07-27 17:36:24 +03:00
return bot . get ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
}
2016-09-11 21:01:06 +03:00
return nullptr ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : frame ( ) {
2019-08-18 21:00:00 +03:00
// this function calls showframe function for all available at call moment bots
2015-07-12 17:18:20 +03:00
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
bot - > frame ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2015-07-12 17:18:20 +03:00
}
2020-10-01 11:42:51 +03:00
void BotManager : : addbot ( StringRef name , int difficulty , int personality , int team , int skin , bool manual ) {
2014-09-09 18:30:40 +04:00
// this function putting bot creation process to queue to prevent engine crashes
2019-09-22 00:39:24 +03:00
BotRequest request { } ;
2014-09-09 18:30:40 +04:00
// fill the holder
2019-09-22 00:39:24 +03:00
request . name = name ;
request . difficulty = difficulty ;
request . personality = personality ;
request . team = team ;
2020-10-01 11:42:51 +03:00
request . skin = skin ;
2019-09-22 00:39:24 +03:00
request . manual = manual ;
2014-09-09 18:30:40 +04:00
2021-09-21 16:52:20 +03:00
// restore the bot name
2024-04-25 15:03:39 +03:00
if ( cv_save_bots_names & & name . empty ( ) & & ! m_saveBotNames . empty ( ) ) {
2021-09-21 16:52:20 +03:00
request . name = m_saveBotNames . popFront ( ) ;
}
2014-09-09 18:30:40 +04:00
// put to queue
2020-11-03 08:57:12 +03:00
m_addRequests . emplaceLast ( cr : : move ( request ) ) ;
2014-09-09 18:30:40 +04:00
}
2020-10-01 11:42:51 +03:00
void BotManager : : addbot ( StringRef name , StringRef difficulty , StringRef personality , StringRef team , StringRef skin , bool manual ) {
2014-09-09 18:30:40 +04:00
// this function is same as the function above, but accept as parameters string instead of integers
2019-09-22 00:39:24 +03:00
BotRequest request { } ;
2021-09-16 16:09:51 +03:00
static StringRef any = " * " ;
2014-09-09 18:30:40 +04:00
2020-06-12 18:52:38 +03:00
request . name = ( name . empty ( ) | | name = = any ) ? StringRef ( " \0 " ) : name ;
2024-04-25 15:03:39 +03:00
request . difficulty = ( difficulty . empty ( ) | | difficulty = = any ) ? - 1 : difficulty . as < int > ( ) ;
request . team = ( team . empty ( ) | | team = = any ) ? - 1 : team . as < int > ( ) ;
request . skin = ( skin . empty ( ) | | skin = = any ) ? - 1 : skin . as < int > ( ) ;
request . personality = ( personality . empty ( ) | | personality = = any ) ? - 1 : personality . as < int > ( ) ;
2019-09-22 00:39:24 +03:00
request . manual = manual ;
2014-09-09 18:30:40 +04:00
2021-09-16 16:09:51 +03:00
addbot ( request . name , request . difficulty , request . personality , request . team , request . skin , request . manual ) ;
2016-01-12 23:57:02 +03:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : maintainQuota ( ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// this function keeps number of bots up to date, and don't allow to maintain bot creation
// while creation process in process.
2016-01-12 23:57:02 +03:00
2019-07-27 17:36:24 +03:00
if ( graph . length ( ) < 1 | | graph . hasChanged ( ) ) {
2024-04-25 15:03:39 +03:00
if ( cv_quota . as < int > ( ) > 0 ) {
2019-07-28 15:47:46 +03:00
ctrl . msg ( " There is no graph found. Cannot create bot. " ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2020-06-12 18:52:38 +03:00
cv_quota . set ( 0 ) ;
2016-01-12 23:57:02 +03:00
return ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-01-12 23:57:02 +03:00
2024-01-26 19:52:00 +03:00
if ( analyzer . isAnalyzing ( ) ) {
ctrl . msg ( " Can't create bot during map analysis process. " ) ;
return ;
}
2024-06-12 23:04:53 +03:00
const int maxClients = game . maxClients ( ) ;
const int botsInGame = getBotCount ( ) ;
2024-01-26 19:52:00 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// bot's creation update
2019-09-22 00:39:24 +03:00
if ( ! m_addRequests . empty ( ) & & m_maintainTime < game . time ( ) ) {
2024-06-12 23:04:53 +03:00
const auto & request = m_addRequests . popFront ( ) ;
const auto createResult = create ( request . name , request . difficulty , request . personality , request . team , request . skin ) ;
2016-11-02 18:36:05 +03:00
2020-11-03 08:57:12 +03:00
if ( request . manual ) {
2024-06-12 23:04:53 +03:00
cv_quota . set ( cr : : min ( cv_quota . as < int > ( ) + 1 , maxClients ) ) ;
2016-01-30 14:02:28 +03:00
}
2016-01-16 21:08:22 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// check the result of creation
2020-11-03 08:57:12 +03:00
if ( createResult = = BotCreateResult : : GraphError ) {
2019-09-22 00:39:24 +03:00
m_addRequests . clear ( ) ; // something wrong with graph, reset tab of creation
2020-06-12 18:52:38 +03:00
cv_quota . set ( 0 ) ; // reset quota
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2020-11-03 08:57:12 +03:00
else if ( createResult = = BotCreateResult : : MaxPlayersReached ) {
2024-06-12 23:04:53 +03:00
ctrl . msg ( " Maximum players reached (%d/%d). Unable to create Bot. " , maxClients , maxClients ) ;
2024-02-19 23:16:03 +03:00
2019-09-22 00:39:24 +03:00
m_addRequests . clear ( ) ; // maximum players reached, so set quota to maximum players
2024-06-12 23:04:53 +03:00
cv_quota . set ( botsInGame ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2020-11-03 08:57:12 +03:00
else if ( createResult = = BotCreateResult : : TeamStacked ) {
2019-07-01 21:10:00 +03:00
ctrl . msg ( " Could not add bot to the game: Team is stacked (to disable this check, set mp_limitteams and mp_autoteambalance to zero and restart the round) " ) ;
2016-01-16 21:08:22 +03:00
2019-09-22 00:39:24 +03:00
m_addRequests . clear ( ) ;
2024-06-12 23:04:53 +03:00
cv_quota . set ( botsInGame ) ;
2016-01-16 21:08:22 +03:00
}
2024-04-25 15:03:39 +03:00
m_maintainTime = game . time ( ) + cv_quota_adding_interval . as < float > ( ) ;
2016-01-16 21:08:22 +03:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// now keep bot number up to date
2019-08-18 21:00:00 +03:00
if ( m_quotaMaintainTime > game . time ( ) ) {
2016-11-02 18:36:05 +03:00
return ;
2016-01-16 21:08:22 +03:00
}
2024-06-12 23:04:53 +03:00
int desiredBotCount = cv_quota . as < int > ( ) ;
2014-09-09 18:30:40 +04:00
2024-06-12 23:04:53 +03:00
// only assign if out of range
if ( desiredBotCount < 0 | | desiredBotCount > maxClients ) {
cv_quota . set ( cr : : clamp ( desiredBotCount , 0 , maxClients ) ) ;
}
2023-06-24 02:36:51 +03:00
const int totalHumansInGame = getHumansCount ( ) ;
const int humanPlayersInGame = getHumansCount ( true ) ;
2014-09-09 18:30:40 +04:00
2019-07-01 21:10:00 +03:00
if ( ! game . isDedicated ( ) & & ! totalHumansInGame ) {
2015-12-26 01:31:46 +03:00
return ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-05-05 01:01:12 +03:00
2024-04-25 15:03:39 +03:00
if ( cv_quota_mode . as < StringRef > ( ) = = " fill " ) {
2024-06-12 23:04:53 +03:00
desiredBotCount = cr : : max ( 0 , desiredBotCount - humanPlayersInGame ) ;
2014-09-09 18:30:40 +04:00
}
2024-04-25 15:03:39 +03:00
else if ( cv_quota_mode . as < StringRef > ( ) = = " match " ) {
2024-06-12 23:04:53 +03:00
const int detectQuotaMatch = cv_quota_match . as < int > ( ) = = 0 ? cv_quota . as < int > ( ) : cv_quota_match . as < int > ( ) ;
2019-05-05 01:01:12 +03:00
2024-06-12 23:04:53 +03:00
desiredBotCount = cr : : max ( 0 , detectQuotaMatch * humanPlayersInGame ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-01-12 23:57:02 +03:00
2024-04-25 15:03:39 +03:00
if ( cv_join_after_player & & humanPlayersInGame = = 0 ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
desiredBotCount = 0 ;
}
2018-06-23 21:28:40 +06:00
2024-04-25 15:03:39 +03:00
if ( cv_autovacate ) {
if ( cv_kick_after_player_connect ) {
2024-06-12 23:04:53 +03:00
desiredBotCount = cr : : min ( desiredBotCount , maxClients - ( totalHumansInGame + cv_autovacate_keep_slots . as < int > ( ) ) ) ;
2023-03-13 18:39:45 +06:00
}
else {
2024-06-12 23:04:53 +03:00
desiredBotCount = cr : : min ( desiredBotCount , maxClients - ( humanPlayersInGame + cv_autovacate_keep_slots . as < int > ( ) ) ) ;
2023-03-13 18:39:45 +06:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
else {
2024-06-12 23:04:53 +03:00
desiredBotCount = cr : : min ( desiredBotCount , maxClients - humanPlayersInGame ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2024-01-21 00:59:15 +03:00
auto maxSpawnCount = game . getSpawnCount ( Team : : Terrorist ) + game . getSpawnCount ( Team : : CT ) - humanPlayersInGame ;
// if has some custom spawn points, max out spawn point counter
2024-01-21 16:21:01 +03:00
if ( desiredBotCount > = botsInGame & & hasCustomCSDMSpawnEntities ( ) ) {
2024-06-12 23:04:53 +03:00
maxSpawnCount = maxClients + 1 ;
2024-01-21 00:59:15 +03:00
}
2019-07-01 21:10:00 +03:00
// sent message only to console from here
ctrl . setFromConsole ( true ) ;
2016-01-12 23:57:02 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// add bots if necessary
2019-05-13 21:41:14 +03:00
if ( desiredBotCount > botsInGame & & botsInGame < maxSpawnCount ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
createRandom ( ) ;
}
else if ( desiredBotCount < botsInGame ) {
2024-06-01 13:58:48 +03:00
balancedKickRandom ( false ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2021-09-21 16:52:20 +03:00
else {
// clear the saved names when quota balancing ended
2024-04-25 15:03:39 +03:00
if ( cv_save_bots_names & & ! m_saveBotNames . empty ( ) ) {
2021-09-21 16:52:20 +03:00
m_saveBotNames . clear ( ) ;
}
}
2024-04-25 15:03:39 +03:00
m_quotaMaintainTime = game . time ( ) + cv_quota_maintain_interval . as < float > ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-01-12 23:57:02 +03:00
2020-06-12 18:52:38 +03:00
void BotManager : : maintainLeaders ( ) {
2024-01-31 13:04:02 +03:00
if ( game . is ( GameFlags : : FreeForAll ) ) {
return ;
}
2020-06-12 18:52:38 +03:00
// select leader each team somewhere in round start
if ( m_timeRoundStart + 5.0f > game . time ( ) & & m_timeRoundStart + 10.0f < game . time ( ) ) {
for ( int team = 0 ; team < kGameTeamNum ; + + team ) {
selectLeaders ( team , false ) ;
}
}
}
2020-02-08 00:03:52 +03:00
void BotManager : : maintainAutoKill ( ) {
2024-04-25 15:03:39 +03:00
const float killDelay = cv_autokill_delay . as < float > ( ) ;
2020-02-08 00:03:52 +03:00
if ( killDelay < 1.0f | | m_roundOver ) {
return ;
}
// check if we're reached the delay, so kill out bots
if ( ! cr : : fzero ( m_autoKillCheckTime ) & & m_autoKillCheckTime < game . time ( ) ) {
2024-01-29 08:08:07 +03:00
killAllBots ( - 1 , true ) ;
2020-02-08 00:03:52 +03:00
m_autoKillCheckTime = 0.0f ;
return ;
}
int aliveBots = 0 ;
// do not interrupt bomb-defuse scenario
if ( game . mapIs ( MapFlags : : Demolition ) & & isBombPlanted ( ) ) {
return ;
}
2023-06-24 02:36:51 +03:00
const int totalHumans = getHumansCount ( true ) ; // we're ignore spectators intentionally
2020-02-08 00:03:52 +03:00
// if we're have no humans in teams do not bother to proceed
if ( ! totalHumans ) {
return ;
}
2023-03-13 15:39:15 +03:00
2020-02-08 00:03:52 +03:00
for ( const auto & bot : m_bots ) {
2023-09-14 16:48:36 +03:00
if ( bot - > m_isAlive ) {
2020-02-08 00:03:52 +03:00
+ + aliveBots ;
// do not interrupt assassination scenario, if vip is a bot
if ( game . is ( MapFlags : : Assassination ) & & util . isPlayerVIP ( bot - > ent ( ) ) ) {
return ;
}
}
}
2023-06-24 02:36:51 +03:00
const int aliveHumans = getAliveHumansCount ( ) ;
2020-02-08 00:03:52 +03:00
// check if we're have no alive players and some alive bots, and start autokill timer
if ( ! aliveHumans & & aliveBots > 0 & & cr : : fzero ( m_autoKillCheckTime ) ) {
m_autoKillCheckTime = game . time ( ) + killDelay ;
}
}
2019-07-27 17:36:24 +03:00
void BotManager : : reset ( ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_grenadeUpdateTime = 0.0f ;
m_entityUpdateTime = 0.0f ;
2019-07-02 09:33:39 +03:00
m_plantSearchUpdateTime = 0.0f ;
m_lastChatTime = 0.0f ;
m_timeBombPlanted = 0.0f ;
2019-07-28 15:47:46 +03:00
m_bombSayStatus = BombPlantedSay : : ChatSay | BombPlantedSay : : Chatter ;
2016-01-12 23:57:02 +03:00
2023-05-06 20:14:03 +03:00
m_interestingEntities . clear ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_activeGrenades . clear ( ) ;
}
2016-01-12 23:57:02 +03:00
2019-07-27 17:36:24 +03:00
void BotManager : : initFilters ( ) {
2019-07-01 21:10:00 +03:00
// table with all available actions for the bots (filtered in & out in bot::setconditions) some of them have subactions included
2024-03-09 01:06:11 +03:00
m_filters = {
{ & Bot : : normal_ , Task : : Normal , 0.0f , kInvalidNodeIndex , 0.0f , true } ,
{ & Bot : : pause_ , Task : : Pause , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : moveToPos_ , Task : : MoveToPosition , 0.0f , kInvalidNodeIndex , 0.0f , true } ,
{ & Bot : : followUser_ , Task : : FollowUser , 0.0f , kInvalidNodeIndex , 0.0f , true } ,
{ & Bot : : pickupItem_ , Task : : PickupItem , 0.0f , kInvalidNodeIndex , 0.0f , true } ,
{ & Bot : : camp_ , Task : : Camp , 0.0f , kInvalidNodeIndex , 0.0f , true } ,
{ & Bot : : plantBomb_ , Task : : PlantBomb , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : defuseBomb_ , Task : : DefuseBomb , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : attackEnemy_ , Task : : Attack , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : huntEnemy_ , Task : : Hunt , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : seekCover_ , Task : : SeekCover , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : throwExplosive_ , Task : : ThrowExplosive , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : throwFlashbang_ , Task : : ThrowFlashbang , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : throwSmoke_ , Task : : ThrowSmoke , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : doublejump_ , Task : : DoubleJump , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : escapeFromBomb_ , Task : : EscapeFromBomb , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : shootBreakable_ , Task : : ShootBreakable , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : hide_ , Task : : Hide , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : blind_ , Task : : Blind , 0.0f , kInvalidNodeIndex , 0.0f , false } ,
{ & Bot : : spraypaint_ , Task : : Spraypaint , 0.0f , kInvalidNodeIndex , 0.0f , false }
} ;
2019-07-27 17:36:24 +03:00
}
void BotManager : : resetFilters ( ) {
2019-07-01 21:10:00 +03:00
for ( auto & task : m_filters ) {
task . time = 0.0f ;
}
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : decrementQuota ( int by ) {
if ( by ! = 0 ) {
2024-04-25 15:03:39 +03:00
cv_quota . set ( cr : : clamp < int > ( cv_quota . as < int > ( ) - by , 0 , cv_quota . as < int > ( ) ) ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
return ;
2014-09-09 18:30:40 +04:00
}
2020-06-12 18:52:38 +03:00
cv_quota . set ( 0 ) ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : initQuota ( ) {
2024-04-25 15:03:39 +03:00
m_maintainTime = game . time ( ) + cv_join_delay . as < float > ( ) ;
m_quotaMaintainTime = game . time ( ) + cv_join_delay . as < float > ( ) ;
2016-01-30 13:15:50 +03:00
2019-09-22 00:39:24 +03:00
m_addRequests . clear ( ) ;
2014-09-09 18:30:40 +04:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : serverFill ( int selection , int personality , int difficulty , int numToAdd ) {
2014-09-09 18:30:40 +04:00
// this function fill server with bots, with specified team & personality
2016-09-13 19:09:20 +03:00
// always keep one slot
2024-04-25 15:03:39 +03:00
const int maxClients = cv_autovacate
? game . maxClients ( ) - cv_autovacate_keep_slots . as < int > ( ) - ( game . isDedicated ( ) ? 0 : getHumansCount ( ) ) : game . maxClients ( ) ;
2016-09-13 19:09:20 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( getBotCount ( ) > = maxClients - getHumansCount ( ) ) {
2014-09-09 18:30:40 +04:00
return ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( selection = = 1 | | selection = = 2 ) {
mp_limitteams . set ( 0 ) ;
mp_autoteambalance . set ( 0 ) ;
}
else {
2014-09-09 18:30:40 +04:00
selection = 5 ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2024-06-01 10:57:57 +03:00
const auto maxToAdd = maxClients - ( getHumansCount ( ) + getBotCount ( ) ) ;
2024-05-16 21:15:41 +03:00
constexpr char kTeams [ 6 ] [ 12 ] = { " " , { " Terrorists " } , { " CTs " } , " " , " " , { " Random " } , } ;
2024-06-01 10:57:57 +03:00
auto toAdd = numToAdd = = - 1 ? maxToAdd : numToAdd ;
// limit manually added count as well
if ( toAdd > maxToAdd - 1 ) {
toAdd = maxToAdd - 1 ;
}
2014-09-09 18:30:40 +04:00
2019-07-27 17:36:24 +03:00
for ( int i = 0 ; i < = toAdd ; + + i ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
addbot ( " " , difficulty , personality , selection , - 1 , true ) ;
}
2024-05-16 21:15:41 +03:00
ctrl . msg ( " Fill server with %s bots... " , & kTeams [ selection ] [ 0 ] ) ;
2014-09-09 18:30:40 +04:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : kickEveryone ( bool instant , bool zeroQuota ) {
2020-06-12 18:52:38 +03:00
// this function drops all bot clients from server (this function removes only yapb's)
2014-09-09 18:30:40 +04:00
2024-04-25 15:03:39 +03:00
if ( cv_quota & & hasBotsOnline ( ) ) {
2019-08-04 18:22:01 +03:00
ctrl . msg ( " Bots are removed from server. " ) ;
2019-07-27 17:36:24 +03:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( zeroQuota ) {
decrementQuota ( 0 ) ;
}
2014-09-09 18:30:40 +04:00
2021-09-21 16:52:20 +03:00
// if everyone is kicked, clear the saved bot names
2024-04-25 15:03:39 +03:00
if ( cv_save_bots_names & & ! m_saveBotNames . empty ( ) ) {
2021-09-21 16:52:20 +03:00
m_saveBotNames . clear ( ) ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( instant ) {
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
2023-06-23 19:52:46 +03:00
bot - > kick ( true ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
}
2019-09-22 00:39:24 +03:00
m_addRequests . clear ( ) ;
2014-09-09 18:30:40 +04:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : kickFromTeam ( Team team , bool removeAll ) {
2014-09-09 18:30:40 +04:00
// this function remove random bot from specified team (if removeAll value = 1 then removes all players from team)
2023-06-23 19:52:46 +03:00
if ( removeAll ) {
const auto & counts = countTeamPlayers ( ) ;
m_quotaMaintainTime = game . time ( ) + 3.0f ;
m_addRequests . clear ( ) ;
if ( team = = Team : : Terrorist ) {
decrementQuota ( counts . first ) ;
}
else {
decrementQuota ( counts . second ) ;
}
}
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
2024-01-31 13:04:02 +03:00
if ( team = = game . getRealTeam ( bot - > ent ( ) ) ) {
2023-06-23 19:52:46 +03:00
bot - > kick ( removeAll ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( ! removeAll ) {
2023-06-23 19:52:46 +03:00
decrementQuota ( ) ;
2014-09-09 18:30:40 +04:00
break ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
}
}
}
2024-01-29 08:08:07 +03:00
void BotManager : : killAllBots ( int team , bool silent ) {
2014-09-09 18:30:40 +04:00
// this function kills all bots on server (only this dll controlled bots)
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
2024-05-08 10:08:49 +03:00
if ( team ! = - 1 & & game . getRealTeam ( bot - > ent ( ) ) ! = team ) {
2019-07-27 17:36:24 +03:00
continue ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
bot - > kill ( ) ;
2014-09-09 18:30:40 +04:00
}
2024-01-29 08:08:07 +03:00
if ( ! silent ) {
ctrl . msg ( " All bots died... " ) ;
}
2014-09-09 18:30:40 +04:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : kickBot ( int index ) {
2019-07-27 17:36:24 +03:00
auto bot = findBotByIndex ( index ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( bot ) {
decrementQuota ( ) ;
bot - > kick ( ) ;
}
}
2019-05-11 23:55:33 +03:00
bool BotManager : : kickRandom ( bool decQuota , Team fromTeam ) {
2014-09-09 18:30:40 +04:00
// this function removes random bot from server (only yapb's)
2019-05-05 18:52:28 +03:00
// if forTeam is unassigned, that means random team
2016-01-16 21:08:22 +03:00
bool deadBotFound = false ;
2019-07-27 17:36:24 +03:00
auto updateQuota = [ & ] ( ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( decQuota ) {
decrementQuota ( ) ;
}
} ;
2019-05-05 18:52:28 +03:00
auto belongsTeam = [ & ] ( Bot * bot ) {
2019-07-27 17:36:24 +03:00
if ( fromTeam = = Team : : Unassigned ) {
2019-05-05 18:52:28 +03:00
return true ;
}
2024-01-31 13:04:02 +03:00
return game . getRealTeam ( bot - > ent ( ) ) = = fromTeam ;
2019-05-05 18:52:28 +03:00
} ;
2016-01-16 21:08:22 +03:00
// first try to kick the bot that is currently dead
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
2024-01-19 00:03:45 +03:00
// is this slot used?
if ( ! bot - > m_isAlive & & belongsTeam ( bot . get ( ) ) ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
updateQuota ( ) ;
bot - > kick ( ) ;
2016-01-16 21:08:22 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
deadBotFound = true ;
2016-01-16 21:08:22 +03:00
break ;
}
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( deadBotFound ) {
2019-05-11 23:55:33 +03:00
return true ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-01-16 21:08:22 +03:00
// if no dead bots found try to find one with lowest amount of frags
2019-07-27 17:36:24 +03:00
Bot * selected = nullptr ;
2019-08-04 18:22:01 +03:00
float score = kInfiniteDistance ;
2016-01-16 21:08:22 +03:00
// search bots in this team
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
if ( bot - > pev - > frags < score & & belongsTeam ( bot . get ( ) ) ) {
selected = bot . get ( ) ;
2016-01-16 21:08:22 +03:00
score = bot - > pev - > frags ;
}
}
// if found some bots
2019-07-27 17:36:24 +03:00
if ( selected ! = nullptr ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
updateQuota ( ) ;
2019-07-27 17:36:24 +03:00
selected - > kick ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2019-05-11 23:55:33 +03:00
return true ;
2016-01-16 21:08:22 +03:00
}
2024-06-01 10:57:57 +03:00
static Array < Bot * > kickable ;
kickable . clear ( ) ;
2016-01-16 21:08:22 +03:00
// worst case, just kick some random bot
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
2024-01-19 00:03:45 +03:00
// is this slot used?
if ( belongsTeam ( bot . get ( ) ) ) {
2024-06-01 10:57:57 +03:00
kickable . push ( bot . get ( ) ) ;
}
}
// kick random from collected
if ( ! kickable . empty ( ) ) {
auto bot = kickable . random ( ) ;
if ( bot ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
updateQuota ( ) ;
2019-05-05 18:52:28 +03:00
bot - > kick ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2019-05-11 23:55:33 +03:00
return true ;
2014-09-09 18:30:40 +04:00
}
}
2019-05-11 23:55:33 +03:00
return false ;
2014-09-09 18:30:40 +04:00
}
2024-06-01 13:58:48 +03:00
bool BotManager : : balancedKickRandom ( bool decQuota ) {
const auto & tp = countTeamPlayers ( ) ;
bool isKicked = false ;
if ( tp . first > tp . second ) {
isKicked = kickRandom ( decQuota , Team : : Terrorist ) ;
}
else if ( tp . first < tp . second ) {
isKicked = kickRandom ( decQuota , Team : : CT ) ;
}
else {
isKicked = kickRandom ( decQuota , Team : : Unassigned ) ;
}
// if we can't kick player from correct team, just kick any random to keep quota control work
if ( ! isKicked ) {
isKicked = kickRandom ( decQuota , Team : : Unassigned ) ;
}
return isKicked ;
}
2024-01-21 00:59:15 +03:00
bool BotManager : : hasCustomCSDMSpawnEntities ( ) {
if ( ! game . is ( GameFlags : : CSDM | GameFlags : : FreeForAll ) ) {
return false ;
}
auto customSpawnClass = conf . fetchCustom ( " CustomCSDMSpawnPoint " ) ;
// check for custom entity
return game . hasEntityInGame ( customSpawnClass ) ;
}
2023-03-13 15:39:15 +03:00
void BotManager : : setLastWinner ( int winner ) {
2019-09-21 23:20:33 +03:00
m_lastWinner = winner ;
2020-02-08 00:03:52 +03:00
m_roundOver = true ;
2019-09-21 23:20:33 +03:00
2024-04-25 15:03:39 +03:00
if ( cv_radio_mode . as < int > ( ) ! = 2 ) {
2019-09-21 23:20:33 +03:00
return ;
}
auto notify = findAliveBot ( ) ;
if ( notify ) {
if ( notify - > m_team = = winner ) {
if ( getRoundMidTime ( ) > game . time ( ) ) {
notify - > pushChatterMessage ( Chatter : : QuickWonRound ) ;
}
else {
notify - > pushChatterMessage ( Chatter : : WonTheRound ) ;
}
}
}
}
2023-05-08 00:44:14 +03:00
void BotManager : : checkBotModel ( edict_t * ent , char * infobuffer ) {
for ( const auto & bot : bots ) {
if ( bot - > ent ( ) = = ent ) {
2024-05-15 22:56:35 +03:00
bot - > refreshCreatureStatus ( infobuffer ) ;
2023-05-08 00:44:14 +03:00
break ;
}
}
}
2024-02-15 23:57:54 +03:00
void BotManager : : checkNeedsToBeKicked ( ) {
for ( const auto & bot : bots ) {
if ( bot - > m_kickMeFromServer ) {
bot - > kick ( ) ; // kick bot from server if requested
break ;
}
}
}
2024-05-15 22:56:35 +03:00
void BotManager : : refreshCreatureStatus ( ) {
if ( ! game . is ( GameFlags : : ZombieMod ) ) {
return ;
}
for ( const auto & bot : bots ) {
if ( bot - > m_isAlive ) {
bot - > refreshCreatureStatus ( nullptr ) ;
}
}
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : setWeaponMode ( int selection ) {
2014-09-09 18:30:40 +04:00
// this function sets bots weapon mode
2019-07-01 21:10:00 +03:00
selection - - ;
2024-05-22 13:33:26 +03:00
constexpr int kStdMaps [ 7 ] [ kNumWeapons ] = {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Knife only
{ - 1 , - 1 , - 1 , 2 , 2 , 0 , 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Pistols only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 2 , 2 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Shotgun only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 2 , 1 , 2 , 0 , 2 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 2 , - 1 } , // Machine Guns only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 0 , 0 , 1 , 0 , 1 , 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Rifles only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 2 , 2 , 0 , 1 , - 1 , - 1 } , // Snipers only
{ - 1 , - 1 , - 1 , 2 , 2 , 0 , 1 , 2 , 2 , 2 , 1 , 2 , 0 , 2 , 0 , 0 , 1 , 0 , 1 , 1 , 2 , 2 , 0 , 1 , 2 , 1 } // Standard
2014-09-09 18:30:40 +04:00
} ;
2024-05-22 13:33:26 +03:00
constexpr int kAsMaps [ 7 ] [ kNumWeapons ] = {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Knife only
{ - 1 , - 1 , - 1 , 2 , 2 , 0 , 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Pistols only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 1 , 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Shotgun only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 1 , 1 , 1 , 0 , 2 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 1 , - 1 } , // Machine Guns only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 0 , - 1 , 1 , 0 , 1 , 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } , // Rifles only
{ - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 0 , 0 , - 1 , 1 , - 1 , - 1 } , // Snipers only
{ - 1 , - 1 , - 1 , 2 , 2 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 2 , 0 , - 1 , 1 , 0 , 1 , 1 , 0 , 0 , - 1 , 1 , 1 , 1 } // Standard
2014-09-09 18:30:40 +04:00
} ;
2024-05-16 21:15:41 +03:00
constexpr char kModes [ 7 ] [ 12 ] = { { " Knife " } , { " Pistol " } , { " Shotgun " } , { " Machine Gun " } , { " Rifle " } , { " Sniper " } , { " Standard " } } ;
2023-03-13 15:39:15 +03:00
2019-07-01 21:10:00 +03:00
// get the raw weapons array
auto tab = conf . getRawWeapons ( ) ;
2014-09-09 18:30:40 +04:00
2019-07-01 21:10:00 +03:00
// set the correct weapon mode
2019-07-27 17:36:24 +03:00
for ( int i = 0 ; i < kNumWeapons ; + + i ) {
2024-05-22 13:33:26 +03:00
tab [ i ] . teamStandard = kStdMaps [ selection ] [ i ] ;
tab [ i ] . teamAS = kAsMaps [ selection ] [ i ] ;
2014-09-09 18:30:40 +04:00
}
2020-06-12 18:52:38 +03:00
cv_jasonmode . set ( selection = = 0 ? 1 : 0 ) ;
2014-09-09 18:30:40 +04:00
2024-05-16 21:15:41 +03:00
ctrl . msg ( " %s weapon mode selected. " , & kModes [ selection ] [ 0 ] ) ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : listBots ( ) {
2014-09-09 18:30:40 +04:00
// this function list's bots currently playing on the server
2024-12-20 01:04:59 +03:00
ctrl . msg ( " %-3.5s \t %-19.16s \t %-10.12s \t %-3.4s \t %-3.4s \t %-3.4s \t %-3.6s \t %-3.5s \t %-3.8s " , " index " , " name " , " personality " , " team " , " difficulty " , " frags " , " deaths " , " alive " , " timeleft " ) ;
2014-09-09 18:30:40 +04:00
2024-01-31 13:04:02 +03:00
auto botTeam = [ ] ( edict_t * ent ) - > StringRef {
const auto team = game . getRealTeam ( ent ) ;
2023-05-12 20:00:06 +03:00
switch ( team ) {
case Team : : CT :
return " CT " ;
case Team : : Terrorist :
return " TE " ;
case Team : : Unassigned :
default :
return " UN " ;
case Team : : Spectator :
return " SP " ;
}
} ;
2023-03-13 15:39:15 +03:00
for ( const auto & bot : bots ) {
2024-04-25 15:03:39 +03:00
auto timelimitStr = cv_rotate_bots ? strings . format ( " %-3.0f secs " , bot - > m_stayTime - game . time ( ) ) : " unlimited " ;
2024-01-29 08:08:07 +03:00
2024-12-20 01:04:59 +03:00
ctrl . msg ( " [%-2.1d] \t %-22.16s \t %-10.12s \t %-3.4s \t %-3.1d \t %-3.1d \t %-3.1d \t %-3.4s \t %s " ,
bot - > index ( ) ,
bot - > pev - > netname . chars ( ) ,
bot - > m_personality = = Personality : : Rusher ? " rusher " : bot - > m_personality = = Personality : : Normal ? " normal " : " careful " ,
botTeam ( bot - > ent ( ) ) ,
bot - > m_difficulty ,
static_cast < int > ( bot - > pev - > frags ) ,
bot - > m_deathCount ,
bot - > m_isAlive ? " yes " : " no " ,
timelimitStr ) ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
ctrl . msg ( " %d bots " , m_bots . length ( ) ) ;
2014-09-09 18:30:40 +04:00
}
2020-10-03 16:39:09 +03:00
float BotManager : : getConnectTime ( StringRef name , float original ) {
2019-07-31 14:05:36 +03:00
// this function get's fake bot player time.
for ( const auto & bot : m_bots ) {
2021-09-16 16:09:51 +03:00
if ( name . startsWith ( bot - > pev - > netname . chars ( ) ) ) {
2020-09-29 19:23:26 +03:00
return bot - > getConnectionTime ( ) ;
2019-07-31 14:05:36 +03:00
}
}
2020-06-12 18:52:38 +03:00
return original ;
2019-07-31 14:05:36 +03:00
}
2020-09-16 13:07:47 +03:00
float BotManager : : getAverageTeamKPD ( bool calcForBots ) {
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
Twin < float , int32_t > calc { } ;
2020-09-16 13:07:47 +03:00
for ( const auto & client : util . getClients ( ) ) {
if ( ! ( client . flags & ClientFlags : : Used ) ) {
continue ;
}
auto bot = bots [ client . ent ] ;
2020-11-23 10:48:44 +03:00
if ( calcForBots & & bot ) {
calc . first + = client . ent - > v . frags ;
calc . second + + ;
}
else if ( ! calcForBots & & ! bot ) {
2020-09-16 13:07:47 +03:00
calc . first + = client . ent - > v . frags ;
calc . second + + ;
}
}
if ( calc . second > 0 ) {
2023-04-12 23:03:36 +03:00
return calc . first / static_cast < float > ( cr : : max ( 1 , calc . second ) ) ;
2020-09-16 13:07:47 +03:00
}
return 0.0f ;
}
2019-07-27 17:36:24 +03:00
Twin < int , int > BotManager : : countTeamPlayers ( ) {
int ts = 0 , cts = 0 ;
2019-07-01 21:10:00 +03:00
for ( const auto & client : util . getClients ( ) ) {
2019-07-27 17:36:24 +03:00
if ( client . flags & ClientFlags : : Used ) {
if ( client . team2 = = Team : : Terrorist ) {
2019-08-04 18:22:01 +03:00
+ + ts ;
2019-05-05 18:52:28 +03:00
}
2019-07-27 17:36:24 +03:00
else if ( client . team2 = = Team : : CT ) {
2019-08-04 18:22:01 +03:00
+ + cts ;
2019-05-05 18:52:28 +03:00
}
}
}
2019-07-27 17:36:24 +03:00
return { ts , cts } ;
2019-05-05 18:52:28 +03:00
}
2019-07-27 17:36:24 +03:00
Bot * BotManager : : findHighestFragBot ( int team ) {
2014-09-09 18:30:40 +04:00
int bestIndex = 0 ;
float bestScore = - 1 ;
// search bots in this team
2019-07-27 17:36:24 +03:00
for ( const auto & bot : bots ) {
2024-01-31 13:04:02 +03:00
if ( bot - > m_isAlive & & game . getRealTeam ( bot - > ent ( ) ) = = team ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( bot - > pev - > frags > bestScore ) {
2019-07-27 17:36:24 +03:00
bestIndex = bot - > index ( ) ;
2016-01-16 21:08:22 +03:00
bestScore = bot - > pev - > frags ;
2014-09-09 18:30:40 +04:00
}
}
}
2019-07-27 17:36:24 +03:00
return findBotByIndex ( bestIndex ) ;
2014-09-09 18:30:40 +04:00
}
2019-07-01 21:10:00 +03:00
void BotManager : : updateTeamEconomics ( int team , bool setTrue ) {
2014-09-09 18:30:40 +04:00
// this function decides is players on specified team is able to buy primary weapons by calculating players
// that have not enough money to buy primary (with economics), and if this result higher 80%, player is can't
// buy primary weapons.
2024-04-25 15:03:39 +03:00
if ( setTrue | | ! cv_economics_rounds ) {
2014-09-09 18:30:40 +04:00
m_economicsGood [ team ] = true ;
return ; // don't check economics while economics disable
}
2019-07-01 21:10:00 +03:00
const int * econLimit = conf . getEconLimit ( ) ;
2014-09-09 18:30:40 +04:00
int numPoorPlayers = 0 ;
int numTeamPlayers = 0 ;
// start calculating
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
if ( bot - > m_team = = team ) {
if ( bot - > m_moneyAmount < = econLimit [ EcoLimit : : PrimaryGreater ] ) {
2019-08-04 18:22:01 +03:00
+ + numPoorPlayers ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-08-04 18:22:01 +03:00
+ + numTeamPlayers ; // update count of team
2014-09-09 18:30:40 +04:00
}
}
m_economicsGood [ team ] = true ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( numTeamPlayers < = 1 ) {
2014-09-09 18:30:40 +04:00
return ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
// if 80 percent of team have no enough money to purchase primary weapon
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( ( numTeamPlayers * 80 ) / 100 < = numPoorPlayers ) {
2014-09-09 18:30:40 +04:00
m_economicsGood [ team ] = false ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
// winner must buy something!
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( m_lastWinner = = team ) {
2014-09-09 18:30:40 +04:00
m_economicsGood [ team ] = true ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : updateBotDifficulties ( ) {
2020-09-16 13:07:47 +03:00
// if min/max difficulty is specified this should not have effect
2024-04-25 15:03:39 +03:00
if ( cv_difficulty_min . as < int > ( ) ! = Difficulty : : Invalid | | cv_difficulty_max . as < int > ( ) ! = Difficulty : : Invalid | | cv_difficulty_auto ) {
2020-09-16 13:07:47 +03:00
return ;
}
2024-04-25 15:03:39 +03:00
const auto difficulty = cv_difficulty . as < int > ( ) ;
2019-05-13 21:41:14 +03:00
if ( difficulty ! = m_lastDifficulty ) {
// sets new difficulty for all bots
2019-07-27 17:36:24 +03:00
for ( const auto & bot : m_bots ) {
bot - > m_difficulty = difficulty ;
2019-05-13 21:41:14 +03:00
}
m_lastDifficulty = difficulty ;
}
}
2020-09-16 13:07:47 +03:00
void BotManager : : balanceBotDifficulties ( ) {
2024-01-29 08:08:07 +03:00
// difficulty changing once per round (time)
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
auto updateDifficulty = [ ] ( Bot * bot , int32_t offset ) {
2020-09-16 13:07:47 +03:00
bot - > m_difficulty = cr : : clamp ( static_cast < Difficulty > ( bot - > m_difficulty + offset ) , Difficulty : : Noob , Difficulty : : Expert ) ;
} ;
2024-01-29 08:08:07 +03:00
// with nightmare difficulty, there is no balance
2024-04-25 15:03:39 +03:00
if ( cv_whose_your_daddy ) {
2024-01-29 08:08:07 +03:00
return ;
}
2024-04-25 15:03:39 +03:00
if ( cv_difficulty_auto & & m_difficultyBalanceTime < game . time ( ) ) {
2023-06-24 02:36:51 +03:00
const auto ratioPlayer = getAverageTeamKPD ( false ) ;
const auto ratioBots = getAverageTeamKPD ( true ) ;
2020-09-16 13:07:47 +03:00
2023-04-12 23:03:36 +03:00
// calculate for each the bot
for ( auto & bot : m_bots ) {
2023-06-24 02:36:51 +03:00
const float score = bot - > m_kpdRatio ;
2020-09-16 13:07:47 +03:00
2023-04-12 23:03:36 +03:00
// if kd ratio is going to go to low, we need to try to set higher difficulty
if ( score < 0.8f | | ( score < = 1.2f & & ratioBots < ratioPlayer ) ) {
updateDifficulty ( bot . get ( ) , + 1 ) ;
}
else if ( score > 4.0f | | ( score > = 2.5f & & ratioBots > ratioPlayer ) ) {
updateDifficulty ( bot . get ( ) , - 1 ) ;
}
2020-09-16 13:07:47 +03:00
}
2024-04-25 15:03:39 +03:00
m_difficultyBalanceTime = game . time ( ) + cv_difficulty_auto_balance_interval . as < float > ( ) ;
2020-09-16 13:07:47 +03:00
}
}
2019-07-27 17:36:24 +03:00
void BotManager : : destroy ( ) {
2014-09-09 18:30:40 +04:00
// this function free all bots slots (used on server shutdown)
2023-05-06 20:14:03 +03:00
for ( auto & bot : m_bots ) {
bot - > markStale ( ) ;
}
2019-07-27 17:36:24 +03:00
m_bots . clear ( ) ;
2014-09-09 18:30:40 +04:00
}
2020-10-01 11:42:51 +03:00
Bot : : Bot ( edict_t * bot , int difficulty , int personality , int team , int skin ) {
2019-09-21 23:20:33 +03:00
// this function does core operation of creating bot, it's called by addbot (),
2014-09-09 18:30:40 +04:00
// when bot setup completed, (this is a bot class constructor)
2023-08-08 11:48:37 +03:00
const int clientIndex = game . indexOfEntity ( bot ) ;
2015-06-04 11:52:48 +03:00
pev = & bot - > v ;
2014-09-09 18:30:40 +04:00
// create the player entity by calling MOD's player function
2020-06-12 18:52:38 +03:00
bots . execGameEntity ( bot ) ;
2014-09-09 18:30:40 +04:00
// set all info buffer keys for this bot
2019-07-27 17:36:24 +03:00
auto buffer = engfuncs . pfnGetInfoKeyBuffer ( bot ) ;
2024-01-19 00:03:45 +03:00
2019-07-01 21:10:00 +03:00
engfuncs . pfnSetClientKeyValue ( clientIndex , buffer , " _vgui_menus " , " 0 " ) ;
2024-01-19 00:03:45 +03:00
engfuncs . pfnSetClientKeyValue ( clientIndex , buffer , " _ah " , " 0 " ) ;
2014-09-09 18:30:40 +04:00
2019-07-27 17:36:24 +03:00
if ( ! game . is ( GameFlags : : Legacy ) ) {
2024-04-25 15:03:39 +03:00
if ( cv_show_latency . as < int > ( ) = = 1 ) {
2019-07-27 17:36:24 +03:00
engfuncs . pfnSetClientKeyValue ( clientIndex , buffer , " *bot " , " 1 " ) ;
}
auto avatar = conf . getRandomAvatar ( ) ;
2024-04-25 15:03:39 +03:00
if ( cv_show_avatars & & ! avatar . empty ( ) ) {
2019-07-27 17:36:24 +03:00
engfuncs . pfnSetClientKeyValue ( clientIndex , buffer , " *sid " , avatar . chars ( ) ) ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
2023-03-13 15:39:15 +03:00
char reject [ 256 ] = { 0 , } ;
2019-09-14 23:13:55 +03:00
MDLL_ClientConnect ( bot , bot - > v . netname . chars ( ) , strings . format ( " 127.0.0.%d " , clientIndex + 100 ) , reject ) ;
2014-09-09 18:30:40 +04:00
2019-08-12 14:16:28 +03:00
if ( ! strings . isEmpty ( reject ) ) {
2019-09-14 23:13:55 +03:00
logger . error ( " Server refused '%s' connection (%s) " , bot - > v . netname . chars ( ) , reject ) ;
game . serverCommand ( " kick \" %s \" " , bot - > v . netname . chars ( ) ) ; // kick the bot player if the server refused it
2014-09-09 18:30:40 +04:00
bot - > v . flags | = FL_KILLME ;
2016-06-23 15:30:19 +03:00
return ;
2014-09-09 18:30:40 +04:00
}
MDLL_ClientPutInServer ( bot ) ;
2024-02-19 23:16:03 +03:00
bot - > v . flags | = FL_CLIENT | FL_FAKECLIENT ; // set this player as fake client
2014-09-09 18:30:40 +04:00
// initialize all the variables for this bot...
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_notStarted = true ; // hasn't joined game yet
2016-09-10 19:31:38 +03:00
m_forceRadio = false ;
2014-09-09 18:30:40 +04:00
2019-07-27 17:36:24 +03:00
m_index = clientIndex - 1 ;
m_startAction = BotMsg : : None ;
2016-10-18 20:34:02 +03:00
m_retryJoin = 0 ;
2014-09-09 18:30:40 +04:00
m_moneyAmount = 0 ;
2025-02-05 21:28:29 +03:00
m_logoDecalIndex = conf . getRandomLogoDecalIndex ( ) ;
2014-09-09 18:30:40 +04:00
2024-04-25 15:03:39 +03:00
if ( cv_rotate_bots ) {
m_stayTime = game . time ( ) + rg ( cv_rotate_stay_min . as < float > ( ) , cv_rotate_stay_max . as < float > ( ) ) ;
2023-03-25 04:36:21 +03:00
}
else {
m_stayTime = game . time ( ) + kInfiniteDistance ;
}
2014-09-09 18:30:40 +04:00
// assign how talkative this bot will be
2024-04-25 15:03:39 +03:00
m_sayTextBuffer . chatDelay = rg ( 3.8f , 10.0f ) ;
m_sayTextBuffer . chatProbability = rg ( 10 , 100 ) ;
2014-09-09 18:30:40 +04:00
2023-09-14 16:48:36 +03:00
m_isAlive = false ;
2019-07-27 17:36:24 +03:00
m_weaponBurstMode = BurstMode : : Off ;
2020-09-16 13:07:47 +03:00
m_difficulty = cr : : clamp ( static_cast < Difficulty > ( difficulty ) , Difficulty : : Noob , Difficulty : : Expert ) ;
2024-04-25 15:03:39 +03:00
auto minDifficulty = cv_difficulty_min . as < int > ( ) ;
auto maxDifficulty = cv_difficulty_max . as < int > ( ) ;
2020-09-16 13:07:47 +03:00
// if we're have min/max difficulty specified, choose value from they
if ( minDifficulty ! = Difficulty : : Invalid & & maxDifficulty ! = Difficulty : : Invalid ) {
if ( maxDifficulty > minDifficulty ) {
cr : : swap ( maxDifficulty , minDifficulty ) ;
}
2024-04-25 15:03:39 +03:00
m_difficulty = rg ( minDifficulty , maxDifficulty ) ;
2020-09-16 13:07:47 +03:00
}
2024-05-22 11:13:52 +03:00
m_pingBase = fakeping . randomBase ( ) ;
m_ping = fakeping . randomBase ( ) ;
2014-09-09 18:30:40 +04:00
2024-04-17 21:20:45 +03:00
m_previousThinkTime = game . time ( ) - 0.1f ;
2019-08-18 21:00:00 +03:00
m_frameInterval = game . time ( ) ;
2019-09-15 21:07:49 +03:00
m_heavyTimestamp = game . time ( ) ;
2019-07-01 21:10:00 +03:00
m_slowFrameTimestamp = 0.0f ;
2020-09-16 13:07:47 +03:00
m_kpdRatio = 0.0f ;
2024-12-20 01:04:59 +03:00
m_deathCount = 0 ;
2014-09-09 18:30:40 +04:00
2019-07-31 14:05:36 +03:00
// stuff from jk_botti
2024-04-25 15:03:39 +03:00
m_playServerTime = 60.0f * rg ( 30.0f , 240.0f ) ;
m_joinServerTime = plat . seconds ( ) - m_playServerTime * rg ( 0.2f , 0.8f ) ;
2019-07-31 14:05:36 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
switch ( personality ) {
2014-09-09 18:30:40 +04:00
case 1 :
2019-07-27 17:36:24 +03:00
m_personality = Personality : : Rusher ;
2024-04-25 15:03:39 +03:00
m_baseAgressionLevel = rg ( 0.7f , 1.0f ) ;
m_baseFearLevel = rg ( 0.0f , 0.4f ) ;
2014-09-09 18:30:40 +04:00
break ;
case 2 :
2019-07-27 17:36:24 +03:00
m_personality = Personality : : Careful ;
2024-04-25 15:03:39 +03:00
m_baseAgressionLevel = rg ( 0.2f , 0.5f ) ;
m_baseFearLevel = rg ( 0.7f , 1.0f ) ;
2014-09-09 18:30:40 +04:00
break ;
default :
2019-07-27 17:36:24 +03:00
m_personality = Personality : : Normal ;
2024-04-25 15:03:39 +03:00
m_baseAgressionLevel = rg ( 0.4f , 0.7f ) ;
m_baseFearLevel = rg ( 0.4f , 0.7f ) ;
2014-09-09 18:30:40 +04:00
break ;
}
2024-06-01 10:57:57 +03:00
clearAmmoInfo ( ) ;
2014-09-09 18:30:40 +04:00
m_currentWeapon = 0 ; // current weapon is not assigned at start
2020-09-13 02:21:15 +03:00
m_weaponType = WeaponType : : None ; // current weapon type is not assigned at start
2024-05-03 00:11:14 +03:00
m_voicePitch = rg ( 85 , 115 ) ; // assign voice pitch
2014-09-09 18:30:40 +04:00
// copy them over to the temp level variables
m_agressionLevel = m_baseAgressionLevel ;
m_fearLevel = m_baseFearLevel ;
2019-08-18 21:00:00 +03:00
m_nextEmotionUpdate = game . time ( ) + 0.5f ;
2020-09-26 18:41:53 +03:00
m_healthValue = bot - > v . health ;
2014-09-09 18:30:40 +04:00
// just to be sure
2020-09-16 13:07:47 +03:00
m_msgQueue . clear ( ) ;
2014-09-09 18:30:40 +04:00
2023-05-06 20:14:03 +03:00
// init async planner
m_planner = cr : : makeUnique < AStarAlgo > ( graph . length ( ) ) ;
2025-01-31 19:32:24 +03:00
// init path walker
m_pathWalk . init ( m_planner - > getMaxLength ( ) ) ;
2024-06-02 23:03:12 +03:00
// init player models parts enumerator
m_hitboxEnumerator = cr : : makeUnique < PlayerHitboxEnumerator > ( ) ;
2023-05-06 20:14:03 +03:00
// bot is not kicked by rotation
2023-03-25 04:36:21 +03:00
m_kickedByRotation = false ;
2014-09-09 18:30:40 +04:00
// assign team and class
m_wantedTeam = team ;
2020-10-01 11:42:51 +03:00
m_wantedSkin = skin ;
2014-09-09 18:30:40 +04:00
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
m_tasks . reserve ( Task : : Max ) ;
2014-09-09 18:30:40 +04:00
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
newRound ( ) ;
2017-02-06 22:31:54 +03:00
}
2024-06-01 10:57:57 +03:00
void Bot : : clearAmmoInfo ( ) {
plat . bzero ( & m_ammoInClip , sizeof ( m_ammoInClip ) ) ;
plat . bzero ( & m_ammo , sizeof ( m_ammo ) ) ;
}
2020-09-29 19:23:26 +03:00
float Bot : : getConnectionTime ( ) {
2023-06-24 02:36:51 +03:00
const auto current = plat . seconds ( ) ;
2020-09-29 19:23:26 +03:00
if ( current - m_joinServerTime > m_playServerTime | | current - m_joinServerTime < = 0.0f ) {
2024-04-25 15:03:39 +03:00
m_playServerTime = 60.0f * rg ( 30.0f , 240.0f ) ;
m_joinServerTime = current - m_playServerTime * rg ( 0.2f , 0.8f ) ;
2020-09-29 19:23:26 +03:00
}
return current - m_joinServerTime ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
int BotManager : : getHumansCount ( bool ignoreSpectators ) {
2014-09-09 18:30:40 +04:00
// this function returns number of humans playing on the server
int count = 0 ;
2019-07-01 21:10:00 +03:00
for ( const auto & client : util . getClients ( ) ) {
2019-07-27 17:36:24 +03:00
if ( ( client . flags & ClientFlags : : Used ) & & ! bots [ client . ent ] & & ! ( client . ent - > v . flags & FL_FAKECLIENT ) ) {
if ( ignoreSpectators & & client . team2 ! = Team : : Terrorist & & client . team2 ! = Team : : CT ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
continue ;
}
2019-08-04 18:22:01 +03:00
+ + count ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
}
return count ;
}
2019-07-27 17:36:24 +03:00
int BotManager : : getAliveHumansCount ( ) {
2014-09-09 18:30:40 +04:00
// this function returns number of humans playing on the server
int count = 0 ;
2019-07-01 21:10:00 +03:00
for ( const auto & client : util . getClients ( ) ) {
2025-01-31 19:32:24 +03:00
if ( ( client . flags & ClientFlags : : Alive )
& & ! bots [ client . ent ]
& & ! ( client . ent - > v . flags & FL_FAKECLIENT ) ) {
2019-08-04 18:22:01 +03:00
+ + count ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
}
return count ;
}
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
int BotManager : : getPlayerPriority ( edict_t * ent ) {
2025-01-31 19:32:24 +03:00
constexpr auto kHighPriority = 1024 ;
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
// always check for only our own bots
auto bot = bots [ ent ] ;
// if player just return high prio
if ( ! bot ) {
2025-01-31 19:32:24 +03:00
return game . indexOfEntity ( ent ) + kHighPriority * 2 ;
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
}
// give bots some priority
2025-01-31 19:32:24 +03:00
if ( bot - > m_hasC4 | | bot - > m_isVIP | | bot - > m_hasHostage | | ( bot - > m_currentTravelFlags & PathFlag : : Jump ) ) {
2023-08-08 11:48:37 +03:00
return bot - > entindex ( ) + kHighPriority ;
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
}
2025-01-25 22:24:18 +03:00
const auto task = bot - > getCurrentTaskId ( ) ;
2023-05-12 20:00:06 +03:00
2025-01-31 19:32:24 +03:00
// higher priority if important task
if ( task = = Task : : MoveToPosition
| | task = = Task : : SeekCover
| | task = = Task : : Camp
| | task = = Task : : Hide ) {
2023-08-08 11:48:37 +03:00
return bot - > entindex ( ) + kHighPriority ;
2023-05-12 20:00:06 +03:00
}
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
return bot - > entindex ( ) ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
bool BotManager : : isTeamStacked ( int team ) {
2019-07-27 17:36:24 +03:00
if ( team ! = Team : : CT & & team ! = Team : : Terrorist ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
return false ;
2014-09-09 18:30:40 +04:00
}
2024-04-25 15:03:39 +03:00
const int limitTeams = mp_limitteams . as < int > ( ) ;
2014-09-09 18:30:40 +04:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( ! limitTeams ) {
2016-10-18 20:34:02 +03:00
return false ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-07-27 17:36:24 +03:00
int teamCount [ kGameTeamNum ] = { 0 , } ;
2016-10-18 20:34:02 +03:00
2019-07-01 21:10:00 +03:00
for ( const auto & client : util . getClients ( ) ) {
2019-07-27 17:36:24 +03:00
if ( ( client . flags & ClientFlags : : Used ) & & client . team2 ! = Team : : Unassigned & & client . team2 ! = Team : : Spectator ) {
2019-08-04 18:22:01 +03:00
+ + teamCount [ client . team2 ] ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-10-18 20:34:02 +03:00
}
2019-07-27 17:36:24 +03:00
return teamCount [ team ] + 1 > teamCount [ team = = Team : : CT ? Team : : Terrorist : Team : : CT ] + limitTeams ;
}
void BotManager : : erase ( Bot * bot ) {
2019-08-12 14:16:28 +03:00
for ( auto & e : m_bots ) {
2020-11-23 00:06:18 +03:00
if ( e . get ( ) ! = bot ) {
continue ;
}
2021-09-21 16:52:20 +03:00
2024-04-25 15:03:39 +03:00
if ( ! bot - > m_kickedByRotation & & cv_save_bots_names ) {
2023-05-12 20:00:06 +03:00
m_saveBotNames . emplaceLast ( bot - > pev - > netname . str ( ) ) ;
2021-09-21 16:52:20 +03:00
}
2020-11-23 00:06:18 +03:00
bot - > markStale ( ) ;
2020-10-13 12:38:24 +03:00
2023-08-08 11:48:37 +03:00
const auto index = m_bots . index ( e ) ;
2020-11-23 00:06:18 +03:00
e . reset ( ) ;
2019-08-12 14:16:28 +03:00
2020-11-23 00:06:18 +03:00
m_bots . erase ( index , 1 ) ; // remove from bots array
break ;
2019-07-27 17:36:24 +03:00
}
2016-10-18 20:34:02 +03:00
}
2019-08-12 14:16:28 +03:00
void BotManager : : handleDeath ( edict_t * killer , edict_t * victim ) {
2024-01-31 13:04:02 +03:00
const auto killerTeam = game . getRealTeam ( killer ) ;
const auto victimTeam = game . getRealTeam ( victim ) ;
2019-08-12 14:16:28 +03:00
2024-04-25 15:03:39 +03:00
if ( cv_radio_mode . as < int > ( ) = = 2 ) {
2019-08-12 14:16:28 +03:00
// need to send congrats on well placed shot
for ( const auto & notify : bots ) {
2024-02-16 00:57:41 +03:00
if ( notify - > m_isAlive
2024-05-05 01:06:56 +03:00
& & killerTeam = = notify - > m_team
& & killerTeam ! = victimTeam
& & killer ! = notify - > ent ( )
& & notify - > seesEntity ( victim - > v . origin ) ) {
2024-02-16 00:57:41 +03:00
2019-08-12 14:16:28 +03:00
if ( ! ( killer - > v . flags & FL_FAKECLIENT ) ) {
2019-09-21 23:20:33 +03:00
notify - > pushChatterMessage ( Chatter : : NiceShotCommander ) ;
2019-08-12 14:16:28 +03:00
}
else {
2019-09-21 23:20:33 +03:00
notify - > pushChatterMessage ( Chatter : : NiceShotPall ) ;
2019-08-12 14:16:28 +03:00
}
break ;
}
}
}
Bot * killerBot = nullptr ;
Bot * victimBot = nullptr ;
// notice nearby to victim teammates, that attacker is near
for ( const auto & notify : bots ) {
2024-01-19 00:03:45 +03:00
if ( notify - > m_difficulty > = Difficulty : : Hard
2024-05-05 01:06:56 +03:00
& & killerTeam ! = victimTeam
& & notify - > m_seeEnemyTime + 2.0f < game . time ( )
& & notify - > m_isAlive
& & notify - > m_team = = victimTeam
& & game . isNullEntity ( notify - > m_enemy )
& & game . isNullEntity ( notify - > m_lastEnemy )
& & util . isVisible ( killer - > v . origin , notify - > ent ( ) ) ) {
2024-01-19 00:03:45 +03:00
2024-03-15 21:23:17 +03:00
// make bot look at last enemy position
2019-08-12 14:16:28 +03:00
notify - > m_actualReactionTime = 0.0f ;
2019-08-18 21:00:00 +03:00
notify - > m_seeEnemyTime = game . time ( ) ;
2019-08-12 14:16:28 +03:00
notify - > m_enemy = killer ;
notify - > m_lastEnemy = killer ;
notify - > m_lastEnemyOrigin = killer - > v . origin ;
}
if ( notify - > ent ( ) = = killer ) {
killerBot = notify . get ( ) ;
}
else if ( notify - > ent ( ) = = victim ) {
victimBot = notify . get ( ) ;
}
}
2024-05-15 22:56:35 +03:00
// mark bot as "spawned", and reset it to new-round state when it dead (for csdm/zombie only)
2023-06-20 22:00:15 +03:00
if ( victimBot ! = nullptr ) {
victimBot - > spawned ( ) ;
}
2019-08-12 14:16:28 +03:00
// is this message about a bot who killed somebody?
if ( killerBot ! = nullptr ) {
2024-01-29 08:08:07 +03:00
killerBot - > setLastVictim ( victim ) ;
2019-08-12 14:16:28 +03:00
}
// did a human kill a bot on his team?
2023-03-13 15:39:15 +03:00
else {
2019-08-12 14:16:28 +03:00
if ( victimBot ! = nullptr ) {
if ( killerTeam = = victimBot - > m_team ) {
victimBot - > m_voteKickIndex = game . indexOfEntity ( killer ) ;
2023-08-08 11:48:37 +03:00
2023-01-24 14:38:08 +00:00
for ( const auto & notify : bots ) {
if ( notify - > seesEntity ( victim - > v . origin ) ) {
2023-03-13 15:39:15 +03:00
notify - > pushChatterMessage ( Chatter : : TeamKill ) ;
2023-01-24 14:38:08 +00:00
}
}
2019-08-12 14:16:28 +03:00
}
2023-09-14 16:48:36 +03:00
victimBot - > m_isAlive = false ;
2019-08-12 14:16:28 +03:00
}
}
}
2019-07-27 17:36:24 +03:00
void Bot : : newRound ( ) {
2014-09-09 18:30:40 +04:00
// this function initializes a bot after creation & at the start of each round
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2014-09-09 18:30:40 +04:00
// delete all allocated path nodes
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
clearSearchNodes ( ) ;
2014-09-09 18:30:40 +04:00
2024-08-25 14:32:57 +03:00
m_pathOrigin . clear ( ) ;
m_destOrigin . clear ( ) ;
2019-08-24 12:43:42 +03:00
2019-07-27 17:36:24 +03:00
m_path = nullptr ;
2014-09-09 18:30:40 +04:00
m_currentTravelFlags = 0 ;
2024-08-25 14:32:57 +03:00
m_desiredVelocity . clear ( ) ;
2019-07-27 17:36:24 +03:00
m_currentNodeIndex = kInvalidNodeIndex ;
m_prevGoalIndex = kInvalidNodeIndex ;
m_chosenGoalIndex = kInvalidNodeIndex ;
2019-07-28 15:47:46 +03:00
m_loosedBombNodeIndex = kInvalidNodeIndex ;
m_plantedBombNodeIndex = kInvalidNodeIndex ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2014-09-09 18:30:40 +04:00
m_moveToC4 = false ;
2023-05-12 20:00:06 +03:00
m_defuseNotified = false ;
2014-09-09 18:30:40 +04:00
m_duckDefuse = false ;
2015-08-15 18:09:15 +03:00
m_duckDefuseCheckTime = 0.0f ;
2023-07-06 14:00:48 +03:00
m_timeDebugUpdateTime = 0.0f ;
2025-02-17 15:03:38 +03:00
m_lastDamageTimestamp = 0.0f ;
2014-09-09 18:30:40 +04:00
2015-07-12 17:18:20 +03:00
m_numFriendsLeft = 0 ;
m_numEnemiesLeft = 0 ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_oldButtons = pev - > button ;
2015-07-12 17:18:20 +03:00
2020-06-12 18:52:38 +03:00
for ( auto & node : m_previousNodes ) {
node = kInvalidNodeIndex ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-08-18 21:00:00 +03:00
m_navTimeset = game . time ( ) ;
2019-07-01 21:10:00 +03:00
m_team = game . getTeam ( ent ( ) ) ;
2014-09-09 18:30:40 +04:00
2021-09-14 15:10:14 +03:00
resetPathSearchType ( ) ;
2014-09-09 18:30:40 +04:00
// clear all states & tasks
m_states = 0 ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
clearTasks ( ) ;
2014-09-09 18:30:40 +04:00
m_isLeader = false ;
m_hasProgressBar = false ;
m_canChooseAimDirection = true ;
2019-07-01 21:10:00 +03:00
m_preventFlashing = 0.0f ;
2014-09-09 18:30:40 +04:00
2015-08-15 18:09:15 +03:00
m_timeTeamOrder = 0.0f ;
2024-04-25 15:03:39 +03:00
m_askCheckTime = rg ( 30.0f , 90.0f ) ;
2015-08-15 18:09:15 +03:00
m_minSpeed = 260.0f ;
m_prevSpeed = 0.0f ;
2019-08-04 18:22:01 +03:00
m_prevOrigin = Vector ( kInfiniteDistance , kInfiniteDistance , kInfiniteDistance ) ;
2019-08-18 21:00:00 +03:00
m_prevTime = game . time ( ) ;
m_lookUpdateTime = game . time ( ) ;
2024-04-25 15:03:39 +03:00
m_changeViewTime = game . time ( ) + ( rg . chance ( 25 ) ? mp_freezetime . as < float > ( ) : 0.0f ) ;
2019-08-18 21:00:00 +03:00
m_aimErrorTime = game . time ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2024-02-27 12:31:37 +03:00
m_viewDistance = Frustum : : kMaxViewDistance ;
m_maxViewDistance = Frustum : : kMaxViewDistance ;
2014-09-09 18:30:40 +04:00
2016-09-11 21:01:06 +03:00
m_liftEntity = nullptr ;
m_pickupItem = nullptr ;
2015-08-15 18:09:15 +03:00
m_itemCheckTime = 0.0f ;
2024-07-03 11:48:56 +03:00
m_ignoredItems . clear ( ) ;
2014-09-09 18:30:40 +04:00
2016-09-11 21:01:06 +03:00
m_breakableEntity = nullptr ;
2024-08-25 14:32:57 +03:00
m_breakableOrigin . clear ( ) ;
2022-02-22 13:51:59 +03:00
m_lastBreakable = nullptr ;
2015-08-15 18:09:15 +03:00
m_timeDoorOpen = 0.0f ;
2025-01-09 21:53:16 +03:00
m_timeHitDoor = 0.0f ;
2014-09-09 18:30:40 +04:00
2024-04-30 14:13:32 +03:00
for ( auto & fall : m_checkFallPoint ) {
2024-08-25 14:32:57 +03:00
fall . clear ( ) ;
2024-04-30 14:13:32 +03:00
}
m_checkFall = false ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
resetCollision ( ) ;
resetDoubleJump ( ) ;
2014-09-09 18:30:40 +04:00
2016-09-11 21:01:06 +03:00
m_enemy = nullptr ;
m_lastVictim = nullptr ;
m_lastEnemy = nullptr ;
2024-08-25 14:32:57 +03:00
m_lastEnemyOrigin . clear ( ) ;
m_lastVictimOrigin . clear ( ) ;
2016-09-11 21:01:06 +03:00
m_trackingEdict = nullptr ;
2024-03-09 22:41:48 +03:00
m_enemyBodyPartSet = nullptr ;
2015-08-15 18:09:15 +03:00
m_timeNextTracking = 0.0f ;
2024-11-13 17:52:19 +03:00
m_lastPredictIndex = kInvalidNodeIndex ;
m_lastPredictLength = kInfiniteDistanceLong ;
2014-09-09 18:30:40 +04:00
2015-08-15 18:09:15 +03:00
m_buttonPushTime = 0.0f ;
m_enemyUpdateTime = 0.0f ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_retreatTime = 0.0f ;
2015-08-15 18:09:15 +03:00
m_seeEnemyTime = 0.0f ;
m_shootAtDeadTime = 0.0f ;
m_oldCombatDesire = 0.0f ;
m_liftUsageTime = 0.0f ;
2022-02-22 13:51:59 +03:00
m_breakableTime = 0.0f ;
2014-09-09 18:30:40 +04:00
2016-09-11 21:01:06 +03:00
m_avoidGrenade = nullptr ;
2014-09-09 18:30:40 +04:00
m_needAvoidGrenade = 0 ;
m_lastDamageType = - 1 ;
m_voteKickIndex = 0 ;
m_lastVoteKick = 0 ;
m_voteMap = 0 ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_tryOpenDoor = 0 ;
2014-09-09 18:30:40 +04:00
m_aimFlags = 0 ;
m_liftState = 0 ;
2024-08-25 14:32:57 +03:00
m_aimLastError . clear ( ) ;
m_position . clear ( ) ;
m_liftTravelPos . clear ( ) ;
2014-09-09 18:30:40 +04:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
setIdealReactionTimers ( true ) ;
2014-09-09 18:30:40 +04:00
2016-09-11 21:01:06 +03:00
m_targetEntity = nullptr ;
2015-08-15 18:09:15 +03:00
m_followWaitTime = 0.0f ;
2014-09-09 18:30:40 +04:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_hostages . clear ( ) ;
2024-06-02 23:03:12 +03:00
m_hitboxEnumerator - > reset ( ) ;
2024-05-22 11:13:52 +03:00
m_approachingLadderTimer . invalidate ( ) ;
2024-01-29 08:08:07 +03:00
m_forgetLastVictimTimer . invalidate ( ) ;
2024-05-22 11:13:52 +03:00
m_lostReachableNodeTimer . invalidate ( ) ;
2025-02-14 20:28:36 +03:00
m_fixFallTimer . invalidate ( ) ;
2014-09-09 18:30:40 +04:00
2020-06-12 18:52:38 +03:00
for ( auto & timer : m_chatterTimes ) {
2023-01-24 14:38:08 +00:00
timer = kMaxChatterRepeatInterval ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2024-05-15 22:56:35 +03:00
refreshCreatureStatus ( nullptr ) ;
2020-06-12 18:52:38 +03:00
2014-09-09 18:30:40 +04:00
m_isReloading = false ;
2019-07-27 17:36:24 +03:00
m_reloadState = Reload : : None ;
2014-09-09 18:30:40 +04:00
2015-08-15 18:09:15 +03:00
m_reloadCheckTime = 0.0f ;
2019-08-18 21:00:00 +03:00
m_shootTime = game . time ( ) ;
m_playerTargetTime = game . time ( ) ;
2015-08-15 18:09:15 +03:00
m_firePause = 0.0f ;
m_timeLastFired = 0.0f ;
2014-09-09 18:30:40 +04:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_sniperStopTime = 0.0f ;
2015-08-15 18:09:15 +03:00
m_grenadeCheckTime = 0.0f ;
2014-09-09 18:30:40 +04:00
m_isUsingGrenade = false ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_bombSearchOverridden = false ;
2024-01-29 08:08:07 +03:00
m_fireHurtsFriend = false ;
2014-09-09 18:30:40 +04:00
m_blindButton = 0 ;
2015-08-03 00:05:27 +03:00
m_blindTime = 0.0f ;
m_jumpTime = 0.0f ;
2014-09-09 18:30:40 +04:00
m_jumpFinished = false ;
m_isStuck = false ;
2019-08-18 21:00:00 +03:00
m_sayTextBuffer . timeNextChat = game . time ( ) ;
2014-09-09 18:30:40 +04:00
m_sayTextBuffer . entityIndex = - 1 ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_sayTextBuffer . sayText . clear ( ) ;
2014-09-09 18:30:40 +04:00
2019-07-27 17:36:24 +03:00
m_buyState = BuyState : : PrimaryWeapon ;
2015-06-04 11:52:48 +03:00
m_lastEquipTime = 0.0f ;
2014-09-09 18:30:40 +04:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// if bot died, clear all weapon stuff and force buying again
2023-09-14 16:48:36 +03:00
if ( ! m_isAlive ) {
2024-06-01 10:57:57 +03:00
clearAmmoInfo ( ) ;
2014-09-09 18:30:40 +04:00
m_currentWeapon = 0 ;
2020-09-13 02:21:15 +03:00
m_weaponType = 0 ;
2014-09-09 18:30:40 +04:00
}
2022-04-14 12:36:23 +03:00
m_flashLevel = 100 ;
2019-08-18 21:00:00 +03:00
m_checkDarkTime = game . time ( ) ;
2014-09-09 18:30:40 +04:00
2024-04-25 15:03:39 +03:00
m_knifeAttackTime = game . time ( ) + rg ( 1.3f , 2.6f ) ;
m_nextBuyTime = game . time ( ) + rg ( 0.6f , 2.0f ) ;
2014-09-09 18:30:40 +04:00
m_buyPending = false ;
m_inBombZone = false ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_ignoreBuyDelay = false ;
2014-09-17 20:36:42 +04:00
m_hasC4 = false ;
2023-05-06 20:14:03 +03:00
m_hasHostage = false ;
2014-09-09 18:30:40 +04:00
2019-05-11 00:14:49 +03:00
m_fallDownTime = 0.0f ;
2015-08-15 18:09:15 +03:00
m_shieldCheckTime = 0.0f ;
m_zoomCheckTime = 0.0f ;
m_strafeSetTime = 0.0f ;
2024-04-25 15:03:39 +03:00
m_dodgeStrafeDir = Dodge : : None ;
2019-07-27 17:36:24 +03:00
m_fightStyle = Fight : : None ;
2015-08-15 18:09:15 +03:00
m_lastFightStyleCheck = 0.0f ;
2014-09-09 18:30:40 +04:00
m_checkWeaponSwitch = true ;
m_checkKnifeSwitch = true ;
m_buyingFinished = false ;
2016-09-11 21:01:06 +03:00
m_radioEntity = nullptr ;
2014-09-09 18:30:40 +04:00
m_radioOrder = 0 ;
m_defendedBomb = false ;
2015-06-04 11:52:48 +03:00
m_defendHostage = false ;
m_headedTime = 0.0f ;
2014-09-09 18:30:40 +04:00
2024-04-25 15:03:39 +03:00
m_timeLogoSpray = game . time ( ) + rg ( 5.0f , 30.0f ) ;
2019-08-18 21:00:00 +03:00
m_spawnTime = game . time ( ) ;
m_lastChatTime = game . time ( ) ;
2014-09-09 18:30:40 +04:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
m_timeCamping = 0.0f ;
2014-09-09 18:30:40 +04:00
m_campDirection = 0 ;
m_nextCampDirTime = 0 ;
m_campButtons = 0 ;
2015-08-15 18:09:15 +03:00
m_soundUpdateTime = 0.0f ;
2019-08-18 21:00:00 +03:00
m_heardSoundTime = game . time ( ) ;
2014-09-09 18:30:40 +04:00
2020-09-16 13:07:47 +03:00
m_msgQueue . clear ( ) ;
2023-06-14 19:36:46 +03:00
m_goalHist . clear ( ) ;
2022-02-22 13:51:59 +03:00
m_ignoredBreakable . clear ( ) ;
2014-09-09 18:30:40 +04:00
2024-02-15 05:42:52 +03:00
// ignore enemies for some time if needed
2024-04-25 15:03:39 +03:00
if ( cv_ignore_enemies_after_spawn_time . as < float > ( ) > 0.0f ) {
m_enemyIgnoreTimer = game . time ( ) + cv_ignore_enemies_after_spawn_time . as < float > ( ) ;
2024-02-15 05:42:52 +03:00
}
else {
m_enemyIgnoreTimer = 0.0f ;
}
2023-08-08 11:48:37 +03:00
// update refvec for blocked movement
updateRightRef ( ) ;
2014-09-09 18:30:40 +04:00
// and put buying into its message queue
2019-07-27 17:36:24 +03:00
pushMsgQueue ( BotMsg : : Buy ) ;
startTask ( Task : : Normal , TaskPri : : Normal , kInvalidNodeIndex , 0.0f , true ) ;
2014-09-09 18:30:40 +04:00
2020-06-12 18:52:38 +03:00
// restore fake client bit, just in case
2024-02-19 23:16:03 +03:00
pev - > flags | = FL_CLIENT | FL_FAKECLIENT ;
2020-06-12 18:52:38 +03:00
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 50 ) ) {
pushChatterMessage ( Chatter : : NewRound ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2024-04-25 15:03:39 +03:00
auto thinkFps = cr : : clamp ( cv_think_fps . as < float > ( ) , 30.0f , 90.0f ) ;
2024-07-14 15:01:36 +03:00
2024-03-11 08:06:39 +03:00
auto updateInterval = 1.0f / thinkFps ;
2024-07-14 15:01:36 +03:00
auto commandInterval = 1.0f / 60.0f ;
2023-06-13 19:55:03 +03:00
2024-07-14 15:01:36 +03:00
if ( game . is ( GameFlags : : Xash3D | GameFlags : : Xash3DLegacy ) ) {
if ( thinkFps < 50 ) {
2023-06-24 21:38:34 +03:00
updateInterval = 1.0f / 50.0f ; // xash3d works acceptable at 50fps
}
}
2024-07-14 15:01:36 +03:00
// legacy games behaves strange, when this enabled, disable for xash3d as well if requested
if ( bots . isFrameSkipDisabled ( ) ) {
updateInterval = 0.0f ;
commandInterval = 0.0f ;
2023-06-13 19:55:03 +03:00
}
2024-04-17 21:20:45 +03:00
m_thinkDelay . interval = updateInterval ;
2024-07-14 15:01:36 +03:00
m_commandDelay . interval = commandInterval ;
2014-09-09 18:30:40 +04:00
}
2021-09-14 15:10:14 +03:00
void Bot : : resetPathSearchType ( ) {
2021-09-15 11:14:05 +03:00
const auto morale = m_fearLevel > m_agressionLevel ? rg . chance ( 30 ) : rg . chance ( 70 ) ;
2021-09-14 15:10:14 +03:00
switch ( m_personality ) {
default :
case Personality : : Normal :
2023-04-02 12:17:12 +03:00
m_pathType = morale ? FindPath : : Optimal : FindPath : : Fast ;
2021-09-14 15:10:14 +03:00
break ;
case Personality : : Rusher :
2021-09-15 11:14:05 +03:00
m_pathType = morale ? FindPath : : Fast : FindPath : : Optimal ;
2021-09-14 15:10:14 +03:00
break ;
case Personality : : Careful :
2021-09-15 11:14:05 +03:00
m_pathType = morale ? FindPath : : Optimal : FindPath : : Safe ;
2021-09-14 15:10:14 +03:00
break ;
}
2023-06-23 19:52:46 +03:00
// if debug goal - set the fastest
2024-04-25 15:03:39 +03:00
if ( cv_debug_goal . as < int > ( ) ! = kInvalidNodeIndex ) {
2023-06-23 19:52:46 +03:00
m_pathType = FindPath : : Fast ;
}
2023-06-29 20:17:46 +03:00
// no need to be safe on csdm
if ( game . is ( GameFlags : : CSDM ) ) {
m_pathType = FindPath : : Fast ;
return ;
}
2021-09-14 15:10:14 +03:00
}
2019-07-27 17:36:24 +03:00
void Bot : : kill ( ) {
2014-09-09 18:30:40 +04:00
// this function kills a bot (not just using ClientKill, but like the CSBot does)
// base code courtesy of Lazy (from bots-united forums!)
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
bots . touchKillerEntity ( this ) ;
2014-09-09 18:30:40 +04:00
}
2023-06-23 19:52:46 +03:00
void Bot : : kick ( bool silent ) {
2014-09-09 18:30:40 +04:00
// this function kick off one bot from the server.
2019-09-14 23:13:55 +03:00
auto username = pev - > netname . chars ( ) ;
2023-03-13 15:39:15 +03:00
2024-02-15 23:57:54 +03:00
if ( ! ( pev - > flags & FL_CLIENT ) | | ( pev - > flags & FL_DORMANT ) | | strings . isEmpty ( username ) ) {
2016-10-29 21:01:41 +03:00
return ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2020-10-13 12:38:24 +03:00
markStale ( ) ;
game . serverCommand ( " kick \" %s \" " , username ) ;
2023-06-23 19:52:46 +03:00
if ( ! silent ) {
ctrl . msg ( " Bot '%s' kicked. " , username ) ;
}
2020-10-13 12:38:24 +03:00
}
2020-06-12 18:52:38 +03:00
2020-10-13 12:38:24 +03:00
void Bot : : markStale ( ) {
2023-05-06 20:14:03 +03:00
// switch chatter icon off
2023-04-19 06:39:18 +00:00
showChatterIcon ( false , true ) ;
2020-11-23 00:06:18 +03:00
2024-02-19 23:43:25 +03:00
// reset bots ping to default
2024-05-22 11:13:52 +03:00
fakeping . reset ( ent ( ) ) ;
2024-02-19 23:43:25 +03:00
2023-05-06 20:14:03 +03:00
// mark bot as leaving
m_isStale = true ;
2020-11-23 00:06:18 +03:00
// clear the bot name
2023-03-13 15:39:15 +03:00
conf . clearUsedName ( this ) ;
2020-11-23 00:06:18 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// clear fakeclient bit
2016-09-22 15:47:35 +03:00
pev - > flags & = ~ FL_FAKECLIENT ;
2023-06-23 19:52:46 +03:00
// make as not receiving any messages
2020-10-13 12:38:24 +03:00
pev - > flags | = FL_DORMANT ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
void Bot : : updateTeamJoin ( ) {
2014-09-09 18:30:40 +04:00
// this function handles the selection of teams & class
2020-02-08 00:03:52 +03:00
if ( ! m_notStarted ) {
return ;
}
2024-01-31 13:04:02 +03:00
const auto botTeam = game . getRealTeam ( ent ( ) ) ;
2020-02-08 00:03:52 +03:00
2016-09-14 15:40:42 +03:00
// cs prior beta 7.0 uses hud-based motd, so press fire once
2019-07-27 17:36:24 +03:00
if ( game . is ( GameFlags : : Legacy ) ) {
2016-09-14 15:40:42 +03:00
pev - > button | = IN_ATTACK ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-09-14 15:40:42 +03:00
2016-10-18 20:34:02 +03:00
// check if something has assigned team to us
2024-01-31 13:04:02 +03:00
else if ( botTeam = = Team : : Terrorist | | botTeam = = Team : : CT ) {
2016-10-18 20:34:02 +03:00
m_notStarted = false ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2024-01-31 13:04:02 +03:00
else if ( botTeam = = Team : : Unassigned & & m_retryJoin > 2 ) {
2019-07-27 17:36:24 +03:00
m_startAction = BotMsg : : TeamSelect ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-10-18 20:34:02 +03:00
2023-08-08 11:48:37 +03:00
// if bot was unable to join team, and no menus pop-ups, check for stacked team
2020-02-08 00:03:52 +03:00
if ( m_startAction = = BotMsg : : None ) {
if ( + + m_retryJoin > 3 & & bots . isTeamStacked ( m_wantedTeam - 1 ) ) {
2016-10-18 20:34:02 +03:00
m_retryJoin = 0 ;
2019-07-01 21:10:00 +03:00
ctrl . msg ( " Could not add bot to the game: Team is stacked (to disable this check, set mp_limitteams and mp_autoteambalance to zero and restart the round). " ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
kick ( ) ;
2016-10-18 20:34:02 +03:00
return ;
}
}
2014-09-09 18:30:40 +04:00
// handle counter-strike stuff here...
2019-07-27 17:36:24 +03:00
if ( m_startAction = = BotMsg : : TeamSelect ) {
m_startAction = BotMsg : : None ; // switch back to idle
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
if ( m_wantedTeam = = - 1 ) {
2024-04-25 15:03:39 +03:00
char teamJoin = cv_join_team . as < StringRef > ( ) [ 0 ] ;
2014-09-09 18:30:40 +04:00
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
if ( teamJoin = = ' C ' | | teamJoin = = ' c ' ) {
m_wantedTeam = 2 ;
}
else if ( teamJoin = = ' T ' | | teamJoin = = ' t ' ) {
m_wantedTeam = 1 ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( m_wantedTeam ! = 1 & & m_wantedTeam ! = 2 ) {
2021-09-16 16:09:51 +03:00
const auto & players = bots . countTeamPlayers ( ) ;
2020-10-01 11:42:51 +03:00
// balance the team upon creation, we can't use game auto select (5) from now, as we use enforced skins belows
// due to we don't know the team bot selected, and TeamInfo messages still shows us we're spectators..
if ( players . first > players . second ) {
m_wantedTeam = 2 ;
}
else if ( players . first < players . second ) {
m_wantedTeam = 1 ;
}
else {
2024-04-25 15:03:39 +03:00
m_wantedTeam = rg ( 1 , 2 ) ;
2020-10-01 11:42:51 +03:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
// select the team the bot wishes to join...
2019-09-14 23:13:55 +03:00
issueCommand ( " menuselect %d " , m_wantedTeam ) ;
2014-09-09 18:30:40 +04:00
}
2019-07-27 17:36:24 +03:00
else if ( m_startAction = = BotMsg : : ClassSelect ) {
m_startAction = BotMsg : : None ; // switch back to idle
2014-09-09 18:30:40 +04:00
2016-10-18 20:34:02 +03:00
// czero has additional models
2023-06-24 02:36:51 +03:00
const auto maxChoice = game . is ( GameFlags : : ConditionZero ) ? 5 : 4 ;
2020-10-01 11:42:51 +03:00
auto enforcedSkin = 0 ;
// setup enforced skin based on selected team
2024-01-31 13:04:02 +03:00
if ( m_wantedTeam = = 1 | | botTeam = = Team : : Terrorist ) {
2024-04-25 15:03:39 +03:00
enforcedSkin = cv_botskin_t . as < int > ( ) ;
2020-10-01 11:42:51 +03:00
}
2024-01-31 13:04:02 +03:00
else if ( m_wantedTeam = = 2 | | botTeam = = Team : : CT ) {
2024-04-25 15:03:39 +03:00
enforcedSkin = cv_botskin_ct . as < int > ( ) ;
2020-10-01 11:42:51 +03:00
}
enforcedSkin = cr : : clamp ( enforcedSkin , 0 , maxChoice ) ;
// try to choice manually
if ( m_wantedSkin < 1 | | m_wantedSkin > maxChoice ) {
2024-04-25 15:03:39 +03:00
m_wantedSkin = rg ( 1 , maxChoice ) ; // use random if invalid
2020-10-01 11:42:51 +03:00
}
2016-10-18 20:34:02 +03:00
2020-10-01 11:42:51 +03:00
// and set enforced if any
if ( enforcedSkin > 0 ) {
m_wantedSkin = enforcedSkin ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
// select the class the bot wishes to use...
2020-10-01 11:42:51 +03:00
issueCommand ( " menuselect %d " , m_wantedSkin ) ;
2014-09-09 18:30:40 +04:00
// bot has now joined the game (doesn't need to be started)
m_notStarted = false ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2014-09-09 18:30:40 +04:00
// check for greeting other players, since we connected
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 20 ) ) {
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
m_needToSendWelcomeChat = true ;
2019-07-01 21:10:00 +03:00
}
}
}
2023-06-20 15:18:35 +03:00
void BotManager : : captureChatRadio ( StringRef cmd , StringRef arg , edict_t * ent ) {
2019-07-01 21:10:00 +03:00
if ( game . isBotCmd ( ) ) {
return ;
}
2023-06-20 15:18:35 +03:00
if ( cmd . startsWith ( " say " ) ) {
2023-08-08 11:48:37 +03:00
const bool alive = util . isAlive ( ent ) ;
2019-07-01 21:10:00 +03:00
int team = - 1 ;
2024-01-31 13:04:02 +03:00
if ( cmd . endsWith ( " team " ) ) {
team = game . getRealTeam ( ent ) ;
2019-07-01 21:10:00 +03:00
}
for ( const auto & client : util . getClients ( ) ) {
2019-07-27 17:36:24 +03:00
if ( ! ( client . flags & ClientFlags : : Used ) | | ( team ! = - 1 & & team ! = client . team2 ) | | alive ! = util . isAlive ( client . ent ) ) {
2019-07-01 21:10:00 +03:00
continue ;
}
2019-07-27 17:36:24 +03:00
auto target = bots [ client . ent ] ;
2023-03-13 15:39:15 +03:00
2019-07-01 21:10:00 +03:00
if ( target ! = nullptr ) {
2019-07-27 17:36:24 +03:00
target - > m_sayTextBuffer . entityIndex = game . indexOfPlayer ( ent ) ;
2023-03-13 15:39:15 +03:00
2019-08-12 14:16:28 +03:00
if ( strings . isEmpty ( engfuncs . pfnCmd_Args ( ) ) ) {
2019-07-01 21:10:00 +03:00
continue ;
}
target - > m_sayTextBuffer . sayText = engfuncs . pfnCmd_Args ( ) ;
2019-08-18 21:00:00 +03:00
target - > m_sayTextBuffer . timeNextChat = game . time ( ) + target - > m_sayTextBuffer . chatDelay ;
2019-07-01 21:10:00 +03:00
}
}
}
2023-05-12 20:00:06 +03:00
auto & target = util . getClient ( game . indexOfPlayer ( ent ) ) ;
2019-07-01 21:10:00 +03:00
// check if this player alive, and issue something
2023-06-20 15:18:35 +03:00
if ( ( target . flags & ClientFlags : : Alive ) & & target . radio ! = 0 & & cmd . startsWith ( " menuselect " ) ) {
2024-04-25 15:03:39 +03:00
auto radioCommand = arg . as < int > ( ) ;
2019-07-01 21:10:00 +03:00
if ( radioCommand ! = 0 ) {
2019-07-27 17:36:24 +03:00
radioCommand + = 10 * ( target . radio - 1 ) ;
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
if ( radioCommand ! = Radio : : RogerThat & & radioCommand ! = Radio : : Negative & & radioCommand ! = Radio : : ReportingIn ) {
for ( const auto & bot : bots ) {
2019-07-01 21:10:00 +03:00
// validate bot
2019-07-27 17:36:24 +03:00
if ( bot - > m_team = = target . team & & ent ! = bot - > ent ( ) & & bot - > m_radioOrder = = 0 ) {
2019-07-01 21:10:00 +03:00
bot - > m_radioOrder = radioCommand ;
bot - > m_radioEntity = ent ;
}
}
}
2019-08-18 21:00:00 +03:00
bots . setLastRadioTimestamp ( target . team , game . time ( ) ) ;
2019-07-01 21:10:00 +03:00
}
2019-07-27 17:36:24 +03:00
target . radio = 0 ;
2019-07-01 21:10:00 +03:00
}
2023-06-20 15:18:35 +03:00
else if ( cmd . startsWith ( " radio " ) ) {
2024-04-25 15:03:39 +03:00
target . radio = cmd . substr ( 5 ) . as < int > ( ) ;
2019-07-01 21:10:00 +03:00
}
}
2019-07-27 17:36:24 +03:00
void BotManager : : notifyBombDefuse ( ) {
2019-07-01 21:10:00 +03:00
// notify all terrorists that CT is starting bomb defusing
2023-05-12 20:00:06 +03:00
const auto & bombPos = graph . getBombOrigin ( ) ;
2020-02-08 00:03:52 +03:00
2019-07-27 17:36:24 +03:00
for ( const auto & bot : bots ) {
2023-08-08 11:48:37 +03:00
const auto task = bot - > getCurrentTaskId ( ) ;
2019-07-01 21:10:00 +03:00
2024-02-16 00:57:41 +03:00
if ( ! bot - > m_defuseNotified
2024-05-05 01:06:56 +03:00
& & bot - > m_isAlive
& & task ! = Task : : MoveToPosition
& & task ! = Task : : DefuseBomb
& & task ! = Task : : EscapeFromBomb ) {
2024-02-16 00:57:41 +03:00
2024-04-25 15:03:39 +03:00
if ( bot - > m_team = = Team : : Terrorist & & bot - > pev - > origin . distanceSq ( bombPos ) < cr : : sqrf ( 512.0f ) ) {
2023-05-02 09:42:43 +03:00
bot - > clearSearchNodes ( ) ;
2023-05-12 20:00:06 +03:00
bot - > m_pathType = FindPath : : Fast ;
2023-05-02 09:42:43 +03:00
bot - > m_position = bombPos ;
2023-05-12 20:00:06 +03:00
bot - > m_defuseNotified = true ;
2023-05-02 09:42:43 +03:00
bot - > startTask ( Task : : MoveToPosition , TaskPri : : MoveToPosition , kInvalidNodeIndex , 0.0f , true ) ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2014-09-09 18:30:40 +04:00
}
2015-06-11 00:18:49 +03:00
}
2019-07-27 17:36:24 +03:00
void BotManager : : updateActiveGrenade ( ) {
2019-08-18 21:00:00 +03:00
if ( m_grenadeUpdateTime > game . time ( ) ) {
2016-03-25 14:56:40 +03:00
return ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-08-18 21:00:00 +03:00
m_activeGrenades . clear ( ) ; // clear previously stored grenades
2015-06-11 00:18:49 +03:00
2020-12-15 15:28:58 +03:00
// need to ignore bomb model in active grenades...
auto bombModel = conf . getBombModelName ( ) ;
2015-06-11 00:18:49 +03:00
// search the map for any type of grenade
2019-08-18 21:00:00 +03:00
game . searchEntities ( " classname " , " grenade " , [ & ] ( edict_t * e ) {
2016-01-27 21:40:47 +03:00
// do not count c4 as a grenade
2020-12-15 15:28:58 +03:00
if ( ! util . isModel ( e , bombModel ) ) {
2020-06-12 18:52:38 +03:00
m_activeGrenades . push ( e ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2020-06-12 18:52:38 +03:00
return EntitySearchResult : : Continue ; // continue iteration
2019-08-18 21:00:00 +03:00
} ) ;
m_grenadeUpdateTime = game . time ( ) + 0.25f ;
2015-06-11 00:18:49 +03:00
}
2023-05-06 20:14:03 +03:00
void BotManager : : updateInterestingEntities ( ) {
2019-08-18 21:00:00 +03:00
if ( m_entityUpdateTime > game . time ( ) ) {
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
return ;
}
// clear previously stored entities
2023-05-06 20:14:03 +03:00
m_interestingEntities . clear ( ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
2019-08-18 21:00:00 +03:00
// search the map for any type of grenade
game . searchEntities ( nullptr , kInfiniteDistance , [ & ] ( edict_t * e ) {
2023-06-20 15:18:35 +03:00
auto classname = e - > v . classname . str ( ) ;
2023-03-13 15:39:15 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// search for grenades, weaponboxes, weapons, items and armoury entities
2023-06-20 15:18:35 +03:00
if ( classname . startsWith ( " weaponbox " ) | | classname . startsWith ( " grenade " ) | | util . isItem ( e ) | | classname . startsWith ( " armoury " ) ) {
2023-05-06 20:14:03 +03:00
m_interestingEntities . push ( e ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2023-06-20 15:18:35 +03:00
// pickup some hostage if on cs_ maps
2023-06-23 19:52:46 +03:00
if ( game . mapIs ( MapFlags : : HostageRescue ) & & util . isHostageEntity ( e ) ) {
2023-05-06 20:14:03 +03:00
m_interestingEntities . push ( e ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-08-18 21:00:00 +03:00
// add buttons
2023-06-20 15:18:35 +03:00
if ( game . mapIs ( MapFlags : : HasButtons ) & & classname . startsWith ( " func_button " ) ) {
2023-05-06 20:14:03 +03:00
m_interestingEntities . push ( e ) ;
2019-08-18 21:00:00 +03:00
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
// pickup some csdm stuff if we're running csdm
2023-06-20 15:18:35 +03:00
if ( game . is ( GameFlags : : CSDM ) & & classname . startsWith ( " csdm " ) ) {
2023-05-06 20:14:03 +03:00
m_interestingEntities . push ( e ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2019-08-18 21:00:00 +03:00
2024-04-25 15:03:39 +03:00
if ( cv_attack_monsters & & util . isMonster ( e ) ) {
2023-05-06 20:14:03 +03:00
m_interestingEntities . push ( e ) ;
2020-12-03 14:14:22 +02:00
}
2019-08-18 21:00:00 +03:00
// continue iteration
return EntitySearchResult : : Continue ;
} ) ;
m_entityUpdateTime = game . time ( ) + 0.5f ;
2016-02-07 02:34:06 +03:00
}
2016-09-10 19:31:38 +03:00
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
void BotManager : : selectLeaders ( int team , bool reset ) {
if ( reset ) {
2016-09-10 19:31:38 +03:00
m_leaderChoosen [ team ] = false ;
return ;
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( m_leaderChoosen [ team ] ) {
return ;
}
2019-07-27 17:36:24 +03:00
if ( game . mapIs ( MapFlags : : Assassination ) ) {
if ( team = = Team : : CT & & ! m_leaderChoosen [ Team : : CT ] ) {
for ( const auto & bot : m_bots ) {
if ( bot - > m_isVIP ) {
2016-09-10 19:31:38 +03:00
// vip bot is the leader
bot - > m_isLeader = true ;
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 50 ) ) {
bot - > pushRadioMessage ( Radio : : FollowMe ) ;
2016-09-10 19:31:38 +03:00
bot - > m_campButtons = 0 ;
}
}
}
2019-07-27 17:36:24 +03:00
m_leaderChoosen [ Team : : CT ] = true ;
2016-09-10 19:31:38 +03:00
}
2019-07-27 17:36:24 +03:00
else if ( team = = Team : : Terrorist & & ! m_leaderChoosen [ Team : : Terrorist ] ) {
auto bot = bots . findHighestFragBot ( team ) ;
2016-09-10 19:31:38 +03:00
2023-09-14 16:48:36 +03:00
if ( bot ! = nullptr & & bot - > m_isAlive ) {
2016-09-10 19:31:38 +03:00
bot - > m_isLeader = true ;
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 45 ) ) {
bot - > pushRadioMessage ( Radio : : FollowMe ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-09-10 19:31:38 +03:00
}
2019-07-27 17:36:24 +03:00
m_leaderChoosen [ Team : : Terrorist ] = true ;
2016-09-10 19:31:38 +03:00
}
}
2019-07-27 17:36:24 +03:00
else if ( game . mapIs ( MapFlags : : Demolition ) ) {
if ( team = = Team : : Terrorist & & ! m_leaderChoosen [ Team : : Terrorist ] ) {
for ( const auto & bot : m_bots ) {
if ( bot - > m_hasC4 ) {
2016-09-10 19:31:38 +03:00
// bot carrying the bomb is the leader
bot - > m_isLeader = true ;
// terrorist carrying a bomb needs to have some company
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 75 ) ) {
2024-04-25 15:03:39 +03:00
if ( cv_radio_mode . as < int > ( ) = = 2 ) {
2019-07-27 17:36:24 +03:00
bot - > pushChatterMessage ( Chatter : : GoingToPlantBomb ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
else {
2019-07-27 17:36:24 +03:00
bot - > pushChatterMessage ( Radio : : FollowMe ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-09-10 19:31:38 +03:00
bot - > m_campButtons = 0 ;
}
}
}
2019-07-27 17:36:24 +03:00
m_leaderChoosen [ Team : : Terrorist ] = true ;
2016-09-10 19:31:38 +03:00
}
2019-07-27 17:36:24 +03:00
else if ( ! m_leaderChoosen [ Team : : CT ] ) {
if ( auto bot = bots . findHighestFragBot ( team ) ) {
2016-09-10 19:31:38 +03:00
bot - > m_isLeader = true ;
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 30 ) ) {
bot - > pushRadioMessage ( Radio : : FollowMe ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
2016-09-10 19:31:38 +03:00
}
2019-07-27 17:36:24 +03:00
m_leaderChoosen [ Team : : CT ] = true ;
2016-09-10 19:31:38 +03:00
}
}
2022-04-03 14:43:29 +03:00
else if ( game . mapIs ( MapFlags : : Escape | MapFlags : : KnifeArena | MapFlags : : FightYard ) ) {
2019-07-27 17:36:24 +03:00
auto bot = bots . findHighestFragBot ( team ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( ! m_leaderChoosen [ team ] & & bot ) {
2016-09-10 19:31:38 +03:00
bot - > m_isLeader = true ;
2019-07-27 17:36:24 +03:00
if ( rg . chance ( 30 ) ) {
bot - > pushRadioMessage ( Radio : : FollowMe ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
m_leaderChoosen [ team ] = true ;
2016-09-10 19:31:38 +03:00
}
}
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
else {
2019-07-27 17:36:24 +03:00
auto bot = bots . findHighestFragBot ( team ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
if ( ! m_leaderChoosen [ team ] & & bot ) {
2016-09-10 19:31:38 +03:00
bot - > m_isLeader = true ;
2019-07-27 17:36:24 +03:00
if ( rg . chance ( team = = Team : : Terrorist ? 30 : 40 ) ) {
bot - > pushRadioMessage ( Radio : : FollowMe ) ;
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
}
m_leaderChoosen [ team ] = true ;
2016-09-10 19:31:38 +03:00
}
}
2018-06-23 21:28:40 +06:00
}
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
void BotManager : : initRound ( ) {
2019-07-01 21:10:00 +03:00
// this is called at the start of each round
2020-02-08 00:03:52 +03:00
m_roundOver = false ;
2019-07-01 21:10:00 +03:00
// check team economics
2019-07-27 17:36:24 +03:00
for ( int team = 0 ; team < kGameTeamNum ; + + team ) {
2019-07-01 21:10:00 +03:00
updateTeamEconomics ( team ) ;
selectLeaders ( team , true ) ;
m_lastRadioTime [ team ] = 0.0f ;
}
reset ( ) ;
2019-07-27 17:36:24 +03:00
// notify all bots about new round arrived
for ( const auto & bot : bots ) {
bot - > newRound ( ) ;
}
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
// reset current radio message for all client
for ( auto & client : util . getClients ( ) ) {
client . radio = 0 ;
2019-07-01 21:10:00 +03:00
}
2019-08-24 12:43:42 +03:00
graph . setBombOrigin ( true ) ;
2019-07-27 17:36:24 +03:00
graph . clearVisited ( ) ;
m_bombSayStatus = BombPlantedSay : : ChatSay | BombPlantedSay : : Chatter ;
2019-07-01 21:10:00 +03:00
m_timeBombPlanted = 0.0f ;
m_plantSearchUpdateTime = 0.0f ;
2020-02-08 00:03:52 +03:00
m_autoKillCheckTime = 0.0f ;
2019-07-01 21:10:00 +03:00
m_botsCanPause = false ;
resetFilters ( ) ;
2023-05-02 09:42:43 +03:00
practice . update ( ) ; // update practice data on round start
2019-07-01 21:10:00 +03:00
// calculate the round mid/end in world time
2024-04-25 15:03:39 +03:00
m_timeRoundStart = game . time ( ) + mp_freezetime . as < float > ( ) ;
m_timeRoundMid = m_timeRoundStart + mp_roundtime . as < float > ( ) * 60.0f * 0.5f ;
m_timeRoundEnd = m_timeRoundStart + mp_roundtime . as < float > ( ) * 60.0f ;
2019-07-01 21:10:00 +03:00
}
void BotManager : : setBombPlanted ( bool isPlanted ) {
2024-04-25 15:03:39 +03:00
if ( cv_ignore_objectives ) {
2021-09-17 15:55:57 +03:00
m_bombPlanted = false ;
return ;
}
2019-07-01 21:10:00 +03:00
if ( isPlanted ) {
2019-08-18 21:00:00 +03:00
m_timeBombPlanted = game . time ( ) ;
2019-07-01 21:10:00 +03:00
}
m_bombPlanted = isPlanted ;
}
2023-05-06 20:14:03 +03:00
void BotThreadWorker : : shutdown ( ) {
2023-06-29 20:17:46 +03:00
if ( ! available ( ) ) {
return ;
}
2023-05-06 20:14:03 +03:00
game . print ( " Shutting down bot thread worker. " ) ;
m_botWorker . shutdown ( ) ;
}
void BotThreadWorker : : startup ( int workers ) {
2023-06-29 20:17:46 +03:00
String disableWorkerEnv = plat . env ( " YAPB_SINGLE_THREADED " ) ;
2024-11-17 15:33:04 +03:00
// disable on legacy games
const bool isLegacyGame = game . is ( GameFlags : : Legacy ) ;
2023-06-29 20:17:46 +03:00
// disable worker if requested via env variable or workers are disabled
2024-11-17 15:33:04 +03:00
if ( isLegacyGame | | workers = = 0 | | ( ! disableWorkerEnv . empty ( ) & & disableWorkerEnv = = " 1 " ) ) {
2023-06-29 20:17:46 +03:00
return ;
}
const auto count = m_botWorker . threadCount ( ) ;
2023-05-06 20:14:03 +03:00
if ( count > 0 ) {
logger . error ( " Tried to start thread pool with existing %d threads in pool. " , count ) ;
return ;
}
2023-06-29 20:17:46 +03:00
const auto maxThreads = plat . hardwareConcurrency ( ) ;
auto requestedThreads = workers ;
2023-05-06 20:14:03 +03:00
2023-06-29 20:17:46 +03:00
if ( requestedThreads < 0 | | requestedThreads > = maxThreads ) {
requestedThreads = 1 ;
2023-05-06 20:14:03 +03:00
}
2023-06-29 20:17:46 +03:00
requestedThreads = cr : : clamp ( requestedThreads , 1 , maxThreads - 1 ) ;
2023-05-06 20:14:03 +03:00
// notify user
2023-06-29 20:17:46 +03:00
game . print ( " Starting up bot thread worker with %d threads. " , requestedThreads ) ;
2023-05-06 20:14:03 +03:00
// start up the worker
2023-06-29 20:17:46 +03:00
m_botWorker . startup ( static_cast < size_t > ( requestedThreads ) ) ;
2023-05-06 20:14:03 +03:00
}
2024-03-31 23:23:01 +03:00
2025-01-09 21:53:16 +03:00
bool BotManager : : isLineBlockedBySmoke ( const Vector & from , const Vector & to ) {
2024-03-31 23:23:01 +03:00
if ( m_activeGrenades . empty ( ) ) {
return false ;
}
2025-01-09 21:53:16 +03:00
constexpr auto kSmokeGrenadeRadius = 115.0f ;
2024-03-31 23:23:01 +03:00
// distance along line of sight covered by smoke
float totalSmokedLength = 0.0f ;
Vector sightDir = to - from ;
const float sightLength = sightDir . normalizeInPlace ( ) ;
for ( auto pent : m_activeGrenades ) {
if ( game . isNullEntity ( pent ) ) {
continue ;
}
// need drawn models
if ( pent - > v . effects & EF_NODRAW ) {
continue ;
}
// smoke must be on a ground
if ( ! ( pent - > v . flags & FL_ONGROUND ) ) {
continue ;
}
// must be a smoke grenade
if ( ! util . isModel ( pent , kSmokeModelName ) ) {
continue ;
}
2025-01-09 21:53:16 +03:00
const float smokeRadiusSq = cr : : sqrf ( kSmokeGrenadeRadius ) ;
2024-03-31 23:23:01 +03:00
const Vector & smokeOrigin = game . getEntityOrigin ( pent ) ;
Vector toGrenade = smokeOrigin - from ;
float alongDist = toGrenade | sightDir ;
// compute closest point to grenade along line of sight ray
2024-05-16 21:15:41 +03:00
Vector close { } ;
2024-03-31 23:23:01 +03:00
// constrain closest point to line segment
if ( alongDist < 0.0f ) {
close = from ;
}
else if ( alongDist > = sightLength ) {
close = to ;
}
else {
close = from + sightDir * alongDist ;
}
// if closest point is within smoke radius, the line overlaps the smoke cloud
Vector toClose = close - smokeOrigin ;
float lengthSq = toClose . lengthSq ( ) ;
if ( lengthSq < smokeRadiusSq ) {
// some portion of the ray intersects the cloud
const float fromSq = toGrenade . lengthSq ( ) ;
const float toSq = ( smokeOrigin - to ) . lengthSq ( ) ;
if ( fromSq < smokeRadiusSq ) {
if ( toSq < smokeRadiusSq ) {
// both 'from' and 'to' lie within the cloud
// entire length is smoked
totalSmokedLength + = ( to - from ) . length ( ) ;
}
else {
// 'from' is inside the cloud, 'to' is outside
// compute half of total smoked length as if ray crosses entire cloud chord
float halfSmokedLength = cr : : sqrtf ( smokeRadiusSq - lengthSq ) ;
if ( alongDist > 0.0f ) {
// ray goes thru 'close'
totalSmokedLength + = halfSmokedLength + ( close - from ) . length ( ) ;
}
else {
// ray starts after 'close'
totalSmokedLength + = halfSmokedLength - ( close - from ) . length ( ) ;
}
}
}
else if ( toSq < smokeRadiusSq ) {
// 'from' is outside the cloud, 'to' is inside
// compute half of total smoked length as if ray crosses entire cloud chord
const float halfSmokedLength = cr : : sqrtf ( smokeRadiusSq - lengthSq ) ;
Vector v = to - smokeOrigin ;
if ( ( v | sightDir ) > 0.0f ) {
// ray goes thru 'close'
totalSmokedLength + = halfSmokedLength + ( close - to ) . length ( ) ;
}
else {
// ray ends before 'close'
totalSmokedLength + = halfSmokedLength - ( close - to ) . length ( ) ;
}
}
else {
// 'from' and 'to' lie outside of the cloud - the line of sight completely crosses it
// determine the length of the chord that crosses the cloud
const float smokedLength = 2.0f * cr : : sqrtf ( smokeRadiusSq - lengthSq ) ;
totalSmokedLength + = smokedLength ;
}
}
}
2024-05-05 01:06:56 +03:00
2024-03-31 23:23:01 +03:00
// define how much smoke a bot can see thru
const float maxSmokedLength = 0.7f * kSmokeGrenadeRadius ;
// return true if the total length of smoke-covered line-of-sight is too much
return ( totalSmokedLength > maxSmokedLength ) ;
}
2024-07-14 15:01:36 +03:00
bool BotManager : : isFrameSkipDisabled ( ) {
if ( game . is ( GameFlags : : Legacy ) ) {
return true ;
}
return game . is ( GameFlags : : Xash3D | GameFlags : : Xash3DLegacy ) & & cv_think_fps_disable ;
}