Page 1 of 2
max # of entities in a quake 3 map?
Posted: Sun Sep 11, 2011 7:32 pm
by dghost77
Is there any limit to the # of entities that can exist in a quake 3 map ? I do remember to hit the limit with Q3Radiant many years ago... I just don't know if there is a limit because of the Quake 3 engine or maybe that's because of the editor. I have 455 entities in my map at the moment and I want to add more to it. I just don't know if I'm gonna hit a limit or not with zeroradiant.
Re: max # of entities in a quake 3 map?
Posted: Sun Sep 11, 2011 7:54 pm
by o40
q3map2.h says:
#define MAX_MAP_ENTITIES 0x1000
so 4096 maybe
Re: max # of entities in a quake 3 map?
Posted: Sun Sep 11, 2011 8:30 pm
by themuffinman
#define MAX_ENTITIES 1023
From cgame\tr_types.h in Quake3 source or renderer\tr_types.h in ioquake3.
Re: max # of entities in a quake 3 map?
Posted: Sun Sep 11, 2011 8:47 pm
by dghost77
yes I think that 1024 was the number I hit for the max of entities in a map. So this is related to the Quake 3 Arena engine specifically, the editor has nothing to do with it. Q3map2 seems to be able to take up to 4096 ent. because it supports more games than Q3A.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 4:17 am
by deqer
Keep in mind, when you add bots and bots start shooting rockets, grenades, etc. will add to this count.
So, you want to allow for some buffer there. Maybe shoot for 900 entities.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 6:07 am
by cityy
My ct3ctf2 had around 2,5k entities. Though ~2k of these are light entities. It used to have more.. q3map2 started refusing to compile it at around 4k entities. Though I remember eraser saying light entities were different from other entities in some regard..
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 7:26 am
by Eraser
Regarding Quake 3 itself, light entities do not count towards that 1023 limit, nor do info_null entities. These entities are discarded by the game when the map is loaded so they are not kept in memory.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 8:51 am
by themuffinman
q3map2 does not save light entity info by default in any case (there's a specific switch - can't remember it right now - to save light ents if you wanted), so the game could not consider light entities in such bsp's even if it was coded to.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 9:25 am
by Eraser
Ok I didn't know that. There are spawn functions for lights and info_null entities in the Q3 code though, but they immediately free them anyway.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 9:27 am
by neoplan
What about info_notnull, are they kept in memory? When is it better to use a info_null\info_notnull or something else to safe some entities.
And are there "sub-limits" to this 1023 entity limit - like seperate limits for doors, buttons, bobbing etc?
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 9:41 am
by Eraser
info_notnull entities remain in the game and aren't freed. They're pretty much the same as target_position entities and are only left in there because of legacy reasons. So there's no real reason to use info_notnull entities as you should be using target_position instead.
info_null entities are used for targeting lights to create spots. The definition in entities.def will tell you that you can use target_position instead as well, but normally target_position entities remain in the game and add up to your limit (unless q3map2 has some smart detection mechanism for this which removes target_position entities that are solely used for targeting lights). info_null entities are removed and since you really won't be needed these light's target to remain in the game, I think it's actually better to use info_null instead of target_position (exclusively for lights that is. For targeting other entities, like jumppads, do use target_position).
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 10:05 am
by themuffinman
The only entities not compiled by default are lights and misc_models. Afaik all other objects considered entities in the editor (including doors, statics etc) will be considered in the entity limit.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 10:59 am
by Eraser
Code: Select all
void SP_info_null( gentity_t *self ) {
G_FreeEntity( self );
}
I doubt info_null counts towards that limit?
edit:
As for lights, it seems the original q3map compiled them into the bsp but q3map2 seems to remove them from the bsp. The SP_light function is hit once for every light entity in the original quake 3 maps (tested with q3dm1) but when I test the same code with a q3map2 compiled map (my own ermap4) then the function isn't hit. Haven't tested this for info_null but the same could be true.
Regardless of this though, both light and info_null entities are freed directly after spawning them, so I doubt they count towards this limit (although I can think of the edge case where the game has already spawned 1023 entities and then tries to spawn a light, but with q3map2 even this situation wouldn't occur).
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 1:02 pm
by dghost77
Whoaa, thx for all the informations.
So we can say that the limit is 1023 in a Q3A map but if compiling with q3map2, light entities, info_null and target_position will not count in the total amount of entities ? Versus compiling with the original q3map it would count in the total?
I am still using the info_notnull for light entities targeting, you are telling me it's better to use target_position instead?
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 1:10 pm
by cityy
Well there is a limit for light entities too apparently.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 1:27 pm
by Eraser
dghost77 wrote:Whoaa, thx for all the informations.
So we can say that the limit is 1023 in a Q3A map but if compiling with q3map2, light entities, info_null and target_position will not count in the total amount of entities ? Versus compiling with the original q3map it would count in the total?
I am still using the info_notnull for light entities targeting, you are telling me it's better to use target_position instead?
Er, not quite.
If you want to create spotlights use light and info_null entities (with the light entitiy targeting the info_null).
For an entity like trigger_push, use target_position.
target_position will count towards that 1023 limit.
lights will not count towards that limit.
info_null most likely doesn't count towards that limit either.
You should never use info_notnull entities (technically it's not wrong to use them, but target_position entities are the norm for Quake 3).
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 1:29 pm
by Eraser
cityy wrote:Well there is a limit for light entities too apparently.
That's a limit imposed by Q3map2 and someone quoted the 4096 limit for that.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 1:54 pm
by ^misantropia^
It's 1024 - 64 - 2 = 958. There are 64 slots reserved for players and bots and there are two special entities, worldspawn and none.
Rockets and bolts are entities too so make sure you leave a gap of ~50 entities for the game itself.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 3:06 pm
by dghost77
Eraser : thank you for clearing that confusion, I read an old tutorial for creating a spotlight and I never knew that info_notnull was not to be used anymore, but then it was an old tutorial...

Now I have to go and change all the spot lights in my map. The more tutorials that I read on this forum, the more job I got for finishing my map, I should just stop reading about mapping for Quake 3 as it is... but I can't stop myself...
misantropia : When you say that rockets count as entities in the map, you mean rockets that were fired by players/bots in air and not the weapons/ammos in the map? Example (without counting the reservation for spawn points that you mentioned) ; if the maximum # of entities in the map is 1013 after compilation with q3map2, then only a maximum of 10 rockets could be fired at the same time in the map?
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 5:08 pm
by ^misantropia^
When you say that rockets count as entities in the map, you mean rockets that were fired by players/bots in air and not the weapons/ammos in the map?
Yes.
if the maximum # of entities in the map is 1013 after compilation with q3map2, then only a maximum of 10 rockets could be fired at the same time in the map?
Yes if the upper limit was 1023 instead of 958. You can keep on firing but the old rockets will just disappear.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 5:19 pm
by deqer
misantropia : When you say that rockets count as entities in the map,
I said that.
Am I on ignore?
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 5:28 pm
by dghost77
Oups, you are right, I read your comment on it then went on in the post and re read mysantropia comment on it.
I never knew that about rockets/grenades being shot that affected the maximum # of entities being processed in a map. My safe guard would be 900 entities then for a map.
Again, thank you all for your input.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 6:48 pm
by Eraser
dghost77 wrote:Eraser : thank you for clearing that confusion, I read an old tutorial for creating a spotlight and I never knew that info_notnull was not to be used anymore, but then it was an old tutorial...

Now I have to go and change all the spot lights in my map. The more tutorials that I read on this forum, the more job I got for finishing my map, I should just stop reading about mapping for Quake 3 as it is... but I can't stop myself...
Not necessary. If you've used info_notnull, leave them. They're basically the same as target_position. info_notnull works just as well.
dghost77 wrote:
misantropia : When you say that rockets count as entities in the map, you mean rockets that were fired by players/bots in air and not the weapons/ammos in the map?
Both. An ammo box is an entity but a rocket fired with the rocket launcher by a player is an entity as well. Just as well as each grenade, each fired BFG shot and even each fired plasma gun shot.
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 7:10 pm
by Theftbot
Shotgun burst must be expensive then!
Re: max # of entities in a quake 3 map?
Posted: Mon Sep 12, 2011 7:15 pm
by dghost77
I'll have to leave more room for entities then, so I guess that all shots being fired in a map count as an entity? Even the machine gun shots?