Quake3World.com Forums
     Level Editing & Modeling
        max # of entities in a quake 3 map?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: max # of entities in a quake 3 map?

Veteran
Veteran
Joined: 23 Aug 2011
Posts: 174
PostPosted: 09-11-2011 11:32 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Recruit
Recruit
Joined: 20 Aug 2011
Posts: 8
PostPosted: 09-11-2011 11:54 AM           Profile Send private message  E-mail  Edit post Reply with quote


q3map2.h says:

#define MAX_MAP_ENTITIES 0x1000

so 4096 maybe




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 352
PostPosted: 09-11-2011 12:30 PM           Profile Send private message  E-mail  Edit post Reply with quote


#define MAX_ENTITIES 1023

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




Top
                 

Veteran
Veteran
Joined: 23 Aug 2011
Posts: 174
PostPosted: 09-11-2011 12:47 PM           Profile Send private message  E-mail  Edit post Reply with quote


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.



_________________
DGhost
http://www.dghost.com


Top
                 

Insane Quaker
Insane Quaker
Joined: 28 Dec 2009
Posts: 298
PostPosted: 09-11-2011 08:17 PM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

surfaceparm nomarks
surfaceparm nomarks
Joined: 10 Aug 2009
Posts: 1005
PostPosted: 09-11-2011 10:07 PM           Profile Send private message  E-mail  Edit post Reply with quote


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



_________________
Portfolio
Twitter


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-11-2011 11:26 PM           Profile   Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 352
PostPosted: 09-12-2011 12:51 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-12-2011 01:25 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Commander
Commander
Joined: 05 Jun 2008
Posts: 124
PostPosted: 09-12-2011 01:27 AM           Profile Send private message  E-mail  Edit post Reply with quote


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?




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-12-2011 01:41 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 352
PostPosted: 09-12-2011 02:05 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-12-2011 02:59 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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




Top
                 

Veteran
Veteran
Joined: 23 Aug 2011
Posts: 174
PostPosted: 09-12-2011 05:02 AM           Profile Send private message  E-mail  Edit post Reply with quote


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?



_________________
DGhost
http://www.dghost.com


Top
                 

surfaceparm nomarks
surfaceparm nomarks
Joined: 10 Aug 2009
Posts: 1005
PostPosted: 09-12-2011 05:10 AM           Profile Send private message  E-mail  Edit post Reply with quote


Well there is a limit for light entities too apparently.



_________________
Portfolio
Twitter


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-12-2011 05:27 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-12-2011 05:29 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 09-12-2011 05:54 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Veteran
Veteran
Joined: 23 Aug 2011
Posts: 174
PostPosted: 09-12-2011 07:06 AM           Profile Send private message  E-mail  Edit post Reply with quote


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?




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 09-12-2011 09:08 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Insane Quaker
Insane Quaker
Joined: 28 Dec 2009
Posts: 298
PostPosted: 09-12-2011 09:19 AM           Profile Send private message  E-mail  Edit post Reply with quote


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

I said that.

Am I on ignore?




Top
                 

Veteran
Veteran
Joined: 23 Aug 2011
Posts: 174
PostPosted: 09-12-2011 09:28 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.



_________________
DGhost
http://www.dghost.com


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-12-2011 10:48 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Theftbot
Theftbot
Joined: 07 Oct 2009
Posts: 468
PostPosted: 09-12-2011 11:10 AM           Profile Send private message  E-mail  Edit post Reply with quote


Shotgun burst must be expensive then!




Top
                 

Veteran
Veteran
Joined: 23 Aug 2011
Posts: 174
PostPosted: 09-12-2011 11:15 AM           Profile Send private message  E-mail  Edit post Reply with quote


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?



_________________
DGhost
http://www.dghost.com


Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 352
PostPosted: 09-12-2011 11:20 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 09-12-2011 11:47 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Veteran
Veteran
Joined: 23 Aug 2011
Posts: 174
PostPosted: 09-12-2011 11:49 AM           Profile Send private message  E-mail  Edit post Reply with quote


ah ok, thx for the precision.



_________________
DGhost
http://www.dghost.com


Top
                 

Commander
Commander
Joined: 05 Jun 2008
Posts: 124
PostPosted: 09-12-2011 02:24 PM           Profile Send private message  E-mail  Edit post Reply with quote


Isn't there this 256 func_door limit too?




Top
                 

Grunt
Grunt
Joined: 21 Jul 2009
Posts: 64
PostPosted: 09-12-2011 02:37 PM           Profile Send private message  E-mail  Edit post Reply with quote


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.



_________________
www.mrlego.com * www.sbhostingsolutions.com


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-12-2011 11:18 PM           Profile   Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Grunt
Grunt
Joined: 21 Jul 2009
Posts: 64
PostPosted: 09-13-2011 02:46 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.



_________________
www.mrlego.com * www.sbhostingsolutions.com


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 42247
PostPosted: 09-13-2011 03:46 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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.




Top
                 
Quake3World.com | Forum Index | Level Editing & Modeling


Post new topic Reply to topic


cron
Quake3World.com
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group