editc error

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

editc error

Post 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...

?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

too many spawned objects
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Too many edicts = g_entities array exceeded. Too many entities.

Mind you that script threads are entities, too. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

No. ScriptThread's are not Entities, and do not take up edicts.
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

if i remove such entities (like $entity remove) would it eat up edicts?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

edicts

Post 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.
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

No. Smoke, rain etc are client-side particle effects (tempmodels). Only their emitter uses an edict.
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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?
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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).
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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:
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply