Quake3World.com
https://www.quake3world.com/forum/

max # of entities in a quake 3 map?
https://www.quake3world.com/forum/viewtopic.php?f=10&t=46343
Page 1 of 1

Author:  dghost77 [ 09-11-2011 11:32 AM ]
Post subject:  max # of entities in a quake 3 map?

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.

Author:  o40 [ 09-11-2011 11:54 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

q3map2.h says:

#define MAX_MAP_ENTITIES 0x1000

so 4096 maybe

Author:  themuffinman [ 09-11-2011 12:30 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

#define MAX_ENTITIES 1023

From cgame\tr_types.h in Quake3 source or renderer\tr_types.h in ioquake3.

Author:  dghost77 [ 09-11-2011 12:47 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  deqer [ 09-11-2011 08:17 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  cityy [ 09-11-2011 10:07 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

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

Author:  Eraser [ 09-11-2011 11:26 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  themuffinman [ 09-12-2011 12:51 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  Eraser [ 09-12-2011 01:25 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  neoplan [ 09-12-2011 01:27 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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?

Author:  Eraser [ 09-12-2011 01:41 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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

Author:  themuffinman [ 09-12-2011 02:05 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  Eraser [ 09-12-2011 02:59 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

Code:
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).

Author:  dghost77 [ 09-12-2011 05:02 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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?

Author:  cityy [ 09-12-2011 05:10 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

Well there is a limit for light entities too apparently.

Author:  Eraser [ 09-12-2011 05:27 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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

Author:  Eraser [ 09-12-2011 05:29 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  ^misantropia^ [ 09-12-2011 05:54 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  dghost77 [ 09-12-2011 07:06 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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?

Author:  ^misantropia^ [ 09-12-2011 09:08 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

Quote:
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.

Quote:
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.

Author:  deqer [ 09-12-2011 09:19 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

Quote:
misantropia : When you say that rockets count as entities in the map,

I said that.

Am I on ignore?

Author:  dghost77 [ 09-12-2011 09:28 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  Eraser [ 09-12-2011 10:48 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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.

Author:  Theftbot [ 09-12-2011 11:10 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

Shotgun burst must be expensive then!

Author:  dghost77 [ 09-12-2011 11:15 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

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?

Author:  themuffinman [ 09-12-2011 11:20 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

Eraser wrote:
Code:
void SP_info_null( gentity_t *self ) {
   G_FreeEntity( self );
}

I doubt info_null counts towards that limit?


You speak the truth. I wasn't aware of that.

Author:  ^misantropia^ [ 09-12-2011 11:47 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

dghost77 wrote:
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?

No. Hitscan weapons use a different system. Only rockets and bolts (RL, GL, PG, BFG) take up entity slots.

Author:  dghost77 [ 09-12-2011 11:49 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

ah ok, thx for the precision.

Author:  neoplan [ 09-12-2011 02:24 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

Isn't there this 256 func_door limit too?

Author:  MrLego [ 09-12-2011 02:37 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

I believe that dead bodies and gibs count as well - part of that goes toward the allocation of 64 for players - unless you had 64 players and then it would roll over into the remainder of the 1024 entities.

Author:  Eraser [ 09-12-2011 11:18 PM ]
Post subject:  Re: max # of entities in a quake 3 map?

MrLego wrote:
I believe that dead bodies and gibs count as well - part of that goes toward the allocation of 64 for players - unless you had 64 players and then it would roll over into the remainder of the 1024 entities.


I'm not sure about dead bodies, but gibs certainly don't. They're client side things. The server doesn't even know there is such a thing as a gib.

Author:  MrLego [ 09-13-2011 02:46 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

The server doesn't care about gibs or bodies but they still apply towards the entity count on the client side.

Once you hit the limit things start to randomly blink in and out or just disappear completely.

I have seen this more times on RTCW and Enemy Territory maps where there are more scripted events happening - Quake 3 maps are more run & gun and usually don't contain all of the extra eye-candy gamemodels.

Author:  Eraser [ 09-13-2011 03:46 AM ]
Post subject:  Re: max # of entities in a quake 3 map?

MrLego wrote:
The server doesn't care about gibs or bodies but they still apply towards the entity count on the client side.


Yeah but this is not directly related to the number of entities in maps. The client will only hold a list of entities that are of relevance to the client, so if there's 1000 entities elsewhere in the map, those won't be present on the client and won't work towards the client's entity limit.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/