Update Engine v2.2

Update Engine v2.2
This commit is contained in:
CuteNoiRe 2024-06-15 19:05:46 +03:00
parent 5b2250f312
commit 4a7168332e
9 changed files with 26 additions and 7 deletions

View file

@ -292,8 +292,8 @@ int AAS_LoadMap(const char *mapname)
//===========================================================================
int AAS_Setup(void)
{
aasworld.maxclients = (int) LibVarValue("maxclients", "128");
aasworld.maxentities = (int) LibVarValue("maxentities", "1024");
aasworld.maxclients = (int) LibVarValue("maxclients", "256");
aasworld.maxentities = (int) LibVarValue("maxentities", "4096");
// as soon as it's set to 1 the routing cache will be saved
saveroutingcache = LibVar("saveroutingcache", "0");
//allocate memory for the entities

View file

@ -133,8 +133,8 @@ static int Export_BotLibSetup( void )
botimport.Print( PRT_MESSAGE, "------- BotLib Initialization -------\n" );
botlibglobals.maxclients = (int) LibVarValue( "maxclients", "64" );
botlibglobals.maxentities = (int) LibVarValue( "maxentities", "1024" );
botlibglobals.maxclients = (int) LibVarValue( "maxclients", "256" );
botlibglobals.maxentities = (int) LibVarValue( "maxentities", "4096" );
errnum = AAS_Setup(); //be_aas_main.c
if (errnum != BLERR_NOERROR) return errnum;

View file

@ -445,7 +445,7 @@ name: default: module(s): description:
"log" "0" l_log.c enable/disable creating a log file
"maxclients" "4" be_interface.c maximum number of clients
"maxentities" "1024" be_interface.c maximum number of entities
"maxentities" "4096" be_interface.c maximum number of entities
"bot_developer" "0" be_interface.c bot developer mode (it's "botDeveloper" in C to prevent symbol clash).
"phys_friction" "6" be_aas_move.c ground friction

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// q_shared.h -- included first by ALL program modules.
// A user mod should never modify this file
#define Q3_VERSION "MiTech 2.1"
#define Q3_VERSION "MiTech 2.2"
#ifndef SVN_VERSION
#define SVN_VERSION Q3_VERSION
#endif

View file

@ -1982,7 +1982,7 @@ static void R_LoadFogs( const lump_t *l, const lump_t *brushesLump, const lump_t
fogColor[1] = LERP( fogColor[1], luminance, r_mapGreyScale->value );
fogColor[2] = LERP( fogColor[2], luminance, r_mapGreyScale->value );
}
if ( r_mapColorScale->value > 0 ) {
float luminance;
luminance = LUMA( fogColor[0], fogColor[1], fogColor[2] );

View file

@ -298,6 +298,7 @@ extern cvar_t *sv_dlRate;
extern cvar_t *sv_gametype;
extern cvar_t *sv_pure;
extern cvar_t *sv_floodProtect;
extern cvar_t *sv_viewdistance;
extern cvar_t *sv_lanForceRate;
extern cvar_t *sv_levelTimeReset;

View file

@ -727,6 +727,7 @@ void SV_Init( void )
Cvar_SetDescription( sv_dlRate, "Bandwidth allotted to PK3 file downloads via UDP, in kbyte/s." );
sv_floodProtect = Cvar_Get( "sv_floodProtect", "1", CVAR_ARCHIVE | CVAR_SERVERINFO );
Cvar_SetDescription( sv_floodProtect, "Toggle server flood protection to keep players from bringing the server down." );
sv_viewdistance = Cvar_Get( "sv_viewdistance", "16", CVAR_ARCHIVE | CVAR_SERVERINFO );
// systeminfo
Cvar_Get( "sv_cheats", "1", CVAR_SYSTEMINFO | CVAR_ROM );

View file

@ -52,6 +52,7 @@ cvar_t *sv_dlRate;
cvar_t *sv_gametype;
cvar_t *sv_pure;
cvar_t *sv_floodProtect;
cvar_t *sv_viewdistance;
cvar_t *sv_lanForceRate; // dedicated 1 (LAN) server forces local client rates to 99999 (bug #491)
cvar_t *sv_levelTimeReset;

View file

@ -321,6 +321,9 @@ static void SV_AddEntitiesVisibleFromPoint( const vec3_t origin, clientSnapshot_
int leafnum;
byte *clientpvs;
byte *bitvector;
vec3_t dir;
float distanceSquared;
float maxViewDistanceSquared;
// during an error shutdown message we may need to transmit
// the shutdown message after the server has shutdown, so
@ -338,6 +341,8 @@ static void SV_AddEntitiesVisibleFromPoint( const vec3_t origin, clientSnapshot_
clientpvs = CM_ClusterPVS (clientcluster);
maxViewDistanceSquared = (sv_viewdistance->integer*512) * (sv_viewdistance->integer*512);
for ( e = 0 ; e < svs.currFrame->count; e++ ) {
es = svs.currFrame->ents[ e ];
ent = SV_GentityNum( es->number );
@ -416,6 +421,17 @@ static void SV_AddEntitiesVisibleFromPoint( const vec3_t origin, clientSnapshot_
}
}*/
// calculate distance from the entity to the client
VectorSubtract(ent->r.currentOrigin, origin, dir);
distanceSquared = VectorLengthSquared(dir);
// check if the entity is within the max view distance
if (distanceSquared > maxViewDistanceSquared) {
if (ent->s.eType != ET_PLAYER && ent->s.eType != ET_BEAM && ent->s.eType != ET_MOVER) {
continue;
}
}
// add it
SV_AddIndexToSnapshot( svEnt, e, eNums );