2016-03-01 13:37:10 +03:00
//
2020-06-12 18:52:38 +03:00
// YaPB - Counter-Strike Bot based on PODBot by Markus Klinge.
2023-01-22 19:12:03 +06:00
// Copyright © 2004-2023 YaPB Project <yapb@jeefo.net>.
2016-03-01 13:37:10 +03:00
//
2020-11-03 08:57:12 +03:00
// SPDX-License-Identifier: MIT
2016-03-01 13:37:10 +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
# include <yapb.h>
2016-03-01 13:37:10 +03:00
2022-01-04 01:29:07 +06:00
ConVar cv_csdm_mode ( " yb_csdm_mode " , " 0 " , " Enables or disables CSDM / FFA mode for bots. \n Allowed values: '0', '1', '2', '3'. \n If '0', CSDM / FFA mode is auto-detected. \n If '1', CSDM mode is enabled, but FFA is disabled. \n If '2', CSDM and FFA mode is enabled. \n If '3', CSDM and FFA mode is disabled. " , true , 0.0f , 3.0f ) ;
2023-03-13 16:08:29 +03:00
ConVar cv_breakable_health_limit ( " yb_breakable_health_limit " , " 500.0 " , " Specifies the maximum health of breakable object, that bot will consider to destroy. " , true , 1.0f , 3000.0 ) ;
2019-08-29 16:24:24 +03:00
2020-06-12 18:52:38 +03:00
ConVar sv_skycolor_r ( " sv_skycolor_r " , nullptr , Var : : GameRef ) ;
ConVar sv_skycolor_g ( " sv_skycolor_g " , nullptr , Var : : GameRef ) ;
ConVar sv_skycolor_b ( " sv_skycolor_b " , nullptr , Var : : GameRef ) ;
2019-05-10 13:51:09 +03:00
2019-07-27 17:36:24 +03:00
Game : : Game ( ) {
2016-09-11 21:01:06 +03:00
m_startEntity = nullptr ;
m_localEntity = nullptr ;
2016-03-12 14:35:44 +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
m_precached = false ;
2019-07-01 21:10:00 +03:00
m_gameFlags = 0 ;
m_mapFlags = 0 ;
2021-09-15 13:02:22 +03:00
m_oneSecondFrame = 0.0f ;
m_halfSecondFrame = 0.0f ;
2019-07-01 21:10: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
m_cvars . clear ( ) ;
2016-03-12 14:35:44 +03:00
}
2019-07-27 17:36:24 +03:00
void Game : : precache ( ) {
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_precached ) {
return ;
}
m_precached = true ;
2019-09-14 23:13:55 +03:00
m_drawModels [ DrawLine : : Simple ] = m_engineWrap . precacheModel ( " sprites/laserbeam.spr " ) ;
m_drawModels [ DrawLine : : Arrow ] = m_engineWrap . precacheModel ( " sprites/arrow1.spr " ) ;
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-14 23:13:55 +03:00
m_engineWrap . precacheSound ( " weapons/xbow_hit1.wav " ) ; // waypoint add
m_engineWrap . precacheSound ( " weapons/mine_activate.wav " ) ; // waypoint delete
m_engineWrap . precacheSound ( " common/wpn_hudoff.wav " ) ; // path add/delete start
m_engineWrap . precacheSound ( " common/wpn_hudon.wav " ) ; // path add/delete done
m_engineWrap . precacheSound ( " common/wpn_moveselect.wav " ) ; // path add/delete cancel
m_engineWrap . precacheSound ( " common/wpn_denyselect.wav " ) ; // path add/delete error
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
m_mapFlags = 0 ; // reset map type as worldspawn is the first entity spawned
2016-03-01 13:37:10 +03:00
2019-07-27 17:36:24 +03:00
// detect official csbots here
if ( ! ( is ( GameFlags : : Legacy ) ) & & engfuncs . pfnCVarGetPointer ( " bot_stop " ) ! = nullptr ) {
m_gameFlags | = GameFlags : : CSBot ;
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
registerCvars ( 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-07-31 14:05:36 +03:00
void Game : : levelInitialize ( edict_t * entities , int max ) {
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 precaches needed models and initialize class variables
2016-03-01 22:52:17 +03:00
2019-07-27 17:36:24 +03:00
m_spawnCount [ Team : : CT ] = 0 ;
m_spawnCount [ Team : : Terrorist ] = 0 ;
2019-08-24 12:43:42 +03:00
// clear all breakables before initialization
m_breakables . clear ( ) ;
2020-06-12 18:52:38 +03:00
2020-11-08 01:20:12 +03:00
// initialize all config files
2023-03-13 15:39:15 +03:00
conf . loadConfigs ( ) ;
2020-11-08 01:20:12 +03:00
// update worldmodel
illum . resetWorldModel ( ) ;
// do level initialization stuff here...
graph . loadGraphData ( ) ;
// execute main config
conf . loadMainConfig ( ) ;
// load map-specific config
conf . loadMapSpecificConfig ( ) ;
// initialize quota management
bots . initQuota ( ) ;
// rebuild vistable if needed
graph . rebuildVisibility ( ) ;
// install the sendto hook to fake queries
util . installSendTo ( ) ;
2022-03-01 21:45:52 +03:00
// flush any print queue
ctrl . resetFlushTimestamp ( ) ;
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
// go thru the all entities on map, and do whatever we're want
2019-07-27 17:36:24 +03:00
for ( int i = 0 ; i < max ; + + i ) {
2019-07-31 14:05:36 +03:00
auto ent = entities + 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
// only valid entities
2020-06-12 18:52:38 +03:00
if ( ! ent | | ent - > v . classname = = 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
continue ;
}
2019-09-14 23:13:55 +03:00
auto classname = ent - > v . 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
if ( strcmp ( classname , " worldspawn " ) = = 0 ) {
m_startEntity = ent ;
}
else if ( strcmp ( classname , " player_weaponstrip " ) = = 0 ) {
2019-09-21 23:20:33 +03:00
if ( is ( GameFlags : : Legacy ) & & strings . isEmpty ( ent - > v . target . chars ( ) ) ) {
2019-07-01 21:10:00 +03:00
ent - > v . target = ent - > v . targetname = engfuncs . pfnAllocString ( " fake " ) ;
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
}
2022-04-08 17:57:19 +03:00
else if ( ! is ( GameFlags : : ReGameDLL ) ) {
2019-07-01 21:10:00 +03:00
engfuncs . pfnRemoveEntity ( ent ) ;
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-08 01:20:12 +03:00
else if ( strcmp ( classname , " info_player_start " ) = = 0 | | strcmp ( classname , " info_vip_start " ) = = 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
ent - > v . rendermode = kRenderTransAlpha ; // set its render mode to transparency
ent - > v . renderamt = 127 ; // set its transparency amount
ent - > v . effects | = EF_NODRAW ;
2019-05-13 21:41:14 +03:00
2019-08-04 18:22:01 +03:00
+ + m_spawnCount [ 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
}
else if ( strcmp ( classname , " info_player_deathmatch " ) = = 0 ) {
ent - > v . rendermode = kRenderTransAlpha ; // set its render mode to transparency
ent - > v . renderamt = 127 ; // set its transparency amount
ent - > v . effects | = EF_NODRAW ;
2019-05-13 21:41:14 +03:00
2019-08-04 18:22:01 +03:00
+ + m_spawnCount [ 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
}
else if ( strcmp ( classname , " func_vip_safetyzone " ) = = 0 | | strcmp ( classname , " info_vip_safetyzone " ) = = 0 ) {
2019-07-27 17:36:24 +03:00
m_mapFlags | = MapFlags : : Assassination ; // assassination map
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
}
2022-01-03 07:18:36 +01:00
else if ( strcmp ( classname , " hostage_entity " ) = = 0 | | strcmp ( classname , " monster_scientist " ) = = 0 ) {
2019-07-27 17:36:24 +03:00
m_mapFlags | = MapFlags : : HostageRescue ; // rescue map
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 ( strcmp ( classname , " func_bomb_target " ) = = 0 | | strcmp ( classname , " info_bomb_target " ) = = 0 ) {
2019-07-27 17:36:24 +03:00
m_mapFlags | = MapFlags : : Demolition ; // defusion map
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 ( strcmp ( classname , " func_escapezone " ) = = 0 ) {
2019-07-27 17:36:24 +03:00
m_mapFlags | = MapFlags : : Escape ;
2020-09-13 02:21:15 +03:00
// strange thing on some ES maps, where hostage entity present there
if ( m_mapFlags & MapFlags : : HostageRescue ) {
m_mapFlags & = ~ MapFlags : : HostageRescue ;
}
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 ( strncmp ( classname , " func_door " , 9 ) = = 0 ) {
2019-07-27 17:36:24 +03:00
m_mapFlags | = MapFlags : : HasDoors ;
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
else if ( strncmp ( classname , " func_button " , 11 ) = = 0 ) {
m_mapFlags | = MapFlags : : HasButtons ;
}
2019-08-24 12:43:42 +03:00
else if ( isShootableBreakable ( ent ) ) {
m_breakables . push ( ent ) ;
}
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
}
// next maps doesn't have map-specific entities, so determine it by name
2019-07-27 17:36:24 +03:00
if ( strncmp ( getMapName ( ) , " fy_ " , 3 ) = = 0 ) {
2022-04-03 14:43:29 +03:00
m_mapFlags | = MapFlags : : FightYard ;
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
else if ( strncmp ( getMapName ( ) , " ka_ " , 3 ) = = 0 ) {
m_mapFlags | = MapFlags : : KnifeArena ;
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
// reset some timers
2021-09-15 13:02:22 +03:00
m_oneSecondFrame = 0.0f ;
m_halfSecondFrame = 0.0f ;
2016-03-01 13:37:10 +03:00
}
2019-07-27 17:36:24 +03:00
void Game : : drawLine ( edict_t * ent , const Vector & start , const Vector & end , int width , int noise , const Color & color , int brightness , int speed , int life , DrawLine type ) {
2016-03-01 13:37:10 +03:00
// this function draws a arrow visible from the client side of the player whose player entity
// is pointed to by ent, from the vector location start to the vector location end,
// which is supposed to last life tenths seconds, and having the color defined by RGB.
2019-07-01 21:10:00 +03:00
if ( ! util . isPlayer ( ent ) ) {
2016-03-01 13:37:10 +03:00
return ; // reliability check
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-03-01 13:37:10 +03:00
2019-08-18 21:00:00 +03:00
MessageWriter ( MSG_ONE_UNRELIABLE , SVC_TEMPENTITY , nullptr , ent )
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
. writeByte ( TE_BEAMPOINTS )
. writeCoord ( end . x )
. writeCoord ( end . y )
. writeCoord ( end . z )
. writeCoord ( start . x )
. writeCoord ( start . y )
. writeCoord ( start . z )
. writeShort ( m_drawModels [ type ] )
. writeByte ( 0 ) // framestart
. writeByte ( 10 ) // framerate
. writeByte ( life ) // life in 0.1's
. writeByte ( width ) // width
. writeByte ( noise ) // noise
2019-07-27 17:36:24 +03:00
. writeByte ( color . red ) // r, g, b
. writeByte ( color . green ) // r, g, b
. writeByte ( color . blue ) // r, g, b
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
. writeByte ( brightness ) // brightness
. writeByte ( speed ) ; // speed
2016-03-01 13:37:10 +03:00
}
2019-07-01 21:10:00 +03:00
void Game : : testLine ( const Vector & start , const Vector & end , int ignoreFlags , edict_t * ignoreEntity , TraceResult * ptr ) {
2016-03-01 13:37:10 +03:00
// this function traces a line dot by dot, starting from vecStart in the direction of vecEnd,
// ignoring or not monsters (depending on the value of IGNORE_MONSTERS, true or false), and stops
// at the first obstacle encountered, returning the results of the trace in the TraceResult structure
// ptr. Such results are (amongst others) the distance traced, the hit surface, the hit plane
// vector normal, etc. See the TraceResult structure for details. This function allows to specify
// whether the trace starts "inside" an entity's polygonal model, and if so, to specify that entity
// in ignoreEntity in order to ignore it as a possible obstacle.
2020-06-12 18:52:38 +03:00
auto engineFlags = 0 ;
2016-03-01 13:37:10 +03:00
2019-07-27 17:36:24 +03:00
if ( ignoreFlags & TraceIgnore : : Monsters ) {
2016-03-01 13:37:10 +03:00
engineFlags = 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
}
2016-03-01 13:37:10 +03:00
2019-07-27 17:36:24 +03:00
if ( ignoreFlags & TraceIgnore : : Glass ) {
2016-03-01 13:37:10 +03:00
engineFlags | = 0x100 ;
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
engfuncs . pfnTraceLine ( start , end , engineFlags , ignoreEntity , ptr ) ;
2016-03-01 13:37:10 +03:00
}
2021-09-16 16:09:51 +03:00
bool Game : : testLineChannel ( TraceChannel channel , const Vector & start , const Vector & end , int ignoreFlags , edict_t * ignoreEntity , TraceResult & result ) {
2020-06-12 18:52:38 +03:00
// this function traces a line dot by dot, starting from vecStart in the direction of vecEnd,
// ignoring or not monsters (depending on the value of IGNORE_MONSTERS, true or false), and stops
// at the first obstacle encountered, returning the results of the trace in the TraceResult structure
// ptr. Such results are (amongst others) the distance traced, the hit surface, the hit plane
// vector normal, etc. See the TraceResult structure for details. This function allows to specify
// whether the trace starts "inside" an entity's polygonal model, and if so, to specify that entity
// in ignoreEntity in order to ignore it as a possible obstacle.
auto bot = bots [ ignoreEntity ] ;
// check if bot is firing trace line
if ( bot & & bot - > canSkipNextTrace ( channel ) ) {
2021-09-16 16:09:51 +03:00
result = bot - > getLastTraceResult ( channel ) ; // set the result from bot stored one
2020-06-12 18:52:38 +03:00
// current call is skipped
return true ;
}
else {
2021-09-16 16:09:51 +03:00
testLine ( start , end , ignoreFlags , ignoreEntity , & result ) ;
2020-06-12 18:52:38 +03:00
// if we're still reaching here, save the last trace result
if ( bot ) {
2021-09-16 16:09:51 +03:00
bot - > setLastTraceResult ( channel , & result ) ;
2020-06-12 18:52:38 +03:00
}
}
return false ;
}
2019-07-01 21:10:00 +03:00
void Game : : testHull ( const Vector & start , const Vector & end , int ignoreFlags , int hullNumber , edict_t * ignoreEntity , TraceResult * ptr ) {
2016-03-01 13:37:10 +03:00
// this function traces a hull dot by dot, starting from vecStart in the direction of vecEnd,
// ignoring or not monsters (depending on the value of IGNORE_MONSTERS, true or
// false), and stops at the first obstacle encountered, returning the results
// of the trace in the TraceResult structure ptr, just like TraceLine. Hulls that can be traced
// (by parameter hull_type) are point_hull (a line), head_hull (size of a crouching player),
// human_hull (a normal body size) and large_hull (for monsters?). Not all the hulls in the
// game can be traced here, this function is just useful to give a relative idea of spatial
// reachability (i.e. can a hostage pass through that tiny hole ?) Also like TraceLine, this
// function allows to specify whether the trace starts "inside" an entity's polygonal model,
// and if so, to specify that entity in ignoreEntity in order to ignore it as an obstacle.
2019-07-27 17:36:24 +03:00
engfuncs . pfnTraceHull ( start , end , ! ! ( ignoreFlags & TraceIgnore : : Monsters ) , hullNumber , ignoreEntity , ptr ) ;
2016-03-01 13:37:10 +03:00
}
2021-09-11 02:03:49 +03:00
// helper class for reading wave header
class WaveEndianessHelper : public DenyCopying {
private :
# if defined (CR_ARCH_CPU_BIG_ENDIAN)
bool little { false } ;
# else
bool little { true } ;
# endif
public :
uint16_t read16 ( uint16_t value ) {
return little ? value : static_cast < uint16_t > ( ( value > > 8 ) | ( value < < 8 ) ) ;
}
uint32_t read32 ( uint32_t value ) {
return little ? value : ( ( ( value & 0x000000ff ) < < 24 ) | ( ( value & 0x0000ff00 ) < < 8 ) | ( ( value & 0x00ff0000 ) > > 8 ) | ( ( value & 0xff000000 ) > > 24 ) ) ;
}
bool isWave ( char * format ) {
if ( little & & memcmp ( format , " WAVE " , 4 ) = = 0 ) {
return true ;
}
return * reinterpret_cast < uint32_t * > ( format ) = = 0x57415645 ;
}
} ;
2019-07-01 21:10:00 +03:00
float Game : : getWaveLen ( const char * fileName ) {
2022-04-14 11:55:37 +03:00
auto filePath = strings . format ( " %s/%s.wav " , cv_chatter_path . str ( ) , fileName ) ;
2016-03-01 22:52:17 +03:00
2022-04-14 11:55:37 +03:00
MemFile fp ( filePath ) ;
2016-03-01 13:37:10 +03:00
// we're got valid handle?
2019-07-27 17:36:24 +03:00
if ( ! fp ) {
2016-03-01 13:37:10 +03:00
return 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
}
2019-07-27 17:36:24 +03:00
2016-03-01 13:37:10 +03:00
// else fuck with manual search
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
struct WavHeader {
2021-09-11 02:03:49 +03:00
char riff [ 4 ] ;
uint32_t chunkSize ;
char wave [ 4 ] ;
char fmt [ 4 ] ;
uint32_t subchunk1Size ;
uint16_t audioFormat ;
uint16_t numChannels ;
uint32_t sampleRate ;
uint32_t byteRate ;
uint16_t blockAlign ;
uint16_t bitsPerSample ;
2016-03-01 13:37:10 +03:00
char dataChunkId [ 4 ] ;
2021-09-11 02:03:49 +03:00
uint32_t dataChunkLength ;
} header { } ;
2016-03-01 13:37:10 +03:00
2021-09-11 02:03:49 +03:00
WaveEndianessHelper weh ;
2016-03-01 13:37:10 +03:00
2021-09-11 02:03:49 +03:00
if ( fp . read ( & header , sizeof ( WavHeader ) ) = = 0 ) {
2019-07-27 17:36:24 +03:00
logger . error ( " Wave File %s - has wrong or unsupported format " , filePath ) ;
2016-03-01 13:37:10 +03:00
return 0.0f ;
}
2020-06-12 18:52:38 +03:00
fp . close ( ) ;
2016-03-01 13:37:10 +03:00
2021-09-11 02:03:49 +03:00
if ( ! weh . isWave ( header . wave ) ) {
2019-07-27 17:36:24 +03:00
logger . error ( " Wave File %s - has wrong wave chunk id " , filePath ) ;
2016-03-01 13:37:10 +03:00
return 0.0f ;
}
2021-09-11 02:03:49 +03:00
if ( weh . read32 ( header . dataChunkLength ) = = 0 ) {
2019-07-27 17:36:24 +03:00
logger . error ( " Wave File %s - has zero length! " , filePath ) ;
2016-03-01 13:37:10 +03:00
return 0.0f ;
}
2021-09-16 16:09:51 +03:00
auto length = static_cast < float > ( weh . read32 ( header . dataChunkLength ) ) ;
auto bps = static_cast < float > ( weh . read16 ( header . bitsPerSample ) ) / 8 ;
auto channels = static_cast < float > ( weh . read16 ( header . numChannels ) ) ;
auto rate = static_cast < float > ( weh . read32 ( header . sampleRate ) ) ;
return length / bps / channels / rate ;
2016-03-01 13:37:10 +03:00
}
2019-07-27 17:36:24 +03:00
bool Game : : isDedicated ( ) {
2016-03-01 13:37:10 +03:00
// return true if server is dedicated server, false otherwise
2019-07-01 21:10:00 +03:00
static bool dedicated = engfuncs . pfnIsDedicatedServer ( ) > 0 ;
2016-03-12 19:56:09 +03:00
return dedicated ;
2016-03-01 13:37:10 +03:00
}
2020-06-15 11:28:42 +03:00
const char * Game : : getRunningModName ( ) {
2016-03-01 13:37:10 +03:00
// this function returns mod name without path
2019-07-27 17:36:24 +03:00
static String name ;
2016-03-01 13:37:10 +03:00
2019-07-27 17:36:24 +03:00
if ( ! name . empty ( ) ) {
return name . 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
}
2016-03-01 13:37:10 +03:00
2019-07-27 17:36:24 +03:00
char engineModName [ 256 ] ;
engfuncs . pfnGetGameDir ( engineModName ) ;
2016-03-01 13:37:10 +03:00
2019-07-27 17:36:24 +03:00
name = engineModName ;
size_t slash = name . findLastOf ( " \\ / " ) ;
2016-03-08 17:11:40 +03:00
2019-08-18 21:00:00 +03:00
if ( slash ! = String : : InvalidIndex ) {
2019-07-27 17:36:24 +03:00
name = name . substr ( slash + 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
}
2019-07-27 17:36:24 +03:00
name = name . trim ( " \\ / " ) ;
return name . chars ( ) ;
2016-03-01 13:37:10 +03:00
}
2019-07-27 17:36:24 +03:00
const char * Game : : getMapName ( ) {
2016-03-01 13:37:10 +03:00
// this function gets the map name and store it in the map_name global string variable.
2019-09-14 23:13:55 +03:00
return strings . format ( " %s " , globals - > mapname . chars ( ) ) ;
2016-03-01 13:37:10 +03:00
}
2021-09-16 16:09:51 +03:00
Vector Game : : getEntityOrigin ( edict_t * ent ) {
2016-03-01 13:37:10 +03:00
// this expanded function returns the vector origin of a bounded entity, assuming that any
// entity that has a bounding box has its center at the center of the bounding box itself.
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 ( isNullEntity ( ent ) ) {
2019-08-18 21:00:00 +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
}
2016-03-01 13:37:10 +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 ( ent - > v . origin . empty ( ) ) {
2019-08-01 23:02:44 +03:00
return ent - > v . absmin + ( ent - > v . size * 0.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
}
2016-03-01 13:37:10 +03:00
return ent - > v . origin ;
}
2019-08-18 21:00:00 +03:00
void Game : : registerEngineCommand ( const char * command , void func ( ) ) {
2016-03-01 13:37:10 +03:00
// this function tells the engine that a new server command is being declared, in addition
// to the standard ones, whose name is command_name. The engine is thus supposed to be aware
// that for every "command_name" server command it receives, it should call the function
// pointed to by "function" in order to handle it.
2016-09-14 15:40:42 +03:00
// check for hl pre 1.1.0.4, as it's doesn't have pfnAddServerCommand
2019-07-27 17:36:24 +03:00
if ( ! plat . checkPointer ( engfuncs . pfnAddServerCommand ) ) {
2020-09-13 02:21:15 +03:00
logger . fatal ( " %s's minimum HL engine version is 1.1.0.4 and minimum Counter-Strike is Beta 6.5. Please update your engine / game version. " , product . 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
}
2019-07-01 21:10:00 +03:00
engfuncs . pfnAddServerCommand ( const_cast < char * > ( command ) , func ) ;
2016-03-01 13:37:10 +03:00
}
2019-07-01 21:10:00 +03:00
void Game : : playSound ( edict_t * ent , const char * sound ) {
2019-07-27 17:36:24 +03:00
if ( isNullEntity ( ent ) ) {
return ;
}
2019-07-01 21:10:00 +03:00
engfuncs . pfnEmitSound ( ent , CHAN_WEAPON , sound , 1.0f , ATTN_NORM , 0 , 100 ) ;
2016-03-01 13:37:10 +03:00
}
2020-11-03 08:57:12 +03:00
void Game : : setPlayerStartDrawModels ( ) {
HashMap < String , String > models ;
models [ " info_player_start " ] = " models/player/urban/urban.mdl " ;
models [ " info_player_deathmatch " ] = " models/player/terror/terror.mdl " ;
models [ " info_vip_start " ] = " models/player/vip/vip.mdl " ;
models . foreach ( [ & ] ( const String & key , const String & val ) {
game . searchEntities ( " classname " , key , [ & ] ( edict_t * ent ) {
m_engineWrap . setModel ( ent , val . chars ( ) ) ;
return EntitySearchResult : : Continue ;
} ) ;
} ) ;
}
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
bool Game : : checkVisibility ( edict_t * ent , uint8_t * set ) {
2019-08-04 18:22:01 +03:00
if ( ! set ) {
return true ;
}
if ( ent - > headnode < 0 ) {
for ( int i = 0 ; i < ent - > num_leafs ; + + i ) {
auto leaf = ent - > leafnums [ i ] ;
if ( set [ leaf > > 3 ] & cr : : bit ( leaf & 7 ) ) {
return true ;
}
}
return false ;
}
for ( int i = 0 ; i < 48 ; + + i ) {
auto leaf = ent - > leafnums [ i ] ;
if ( leaf = = - 1 ) {
break ;
}
if ( set [ leaf > > 3 ] & cr : : bit ( leaf & 7 ) ) {
return true ;
}
}
return engfuncs . pfnCheckVisibility ( ent , set ) > 0 ;
}
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
uint8_t * Game : : getVisibilitySet ( Bot * bot , bool pvs ) {
2019-08-04 18:22:01 +03:00
if ( is ( GameFlags : : Xash3D ) ) {
return nullptr ;
}
auto eyes = bot - > getEyesPos ( ) ;
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 ( bot - > isDucking ( ) ) {
2019-08-04 18:22:01 +03:00
eyes + = VEC_HULL_MIN - VEC_DUCK_HULL_MIN ;
}
float org [ 3 ] { eyes . x , eyes . y , eyes . z } ;
return pvs ? engfuncs . pfnSetFatPVS ( org ) : engfuncs . pfnSetFatPAS ( org ) ;
}
2020-10-12 20:59:48 +03:00
void Game : : sendClientMessage ( bool console , edict_t * ent , StringRef message ) {
2019-07-27 17:36:24 +03:00
// helper to sending the client message
2020-10-12 20:59:48 +03:00
// do not send messages to fakeclients
if ( ! util . isPlayer ( ent ) | | util . isFakeClient ( ent ) ) {
return ;
}
2020-10-13 15:43:25 +03:00
const String & buffer = message ;
2020-10-12 20:59:48 +03:00
// used to split messages
auto sendTextMsg = [ & console , & ent ] ( StringRef text ) {
2022-01-16 01:14:11 +03:00
MessageWriter ( MSG_ONE_UNRELIABLE , msgs . id ( NetMsg : : TextMsg ) , nullptr , ent )
2020-10-12 20:59:48 +03:00
. writeByte ( console ? HUD_PRINTCONSOLE : HUD_PRINTCENTER )
. writeString ( text . chars ( ) ) ;
} ;
2023-03-13 15:39:15 +03:00
2020-10-12 20:59:48 +03:00
// do not excess limit
2020-10-14 20:08:06 +03:00
constexpr size_t maxSendLength = 125 ;
2020-10-12 20:59:48 +03:00
// split up the string into chunks if needed (maybe check if it's multibyte?)
2020-10-13 15:43:25 +03:00
if ( buffer . length ( ) > maxSendLength ) {
auto chunks = buffer . split ( maxSendLength ) ;
2023-03-13 15:39:15 +03:00
2020-10-12 20:59:48 +03:00
// send in chunks
for ( size_t i = 0 ; i < chunks . length ( ) ; + + i ) {
sendTextMsg ( chunks [ i ] ) ;
}
return ;
}
2020-10-13 15:43:25 +03:00
sendTextMsg ( buffer ) ;
2020-10-12 20:59:48 +03:00
}
void Game : : sendServerMessage ( StringRef message ) {
// helper to sending the client message
// do not excess limit
2020-10-14 20:08:06 +03:00
constexpr size_t maxSendLength = 175 ;
2020-10-12 20:59:48 +03:00
// split up the string into chunks if needed (maybe check if it's multibyte?)
if ( message . length ( ) > maxSendLength ) {
auto chunks = message . split ( maxSendLength ) ;
// send in chunks
for ( size_t i = 0 ; i < chunks . length ( ) ; + + i ) {
engfuncs . pfnServerPrint ( chunks [ i ] . chars ( ) ) ;
}
return ;
}
engfuncs . pfnServerPrint ( message . chars ( ) ) ;
2019-07-27 17:36:24 +03:00
}
void Game : : prepareBotArgs ( edict_t * ent , String str ) {
2016-03-01 22:52:17 +03:00
// the purpose of this function is to provide fakeclients (bots) with the same client
// command-scripting advantages (putting multiple commands in one line between semicolons)
// as real players. It is an improved version of botman's FakeClientCommand, in which you
// supply directly the whole string as if you were typing it in the bot's "console". It
// is supposed to work exactly like the pfnClientCommand (server-sided client command).
2020-07-08 13:03:27 +03:00
m_botArgs . clear ( ) ; // always clear args
2019-07-01 21:10:00 +03:00
if ( str . empty ( ) ) {
2016-03-01 22:52:17 +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-03-01 22:52:17 +03:00
2019-07-01 21:10:00 +03:00
// helper to parse single (not multi) command
2023-03-13 15:39:15 +03:00
auto parsePartArgs = [ & ] ( String & args ) {
2019-07-01 21:10:00 +03:00
args . trim ( " \r \n \t \" " ) ; // trim new lines
2016-03-01 22:52:17 +03:00
2019-07-01 21:10:00 +03:00
// we're have empty commands?
if ( args . empty ( ) ) {
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-03-01 22:52:17 +03:00
2019-07-01 21:10:00 +03:00
// find first space
const size_t space = args . find ( ' ' , 0 ) ;
2016-03-01 22:52:17 +03:00
2019-07-01 21:10:00 +03:00
// if found space
2019-08-18 21:00:00 +03:00
if ( space ! = String : : InvalidIndex ) {
2019-07-01 21:10:00 +03:00
const auto quote = space + 1 ; // check for quote next to space
2016-03-01 22:52:17 +03:00
2019-07-01 21:10:00 +03:00
// check if we're got a quoted string
if ( quote < args . length ( ) & & args [ quote ] = = ' \" ' ) {
2020-09-26 18:41:53 +03:00
m_botArgs . emplace ( args . substr ( 0 , space ) ) ; // add command
m_botArgs . emplace ( args . substr ( quote , args . length ( ) - 1 ) . trim ( " \" " ) ) ; // add string with trimmed quotes
2016-03-01 22:52:17 +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-12-01 23:42:31 +03:00
for ( auto & & arg : args . split ( " " ) ) {
2020-09-26 18:41:53 +03:00
m_botArgs . emplace ( arg ) ;
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
}
else {
2020-09-26 18:41:53 +03:00
m_botArgs . emplace ( args ) ; // move all the part to args
2016-03-01 22:52:17 +03:00
}
MDLL_ClientCommand ( ent ) ;
2019-12-01 23:42:31 +03:00
// clear space for next cmd
m_botArgs . clear ( ) ;
2019-07-01 21:10:00 +03:00
} ;
2019-08-18 21:00:00 +03:00
if ( str . find ( ' ; ' , 0 ) ! = String : : InvalidIndex ) {
2019-12-01 23:42:31 +03:00
for ( auto & & part : str . split ( " ; " ) ) {
2019-07-01 21:10:00 +03:00
parsePartArgs ( part ) ;
}
}
else {
parsePartArgs ( str ) ;
2016-03-01 22:52:17 +03:00
}
}
2019-07-27 17:36:24 +03:00
bool Game : : isSoftwareRenderer ( ) {
2019-05-14 11:38:45 +03:00
// xash always use "hw" structures
2019-07-27 17:36:24 +03:00
if ( is ( GameFlags : : Xash3D ) ) {
2019-05-14 11:38:45 +03:00
return false ;
}
// dedicated server (except xash) always use "sw" structures
if ( isDedicated ( ) ) {
return true ;
}
2019-09-21 23:20:33 +03:00
auto model = illum . getWorldModel ( ) ;
if ( model - > nodes [ 0 ] . parent ! = nullptr ) {
return false ;
}
const auto child = model - > nodes [ 0 ] . children [ 0 ] ;
if ( child < model - > nodes | | child > model - > nodes + model - > numnodes ) {
return false ;
}
if ( child - > parent ! = & model - > nodes [ 0 ] ) {
return false ;
}
2019-05-14 11:38:45 +03:00
2019-07-01 21:10:00 +03:00
// and on only windows version you can use software-render game. Linux, OSX always defaults to OpenGL
2020-11-23 10:48:44 +03:00
if ( plat . win ) {
2019-07-27 17:36:24 +03:00
return plat . hasModule ( " sw " ) ;
}
2019-08-01 23:02:44 +03:00
return false ;
2016-03-01 13:37:10 +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
void Game : : addNewCvar ( const char * name , const char * value , const char * info , bool bounded , float min , float max , int32_t varType , bool missingAction , const char * regval , ConVar * self ) {
2016-03-01 22:52:17 +03:00
// this function adds globally defined variable to registration stack
2020-06-12 18:52:38 +03:00
ConVarReg reg { } ;
2016-03-01 13:37:10 +03:00
2020-06-12 18:52:38 +03:00
reg . reg . name = const_cast < char * > ( name ) ;
reg . reg . string = const_cast < char * > ( value ) ;
reg . missing = missingAction ;
reg . init = value ;
reg . info = info ;
reg . bounded = bounded ;
if ( regval ) {
reg . regval = regval ;
}
2019-08-24 12:43:42 +03:00
if ( bounded ) {
2020-06-12 18:52:38 +03:00
reg . min = min ;
reg . max = max ;
reg . initial = static_cast < float > ( atof ( value ) ) ;
2019-08-24 12:43:42 +03:00
}
2016-03-01 22:52:17 +03:00
2019-08-24 12:43:42 +03:00
auto eflags = FCVAR_EXTDLL ;
2016-03-01 22:52:17 +03:00
2019-07-27 17:36:24 +03:00
if ( varType = = Var : : Normal ) {
2019-08-24 12:43:42 +03:00
eflags | = FCVAR_SERVER ;
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
else if ( varType = = Var : : ReadOnly ) {
2019-08-24 12:43:42 +03:00
eflags | = FCVAR_SERVER | FCVAR_SPONLY | FCVAR_PRINTABLEONLY ;
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
else if ( varType = = Var : : Password ) {
2019-08-24 12:43:42 +03:00
eflags | = FCVAR_PROTECTED ;
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-03-01 22:52:17 +03:00
2020-06-12 18:52:38 +03:00
reg . reg . flags = eflags ;
reg . self = self ;
reg . type = varType ;
2016-03-01 22:52:17 +03:00
2020-06-12 18:52:38 +03:00
m_cvars . push ( cr : : move ( reg ) ) ;
2016-03-01 22:52:17 +03:00
}
2019-08-24 12:43:42 +03:00
void Game : : checkCvarsBounds ( ) {
for ( const auto & var : m_cvars ) {
2020-06-12 18:52:38 +03:00
// read only cvar is not changeable
if ( var . type = = Var : : ReadOnly & & ! var . init . empty ( ) ) {
if ( var . init ! = var . self - > str ( ) ) {
var . self - > set ( var . init . chars ( ) ) ;
}
continue ;
}
2019-08-24 12:43:42 +03:00
if ( ! var . bounded | | ! var . self ) {
continue ;
}
auto value = var . self - > float_ ( ) ;
auto str = var . self - > str ( ) ;
// check the bounds and set default if out of bounds
if ( value > var . max | | value < var . min | | ( ! strings . isEmpty ( str ) & & isalpha ( * str ) ) ) {
var . self - > set ( var . initial ) ;
// notify about that
ctrl . msg ( " Bogus value for cvar '%s', min is '%.1f' and max is '%.1f', and we're got '%s', value reverted to default '%.1f'. " , var . reg . name , var . min , var . max , str , var . initial ) ;
}
}
2021-09-30 16:37:40 +03:00
// special case for xash3d, by default engine is not calling startframe if no players on server, but our quota management and bot adding
// mechanism assumes that starframe is called even if no players on server, so, set the xash3d's sv_forcesimulating cvar to 1 in case it's not
if ( is ( GameFlags : : Xash3D ) ) {
static cvar_t * sv_forcesimulating = engfuncs . pfnCVarGetPointer ( " sv_forcesimulating " ) ;
2023-04-02 12:17:12 +03:00
if ( sv_forcesimulating & & ! cr : : fequal ( sv_forcesimulating - > value , 1.0f ) ) {
2021-09-30 16:37:40 +03:00
game . print ( " Force-enable Xash3D sv_forcesimulating cvar. " ) ;
engfuncs . pfnCVarSetFloat ( " sv_forcesimulating " , 1.0f ) ;
}
}
2019-08-24 12:43:42 +03:00
}
2019-07-27 17:36:24 +03:00
void Game : : registerCvars ( bool gameVars ) {
2016-03-01 22:52:17 +03:00
// this function pushes all added global variables to engine registration
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
for ( auto & var : m_cvars ) {
ConVar & self = * var . self ;
cvar_t & reg = var . reg ;
2016-03-01 22:52:17 +03:00
2020-06-12 18:52:38 +03:00
if ( var . type ! = Var : : GameRef ) {
2019-08-24 12:43:42 +03:00
self . ptr = engfuncs . pfnCVarGetPointer ( reg . name ) ;
2016-03-01 22:52:17 +03:00
2019-08-24 12:43:42 +03:00
if ( ! self . ptr ) {
2019-07-27 17:36:24 +03:00
static cvar_t reg_ ;
// fix metamod' memlocs not found
if ( is ( GameFlags : : Metamod ) ) {
reg_ = var . reg ;
engfuncs . pfnCVarRegister ( & reg_ ) ;
}
else {
engfuncs . pfnCVarRegister ( & var . reg ) ;
}
2019-08-24 12:43:42 +03:00
self . ptr = engfuncs . pfnCVarGetPointer ( reg . name ) ;
2016-03-01 22:52:17 +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 if ( gameVars ) {
2019-08-24 12:43:42 +03:00
self . ptr = engfuncs . pfnCVarGetPointer ( reg . name ) ;
2016-03-01 22:52:17 +03:00
2019-08-24 12:43:42 +03:00
if ( var . missing & & ! self . ptr ) {
2020-06-12 18:52:38 +03:00
if ( reg . string = = nullptr & & ! var . regval . empty ( ) ) {
reg . string = const_cast < char * > ( var . regval . 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
reg . flags | = FCVAR_SERVER ;
2016-09-14 15:40:42 +03:00
}
2019-07-01 21:10:00 +03:00
engfuncs . pfnCVarRegister ( & var . reg ) ;
2019-08-24 12:43:42 +03:00
self . ptr = engfuncs . pfnCVarGetPointer ( reg . 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
}
2019-08-24 12:43:42 +03:00
if ( ! self . ptr ) {
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
print ( " Got nullptr on cvar %s! " , reg . name ) ;
2016-03-08 17:22:44 +03:00
}
2016-03-01 22:52:17 +03:00
}
}
}
2019-07-27 17:36:24 +03:00
bool Game : : loadCSBinary ( ) {
2020-06-15 11:28:42 +03:00
auto modname = getRunningModName ( ) ;
2019-07-01 21:10:00 +03:00
if ( ! modname ) {
return false ;
}
2019-07-27 17:36:24 +03:00
StringArray libs ;
2019-07-01 21:10:00 +03:00
2020-11-23 10:48:44 +03:00
if ( plat . win ) {
2019-07-27 17:36:24 +03:00
libs . push ( " mp.dll " ) ;
libs . push ( " cs.dll " ) ;
}
2020-11-23 10:48:44 +03:00
else if ( plat . nix ) {
2019-07-27 17:36:24 +03:00
libs . push ( " cs.so " ) ;
libs . push ( " cs_i386.so " ) ;
}
2019-09-14 23:13:55 +03:00
else if ( plat . osx ) {
2019-07-27 17:36:24 +03:00
libs . push ( " cs.dylib " ) ;
}
2019-07-01 21:10:00 +03:00
2020-06-12 18:52:38 +03:00
auto libCheck = [ & ] ( StringRef mod , StringRef dll ) {
2019-07-01 21:10:00 +03:00
// try to load gamedll
2019-07-27 17:36:24 +03:00
if ( ! m_gameLib ) {
2020-06-12 18:52:38 +03:00
logger . fatal ( " Unable to load gamedll \" %s \" . Exiting... (gamedir: %s) " , dll , mod ) ;
2019-07-01 21:10:00 +03:00
}
auto ent = m_gameLib . resolve < EntityFunction > ( " trigger_random_unique " ) ;
// detect regamedll by addon entity they provide
if ( ent ! = nullptr ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = GameFlags : : ReGameDLL ;
2019-07-01 21:10:00 +03:00
}
return true ;
} ;
2023-03-13 15:39:15 +03:00
2019-07-01 21:10:00 +03:00
// search the libraries inside game dlls directory
2019-07-27 17:36:24 +03:00
for ( const auto & lib : libs ) {
2020-06-12 18:52:38 +03:00
auto path = strings . format ( " %s/dlls/%s " , modname , lib ) ;
2019-07-01 21:10:00 +03:00
// if we can't read file, skip it
if ( ! File : : exists ( path ) ) {
continue ;
}
2023-03-13 15:39:15 +03:00
2019-07-01 21:10:00 +03:00
// special case, czero is always detected first, as it's has custom directory
if ( strcmp ( modname , " czero " ) = = 0 ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = ( GameFlags : : ConditionZero | GameFlags : : HasBotVoice | GameFlags : : HasFakePings ) ;
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
if ( is ( GameFlags : : Metamod ) ) {
2019-07-01 21:10:00 +03:00
return false ;
}
m_gameLib . load ( path ) ;
// verify dll is OK
2019-07-27 17:36:24 +03:00
return libCheck ( modname , lib ) ;
2019-07-01 21:10:00 +03:00
}
else {
m_gameLib . load ( path ) ;
// verify dll is OK
if ( ! libCheck ( modname , lib ) ) {
return false ;
}
// detect if we're running modern game
auto entity = m_gameLib . resolve < EntityFunction > ( " weapon_famas " ) ;
// detect xash engine
2023-04-02 12:17:12 +03:00
if ( engfuncs . pfnCVarGetPointer ( " host_ver " ) ! = nullptr ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = ( GameFlags : : Legacy | GameFlags : : Xash3D ) ;
2019-07-01 21:10:00 +03:00
if ( entity ! = nullptr ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = GameFlags : : HasBotVoice ;
2019-07-01 21:10:00 +03:00
}
2019-07-27 17:36:24 +03:00
if ( is ( GameFlags : : Metamod ) ) {
2019-07-01 21:10:00 +03:00
return false ;
}
return true ;
}
2023-03-13 15:39:15 +03:00
2019-07-01 21:10:00 +03:00
if ( entity ! = nullptr ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = ( GameFlags : : Modern | GameFlags : : HasBotVoice | GameFlags : : HasFakePings ) ;
2019-07-01 21:10:00 +03:00
}
else {
2019-07-27 17:36:24 +03:00
m_gameFlags | = GameFlags : : Legacy ;
2019-07-01 21:10:00 +03:00
}
2019-07-27 17:36:24 +03:00
if ( is ( GameFlags : : Metamod ) ) {
2019-07-01 21:10:00 +03:00
return false ;
}
return true ;
}
}
return false ;
}
2019-07-27 17:36:24 +03:00
bool Game : : postload ( ) {
2019-07-01 21:10:00 +03:00
2020-06-12 18:52:38 +03:00
// register logger
logger . initialize ( strings . format ( " %slogs/%s.log " , graph . getDataDirectory ( false ) , product . folder ) , [ ] ( const char * msg ) {
game . print ( msg ) ;
} ) ;
2019-08-18 21:00:00 +03:00
// ensure we're have all needed directories
2020-10-05 18:59:40 +03:00
for ( const auto & dir : StringArray { " conf/lang " , " data/train " , " data/graph " , " data/logs " , " data/pwf " } ) {
2020-06-15 11:28:42 +03:00
File : : createPath ( strings . format ( " %s/addons/%s/%s " , getRunningModName ( ) , product . folder , dir ) ) ;
2019-08-18 21:00:00 +03:00
}
2019-07-27 17:36:24 +03:00
// set out user agent for http stuff
2020-06-12 18:52:38 +03:00
http . setUserAgent ( strings . format ( " %s/%s " , product . name , product . version ) ) ;
2019-07-01 21:10:00 +03:00
2020-12-18 20:06:05 +03:00
// startup the sockets on windows
http . startup ( ) ;
2020-10-04 00:54:34 +03:00
// set the app name
plat . setAppName ( product . name . chars ( ) ) ;
2019-08-18 21:00:00 +03:00
// register bot cvars
game . registerCvars ( ) ;
2020-06-12 18:52:38 +03:00
// handle prefixes
2020-09-10 13:54:00 +03:00
static StringArray prefixes = { product . cmdPri , product . cmdSec } ;
2019-08-18 21:00:00 +03:00
2020-06-12 18:52:38 +03:00
// register all our handlers
for ( const auto & prefix : prefixes ) {
registerEngineCommand ( prefix . chars ( ) , [ ] ( ) {
ctrl . handleEngineCommands ( ) ;
2019-08-18 21:00:00 +03:00
} ) ;
2020-06-12 18:52:38 +03:00
}
2019-08-18 21:00:00 +03:00
// register fake metamod command handler if we not! under mm
if ( ! ( game . is ( GameFlags : : Metamod ) ) ) {
game . registerEngineCommand ( " meta " , [ ] ( ) {
2020-06-12 18:52:38 +03:00
game . print ( " You're launched standalone version of %s. Metamod is not installed or not enabled! " , product . name ) ;
2019-08-18 21:00:00 +03:00
} ) ;
}
// initialize weapons
conf . initWeapons ( ) ;
2019-09-14 23:13:55 +03:00
if ( plat . android ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = ( GameFlags : : Xash3D | GameFlags : : Mobility | GameFlags : : HasBotVoice | GameFlags : : ReGameDLL ) ;
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
if ( is ( GameFlags : : Metamod ) ) {
return true ; // we should stop the attempt for loading the real gamedll, since metamod handle this for us
}
2019-09-21 23:20:33 +03:00
auto gamedll = strings . format ( " %s/%s " , plat . env ( " XASH3D_GAMELIBDIR " ) , plat . hfp ? " libserver_hardfp.so " : " libserver.so " ) ;
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
if ( ! m_gameLib . load ( gamedll ) ) {
2020-06-15 11:28:42 +03:00
logger . fatal ( " Unable to load gamedll \" %s \" . Exiting... (gamedir: %s) " , gamedll , getRunningModName ( ) ) ;
2019-07-27 17:36:24 +03:00
}
2019-07-01 21:10:00 +03:00
}
2019-07-27 17:36:24 +03:00
else {
bool binaryLoaded = loadCSBinary ( ) ;
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
if ( ! binaryLoaded & & ! is ( GameFlags : : Metamod ) ) {
2020-06-15 11:28:42 +03:00
logger . fatal ( " Mod that you has started, not supported by this bot (gamedir: %s) " , getRunningModName ( ) ) ;
2019-07-27 17:36:24 +03:00
}
2019-07-01 21:10:00 +03:00
2019-07-27 17:36:24 +03:00
if ( is ( GameFlags : : Metamod ) ) {
m_gameLib . unload ( ) ;
return true ;
}
2019-07-01 21:10:00 +03:00
}
return false ;
}
2019-08-29 16:24:24 +03:00
void Game : : applyGameModes ( ) {
2019-07-27 17:36:24 +03:00
if ( ! is ( GameFlags : : Metamod | GameFlags : : ReGameDLL ) ) {
2019-07-01 21:10:00 +03:00
return ;
}
2019-08-29 16:24:24 +03:00
// handle cvar cases
2020-06-12 18:52:38 +03:00
switch ( cv_csdm_mode . int_ ( ) ) {
2019-08-29 16:24:24 +03:00
default :
case 0 :
break ;
2023-03-13 15:39:15 +03:00
// force CSDM mode
2019-08-29 16:24:24 +03:00
case 1 :
m_gameFlags | = GameFlags : : CSDM ;
m_gameFlags & = ~ GameFlags : : FreeForAll ;
return ;
2023-03-13 15:39:15 +03:00
// force CSDM FFA mode
2019-08-29 16:24:24 +03:00
case 2 :
m_gameFlags | = GameFlags : : CSDM | GameFlags : : FreeForAll ;
return ;
2023-03-13 15:39:15 +03:00
// force disable everything
2019-08-29 16:24:24 +03:00
case 3 :
m_gameFlags & = ~ ( GameFlags : : CSDM | GameFlags : : FreeForAll ) ;
return ;
}
2019-07-01 21:10:00 +03:00
static auto dmActive = engfuncs . pfnCVarGetPointer ( " csdm_active " ) ;
static auto freeForAll = engfuncs . pfnCVarGetPointer ( " mp_freeforall " ) ;
// csdm is only with amxx and metamod
if ( dmActive ) {
if ( dmActive - > value > 0.0f ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = GameFlags : : CSDM ;
2019-07-01 21:10:00 +03:00
}
2019-07-27 17:36:24 +03:00
else if ( is ( GameFlags : : CSDM ) ) {
m_gameFlags & = ~ GameFlags : : CSDM ;
2019-07-01 21:10:00 +03:00
}
}
// but this can be provided by regamedll
if ( freeForAll ) {
if ( freeForAll - > value > 0.0f ) {
2019-07-27 17:36:24 +03:00
m_gameFlags | = GameFlags : : FreeForAll ;
2019-07-01 21:10:00 +03:00
}
2019-07-27 17:36:24 +03:00
else if ( is ( GameFlags : : FreeForAll ) ) {
m_gameFlags & = ~ GameFlags : : FreeForAll ;
2019-07-01 21:10:00 +03:00
}
}
}
2019-07-27 17:36:24 +03:00
void Game : : slowFrame ( ) {
2021-09-15 13:02:22 +03:00
const auto nextUpdate = cr : : clamp ( 75.0f * globals - > frametime , 0.5f , 1.0f ) ;
// run something that is should run more
if ( m_halfSecondFrame < time ( ) ) {
// refresh bomb origin in case some plugin moved it out
graph . setBombOrigin ( ) ;
// update next update time
m_halfSecondFrame = nextUpdate * 0.25f + time ( ) ;
}
if ( m_oneSecondFrame > time ( ) ) {
2019-07-01 21:10:00 +03:00
return ;
}
ctrl . maintainAdminRights ( ) ;
2019-07-27 17:36:24 +03:00
// update bot difficulties to newly selected from cvar
bots . updateBotDifficulties ( ) ;
2020-02-08 00:03:52 +03:00
// check if we're need to autokill bots
bots . maintainAutoKill ( ) ;
2023-03-13 15:39:15 +03:00
// update client pings
2021-09-15 13:02:22 +03:00
util . calculatePings ( ) ;
2020-06-12 18:52:38 +03:00
// maintain leaders selection upon round start
bots . maintainLeaders ( ) ;
2019-08-04 18:22:01 +03:00
// initialize light levels
graph . initLightLevels ( ) ;
2020-01-08 18:29:28 +03:00
// initialize corridors
graph . initNarrowPlaces ( ) ;
2019-07-01 21:10:00 +03:00
// detect csdm
2019-08-29 16:24:24 +03:00
applyGameModes ( ) ;
2019-07-01 21:10:00 +03:00
2019-08-24 12:43:42 +03:00
// check the cvar bounds
checkCvarsBounds ( ) ;
2019-07-01 21:10:00 +03:00
// display welcome message
util . checkWelcome ( ) ;
2021-09-15 13:02:22 +03:00
// update next update time
m_oneSecondFrame = nextUpdate + time ( ) ;
2019-08-18 21:00:00 +03:00
}
2020-06-12 18:52:38 +03:00
void Game : : searchEntities ( StringRef field , StringRef value , EntitySearch functor ) {
2019-08-18 21:00:00 +03:00
edict_t * ent = nullptr ;
while ( ! game . isNullEntity ( ent = engfuncs . pfnFindEntityByString ( ent , field . chars ( ) , value . chars ( ) ) ) ) {
if ( ( ent - > v . flags & EF_NODRAW ) | | ( ent - > v . flags & FL_CLIENT ) ) {
continue ;
}
if ( functor ( ent ) = = EntitySearchResult : : Break ) {
break ;
}
}
}
2020-06-12 18:52:38 +03:00
void Game : : searchEntities ( const Vector & position , float radius , EntitySearch functor ) {
2019-08-18 21:00:00 +03:00
edict_t * ent = nullptr ;
const Vector & pos = position . empty ( ) ? m_startEntity - > v . origin : position ;
while ( ! game . isNullEntity ( ent = engfuncs . pfnFindEntityInSphere ( ent , pos , radius ) ) ) {
if ( ( ent - > v . flags & EF_NODRAW ) | | ( ent - > v . flags & FL_CLIENT ) ) {
continue ;
}
if ( functor ( ent ) = = EntitySearchResult : : Break ) {
break ;
}
}
2019-07-01 21:10:00 +03:00
}
2019-08-24 12:43:42 +03:00
bool Game : : isShootableBreakable ( edict_t * ent ) {
if ( isNullEntity ( ent ) ) {
return false ;
}
2023-03-13 16:08:29 +03:00
auto limit = cv_breakable_health_limit . float_ ( ) ;
2019-08-24 12:43:42 +03:00
2023-03-13 16:08:29 +03:00
if ( ( strcmp ( ent - > v . classname . chars ( ) , " func_breakable " ) = = 0 & & ent - > v . health < limit ) | | ( strcmp ( ent - > v . classname . chars ( ) , " func_pushable " ) = = 0 & & ( ent - > v . spawnflags & SF_PUSH_BREAKABLE ) & & ent - > v . health < limit ) | | ( strcmp ( ent - > v . classname . chars ( ) , " func_wall " ) = = 0 & & ent - > v . health < limit ) ) {
2023-04-02 12:17:12 +03:00
if ( ent - > v . takedamage > 0.0f & & ent - > v . impulse < = 0 & & ! ( ent - > v . flags & FL_WORLDBRUSH ) & & ! ( ent - > v . spawnflags & SF_BREAK_TRIGGER_ONLY ) ) {
2022-12-10 21:43:19 +03:00
return ( ent - > v . movetype = = MOVETYPE_PUSH | | ent - > v . movetype = = MOVETYPE_PUSHSTEP ) ;
}
2019-08-24 12:43:42 +03:00
}
return false ;
}
2020-11-13 19:16:56 +03:00
void Game : : printBotVersion ( ) {
String gameVersionStr ;
StringArray gameVersionFlags ;
if ( is ( GameFlags : : Legacy ) ) {
gameVersionStr . assign ( " Legacy " ) ;
}
else if ( is ( GameFlags : : ConditionZero ) ) {
gameVersionStr . assign ( " Condition Zero " ) ;
}
else if ( is ( GameFlags : : Modern ) ) {
gameVersionStr . assign ( " v1.6 " ) ;
}
if ( is ( GameFlags : : Xash3D ) ) {
gameVersionStr . append ( " @ Xash3D Engine " ) ;
if ( is ( GameFlags : : Mobility ) ) {
gameVersionStr . append ( " Mobile " ) ;
}
gameVersionStr . replace ( " Legacy " , " 1.6 Limited " ) ;
}
if ( is ( GameFlags : : HasBotVoice ) ) {
gameVersionFlags . push ( " BotVoice " ) ;
}
if ( is ( GameFlags : : ReGameDLL ) ) {
gameVersionFlags . push ( " ReGameDLL " ) ;
}
if ( is ( GameFlags : : HasFakePings ) ) {
gameVersionFlags . push ( " FakePing " ) ;
}
if ( is ( GameFlags : : Metamod ) ) {
gameVersionFlags . push ( " Metamod " ) ;
}
ctrl . msg ( " \n %s v%s successfully loaded for game: Counter-Strike %s. \n \t Flags: %s. \n " , product . name , product . version , gameVersionStr , gameVersionFlags . empty ( ) ? " None " : String : : join ( gameVersionFlags , " , " ) ) ;
}
2019-07-27 17:36:24 +03:00
void LightMeasure : : initializeLightstyles ( ) {
2019-05-10 01:33:17 +03:00
// this function initializes lighting information...
// reset all light styles
2019-07-01 21:10:00 +03:00
for ( auto & ls : m_lightstyle ) {
ls . length = 0 ;
ls . map [ 0 ] = 0 ;
2019-05-10 01:33:17 +03:00
}
2019-07-01 21:10:00 +03:00
for ( auto & lsv : m_lightstyleValue ) {
lsv = 264 ;
2019-05-10 01:33:17 +03:00
}
}
2019-07-27 17:36:24 +03:00
void LightMeasure : : animateLight ( ) {
2019-05-10 01:33:17 +03:00
// this function performs light animations
if ( ! m_doAnimation ) {
return ;
}
// 'm' is normal light, 'a' is no light, 'z' is double bright
2019-08-18 21:00:00 +03:00
const int index = static_cast < int > ( game . time ( ) * 10.0f ) ;
2019-05-10 01:33:17 +03:00
2020-06-12 18:52:38 +03:00
for ( auto j = 0 ; j < MAX_LIGHTSTYLES ; + + j ) {
2019-05-10 01:33:17 +03:00
if ( ! m_lightstyle [ j ] . length ) {
m_lightstyleValue [ j ] = 256 ;
continue ;
}
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_lightstyleValue [ j ] = static_cast < uint32_t > ( m_lightstyle [ j ] . map [ index % m_lightstyle [ j ] . length ] - ' a ' ) * 22u ;
2019-05-10 01:33:17 +03:00
}
}
2019-07-01 21:10:00 +03:00
void LightMeasure : : updateLight ( int style , char * value ) {
if ( ! m_doAnimation ) {
return ;
}
if ( style > = MAX_LIGHTSTYLES ) {
return ;
}
2023-03-13 15:39:15 +03:00
if ( strings . isEmpty ( value ) ) {
2019-07-01 21:10:00 +03:00
m_lightstyle [ style ] . length = 0u ;
2020-06-12 18:52:38 +03:00
m_lightstyle [ style ] . map [ 0 ] = kNullChar ;
2019-07-01 21:10:00 +03:00
return ;
}
2020-06-12 18:52:38 +03:00
const auto copyLimit = sizeof ( m_lightstyle [ style ] . map ) - sizeof ( kNullChar ) ;
2019-09-21 23:20:33 +03:00
strings . copy ( m_lightstyle [ style ] . map , value , copyLimit ) ;
2019-07-01 21:10:00 +03:00
2020-06-12 18:52:38 +03:00
m_lightstyle [ style ] . map [ copyLimit ] = kNullChar ;
m_lightstyle [ style ] . length = static_cast < int > ( strlen ( m_lightstyle [ style ] . map ) ) ;
2019-07-01 21:10:00 +03:00
}
2019-05-10 13:51:09 +03:00
template < typename S , typename M > bool LightMeasure : : recursiveLightPoint ( const M * node , const Vector & start , const Vector & end ) {
2019-07-27 17:36:24 +03:00
if ( ! node | | node - > contents < 0 ) {
2019-05-10 01:33:17 +03:00
return false ;
}
// determine which side of the node plane our points are on, fixme: optimize for axial
auto plane = node - > plane ;
float front = ( start | plane - > normal ) - plane - > dist ;
float back = ( end | plane - > normal ) - plane - > dist ;
int side = front < 0.0f ;
// if they're both on the same side of the plane, don't bother to split just check the appropriate child
if ( ( back < 0.0f ) = = side ) {
2019-05-10 13:51:09 +03:00
return recursiveLightPoint < S , M > ( reinterpret_cast < M * > ( node - > children [ side ] ) , start , end ) ;
2019-05-10 01:33:17 +03:00
}
// calculate mid point
float frac = front / ( front - back ) ;
auto mid = start + ( end - start ) * frac ;
// go down front side
2019-05-10 13:51:09 +03:00
if ( recursiveLightPoint < S , M > ( reinterpret_cast < M * > ( node - > children [ side ] ) , start , mid ) ) {
2019-05-10 01:33:17 +03:00
return true ; // hit something
}
// blow it off if it doesn't split the plane...
2019-05-11 23:55:33 +03:00
if ( ( back < 0.0f ) = = ! ! side ) {
2019-05-10 01:33:17 +03:00
return false ; // didn't hit anything
}
// check for impact on this node
// lightspot = mid;
// lightplane = plane;
2019-05-10 13:51:09 +03:00
auto surf = reinterpret_cast < S * > ( m_worldModel - > surfaces ) + node - > firstsurface ;
2019-05-10 01:33:17 +03:00
2019-07-27 17:36:24 +03:00
for ( int i = 0 ; i < node - > numsurfaces ; + + i , + + surf ) {
2019-05-10 01:33:17 +03:00
if ( surf - > flags & SURF_DRAWTILED ) {
continue ; // no lightmaps
}
auto tex = surf - > texinfo ;
// see where in lightmap space our intersection point is
int s = static_cast < int > ( ( mid | Vector ( tex - > vecs [ 0 ] ) ) + tex - > vecs [ 0 ] [ 3 ] ) ;
int t = static_cast < int > ( ( mid | Vector ( tex - > vecs [ 1 ] ) ) + tex - > vecs [ 1 ] [ 3 ] ) ;
// not in the bounds of our lightmap? punt...
if ( s < surf - > texturemins [ 0 ] | | t < surf - > texturemins [ 1 ] ) {
continue ;
}
// assuming a square lightmap (fixme: which ain't always the case), lets see if it lies in that rectangle. if not, punt...
int ds = s - surf - > texturemins [ 0 ] ;
int dt = t - surf - > texturemins [ 1 ] ;
if ( ds > surf - > extents [ 0 ] | | dt > surf - > extents [ 1 ] ) {
continue ;
}
if ( ! surf - > samples ) {
return true ;
}
ds > > = 4 ;
dt > > = 4 ;
m_point . reset ( ) ; // reset point color.
int smax = ( surf - > extents [ 0 ] > > 4 ) + 1 ;
int tmax = ( surf - > extents [ 1 ] > > 4 ) + 1 ;
int size = smax * tmax ;
auto lightmap = surf - > samples + dt * smax + ds ;
// compute the lightmap color at a particular point
for ( int maps = 0u ; maps < MAXLIGHTMAPS & & surf - > styles [ maps ] ! = 255u ; + + maps ) {
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
uint32_t scale = m_lightstyleValue [ surf - > styles [ maps ] ] ;
2019-05-10 01:33:17 +03:00
m_point . red + = lightmap - > r * scale ;
m_point . green + = lightmap - > g * scale ;
m_point . blue + = lightmap - > b * scale ;
lightmap + = size ; // skip to next lightmap
}
m_point . red > > = 8u ;
m_point . green > > = 8u ;
m_point . blue > > = 8u ;
return true ;
}
2019-05-10 13:51:09 +03:00
return recursiveLightPoint < S , M > ( reinterpret_cast < M * > ( node - > children [ ! side ] ) , mid , end ) ; // go down back side
2019-05-10 01:33:17 +03:00
}
float LightMeasure : : getLightLevel ( const Vector & point ) {
2019-07-27 17:36:24 +03:00
if ( game . is ( GameFlags : : Legacy ) & & ! game . is ( GameFlags : : Xash3D ) ) {
return 0.0f ;
}
2019-05-10 01:33:17 +03:00
if ( ! m_worldModel ) {
return 0.0f ;
}
if ( ! m_worldModel - > lightdata ) {
return 255.0f ;
}
Vector endPoint ( point ) ;
endPoint . z - = 2048.0f ;
2019-05-10 13:51:09 +03:00
// it's depends if we're are on dedicated or on listenserver
2019-07-27 17:36:24 +03:00
auto recursiveCheck = [ & ] ( ) - > bool {
2019-07-01 21:10:00 +03:00
if ( ! game . isSoftwareRenderer ( ) ) {
2019-05-10 13:51:09 +03:00
return recursiveLightPoint < msurface_hw_t , mnode_hw_t > ( reinterpret_cast < mnode_hw_t * > ( m_worldModel - > nodes ) , point , endPoint ) ;
}
return recursiveLightPoint < msurface_t , mnode_t > ( m_worldModel - > nodes , point , endPoint ) ;
} ;
return ! recursiveCheck ( ) ? 0.0f : 100 * cr : : sqrtf ( cr : : min ( 75.0f , static_cast < float > ( m_point . avg ( ) ) ) / 75.0f ) ;
}
2019-07-27 17:36:24 +03:00
float LightMeasure : : getSkyColor ( ) {
return static_cast < float > ( Color ( sv_skycolor_r . int_ ( ) , sv_skycolor_g . int_ ( ) , sv_skycolor_b . int_ ( ) ) . avg ( ) ) ;
2019-05-10 13:51:09 +03:00
}