Re: Racing Ghosts (As this unfolds)
Spike wrote: draw the model with glColorMask(0,0,0,0)
I had no idea you could do that (just write to the depth buffer by turning all color off). That is a very nice trick and concept there, thanks Spike.
Moderator: Inside3D Admins
Spike wrote: draw the model with glColorMask(0,0,0,0)
Baker wrote:/ Note: Really I wouldn't have done this qbism didn't start talking about it more. But I was getting bored with whatever code I was working on.
qbism wrote:To a master of getting ideas rolling, a taste of your own medicine.Baker wrote:/ Note: Really I wouldn't have done this qbism didn't start talking about it more. But I was getting bored with whatever code I was working on.
Monsters, rockets, etc.
mh wrote:Extending cl_entities is a bit more work (if you want to avoid reserving too much memory for this array), but since this is defined at size MAX_EDICTS which is the same size used for server-side
SV_SpawnServer in sv_main.c
/////////////////////////////////////////////////////////////////////////////////
#ifdef SUPPORTS_SMART_EDICTS // Baker change (moved down and reworked)
// Earliest point we can read the entity string, since we need the model loaded.
// 1. Read entity_string from memory
#ifdef SUPPORTS_WRONG_CONTENT_PROTECTION // Baker change
entity_string = (char *)COM_LoadHunkFile_Limited (va ("maps/%s.ent", sv.name), sv.worldmodel->loadinfo.searchpath );
#else // Baker change +
entity_string = (char *)COM_LoadHunkFile (va ("maps/%s.ent", sv.name) );
#endif // Baker change -
if (entity_string)
Con_Printf ("External .ent file: Using entfile maps/%s.ent\n", sv.name);
else
entity_string = sv.worldmodel->entities; // Point it to the standard entities string
// 2. If maxedicts.value == 0 (automatic), look at the entity string
if (max_edicts.value)
{
// Manual setting of maxedicts
sv.max_edicts = max_edicts.value;
}
else
{
// Automatic estimation of a good maxedicts #
int classname_count;
classname_count = COM_StringCount (entity_string, "classname");
// Automatic estimation of a good maxedicts #
sv.max_edicts = classname_count * 1.5;
Con_DPrintf ("Setting server edicts maximum to %i edicts on classname count of %i\n", sv.max_edicts, classname_count);
}
// 3. Allocate the memory
sv.max_edicts = CLAMP(512, sv.max_edicts, 8192);
sv.edicts = Hunk_AllocName (sv.max_edicts * pr_edict_size, "edicts");
// 4. Now do this.
// leave slots at start for clients only
sv.num_edicts = svs.maxclients + 1;
for (i=0 ; i<svs.maxclients ; i++)
{
ent = EDICT_NUM(i+1);
svs.clients[i].edict = ent;
}
#endif // Baker change +
////////////////////////////////////////////////////////////////
CL_ClearState in cl_main.c
#ifdef SUPPORTS_SMART_EDICTS // Baker change
if (sv.active)
cl_max_edicts = sv.max_edicts; // Server is active
else if (max_edicts.value)
cl_max_edicts = max_edicts.value; // Client-only (demo or connected to a server) and max_edicts has non-zero value (should be rare)
else
cl_max_edicts = 8192; // Client-only and max_edicts is 0. Set to 8192. cl edicts are tiny.
cl_max_edicts = CLAMP (MIN_EDICTS, cl_max_edicts, MAX_EDICTS);
#else // Baker change +Spike wrote:guessing the number of entities required is a horrible thought indeed, especially if your guess can be wildly affected by the number of lights on a map which are _generally_ removed immediately after spawning and thus do not contribute to the required limit.
Your 512 minimum limit may result in crashes if you have 16 players all on some moderatly large/open map spamming nail-spewing grenades, depending on the mod.
Users browsing this forum: No registered users and 1 guest