Page 1 of 1

editc error

Posted: Wed Jul 13, 2005 7:50 pm
by lizardkid

Code: Select all

LEVEL::AllocEdict - No free Edicts
stops halfway through my script after calling another thread, waits a while as if it was an infinite loop error but i bring up the console and...

?

Posted: Wed Jul 13, 2005 8:07 pm
by Elgan
too many spawned objects

Posted: Wed Jul 13, 2005 8:22 pm
by Rookie One.pl
Too many edicts = g_entities array exceeded. Too many entities.

Mind you that script threads are entities, too. ;)

Posted: Wed Jul 13, 2005 8:40 pm
by jv_map
No. ScriptThread's are not Entities, and do not take up edicts.

Posted: Wed Jul 13, 2005 8:51 pm
by Rookie One.pl
Oh, yes, my bad. :oops: They don't inherit anything from the Entity class, which means they don't eat edicts.
ScriptThread -> Listener -> Class

Posted: Wed Jul 13, 2005 10:22 pm
by lizardkid
if i remove such entities (like $entity remove) would it eat up edicts?

Posted: Thu Jul 14, 2005 5:42 am
by Rookie One.pl
Edicts are instances of the gentity_s structure. Every instance of any class that inherits from the Entity class (including the Entity class itself) eats up edicts. This is a fragment from FAKK2's source:

Code: Select all

class Entity : public Listener
	{
	public:
		CLASS_PROTOTYPE( Entity );

		// spawning variables
		int					entnum;
      gentity_t         *edict;
		gclient_t			*client;
		int					spawnflags;
So, removing an entity reduces the edict count, not increases it. ;)

edicts

Posted: Thu Jul 14, 2005 5:48 am
by tltrude
When an animated explosion goes off, it creates edicts for each chunk of flying debris. Also, other animated things like snow or rain will be hard on the edict count. Basiically, anything that creates its own objects uses edicts.

Posted: Thu Jul 14, 2005 7:22 am
by jv_map
No. Smoke, rain etc are client-side particle effects (tempmodels). Only their emitter uses an edict.

Posted: Thu Jul 14, 2005 9:35 am
by Elgan
ok why not just skip all the technikal crap:

he's got somethign spawning too much.

Maybe you have a loop with a spawn and are not deleting it at the end? why do u need to spawn os many things?

Posted: Thu Jul 14, 2005 1:22 pm
by Rookie One.pl
jv_map wrote:No. Smoke, rain etc are client-side particle effects (tempmodels). Only their emitter uses an edict.
Jv's perfectly right. ;)

A translation to human speak of the bit of FAKK's code above: :P basically, the Entity class is just an object-wrapper around the basic Q3 entity type (struct gentity_s gentity_t).

Posted: Thu Jul 14, 2005 4:57 pm
by lizardkid
alright, i understand (now) that edicts are allocated every time an entity is spawned NOT at map start.

But what are they exactly? memory space?

i fixed the problem btw, had a near-infinite while loop that was spawning a script_object every .1 seconds :lol:

Posted: Thu Jul 14, 2005 5:33 pm
by Rookie One.pl
Edicts are instances of the gentity_s structure, which is the entity type.

Code: Select all

typedef struct gentity_s gentity_t;

struct gentity_s 
   {
	entityState_t	         s;				      // communicated by server to clients
	struct playerState_s	   *client;
	qboolean	               inuse;
	qboolean	               linked;				// qfalse if not in any good cluster
	int			            linkcount;

	int			            svFlags;			   // SVF_NOCLIENT, SVF_BROADCAST, etc

	qboolean	               bmodel;				// if false, assume an explicit mins / maxs bounding box
									                  // only set by gi.SetBrushModel
	vec3_t		            mins, maxs;
	int			            contents;			// CONTENTS_TRIGGER, CONTENTS_SOLID, CONTENTS_BODY, etc
									                  // a non-solid entity should set to 0

	vec3_t		            absmin, absmax;	// derived from mins/maxs and origin + rotation

   float                   radius;           // radius of object
   vec3_t                  centroid;         // centroid, to be used with radius
   int                     areanum;          // areanum needs to be seen inside the game as well

	// currentOrigin will be used for all collision detection and world linking.
	// it will not necessarily be the same as the trajectory evaluation for the current
	// time, because each entity must be moved one at a time after time is advanced
	// to avoid simultanious collision issues
	vec3_t		            currentOrigin;
	vec3_t		            currentAngles;

	// when a trace call is made and passEntityNum != ENTITYNUM_NONE,
	// an ent will be excluded from testing if:
	// ent->s.number == passEntityNum	(don't interact with self)
	// ent->s.ownerNum = passEntityNum	(don't interact with your own missiles)
	// entity[ent->s.ownerNum].ownerNum = passEntityNum	(don't interact with other missiles from owner)
	int			            ownerNum;
	//gentity_t               *owner;		// objects never interact with their owners, to
									            // prevent player missiles from immediately
									            // colliding with their owner

   solid_t                 solid;
	// the game dll can add anything it wants after
	// this point in the structure
   };
It's just a structure of all the basic data an entity needs to exist.