2014-07-30 14:17:46 +04:00
|
|
|
//
|
2023-05-24 23:41:23 +03:00
|
|
|
// YaPB, based on PODBot by Markus Klinge ("CountFloyd").
|
|
|
|
|
// Copyright © YaPB Project Developers <yapb@jeefo.net>.
|
2014-07-30 14:17:46 +04:00
|
|
|
//
|
2020-11-03 08:57:12 +03:00
|
|
|
// SPDX-License-Identifier: MIT
|
2014-07-30 14:17:46 +04:00
|
|
|
//
|
|
|
|
|
|
2014-09-09 18:29:42 +04:00
|
|
|
#pragma once
|
2019-07-31 14:17:05 +03:00
|
|
|
|
2021-09-12 13:04:05 +03:00
|
|
|
#include <crlib/crlib.h>
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2023-05-12 20:00:06 +03:00
|
|
|
#include <linkage/goldsrc.h>
|
|
|
|
|
#include <linkage/metamod.h>
|
|
|
|
|
#include <linkage/physint.h>
|
|
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
// use all the cr-library
|
|
|
|
|
using namespace cr;
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2020-06-12 18:52:38 +03:00
|
|
|
#include <product.h>
|
2020-11-05 15:17:06 +03:00
|
|
|
#include <module.h>
|
2023-06-20 15:18:35 +03:00
|
|
|
#include <constant.h>
|
2024-01-19 00:03:45 +03:00
|
|
|
#include <chatlib.h>
|
2014-07-30 14:17:46 +04:00
|
|
|
|
|
|
|
|
// tasks definition
|
2019-07-27 17:36:24 +03:00
|
|
|
struct BotTask {
|
2019-09-21 23:20:33 +03:00
|
|
|
using Function = void (Bot::*) ();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Function func; // corresponding exec function in bot class
|
2019-07-27 17:36:24 +03:00
|
|
|
Task id; // major task/action carried out
|
2014-07-30 14:17:46 +04:00
|
|
|
float desire; // desire (filled in) for this task
|
2019-07-27 17:36:24 +03:00
|
|
|
int data; // additional data (node index)
|
2014-07-30 14:17:46 +04:00
|
|
|
float time; // time task expires
|
|
|
|
|
bool resume; // if task can be continued if interrupted
|
2019-07-27 17:36:24 +03:00
|
|
|
|
|
|
|
|
public:
|
2019-09-21 23:20:33 +03:00
|
|
|
BotTask (Function func, Task id, float desire, int data, float time, bool resume) : func (func), id (id), desire (desire), data (data), time (time), resume (resume) { }
|
2014-07-30 14:17:46 +04:00
|
|
|
};
|
|
|
|
|
|
2019-07-01 21:10:00 +03:00
|
|
|
// weapon properties structure
|
|
|
|
|
struct WeaponProp {
|
2019-08-12 14:16:28 +03:00
|
|
|
String classname;
|
2019-07-01 21:10:00 +03:00
|
|
|
int ammo1; // ammo index for primary ammo
|
|
|
|
|
int ammo1Max; // max primary ammo
|
|
|
|
|
int slot; // HUD slot (0 based)
|
|
|
|
|
int pos; // slot position
|
|
|
|
|
int id; // weapon ID
|
|
|
|
|
int flags; // flags???
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// weapon info structure
|
|
|
|
|
struct WeaponInfo {
|
2014-07-30 14:17:46 +04:00
|
|
|
int id; // the weapon id value
|
2023-06-24 02:36:51 +03:00
|
|
|
StringRef name; // name of the weapon when selecting it
|
|
|
|
|
StringRef model; // model name to separate cs weapons
|
2014-07-30 14:17:46 +04:00
|
|
|
int price; // price when buying
|
|
|
|
|
int minPrimaryAmmo; // minimum primary ammo
|
|
|
|
|
int teamStandard; // used by team (number) (standard map)
|
|
|
|
|
int teamAS; // used by team (as map)
|
|
|
|
|
int buyGroup; // group in buy menu (standard map)
|
|
|
|
|
int buySelect; // select item in buy menu (standard map)
|
2019-08-12 14:16:28 +03:00
|
|
|
int buySelectT; // for counter-strike v1.6
|
|
|
|
|
int buySelectCT; // for counter-strike v1.6
|
2015-06-04 11:52:48 +03:00
|
|
|
int penetratePower; // penetrate power
|
2019-07-01 21:10:00 +03:00
|
|
|
int maxClip; // max ammo in clip
|
2020-09-13 02:21:15 +03:00
|
|
|
int type; // weapon class
|
2014-07-30 14:17:46 +04:00
|
|
|
bool primaryFireHold; // hold down primary fire button to use?
|
2019-07-27 17:36:24 +03:00
|
|
|
|
|
|
|
|
public:
|
2019-08-12 22:51:26 +03:00
|
|
|
WeaponInfo (int id,
|
2023-06-24 02:36:51 +03:00
|
|
|
StringRef name,
|
|
|
|
|
StringRef model,
|
2019-08-12 22:51:26 +03:00
|
|
|
int price,
|
|
|
|
|
int minPriAmmo,
|
|
|
|
|
int teamStd,
|
|
|
|
|
int teamAs,
|
|
|
|
|
int buyGroup,
|
|
|
|
|
int buySelect,
|
|
|
|
|
int buySelectT,
|
|
|
|
|
int buySelectCT,
|
|
|
|
|
int penetratePower,
|
|
|
|
|
int maxClip,
|
2020-09-13 02:21:15 +03:00
|
|
|
int type,
|
2019-08-12 22:51:26 +03:00
|
|
|
bool fireHold) : id (id), name (name), model (model), price (price), minPrimaryAmmo (minPriAmmo), teamStandard (teamStd),
|
|
|
|
|
teamAS (teamAs), buyGroup (buyGroup), buySelect (buySelect), buySelectT (buySelectT), buySelectCT (buySelectCT),
|
2020-09-13 02:21:15 +03:00
|
|
|
penetratePower (penetratePower), maxClip (maxClip), type (type), primaryFireHold (fireHold)
|
2019-08-12 22:51:26 +03:00
|
|
|
{ }
|
2014-07-30 14:17:46 +04:00
|
|
|
};
|
|
|
|
|
|
2019-08-24 12:43:42 +03:00
|
|
|
// clients noise
|
|
|
|
|
struct ClientNoise {
|
|
|
|
|
Vector pos;
|
|
|
|
|
float dist;
|
|
|
|
|
float last;
|
|
|
|
|
};
|
|
|
|
|
|
2014-07-30 14:17:46 +04:00
|
|
|
// array of clients struct
|
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 Client {
|
2014-07-30 14:17:46 +04:00
|
|
|
edict_t *ent; // pointer to actual edict
|
|
|
|
|
Vector origin; // position in the world
|
|
|
|
|
int team; // bot team
|
2016-03-12 19:56:09 +03:00
|
|
|
int team2; // real bot team in free for all mode (csdm)
|
2014-07-30 14:17:46 +04:00
|
|
|
int flags; // client flags
|
2019-07-01 21:10:00 +03:00
|
|
|
int radio; // radio orders
|
2023-05-12 22:12:22 +03:00
|
|
|
int menu; // identifier to opened menu
|
2019-07-27 17:36:24 +03:00
|
|
|
int ping; // when bot latency is enabled, client ping stored here
|
|
|
|
|
int iconFlags[kGameMaxPlayers]; // flag holding chatter icons
|
|
|
|
|
float iconTimestamp[kGameMaxPlayers]; // timers for chatter icons
|
2019-08-24 12:43:42 +03:00
|
|
|
ClientNoise noise;
|
2014-07-30 14:17:46 +04:00
|
|
|
};
|
|
|
|
|
|
2020-06-12 18:52:38 +03:00
|
|
|
// include bot graph stuff
|
|
|
|
|
#include <graph.h>
|
2023-06-29 20:17:46 +03:00
|
|
|
#include <vision.h>
|
2020-06-12 18:52:38 +03:00
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
// this structure links nodes returned from pathfinder
|
2023-05-12 20:00:06 +03:00
|
|
|
class PathWalk final : public NonCopyable {
|
2019-07-27 17:36:24 +03:00
|
|
|
private:
|
2023-05-02 09:42:43 +03:00
|
|
|
size_t m_cursor {};
|
|
|
|
|
size_t m_length {};
|
|
|
|
|
|
|
|
|
|
UniquePtr <int32_t[]> m_path {};
|
2019-07-27 17:36:24 +03:00
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
public:
|
|
|
|
|
explicit PathWalk () = default;
|
|
|
|
|
~PathWalk () = default;
|
|
|
|
|
|
|
|
|
|
public:
|
2023-07-27 01:19:19 +03:00
|
|
|
int32_t &doubleNext () {
|
|
|
|
|
return at (2);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
int32_t &next () {
|
|
|
|
|
return at (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t &first () {
|
|
|
|
|
return at (0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t &last () {
|
|
|
|
|
return at (length () - 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t &at (size_t index) {
|
|
|
|
|
return m_path[m_cursor + index];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void shift () {
|
|
|
|
|
++m_cursor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void reverse () {
|
|
|
|
|
for (size_t i = 0; i < m_length / 2; ++i) {
|
|
|
|
|
cr::swap (m_path[i], m_path[m_length - 1 - i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t length () const {
|
|
|
|
|
if (m_cursor >= m_length) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return m_length - m_cursor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool hasNext () const {
|
2023-05-10 09:08:34 +03:00
|
|
|
return length () - m_cursor > 1;
|
2023-05-02 09:42:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool empty () const {
|
|
|
|
|
return !length ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void add (int32_t node) {
|
|
|
|
|
m_path[m_length++] = node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clear () {
|
|
|
|
|
m_cursor = 0;
|
|
|
|
|
m_length = 0;
|
|
|
|
|
|
|
|
|
|
m_path[0] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void init (size_t length) {
|
|
|
|
|
m_path = cr::makeUnique <int32_t[]> (length);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// main bot class
|
|
|
|
|
class Bot final {
|
2019-07-27 17:36:24 +03:00
|
|
|
public:
|
2014-07-30 14:17:46 +04:00
|
|
|
friend class BotManager;
|
|
|
|
|
|
2023-05-06 20:14:03 +03:00
|
|
|
private:
|
|
|
|
|
mutable Mutex m_pathFindLock {};
|
2023-07-02 19:25:18 +03:00
|
|
|
mutable Mutex m_predictLock {};
|
2023-05-06 20:14:03 +03:00
|
|
|
|
2014-07-30 14:17:46 +04:00
|
|
|
private:
|
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 m_states {}; // sensing bitstates
|
|
|
|
|
uint32_t m_collideMoves[kMaxCollideMoves] {}; // sorted array of movements
|
|
|
|
|
uint32_t m_collisionProbeBits {}; // bits of possible collision moves
|
|
|
|
|
uint32_t m_collStateIndex {}; // index into collide moves
|
|
|
|
|
uint32_t m_aimFlags {}; // aiming conditions
|
|
|
|
|
uint32_t m_currentTravelFlags {}; // connection flags like jumping
|
2020-11-23 13:11:28 +03:00
|
|
|
|
|
|
|
|
int m_oldButtons {}; // our old buttons
|
|
|
|
|
int m_reloadState {}; // current reload state
|
2023-04-02 12:17:12 +03:00
|
|
|
int m_voicePitch {}; // bot voice pitch
|
2020-11-23 13:11:28 +03:00
|
|
|
int m_loosedBombNodeIndex {}; // nearest to loosed bomb node
|
|
|
|
|
int m_plantedBombNodeIndex {}; // nearest to planted bomb node
|
|
|
|
|
int m_currentNodeIndex {}; // current node index
|
|
|
|
|
int m_travelStartIndex {}; // travel start index to double jump action
|
2023-05-12 22:12:22 +03:00
|
|
|
int m_previousNodes[5] {}; // previous node indexes from node find
|
2020-11-23 13:11:28 +03:00
|
|
|
int m_pathFlags {}; // current node flags
|
|
|
|
|
int m_needAvoidGrenade {}; // which direction to strafe away
|
|
|
|
|
int m_campDirection {}; // camp Facing direction
|
|
|
|
|
int m_campButtons {}; // buttons to press while camping
|
|
|
|
|
int m_tryOpenDoor {}; // attempt's to open the door
|
|
|
|
|
int m_liftState {}; // state of lift handling
|
|
|
|
|
int m_radioSelect {}; // radio entry
|
2023-05-06 20:14:03 +03:00
|
|
|
|
|
|
|
|
int m_lastPredictIndex { kInvalidNodeIndex }; // last predicted path index
|
|
|
|
|
int m_lastPredictLength {}; // last predicted path length
|
2023-06-08 16:59:52 +03:00
|
|
|
int m_pickupType {}; // type of entity which needs to be used/picked up
|
2023-05-06 20:14:03 +03:00
|
|
|
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_headedTime {};
|
|
|
|
|
float m_prevTime {}; // time previously checked movement speed
|
2023-04-02 12:17:12 +03:00
|
|
|
float m_heavyTimestamp {}; // is it time to execute heavy-weight functions
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_prevSpeed {}; // speed some frames before
|
2023-05-12 20:00:06 +03:00
|
|
|
float m_prevVelocity {}; // velocity some frames before
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_timeDoorOpen {}; // time to next door open check
|
|
|
|
|
float m_lastChatTime {}; // time bot last chatted
|
|
|
|
|
float m_timeLogoSpray {}; // time bot last spray logo
|
|
|
|
|
float m_knifeAttackTime {}; // time to rush with knife (at the beginning of the round)
|
|
|
|
|
float m_duckDefuseCheckTime {}; // time to check for ducking for defuse
|
2023-04-02 12:17:12 +03:00
|
|
|
float m_frameInterval {}; // bot's frame interval
|
|
|
|
|
float m_lastCommandTime {}; // time bot last thinked
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_reloadCheckTime {}; // time to check reloading
|
|
|
|
|
float m_zoomCheckTime {}; // time to check zoom again
|
2023-05-12 22:12:22 +03:00
|
|
|
float m_shieldCheckTime {}; // time to check shield drawing again
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_grenadeCheckTime {}; // time to check grenade usage
|
|
|
|
|
float m_sniperStopTime {}; // bot switched to other weapon?
|
|
|
|
|
float m_lastEquipTime {}; // last time we equipped in buyzone
|
|
|
|
|
float m_duckTime {}; // time to duck
|
|
|
|
|
float m_jumpTime {}; // time last jump happened
|
|
|
|
|
float m_soundUpdateTime {}; // time to update the sound
|
|
|
|
|
float m_heardSoundTime {}; // last time noise is heard
|
|
|
|
|
float m_buttonPushTime {}; // time to push the button
|
|
|
|
|
float m_liftUsageTime {}; // time to use lift
|
|
|
|
|
float m_askCheckTime {}; // time to ask team
|
|
|
|
|
float m_collideTime {}; // time last collision
|
|
|
|
|
float m_firstCollideTime {}; // time of first collision
|
|
|
|
|
float m_probeTime {}; // time of probing different moves
|
|
|
|
|
float m_lastCollTime {}; // time until next collision check
|
|
|
|
|
float m_lookYawVel {}; // look yaw velocity
|
|
|
|
|
float m_lookPitchVel {}; // look pitch velocity
|
|
|
|
|
float m_lookUpdateTime {}; // lookangles update time
|
|
|
|
|
float m_aimErrorTime {}; // time to update error vector
|
|
|
|
|
float m_nextCampDirTime {}; // time next camp direction change
|
|
|
|
|
float m_lastFightStyleCheck {}; // time checked style
|
|
|
|
|
float m_strafeSetTime {}; // time strafe direction was set
|
|
|
|
|
float m_randomizeAnglesTime {}; // time last randomized location
|
|
|
|
|
float m_playerTargetTime {}; // time last targeting
|
|
|
|
|
float m_timeCamping {}; // time to camp
|
|
|
|
|
float m_lastUsedNodesTime {}; // last time bot followed nodes
|
|
|
|
|
float m_shootAtDeadTime {}; // time to shoot at dying players
|
|
|
|
|
float m_followWaitTime {}; // wait to follow time
|
|
|
|
|
float m_chatterTimes[Chatter::Count] {}; // chatter command timers
|
|
|
|
|
float m_navTimeset {}; // time node chosen by Bot
|
|
|
|
|
float m_moveSpeed {}; // current speed forward/backward
|
|
|
|
|
float m_strafeSpeed {}; // current speed sideways
|
|
|
|
|
float m_minSpeed {}; // minimum speed in normal mode
|
|
|
|
|
float m_oldCombatDesire {}; // holds old desire for filtering
|
|
|
|
|
float m_itemCheckTime {}; // time next search for items needs to be done
|
2023-04-02 12:17:12 +03:00
|
|
|
float m_joinServerTime {}; // time when bot joined the game
|
|
|
|
|
float m_playServerTime {}; // time bot spent in the game
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_changeViewTime {}; // timestamp to change look at while at freezetime
|
2023-05-12 22:12:22 +03:00
|
|
|
float m_breakableTime {}; // breakable acquired time
|
2023-05-12 20:00:06 +03:00
|
|
|
float m_stuckTimestamp {}; // last time was stuck
|
2023-07-06 14:00:48 +03:00
|
|
|
float m_timeDebugUpdateTime {}; // time to update last debug timestamp
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2020-11-23 13:11:28 +03:00
|
|
|
bool m_moveToGoal {}; // bot currently moving to goal??
|
|
|
|
|
bool m_isStuck {}; // bot is stuck
|
2023-05-06 20:14:03 +03:00
|
|
|
bool m_isStale {}; // bot is leaving server
|
2020-11-23 13:11:28 +03:00
|
|
|
bool m_isReloading {}; // bot is reloading a gun
|
2023-04-02 12:17:12 +03:00
|
|
|
bool m_forceRadio {}; // should bot use radio anyway?
|
2020-11-23 13:11:28 +03:00
|
|
|
bool m_defendedBomb {}; // defend action issued
|
|
|
|
|
bool m_defendHostage {}; // defend action issued
|
|
|
|
|
bool m_duckDefuse {}; // should or not bot duck to defuse bomb
|
|
|
|
|
bool m_checkKnifeSwitch {}; // is time to check switch to knife action
|
|
|
|
|
bool m_checkWeaponSwitch {}; // is time to check weapon switch
|
|
|
|
|
bool m_isUsingGrenade {}; // bot currently using grenade??
|
|
|
|
|
bool m_bombSearchOverridden {}; // use normal node if applicable when near the bomb
|
|
|
|
|
bool m_wantsToFire {}; // bot needs consider firing
|
|
|
|
|
bool m_jumpFinished {}; // has bot finished jumping
|
|
|
|
|
bool m_isLeader {}; // bot is leader of his team
|
|
|
|
|
bool m_checkTerrain {}; // check for terrain
|
|
|
|
|
bool m_moveToC4 {}; // ct is moving to bomb
|
|
|
|
|
bool m_grenadeRequested {}; // bot requested change to grenade
|
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 m_needToSendWelcomeChat {}; // bot needs to greet people on server?
|
2023-05-08 00:44:14 +03:00
|
|
|
bool m_isCreature {}; // bot is not a player, but something else ? zombie ?
|
2023-05-12 20:00:06 +03:00
|
|
|
bool m_defuseNotified {}; // bot is notified about bomb defusion
|
2023-05-12 22:41:53 +03:00
|
|
|
bool m_jumpSequence {}; // next path link will be jump link
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2023-04-02 12:17:12 +03:00
|
|
|
PathWalk m_pathWalk {}; // pointer to current node from path
|
|
|
|
|
Dodge m_combatStrafeDir {}; // direction to strafe
|
|
|
|
|
Fight m_fightStyle {}; // combat style to use
|
|
|
|
|
CollisionState m_collisionState {}; // collision State
|
|
|
|
|
FindPath m_pathType {}; // which pathfinder to use
|
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 m_enemyParts {}; // visibility flags
|
2023-05-08 00:44:14 +03:00
|
|
|
uint16_t m_modelMask {}; // model mask bits
|
2023-06-20 15:18:35 +03:00
|
|
|
UniquePtr <class AStarAlgo> m_planner {};
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2020-11-23 13:11:28 +03:00
|
|
|
edict_t *m_pickupItem {}; // pointer to entity of item to use/pickup
|
|
|
|
|
edict_t *m_itemIgnore {}; // pointer to entity to ignore for pickup
|
|
|
|
|
edict_t *m_liftEntity {}; // pointer to lift entity
|
|
|
|
|
edict_t *m_breakableEntity {}; // pointer to breakable entity
|
2022-02-22 13:51:59 +03:00
|
|
|
edict_t *m_lastBreakable {}; // last acquired breakable
|
2020-11-23 13:11:28 +03:00
|
|
|
edict_t *m_targetEntity {}; // the entity that the bot is trying to reach
|
|
|
|
|
edict_t *m_avoidGrenade {}; // pointer to grenade entity to avoid
|
2023-05-12 22:12:22 +03:00
|
|
|
edict_t *m_hindrance {}; // the hindrance
|
2014-08-01 22:28:45 +04:00
|
|
|
|
2023-04-02 12:17:12 +03:00
|
|
|
Vector m_liftTravelPos {}; // lift travel position
|
|
|
|
|
Vector m_moveAngles {}; // bot move angles
|
|
|
|
|
Vector m_idealAngles {}; // angle wanted
|
|
|
|
|
Vector m_randomizedIdealAngles {}; // angle wanted with noise
|
|
|
|
|
Vector m_angularDeviation {}; // angular deviation from current to ideal angles
|
|
|
|
|
Vector m_aimSpeed {}; // aim speed calculated
|
|
|
|
|
Vector m_aimLastError {}; // last calculated aim error
|
|
|
|
|
Vector m_prevOrigin {}; // origin some frames before
|
|
|
|
|
Vector m_lookAt {}; // vector bot should look at
|
|
|
|
|
Vector m_throw {}; // origin of node to throw grenades
|
|
|
|
|
Vector m_enemyOrigin {}; // target origin chosen for shooting
|
|
|
|
|
Vector m_grenade {}; // calculated vector for grenades
|
2023-06-23 19:52:46 +03:00
|
|
|
Vector m_entity {}; // origin of entities like buttons etc
|
|
|
|
|
Vector m_lookAtSafe {}; // aiming vector when camping
|
|
|
|
|
Vector m_lookAtPredict {}; // aiming vector when predicting
|
2023-04-02 12:17:12 +03:00
|
|
|
Vector m_desiredVelocity {}; // desired velocity for jump nodes
|
|
|
|
|
Vector m_breakableOrigin {}; // origin of breakable
|
2023-08-08 11:48:37 +03:00
|
|
|
Vector m_rightRef {}; // right referential vector
|
2023-04-02 12:17:12 +03:00
|
|
|
|
|
|
|
|
Array <edict_t *> m_ignoredBreakable {}; // list of ignored breakables
|
|
|
|
|
Array <edict_t *> m_hostages {}; // pointer to used hostage entities
|
|
|
|
|
|
2020-11-23 13:11:28 +03:00
|
|
|
Path *m_path {}; // pointer to the current path node
|
2023-04-02 12:17:12 +03:00
|
|
|
String m_chatBuffer {}; // space for strings (say text...)
|
2023-06-29 20:17:46 +03:00
|
|
|
Frustum::Planes m_viewFrustum {};
|
2024-01-29 08:08:07 +03:00
|
|
|
CountdownTimer m_forgetLastVictimTimer {}; // time to forget last victim position ?
|
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
|
|
|
private:
|
2023-05-02 09:42:43 +03:00
|
|
|
int pickBestWeapon (Array <int> &vec, int moneySave);
|
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
|
|
|
int getRandomCampDir ();
|
2023-04-04 16:53:01 +03:00
|
|
|
int findAimingNode (const Vector &to, int &pathLength);
|
2019-07-27 17:36:24 +03:00
|
|
|
int findNearestNode ();
|
|
|
|
|
int findBombNode ();
|
|
|
|
|
int findCoverNode (float maxDistance);
|
|
|
|
|
int findDefendNode (const Vector &origin);
|
|
|
|
|
int findBestGoal ();
|
2023-04-04 16:53:01 +03:00
|
|
|
int findBestGoalWhenBombAction ();
|
2023-06-14 19:36:46 +03:00
|
|
|
int findGoalPost (int tactic, IntArray *defensive, IntArray *offensive);
|
2019-07-27 17:36:24 +03:00
|
|
|
int bestPrimaryCarried ();
|
|
|
|
|
int bestSecondaryCarried ();
|
|
|
|
|
int bestGrenadeCarried ();
|
|
|
|
|
int bestWeaponCarried ();
|
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
|
|
|
int changeNodeIndex (int index);
|
2023-06-24 02:36:51 +03:00
|
|
|
int numEnemiesNear (const Vector &origin, const float radius);
|
|
|
|
|
int numFriendsNear (const Vector &origin, const float radius);
|
2019-07-01 21:10:00 +03:00
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
float getBombTimeleft ();
|
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
|
|
|
float getEstimatedNodeReachTime ();
|
2019-07-01 21:10:00 +03:00
|
|
|
float isInFOV (const Vector &dest);
|
2019-07-27 17:36:24 +03:00
|
|
|
float getShiftSpeed ();
|
2020-12-09 19:00:43 +02:00
|
|
|
float calculateScaleFactor (edict_t *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
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
bool canReplaceWeapon ();
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
bool canDuckUnder (const Vector &normal);
|
|
|
|
|
bool canJumpUp (const Vector &normal);
|
2019-08-12 14:16:28 +03:00
|
|
|
bool doneCanJumpUp (const Vector &normal, const Vector &right);
|
2023-06-23 19:52:46 +03:00
|
|
|
bool isBlockedForward (const Vector &normal, TraceResult *tr);
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
bool canStrafeLeft (TraceResult *tr);
|
|
|
|
|
bool canStrafeRight (TraceResult *tr);
|
2019-07-27 17:36:24 +03:00
|
|
|
bool isBlockedLeft ();
|
|
|
|
|
bool isBlockedRight ();
|
|
|
|
|
bool checkWallOnLeft ();
|
|
|
|
|
bool checkWallOnRight ();
|
|
|
|
|
bool updateNavigation ();
|
|
|
|
|
bool isEnemyThreat ();
|
2019-07-01 21:10:00 +03:00
|
|
|
bool isWeaponRestricted (int weaponIndex);
|
|
|
|
|
bool isWeaponRestrictedAMX (int weaponIndex);
|
|
|
|
|
bool isInViewCone (const Vector &origin);
|
2019-08-12 14:16:28 +03:00
|
|
|
bool checkBodyParts (edict_t *target);
|
2023-06-27 09:45:04 +03:00
|
|
|
bool seesEnemy (edict_t *player);
|
2019-07-27 17:36:24 +03:00
|
|
|
bool hasActiveGoal ();
|
|
|
|
|
bool advanceMovement ();
|
2019-07-01 21:10:00 +03:00
|
|
|
bool isBombDefusing (const Vector &bombOrigin);
|
2020-06-12 18:52:38 +03:00
|
|
|
bool isOccupiedNode (int index, bool needZeroVelocity = false);
|
2023-06-20 15:18:35 +03:00
|
|
|
bool seesItem (const Vector &dest, StringRef classname);
|
2019-07-27 17:36:24 +03:00
|
|
|
bool lastEnemyShootable ();
|
2019-07-01 21:10:00 +03:00
|
|
|
bool rateGroundWeapon (edict_t *ent);
|
2019-07-27 17:36:24 +03:00
|
|
|
bool reactOnEnemy ();
|
|
|
|
|
bool selectBestNextNode ();
|
|
|
|
|
bool hasAnyWeapons ();
|
2023-04-11 22:32:28 +03:00
|
|
|
bool isKnifeMode ();
|
2024-02-10 21:58:10 +03:00
|
|
|
bool isGrenadeWar ();
|
2019-07-01 21:10:00 +03:00
|
|
|
bool isDeadlyMove (const Vector &to);
|
2019-07-27 17:36:24 +03:00
|
|
|
bool isOutOfBombTimer ();
|
2019-07-01 21:10:00 +03:00
|
|
|
bool isWeaponBadAtDistance (int weaponIndex, float distance);
|
|
|
|
|
bool needToPauseFiring (float distance);
|
2019-07-27 17:36:24 +03:00
|
|
|
bool lookupEnemies ();
|
2019-07-01 21:10:00 +03:00
|
|
|
bool isEnemyHidden (edict_t *enemy);
|
2020-12-03 14:37:21 +02:00
|
|
|
bool isEnemyInvincible (edict_t *enemy);
|
2023-04-12 21:36:48 +03:00
|
|
|
bool isEnemyNoTarget (edict_t *enemy);
|
2019-07-01 21:10:00 +03:00
|
|
|
bool isFriendInLineOfFire (float distance);
|
|
|
|
|
bool isGroupOfEnemies (const Vector &location, int numEnemies = 1, float radius = 256.0f);
|
|
|
|
|
bool isPenetrableObstacle (const Vector &dest);
|
|
|
|
|
bool isPenetrableObstacle2 (const Vector &dest);
|
2023-04-02 14:13:52 +03:00
|
|
|
bool isPenetrableObstacle3 (const Vector &dest);
|
2019-07-01 21:10:00 +03:00
|
|
|
bool isEnemyBehindShield (edict_t *enemy);
|
|
|
|
|
bool checkChatKeywords (String &reply);
|
2019-07-27 17:36:24 +03:00
|
|
|
bool isReplyingToChat ();
|
2019-08-12 14:16:28 +03:00
|
|
|
bool isReachableNode (int index);
|
2019-08-18 21:00:00 +03:00
|
|
|
bool updateLiftHandling ();
|
|
|
|
|
bool updateLiftStates ();
|
2019-09-15 21:07:49 +03:00
|
|
|
bool canRunHeavyWeight ();
|
2023-04-11 22:32:28 +03:00
|
|
|
bool isEnemyInSight (Vector &endPos);
|
2023-05-07 01:04:09 +03:00
|
|
|
bool isEnemyNoticeable (float range);
|
2023-05-08 00:44:14 +03:00
|
|
|
bool isCreature ();
|
2015-06-28 19:43:31 +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 doPlayerAvoidance (const Vector &normal);
|
|
|
|
|
void selectCampButtons (int index);
|
2019-07-01 21:10:00 +03:00
|
|
|
void instantChatter (int type);
|
2019-08-18 21:00:00 +03:00
|
|
|
void update ();
|
2019-07-27 17:36:24 +03:00
|
|
|
void runMovement ();
|
|
|
|
|
void checkSpawnConditions ();
|
|
|
|
|
void buyStuff ();
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void changePitch (float speed);
|
|
|
|
|
void changeYaw (float speed);
|
2019-07-27 17:36:24 +03:00
|
|
|
void checkMsgQueue ();
|
|
|
|
|
void checkRadioQueue ();
|
|
|
|
|
void checkReload ();
|
|
|
|
|
void avoidGrenades ();
|
|
|
|
|
void checkGrenadesThrow ();
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void checkBurstMode (float distance);
|
2019-07-27 17:36:24 +03:00
|
|
|
void checkSilencer ();
|
2024-01-29 08:08:07 +03:00
|
|
|
void setAimDirection ();
|
2019-07-27 17:36:24 +03:00
|
|
|
void updateLookAngles ();
|
|
|
|
|
void updateBodyAngles ();
|
2019-07-01 21:10:00 +03:00
|
|
|
void updateLookAnglesNewbie (const Vector &direction, float delta);
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void setIdealReactionTimers (bool actual = false);
|
2019-07-27 17:36:24 +03:00
|
|
|
void updateHearing ();
|
2020-06-12 18:52:38 +03:00
|
|
|
void postprocessGoals (const IntArray &goals, int result[]);
|
2019-07-27 17:36:24 +03:00
|
|
|
void updatePickups ();
|
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 ensureEntitiesClear ();
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void checkTerrain (float movedDistance, const Vector &dirNormal);
|
2019-07-27 17:36:24 +03:00
|
|
|
void checkDarkness ();
|
|
|
|
|
void checkParachute ();
|
|
|
|
|
void updatePracticeValue (int damage);
|
|
|
|
|
void updatePracticeDamage (edict_t *attacker, int damage);
|
|
|
|
|
void findShortestPath (int srcIndex, int destIndex);
|
|
|
|
|
void findPath (int srcIndex, int destIndex, FindPath pathType = FindPath::Fast);
|
2023-05-06 20:14:03 +03:00
|
|
|
void syncFindPath (int srcIndex, int destIndex, FindPath pathType);
|
2023-08-08 11:48:37 +03:00
|
|
|
void debugMsgInternal (StringRef str);
|
2019-07-27 17:36:24 +03:00
|
|
|
void frame ();
|
|
|
|
|
void resetCollision ();
|
|
|
|
|
void ignoreCollision ();
|
|
|
|
|
void setConditions ();
|
|
|
|
|
void overrideConditions ();
|
|
|
|
|
void updateEmotions ();
|
2019-07-01 21:10:00 +03:00
|
|
|
void setStrafeSpeed (const Vector &moveDir, float strafeSpeed);
|
2019-07-27 17:36:24 +03:00
|
|
|
void updateTeamJoin ();
|
|
|
|
|
void updateTeamCommands ();
|
|
|
|
|
void decideFollowUser ();
|
|
|
|
|
void attackMovement ();
|
|
|
|
|
void findValidNode ();
|
2023-05-06 20:14:03 +03:00
|
|
|
void setPathOrigin ();
|
2019-07-27 17:36:24 +03:00
|
|
|
void fireWeapons ();
|
2019-07-01 21:10:00 +03:00
|
|
|
void selectWeapons (float distance, int index, int id, int choosen);
|
2019-07-27 17:36:24 +03:00
|
|
|
void focusEnemy ();
|
|
|
|
|
void selectBestWeapon ();
|
|
|
|
|
void selectSecondary ();
|
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 selectWeaponById (int id);
|
2023-04-02 12:17:12 +03:00
|
|
|
void selectWeaponByIndex (int index);
|
2023-07-02 19:25:18 +03:00
|
|
|
void syncUpdatePredictedIndex ();
|
2023-05-06 20:14:03 +03:00
|
|
|
void updatePredictedIndex ();
|
2023-05-08 00:44:14 +03:00
|
|
|
void refreshModelName (char *infobuffer);
|
2023-08-08 11:48:37 +03:00
|
|
|
void updateRightRef ();
|
2020-06-12 18:52:38 +03:00
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
void completeTask ();
|
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 executeTasks ();
|
2019-08-18 21:00:00 +03:00
|
|
|
void trackEnemies ();
|
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 logicDuringFreezetime ();
|
|
|
|
|
void translateInput ();
|
|
|
|
|
void moveToGoal ();
|
2023-05-12 20:00:06 +03:00
|
|
|
void resetMovement ();
|
2023-06-29 20:17:46 +03:00
|
|
|
void refreshEnemyPredict ();
|
2024-01-29 08:08:07 +03:00
|
|
|
void setLastVictim (edict_t *victim);
|
2019-07-27 17:36:24 +03:00
|
|
|
|
|
|
|
|
void normal_ ();
|
|
|
|
|
void spraypaint_ ();
|
|
|
|
|
void huntEnemy_ ();
|
|
|
|
|
void seekCover_ ();
|
|
|
|
|
void attackEnemy_ ();
|
|
|
|
|
void pause_ ();
|
|
|
|
|
void blind_ ();
|
|
|
|
|
void camp_ ();
|
|
|
|
|
void hide_ ();
|
|
|
|
|
void moveToPos_ ();
|
|
|
|
|
void plantBomb_ ();
|
2019-09-21 23:20:33 +03:00
|
|
|
void defuseBomb_ ();
|
2019-07-27 17:36:24 +03:00
|
|
|
void followUser_ ();
|
|
|
|
|
void throwExplosive_ ();
|
|
|
|
|
void throwFlashbang_ ();
|
|
|
|
|
void throwSmoke_ ();
|
|
|
|
|
void doublejump_ ();
|
|
|
|
|
void escapeFromBomb_ ();
|
|
|
|
|
void pickupItem_ ();
|
|
|
|
|
void shootBreakable_ ();
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
|
2023-08-08 11:48:37 +03:00
|
|
|
edict_t *lookupButton (StringRef target);
|
2019-07-27 17:36:24 +03:00
|
|
|
edict_t *lookupBreakable ();
|
2023-08-08 11:48:37 +03:00
|
|
|
edict_t *setCorrectGrenadeVelocity (StringRef model);
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
|
2023-04-11 22:32:28 +03:00
|
|
|
Vector getEnemyBodyOffset ();
|
2019-07-01 21:10:00 +03:00
|
|
|
Vector calcThrow (const Vector &start, const Vector &stop);
|
|
|
|
|
Vector calcToss (const Vector &start, const Vector &stop);
|
2019-07-27 17:36:24 +03:00
|
|
|
Vector isBombAudible ();
|
2019-05-31 11:34:32 +03:00
|
|
|
Vector getBodyOffsetError (float distance);
|
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
|
|
|
Vector getCampDirection (const Vector &dest);
|
2023-04-11 22:32:28 +03:00
|
|
|
Vector getCustomHeight (float distance);
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
|
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
|
|
|
uint8_t computeMsec ();
|
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
|
|
|
private:
|
2019-07-27 17:36:24 +03:00
|
|
|
bool isOnLadder () const {
|
2019-07-01 21:10:00 +03:00
|
|
|
return pev->movetype == MOVETYPE_FLY;
|
|
|
|
|
}
|
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
|
|
|
bool isOnFloor () const {
|
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
|
|
|
return !!(pev->flags & (FL_ONGROUND | FL_PARTIALGROUND));
|
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
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
bool isInWater () const {
|
2019-07-01 21:10:00 +03:00
|
|
|
return pev->waterlevel >= 2;
|
|
|
|
|
}
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2020-01-08 18:29:28 +03:00
|
|
|
bool isInNarrowPlace () const {
|
|
|
|
|
return (m_pathFlags & NodeFlag::Narrow);
|
|
|
|
|
}
|
|
|
|
|
|
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 dropCurrentWeapon () {
|
|
|
|
|
issueCommand ("drop");
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
// ensures current node is ok
|
|
|
|
|
void ensureCurrentNodeIndex () {
|
|
|
|
|
if (m_currentNodeIndex == kInvalidNodeIndex) {
|
|
|
|
|
changeNodeIndex (findNearestNode ());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-30 14:17:46 +04:00
|
|
|
public:
|
2023-04-02 12:17:12 +03:00
|
|
|
entvars_t *pev {};
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2023-04-02 12:17:12 +03:00
|
|
|
int m_index {}; // saved bot index
|
|
|
|
|
int m_wantedTeam {}; // player team bot wants select
|
|
|
|
|
int m_wantedSkin {}; // player model bot wants to select
|
|
|
|
|
int m_difficulty {}; // bots hard level
|
|
|
|
|
int m_moneyAmount {}; // amount of money in bot's bank
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_spawnTime {}; // time this bot spawned
|
|
|
|
|
float m_timeTeamOrder {}; // time of last radio command
|
2023-04-02 12:17:12 +03:00
|
|
|
float m_slowFrameTimestamp {}; // time to per-second think
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_nextBuyTime {}; // next buy time
|
|
|
|
|
float m_checkDarkTime {}; // check for darkness time
|
|
|
|
|
float m_preventFlashing {}; // bot turned away from flashbang
|
|
|
|
|
float m_blindTime {}; // time when bot is blinded
|
|
|
|
|
float m_blindMoveSpeed {}; // mad speeds when bot is blind
|
|
|
|
|
float m_blindSidemoveSpeed {}; // mad side move speeds when bot is blind
|
|
|
|
|
float m_fallDownTime {}; // time bot started to fall
|
|
|
|
|
float m_duckForJump {}; // is bot needed to duck for double jump
|
2023-04-02 12:17:12 +03:00
|
|
|
float m_baseAgressionLevel {}; // base aggression level (on initializing)
|
|
|
|
|
float m_baseFearLevel {}; // base fear level (on initializing)
|
|
|
|
|
float m_agressionLevel {}; // dynamic aggression level (in game)
|
|
|
|
|
float m_fearLevel {}; // dynamic fear level (in game)
|
|
|
|
|
float m_nextEmotionUpdate {}; // next time to sanitize emotions
|
2020-11-23 13:11:28 +03:00
|
|
|
float m_updateTime {}; // skip some frames in bot thinking
|
|
|
|
|
float m_updateInterval {}; // interval between frames
|
|
|
|
|
float m_goalValue {}; // ranking value for this node
|
|
|
|
|
float m_viewDistance {}; // current view distance
|
|
|
|
|
float m_maxViewDistance {}; // maximum view distance
|
|
|
|
|
float m_retreatTime {}; // time to retreat?
|
|
|
|
|
float m_enemyUpdateTime {}; // time to check for new enemies
|
|
|
|
|
float m_enemyReachableTimer {}; // time to recheck if enemy reachable
|
|
|
|
|
float m_enemyIgnoreTimer {}; // ignore enemy for some time
|
|
|
|
|
float m_seeEnemyTime {}; // time bot sees enemy
|
|
|
|
|
float m_enemySurpriseTime {}; // time of surprise
|
|
|
|
|
float m_idealReactionTime {}; // time of base reaction
|
|
|
|
|
float m_actualReactionTime {}; // time of current reaction time
|
|
|
|
|
float m_timeNextTracking {}; // time node index for tracking player is recalculated
|
|
|
|
|
float m_firePause {}; // time to pause firing
|
|
|
|
|
float m_shootTime {}; // time to shoot
|
|
|
|
|
float m_timeLastFired {}; // time to last firing
|
|
|
|
|
float m_difficultyChange {}; // time when auto-difficulty was last applied to this bot
|
2023-04-02 12:17:12 +03:00
|
|
|
float m_kpdRatio {}; // kill per death ratio
|
|
|
|
|
float m_healthValue {}; // clamped bot health
|
|
|
|
|
float m_stayTime {}; // stay time before reconnect
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2023-03-23 15:22:29 +03:00
|
|
|
int m_blindNodeIndex {}; // node index to cover when blind
|
2022-04-14 12:36:23 +03:00
|
|
|
int m_flashLevel {}; // flashlight level
|
2023-04-02 12:17:12 +03:00
|
|
|
int m_basePing {}; // base ping for bot
|
2020-11-23 13:11:28 +03:00
|
|
|
int m_numEnemiesLeft {}; // number of enemies alive left on map
|
|
|
|
|
int m_numFriendsLeft {}; // number of friend alive left on map
|
2023-05-12 22:12:22 +03:00
|
|
|
int m_retryJoin {}; // retry count for choosing team/class
|
2023-04-02 12:17:12 +03:00
|
|
|
int m_startAction {}; // team/class selection state
|
2020-11-23 13:11:28 +03:00
|
|
|
int m_voteKickIndex {}; // index of player to vote against
|
|
|
|
|
int m_lastVoteKick {}; // last index
|
|
|
|
|
int m_voteMap {}; // number of map to vote for
|
2023-04-02 12:17:12 +03:00
|
|
|
int m_logotypeIndex {}; // index for logotype
|
2020-11-23 13:11:28 +03:00
|
|
|
int m_buyState {}; // current count in buying
|
|
|
|
|
int m_blindButton {}; // buttons bot press, when blind
|
|
|
|
|
int m_radioOrder {}; // actual command
|
|
|
|
|
int m_prevGoalIndex {}; // holds destination goal node
|
|
|
|
|
int m_chosenGoalIndex {}; // used for experience, same as above
|
|
|
|
|
int m_lastDamageType {}; // stores last damage
|
|
|
|
|
int m_team {}; // bot team
|
2023-04-02 12:17:12 +03:00
|
|
|
int m_currentWeapon {}; // one current weapon for each bot
|
|
|
|
|
int m_weaponType {}; // current weapon type
|
2020-11-23 13:11:28 +03:00
|
|
|
int m_ammoInClip[kMaxWeapons] {}; // ammo in clip for each weapons
|
|
|
|
|
int m_ammo[MAX_AMMO_SLOTS] {}; // total ammo amounts
|
2014-07-30 14:17:46 +04:00
|
|
|
|
2020-11-23 13:11:28 +03:00
|
|
|
bool m_isVIP {}; // bot is vip?
|
2023-09-14 16:48:36 +03:00
|
|
|
bool m_isAlive {}; // has the player been killed or has he just respawned
|
2023-04-02 12:17:12 +03:00
|
|
|
bool m_notStarted {}; // team/class not chosen yet
|
2020-11-23 13:11:28 +03:00
|
|
|
bool m_ignoreBuyDelay {}; // when reaching buyzone in the middle of the round don't do pauses
|
|
|
|
|
bool m_inBombZone {}; // bot in the bomb zone or not
|
|
|
|
|
bool m_inBuyZone {}; // bot currently in buy zone
|
2023-05-12 22:12:22 +03:00
|
|
|
bool m_inVIPZone {}; // bot in the vip safety zone
|
2020-11-23 13:11:28 +03:00
|
|
|
bool m_buyingFinished {}; // done with buying
|
|
|
|
|
bool m_buyPending {}; // bot buy is pending
|
|
|
|
|
bool m_hasDefuser {}; // does bot has defuser
|
|
|
|
|
bool m_hasNVG {}; // does bot has nightvision goggles
|
|
|
|
|
bool m_usesNVG {}; // does nightvision goggles turned on
|
|
|
|
|
bool m_hasC4 {}; // does bot has c4 bomb
|
2023-05-06 20:14:03 +03:00
|
|
|
bool m_hasHostage {}; // does bot owns some hostages
|
2020-11-23 13:11:28 +03:00
|
|
|
bool m_hasProgressBar {}; // has progress bar on a HUD
|
|
|
|
|
bool m_jumpReady {}; // is double jump ready
|
|
|
|
|
bool m_canChooseAimDirection {}; // can choose aiming direction
|
|
|
|
|
bool m_isEnemyReachable {}; // direct line to enemy
|
2023-03-25 04:36:21 +03:00
|
|
|
bool m_kickedByRotation {}; // is bot kicked due to rotation ?
|
2023-05-06 20:14:03 +03:00
|
|
|
bool m_kickMeFromServer {}; // kick the bot off the server?
|
2024-01-29 08:08:07 +03:00
|
|
|
bool m_fireHurtsFriend {}; // firing at enemy will hurt our friend?
|
2020-11-23 13:11:28 +03:00
|
|
|
|
|
|
|
|
edict_t *m_doubleJumpEntity {}; // pointer to entity that request double jump
|
|
|
|
|
edict_t *m_radioEntity {}; // pointer to entity issuing a radio command
|
|
|
|
|
edict_t *m_enemy {}; // pointer to enemy entity
|
|
|
|
|
edict_t *m_lastEnemy {}; // pointer to last enemy entity
|
|
|
|
|
edict_t *m_lastVictim {}; // pointer to killed entity
|
|
|
|
|
edict_t *m_trackingEdict {}; // pointer to last tracked player when camping/hiding
|
2017-02-06 22:31:54 +03:00
|
|
|
|
2023-04-02 12:17:12 +03:00
|
|
|
Vector m_pathOrigin {}; // origin of node
|
|
|
|
|
Vector m_destOrigin {}; // origin of move destination
|
|
|
|
|
Vector m_position {}; // position to move to in move to position task
|
|
|
|
|
Vector m_doubleJumpOrigin {}; // origin of double jump
|
|
|
|
|
Vector m_lastEnemyOrigin {}; // vector to last enemy origin
|
2024-01-29 08:08:07 +03:00
|
|
|
Vector m_lastVictimOrigin {}; // last victim origin to watch it
|
2023-06-14 19:36:46 +03:00
|
|
|
|
2023-04-02 12:17:12 +03:00
|
|
|
ChatCollection m_sayTextBuffer {}; // holds the index & the actual message of the last unprocessed text message of a player
|
|
|
|
|
BurstMode m_weaponBurstMode {}; // bot using burst mode? (famas/glock18, but also silencer mode)
|
|
|
|
|
Personality m_personality {}; // bots type
|
|
|
|
|
Array <BotTask> m_tasks {};
|
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
|
|
|
Deque <int32_t> m_msgQueue {};
|
2023-06-14 19:36:46 +03:00
|
|
|
Array <int32_t> m_goalHist {};
|
2015-07-22 23:04:43 +03:00
|
|
|
|
2019-07-01 21:10:00 +03:00
|
|
|
public:
|
2020-10-01 11:42:51 +03:00
|
|
|
Bot (edict_t *bot, int difficulty, int personality, int team, int skin);
|
2023-05-06 20:14:03 +03:00
|
|
|
|
|
|
|
|
// need to wait until all threads will finish it's work before terminating bot object
|
|
|
|
|
~Bot () {
|
2023-06-28 19:48:51 +03:00
|
|
|
MutexScopedLock lock1 (m_pathFindLock);
|
2023-05-06 20:14:03 +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
|
|
|
|
2019-07-01 21:10:00 +03:00
|
|
|
public:
|
2019-08-18 21:00:00 +03:00
|
|
|
void logic (); /// the things that can be executed while skipping frames
|
2020-09-13 02:21:15 +03:00
|
|
|
void spawned ();
|
2019-08-18 21:00:00 +03:00
|
|
|
void takeBlind (int alpha);
|
|
|
|
|
void takeDamage (edict_t *inflictor, int damage, int armor, int bits);
|
2019-07-27 17:36:24 +03:00
|
|
|
void showDebugOverlay ();
|
|
|
|
|
void newRound ();
|
2021-09-14 15:10:14 +03:00
|
|
|
void resetPathSearchType ();
|
2019-08-18 21:00:00 +03:00
|
|
|
void enteredBuyZone (int buyState);
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void pushMsgQueue (int message);
|
2020-06-12 18:52:38 +03:00
|
|
|
void prepareChatMessage (StringRef message);
|
2019-07-27 17:36:24 +03:00
|
|
|
void checkForChat ();
|
2023-04-19 06:39:18 +00:00
|
|
|
void showChatterIcon (bool show, bool disconnect = false);
|
2019-07-27 17:36:24 +03:00
|
|
|
void clearSearchNodes ();
|
2019-08-18 21:00:00 +03:00
|
|
|
void checkBreakable (edict_t *touch);
|
2019-08-24 21:17:11 +03:00
|
|
|
void checkBreakablesAround ();
|
2019-07-27 17:36:24 +03:00
|
|
|
void startTask (Task id, float desire, int data, float time, bool resume);
|
|
|
|
|
void clearTask (Task id);
|
|
|
|
|
void filterTasks ();
|
|
|
|
|
void clearTasks ();
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void dropWeaponForUser (edict_t *user, bool discardC4);
|
2020-06-12 18:52:38 +03:00
|
|
|
void sendToChat (StringRef message, bool teamOnly);
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void pushChatMessage (int type, bool isTeamSay = false);
|
|
|
|
|
void pushRadioMessage (int message);
|
|
|
|
|
void pushChatterMessage (int message);
|
2019-07-27 17:36:24 +03:00
|
|
|
void tryHeadTowardRadioMessage ();
|
|
|
|
|
void kill ();
|
2023-06-23 19:52:46 +03:00
|
|
|
void kick (bool silent = false);
|
2019-07-27 17:36:24 +03:00
|
|
|
void resetDoubleJump ();
|
2.9 Update (#64)
* Fixed bots not camping in camp spots.
Fixed chatter/radio message cycling. (need feedback).
Fixed CTs unable to defuse bomb.
Fixed backward jump path generation in waypoint editor.
Fixed autoradius in waypoint editor.
Fixed autoradius menu non closeable.
Fixed bots version display on entering game.
Fixed memory leak in DLL-loader. (non metamod).
Fixed bots able to see through smoke.
Fixed team-detection on non-standard modes.
Fixed quota & autovacate management.
Fixed bunch of warnings from static analyzers.
Greatly imporoved grenade throwing.
Grealty reduced bot CPU usage.
* Fixed stack-corruption in memory-file reader.
Fixed A* pathfinder not working correctly.
Fixed 'Tried to write to uninitialized sizebuf_t error' on bot add/remove.
Minor tweaks to camping and bot enemy aiming
* Make clang happy.
* Fixed VIP-dection on some maps.
Fixed occupied waypoint checker.
Small refactoring of code with clang-format.
* Fixed clang compilation
* Fixed compilation.
* Debugging seek cover task.
Some more code cleanup.
* Fixed typos.
* Fixes to attack movement.
Revert Z component updates.
* Fixes for aiming at enemy.
Fixes for seek cover & enemy hunt tasks.
More refactoring.
* Making clang happy once again?
Tweaked grenade timers.
* Revised language comparer hasher
* Fixed build.
* Fixed build.
* Optimized headshot offsets.
Optimized aim errors and enemy searches.
Get rid of preprocessor macroses.
Added back yb_think_fps. Use with caution.
* Minor refactoring of code.
* Check if tracking entity is still alive.
Do not duck in crouch-goal waypoints.
Remove ancient hack with failed goals.
* Get rid of c++14 stuff.
Tweaked isOccupiedPoint.
* Changed pickup check radius.
* Fix compilation.
* Fixed bots ignore breakables.
Fixed A* pathfinder.
Fixed searching for optimal waypoints.
Fixed bot waypoint reachability functions.
* Get rid of new/delete calls in pathfinder.
Disallow access to yapb waypoint menu on hlds.
Minor refactoring.
* Updated linux/osx makefile
* Spaces -> Tabs in makefile.
Made G++ happy.
* Updated makefile.
* Fixed heap buffer overflow in config loader code.
* Lowered CPU usage a bit, by using "waypoint buckets" for searching closest node.
Do not traceline for doors on map, that have no doors.
Get rid stack-based containers.
* Remove win-only debug crap.
* Refactored string class.
* Fix OSX compiling.
* Minor refactoring of corelib to use cpp move-semantic.
* Use reference for active grenades searcher.
* Use system's atan2f () as it's eror rate is a bit lower.
Fixed bots continuously stays in throw smoke task.
Fixed bots reaching camp-goal jumping or stays they for some time.
Increased radius for searching targets for grenades.
Tweaked bot difficulty levels.
Improved sniper weapon handling. Trying to stand still while shooting.
Increase retreat level only if sniper weapon is low on ammo.
Fixed predict path enemy tracking timer is always true.
Allow bots to process their tasks while on freezetime, so on small maps they already aiming enemies when freezetime ends.
Fied bots endlessy trying to pickup weapons.
Reduce surpise timers when holding sniper weapons.
New aim-at-head position calculation.
Shoot delay timers are now based on bot's difficulty.
Prefer smoke grenades more than flashbangs.
Fixed kill-all bot command not killing one random bot for first time use.
Do not play with jump velocity, now using the same as in waypoints.
Tweaked shift move, so zero move speed not overriden with shift speed.
Radius waypoint searcher use waypoint bucket as well.
Increase reachability radius for dest waypoint, if it's currenlty owned by other bot.
Partially fixed bots choice to use unreachable waypoints.
* Makes OSX clang happy?
* Support for compiling on llvm-win32, makefile to be done.
Increased default reachability time.
* Fixed build.
* Move level-initialization stuff from Spawn to ServerActivate, so bot will not check init-stuff every entity spawn. This should save few CPU cycles.
* Fixed active grenades list not working after changelevel.
Reworked items pickup code, so every bot is not firing sphere search every time, but instead we maintain our own list of intresting entities, so every bot is accessing this list. This should lower CPU usage more a little.
* Precache should be done in spawn...
* Do not use engfuncs in intresting entities.
* Fixed GCC-8.2 warnings.
Minor refactoring.
* Added some safety checks to intresting entities.
Get rid of stdc++ dependency for GCC & ICC under linux.
* Remove -g from release make.
Cosmetic changes.
* Re-enabled debug overlay.
* Remove test header...
* Some static-analyzer warnings fixed.
Support for X64 build for FWGS Xash3D Engine.
* Reduced time between selecting grenade and throwing it away.
Do not try to kill bots that already dead with kill command.
Several fixes from static-analyzers.
* Update CI.
* Fixed bot's not added after the changelevel on Xash3D engine.
* Revert commit that enables movement during freezetime. Everything goes bad, when there is no freezetime....
* Bots will try to not strafe while in combat if seeing enemy only partially.
Do not use "shift" when considering stuck.
* Weapon price for Elite is 800$ since CS 1.6...
* Fixed bots at difficulty 0 can't shoot enemies.
* Cosmetic change.
* Fixed assert in ClientDisconnect when quitting game while meta unloaded yapb module.
Consider freed entities as invalid.
* Bigger distance for throwing he grenades.
* Faster version of atan2f().
* Removed accidentally left SSE header.
* Cosmetic changes to enums.
* Tweaked difficulty levels.
Bots on Android will have a difficulty level 2 by default.
Fixed LTO builds under linux.
* Do not consider Android CS as legacy.
* Get rid of system's math functions. Just for fun)
* Use SSE2 for sincos function.
* Fixed failed during load wayponts still allows to add bots, thus causing bot to crash.
Added ability to delete waypoint by number using "yb wp delete".
Enabled Link Time Optimization for Linux and OSX.
* Fixed CI Builds.
2018-10-28 19:26:36 +03:00
|
|
|
void startDoubleJump (edict_t *ent);
|
2020-11-05 15:17:06 +03:00
|
|
|
void sendBotToOrigin (const Vector &origin);
|
2023-05-06 20:14:03 +03:00
|
|
|
void markStale ();
|
2019-07-27 17:36:24 +03:00
|
|
|
bool hasHostage ();
|
|
|
|
|
bool hasPrimaryWeapon ();
|
|
|
|
|
bool hasSecondaryWeapon ();
|
|
|
|
|
bool hasShield ();
|
|
|
|
|
bool isShieldDrawn ();
|
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 findNextBestNode ();
|
2019-07-01 21:10:00 +03:00
|
|
|
bool seesEntity (const Vector &dest, bool fromBody = false);
|
|
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
int getAmmo ();
|
2023-04-02 12:17:12 +03:00
|
|
|
int getAmmo (int id);
|
2019-07-27 17:36:24 +03:00
|
|
|
int getNearestToPlantedBomb ();
|
2019-07-01 21:10:00 +03:00
|
|
|
|
2020-09-29 19:23:26 +03:00
|
|
|
float getConnectionTime ();
|
2019-07-27 17:36:24 +03:00
|
|
|
BotTask *getTask ();
|
2019-07-01 21:10:00 +03:00
|
|
|
|
|
|
|
|
public:
|
2019-07-27 17:36:24 +03:00
|
|
|
int getAmmoInClip () const {
|
2019-07-01 21:10:00 +03:00
|
|
|
return m_ammoInClip[m_currentWeapon];
|
|
|
|
|
}
|
2023-04-02 12:17:12 +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
|
|
|
bool isDucking () const {
|
|
|
|
|
return !!(pev->flags & FL_DUCKING);
|
|
|
|
|
}
|
2019-07-01 21:10:00 +03:00
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
Vector getCenter () const {
|
2019-07-01 21:10:00 +03:00
|
|
|
return (pev->absmax + pev->absmin) * 0.5;
|
|
|
|
|
};
|
|
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
Vector getEyesPos () const {
|
2019-07-01 21:10:00 +03:00
|
|
|
return pev->origin + pev->view_ofs;
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-24 03:23:22 +03:00
|
|
|
Task getCurrentTaskId () {
|
2019-07-01 21:10:00 +03:00
|
|
|
return getTask ()->id;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-27 17:36:24 +03:00
|
|
|
edict_t *ent () {
|
2019-07-01 21:10:00 +03:00
|
|
|
return pev->pContainingEntity;
|
|
|
|
|
};
|
2019-07-27 17:36:24 +03:00
|
|
|
|
2019-09-14 23:13:55 +03:00
|
|
|
// bots array index
|
2019-07-27 17:36:24 +03:00
|
|
|
int index () const {
|
|
|
|
|
return m_index;
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-14 23:13:55 +03:00
|
|
|
// entity index with worldspawn shift
|
2019-07-27 17:36:24 +03:00
|
|
|
int entindex () const {
|
|
|
|
|
return m_index + 1;
|
|
|
|
|
}
|
2019-09-14 23:13:55 +03:00
|
|
|
|
2020-11-05 15:17:06 +03:00
|
|
|
// get the current node index
|
|
|
|
|
int getCurrentNodeIndex () const {
|
|
|
|
|
return m_currentNodeIndex;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-12 22:12:22 +03:00
|
|
|
// is low on ammo on index?
|
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 isLowOnAmmo (const int index, const float factor) const;
|
|
|
|
|
|
2019-09-14 23:13:55 +03:00
|
|
|
// prints debug message
|
2020-06-12 18:52:38 +03:00
|
|
|
template <typename ...Args> void debugMsg (const char *fmt, Args &&...args) {
|
2019-09-14 23:13:55 +03:00
|
|
|
debugMsgInternal (strings.format (fmt, cr::forward <Args> (args)...));
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-24 03:23:22 +03:00
|
|
|
private:
|
|
|
|
|
// returns true if bot is using a sniper rifle
|
|
|
|
|
bool usesSniper () const {
|
|
|
|
|
return m_weaponType == WeaponType::Sniper;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot is using a rifle
|
|
|
|
|
bool usesRifle () const {
|
|
|
|
|
return usesZoomableRifle () || m_weaponType == WeaponType::Rifle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot is using a zoomable rifle
|
|
|
|
|
bool usesZoomableRifle () const {
|
|
|
|
|
return m_weaponType == WeaponType::ZoomRifle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot is using a pistol
|
|
|
|
|
bool usesPistol () const {
|
|
|
|
|
return m_weaponType == WeaponType::Pistol;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot is using a SMG
|
|
|
|
|
bool usesSubmachine () const {
|
|
|
|
|
return m_weaponType == WeaponType::SMG;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot is using a shotgun
|
|
|
|
|
bool usesShotgun () const {
|
|
|
|
|
return m_weaponType == WeaponType::Shotgun;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot is using m249
|
|
|
|
|
bool usesHeavy () const {
|
|
|
|
|
return m_weaponType == WeaponType::Heavy;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot using not very good weapon
|
|
|
|
|
bool usesBadWeapon () const {
|
|
|
|
|
return usesShotgun () || m_currentWeapon == Weapon::UMP45 || m_currentWeapon == Weapon::MAC10 || m_currentWeapon == Weapon::TMP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot using a camp gun
|
|
|
|
|
bool usesCampGun () const {
|
|
|
|
|
return usesSubmachine () || usesRifle () || usesSniper () || usesHeavy ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// returns true if bot using knife
|
|
|
|
|
bool usesKnife () const {
|
|
|
|
|
return m_weaponType == WeaponType::Melee;
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-14 23:13:55 +03:00
|
|
|
// execute client command helper
|
2020-06-12 18:52:38 +03:00
|
|
|
template <typename ...Args> void issueCommand (const char *fmt, Args &&...args);
|
2014-07-30 14:17:46 +04:00
|
|
|
};
|
|
|
|
|
|
2021-09-08 20:09:23 +03:00
|
|
|
#include "config.h"
|
|
|
|
|
#include "support.h"
|
2024-01-19 00:03:45 +03:00
|
|
|
#include "hooks.h"
|
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
|
|
|
#include "sounds.h"
|
2021-09-08 20:09:23 +03:00
|
|
|
#include "message.h"
|
|
|
|
|
#include "engine.h"
|
|
|
|
|
#include "manager.h"
|
|
|
|
|
#include "control.h"
|
2023-05-02 09:42:43 +03:00
|
|
|
#include "planner.h"
|
|
|
|
|
#include "storage.h"
|
|
|
|
|
#include "analyze.h"
|
2014-07-30 14:17:46 +04:00
|
|
|
|
|
|
|
|
// very global convars
|
2020-06-12 18:52:38 +03:00
|
|
|
extern ConVar cv_jasonmode;
|
|
|
|
|
extern ConVar cv_radio_mode;
|
|
|
|
|
extern ConVar cv_ignore_enemies;
|
2021-09-17 15:55:57 +03:00
|
|
|
extern ConVar cv_ignore_objectives;
|
2020-06-12 18:52:38 +03:00
|
|
|
extern ConVar cv_chat;
|
|
|
|
|
extern ConVar cv_language;
|
|
|
|
|
extern ConVar cv_show_latency;
|
|
|
|
|
extern ConVar cv_enable_query_hook;
|
|
|
|
|
extern ConVar cv_chatter_path;
|
2020-06-15 11:28:42 +03:00
|
|
|
extern ConVar cv_quota;
|
|
|
|
|
extern ConVar cv_difficulty;
|
2020-12-03 14:14:22 +02:00
|
|
|
extern ConVar cv_attack_monsters;
|
|
|
|
|
extern ConVar cv_pickup_custom_items;
|
2021-09-16 16:09:51 +03:00
|
|
|
extern ConVar cv_economics_rounds;
|
|
|
|
|
extern ConVar cv_shoots_thru_walls;
|
|
|
|
|
extern ConVar cv_debug;
|
|
|
|
|
extern ConVar cv_debug_goal;
|
2021-09-21 16:52:20 +03:00
|
|
|
extern ConVar cv_save_bots_names;
|
2023-03-25 05:01:58 +03:00
|
|
|
extern ConVar cv_rotate_bots;
|
2023-05-02 09:42:43 +03:00
|
|
|
extern ConVar cv_graph_url;
|
2023-04-13 03:05:35 +03:00
|
|
|
extern ConVar cv_graph_url_upload;
|
2023-05-02 09:42:43 +03:00
|
|
|
extern ConVar cv_graph_auto_save_count;
|
|
|
|
|
extern ConVar cv_graph_analyze_max_jump_height;
|
2023-05-10 09:08:34 +03:00
|
|
|
extern ConVar cv_spraypaints;
|
2024-01-29 08:08:07 +03:00
|
|
|
extern ConVar cv_whose_your_daddy;
|
2024-02-10 21:58:10 +03:00
|
|
|
extern ConVar cv_grenadier_mode;
|
2021-09-16 16:09:51 +03:00
|
|
|
|
|
|
|
|
extern ConVar mp_freezetime;
|
|
|
|
|
extern ConVar mp_roundtime;
|
|
|
|
|
extern ConVar mp_timelimit;
|
|
|
|
|
extern ConVar mp_limitteams;
|
|
|
|
|
extern ConVar mp_autoteambalance;
|
|
|
|
|
extern ConVar mp_footsteps;
|
|
|
|
|
extern ConVar mp_startmoney;
|
2023-04-04 16:53:01 +03:00
|
|
|
extern ConVar mp_c4timer;
|
2019-09-14 23:13:55 +03:00
|
|
|
|
|
|
|
|
// execute client command helper
|
2020-06-12 18:52:38 +03:00
|
|
|
template <typename ...Args> void Bot::issueCommand (const char *fmt, Args &&...args) {
|
2019-09-14 23:13:55 +03:00
|
|
|
game.botCommand (ent (), strings.format (fmt, cr::forward <Args> (args)...));
|
|
|
|
|
}
|