max # of entities in a quake 3 map?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
dghost77
Posts: 174
Joined: Tue Aug 23, 2011 8:28 pm

max # of entities in a quake 3 map?

Post 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.
o40
Posts: 8
Joined: Sat Aug 20, 2011 4:10 pm

Re: max # of entities in a quake 3 map?

Post by o40 »

q3map2.h says:

#define MAX_MAP_ENTITIES 0x1000

so 4096 maybe
themuffinman
Posts: 384
Joined: Fri Mar 05, 2010 5:29 pm

Re: max # of entities in a quake 3 map?

Post by themuffinman »

#define MAX_ENTITIES 1023

From cgame\tr_types.h in Quake3 source or renderer\tr_types.h in ioquake3.
dghost77
Posts: 174
Joined: Tue Aug 23, 2011 8:28 pm

Re: max # of entities in a quake 3 map?

Post 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.
[b]DG[color=#0040FF]host[/color][/b]
[url]http://www.dghost.com[/url]
deqer
Posts: 298
Joined: Mon Dec 28, 2009 6:30 pm

Re: max # of entities in a quake 3 map?

Post 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.
cityy
Posts: 1020
Joined: Mon Aug 10, 2009 8:23 am

Re: max # of entities in a quake 3 map?

Post 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..
www.ferdinandlist.de/leveldesign
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: max # of entities in a quake 3 map?

Post 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.
themuffinman
Posts: 384
Joined: Fri Mar 05, 2010 5:29 pm

Re: max # of entities in a quake 3 map?

Post 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.
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: max # of entities in a quake 3 map?

Post 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.
neoplan
Posts: 125
Joined: Thu Jun 05, 2008 9:47 pm

Re: max # of entities in a quake 3 map?

Post 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?
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: max # of entities in a quake 3 map?

Post 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).
themuffinman
Posts: 384
Joined: Fri Mar 05, 2010 5:29 pm

Re: max # of entities in a quake 3 map?

Post 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.
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: max # of entities in a quake 3 map?

Post 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).
dghost77
Posts: 174
Joined: Tue Aug 23, 2011 8:28 pm

Re: max # of entities in a quake 3 map?

Post 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?
[b]DG[color=#0040FF]host[/color][/b]
[url]http://www.dghost.com[/url]
cityy
Posts: 1020
Joined: Mon Aug 10, 2009 8:23 am

Re: max # of entities in a quake 3 map?

Post by cityy »

Well there is a limit for light entities too apparently.
www.ferdinandlist.de/leveldesign
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: max # of entities in a quake 3 map?

Post 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).
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: max # of entities in a quake 3 map?

Post 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.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: max # of entities in a quake 3 map?

Post 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.
dghost77
Posts: 174
Joined: Tue Aug 23, 2011 8:28 pm

Re: max # of entities in a quake 3 map?

Post 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... :shrug: 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?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: max # of entities in a quake 3 map?

Post 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.
deqer
Posts: 298
Joined: Mon Dec 28, 2009 6:30 pm

Re: max # of entities in a quake 3 map?

Post by deqer »

misantropia : When you say that rockets count as entities in the map,
I said that.

Am I on ignore?
dghost77
Posts: 174
Joined: Tue Aug 23, 2011 8:28 pm

Re: max # of entities in a quake 3 map?

Post 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.
[b]DG[color=#0040FF]host[/color][/b]
[url]http://www.dghost.com[/url]
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: max # of entities in a quake 3 map?

Post 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... :shrug: 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.
User avatar
Theftbot
Posts: 483
Joined: Thu Oct 08, 2009 4:03 am

Re: max # of entities in a quake 3 map?

Post by Theftbot »

Shotgun burst must be expensive then!
dghost77
Posts: 174
Joined: Tue Aug 23, 2011 8:28 pm

Re: max # of entities in a quake 3 map?

Post 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?
[b]DG[color=#0040FF]host[/color][/b]
[url]http://www.dghost.com[/url]
Post Reply