Jump to content

Entity reduction


Recommended Posts

Just kinda wondering it people hit the entity limit often making maps etc.  Placing more entities in a map than a map can have and be played without errors?

 

I've seen a tutorial about spawning npc's and in some maps you can only add one or 2 or not at all because of an entity limit.

 

I may have a solution or 2 to help out with this.  If you already know it great!  If you don't, there are a couple things when making a map that can help reduce the amount of entities and free up some space.

 

1 - func_group reduction:  When capping a cylinder, beveling a patching or thickening a patch, radiant by default turns these into a func_group.  (There is a check box for creating a func_group which can be deselected)  A func_group does nothing in itself (doesn't move or trigger anything etc).  A func_group can be used to group multiple brushes or patches together for editing a map but as they are a func_group they become an entity themselves.  Using the "L" key to bring up the entity window you can find all the func_groups in your map.  Selecting them and ungrouping them in GTK under the selection menu will turn them back into a worldspawn brush or patch and it will no longer be a func_group entity.  Sometimes these can slip by and you can have many of them in a map someone is creating.  Each func_group counts as one entity, reducing these will free up some entity space. (Incorrect)

 

2 - triggers:  Triggers can also count as 1 or more entities whether they are a trigger_multiple or a trigger_hurt and depending on their use.  There is a way to reduce the amount of trigger entities you have when making a map. 

 

                    For example:  Say you have made an elevator and for that elevator you have 2 triggers to make the elevator work.  One trigger on the bottom floor and one on the top floor.  If you make the triggers separately and create them individually and turn them into a trigger_multiple you will have 2 trigger entities for the same elevator.  In order to create one trigger entity you must select both trigger brushes then turn them into a trigger_multiple.  Selecting them both will create one entity and not 2 separate entities.  Another way this can be done is making one brush and turning it into a trigger_multiple then cutting a piece of that trigger and separating the piece from the trigger brush that was cut.  You will have 2 trigger brushes however they are grouped as one entity.

 

                    The same can be said about a trigger_hurt.  If you have many brushes that are a trigger_hurt, creating them separately will create multiple entities.  Selecting all the trigger_hurt brushes and turning them all into one trigger hurt at the same time will create one entity and not several entities.  And also cutting a trigger hurt will create 2 brushes however they will be considered as one entity.

 

There may be some other ways to reduce entities in a map.  I would like to know of any others if they exist.  I thought about making a tutorial with illustrations etc.  If you guys think this is useful I can create a tutorial when I have time.  I have run into this entity limit before and using those methods described above I was able to add more entities to the map.  I posted it in modding discussions to get others viewpoints on the subject.

 

:)

Boothand likes this
Link to comment

From Q3Map2's source code, map.c:1745 to be specific:

	/* group entities are just for editor convenience, toss all brushes into worldspawn */
	if ( funcGroup ) {
		MoveBrushesToWorld( mapEnt );
		numEntities--;
		return qtrue;
	}
As for other improvements: use info_null with the "light" spawnflag to define spotlight directions. They'll be stripped out when the map is loaded.

 

Also, use scripts in lieu of complicated entity networks.

Link to comment

When we're on this topic, what is the max entity limit, and is it for the whole level, or only for entities visible at the same time? (SP & MP)

 

 

If I'm not mistaken, misc_model is baked into the geometry at compile, and thus not counting as an entity, whereas misc_model_static stays an entity?

Link to comment

misc_model_static and misc_model_breakable are sent as entities. Non-dynamic lights are not considered entities.

Max entity limit is 1023, keep in mind this includes players, bodyque, projectiles, lightsabers, and NPCs (which also have bodyque + projectiles + lightsabers). Also, triggers, target entities (except target_speaker), NPC spawners (but not the NPCs themselves) are treated as logical entities in some mods (Lugormod, JKG, ...?) and do not count towards the entity limit.

Link to comment

I have found before that the func_group did create a problem for me before.  When I turned them into worldspawn I was able to add more entities.  This happened a long time ago.  I don't exactly know what map I was working on.  Maybe I was wrong.

 

I put this in discussions to discuss this and not in a tutorial section.  I was wanting to discuss this with some of you guys here but someone wants to edit my post calling it incorrect etc.  (I understand why which is why I am leaving it that way).  Maybe I should have been a little more clear asking you guys if I was correct in talking about func_groups rather than someone telling me to do fact checking......that's why I was posting this to begin with.  What I posted was "I may have" meaning "I think this is correct but I am posting it here for discussion".

 

Thank you Szico and others for a good answer for my discussion. Other people want to put others down to get their point across....ahumm.....Moondog (not pointing any fingers :P )  Please be helpful not hurtfull thank you.

Link to comment

Ah its okay everyone makes errors - the reason it was dashed is because unfortunately, people don't tend to read entire topics and if people come across threads like these with wrong info in the future they wont bother to check post 4 and 8 or whatever to find the real answer. They'll either start new topics to ask again or add on the same answer about it being wrong like 3 weeks later.

 

Incidental question - If I add a model2 key to a func_entity as opposed to targeting a misc_model at the entity, does that make any difference to entity count?

I recently noticed I can add .ase models to entities using this targeting method, as ase's don't usually work as non-static model. Made me wonder if it was just baked into the entity rather than the map in that instance... (Unless thats an openJK change)

Link to comment

Incidental question - If I add a model2 key to a func_entity as opposed to targeting a misc_model at the entity, does that make any difference to entity count?

I recently noticed I can add .ase models to entities using this targeting method, as ase's don't usually work as non-static model. Made me wonder if it was just baked into the entity rather than the map in that instance... (Unless thats an openJK change)

Being able to use .ase implies it's done in Q3Map2. I briefly looked through the source code and it does seem to be so (see light_trace.c:1276). Did you know you can set a frame to display using _frame2?
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...