backport: nodes flooder (analyzer) from cs-ebot
analyze: allow to disable goal marking analyze: add cvars descriptions and bounds nav: added optional post path smoothing for astar algorithm nav: now bots will use Dijkstra algo instead of floyd-warshall if memory usage too high (controlled via yb_path_floyd_memory_limit cvar) (fixes #434) nav: vistable are now calculated every frame to prevent game-freeze during loading the game (fixes #434) graph: pracrice reworked to hash table so memory footprint is as low as possible (at cost 5-10% performance loss on practice) (fixes #434) control: bots commands now is case-insensitive bot: major refactoring of bot's code nav: issue warnings about path fail only with debug practice: check for visibility when updating danger index analyzer: suspend any analyzing on change level control: add kickall_ct/kickall_t nav: increase blocked distance in stuck check
This commit is contained in:
parent
bb2e93a539
commit
e7712a551a
31 changed files with 3114 additions and 1722 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 6d716494737f740ebea58cfc6e6b6b30039cf7e9
|
||||
Subproject commit 4d370ec500675ad23e9507831bbbbd6bb166ce3a
|
||||
|
|
@ -27,10 +27,16 @@ typedef unsigned char byte;
|
|||
#include <crlib/vector.h>
|
||||
#include <crlib/string.h>
|
||||
|
||||
#if defined (CR_ARCH_X64)
|
||||
using estring_t = int32_t;
|
||||
#else
|
||||
using estring_t = uint32_t;
|
||||
#endif
|
||||
|
||||
// idea from regamedll
|
||||
class string_t final : public cr::DenyCopying {
|
||||
private:
|
||||
int offset;
|
||||
estring_t offset;
|
||||
|
||||
public:
|
||||
explicit string_t () : offset (0)
|
||||
|
|
@ -42,10 +48,10 @@ public:
|
|||
~string_t () = default;
|
||||
|
||||
public:
|
||||
const char *chars (size_t shift = 0) const;
|
||||
const char *chars (estring_t shift = 0) const;
|
||||
|
||||
public:
|
||||
operator int () const {
|
||||
operator estring_t () const {
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +96,9 @@ extern enginefuncs_t engfuncs;
|
|||
extern gamefuncs_t dllapi;
|
||||
|
||||
// Use this instead of ALLOC_STRING on constant strings
|
||||
#define STRING(offset) (const char *)(globals->pStringBase + (int)offset)
|
||||
static inline const char *STRING (estring_t offset) {
|
||||
return globals->pStringBase + offset;
|
||||
}
|
||||
|
||||
// form fwgs-hlsdk
|
||||
#if defined (CR_ARCH_X64)
|
||||
|
|
@ -103,12 +111,13 @@ static inline int MAKE_STRING (const char *val) {
|
|||
return static_cast <int> (ptrdiff);
|
||||
}
|
||||
#else
|
||||
#define MAKE_STRING(str) ((uint64_t)(str) - (uint64_t)(STRING(0)))
|
||||
static inline estring_t MAKE_STRING (const char *str) {
|
||||
return static_cast <estring_t> (reinterpret_cast <uint64_t> (str) - reinterpret_cast <uint64_t> (globals->pStringBase));
|
||||
}
|
||||
#endif
|
||||
|
||||
inline const char *string_t::chars (size_t shift) const {
|
||||
inline const char *string_t::chars (estring_t shift) const {
|
||||
auto result = STRING (offset);
|
||||
|
||||
return cr::strings.isEmpty (result) ? &cr::kNullChar : (result + shift);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,25 +20,6 @@ extern globalvars_t *globals;
|
|||
extern enginefuncs_t engfuncs;
|
||||
extern gamefuncs_t dllapi;
|
||||
|
||||
// Use this instead of ALLOC_STRING on constant strings
|
||||
#define STRING(offset) (const char *)(globals->pStringBase + (int)offset)
|
||||
|
||||
// form fwgs-hlsdk
|
||||
#if defined (CR_ARCH_X64)
|
||||
static inline int MAKE_STRING (const char *val) {
|
||||
long long ptrdiff = val - STRING (0);
|
||||
|
||||
if (ptrdiff > INT_MAX || ptrdiff < INT_MIN) {
|
||||
return engfuncs.pfnAllocString (val);
|
||||
}
|
||||
return static_cast <int> (ptrdiff);
|
||||
}
|
||||
#else
|
||||
#define MAKE_STRING(str) ((uint64_t)(str) - (uint64_t)(STRING(0)))
|
||||
#endif
|
||||
|
||||
#define ENGINE_STR(str) (const_cast <char *> (STRING (engfuncs.pfnAllocString (str))))
|
||||
|
||||
// Dot products for view cone checking
|
||||
#define VIEW_FIELD_FULL (float)-1.0 // +-180 degrees
|
||||
#define VIEW_FIELD_WIDE (float)-0.7 // +-135 degrees 0.1 // +-85 degrees, used for full FOV checks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue