Counting Runtime Entities
prsearle
Join Date: 2002-11-01 Member: 2365Members, Constellation
<div class="IPBDescription">A tool to do it for you</div>Just something I've been playing around with - a Java applet that reads in a BSP and produces some statistics on how many entities are being used, how many will count towards the runtime limit, etc. It also checks whether the map meets the entity requirements listed in the mapping guidelines. Get it <a href='http://homepage.ntlworld.com/pr.searle/EntReport/' target='_blank'>here</a>. Note that you'll need to say yes when asked if you want to trust it. This is because it needs local file access to read the BSP.
I originally wrote this to see what kind of effect implementing client-side models would have in a typical NS map. The results seem to vary - maps like ns_eclipse save only a few entities (mostly sprites), while ns_hera could save nearly 40 entities. I also found that replacing info_targets that are only referenced by lights or light_spots could reduce ns_caged's runtime entity count by 67.
While I'm here, do the following entities contribute to the runtime entity count?<ul><li>light_environment
In the standard SDK, this calls CLight::Spawn() which removes itself immediately if it doesn't have a targetname. Since no light_environment will ever have a targetname (they're not switchable), they will always disappear when the map loads.</li><li>trigger_auto with "Remove on fire" checked
Same thing here - it fires it's target and removes itself immediately.</li><li>env_gamma</li><li>info_mapinfo</li><li>info_gameplay
Do these three hang around after map load, or is the data they contain squirrelled away somewhere? If so, should they count towards the limit?</li><li>infodecal with no targetname
From the standard SDK (and I see no reason it should have changed), these spray their decal and remove themselves immediately if they have no targetname.</li></ul>
I originally wrote this to see what kind of effect implementing client-side models would have in a typical NS map. The results seem to vary - maps like ns_eclipse save only a few entities (mostly sprites), while ns_hera could save nearly 40 entities. I also found that replacing info_targets that are only referenced by lights or light_spots could reduce ns_caged's runtime entity count by 67.
While I'm here, do the following entities contribute to the runtime entity count?<ul><li>light_environment
In the standard SDK, this calls CLight::Spawn() which removes itself immediately if it doesn't have a targetname. Since no light_environment will ever have a targetname (they're not switchable), they will always disappear when the map loads.</li><li>trigger_auto with "Remove on fire" checked
Same thing here - it fires it's target and removes itself immediately.</li><li>env_gamma</li><li>info_mapinfo</li><li>info_gameplay
Do these three hang around after map load, or is the data they contain squirrelled away somewhere? If so, should they count towards the limit?</li><li>infodecal with no targetname
From the standard SDK (and I see no reason it should have changed), these spray their decal and remove themselves immediately if they have no targetname.</li></ul>
Comments
You can download the JRE plugin <a href='http://java.sun.com/j2se/1.4.2/download.html' target='_blank'>here</a>. You'll want to download "J2SE v 1.4.2_03" JRE (not SDK). It's free and only 14.5MB (2MB if you use the web installer - it only downloads what it needs then).
Cobra^: The only entities listed in the guidelines are info_player_start, info_team_start, info_location, info_null and unnamed light/light_spot. The other entities I mentioned all remove themselves immedietely (or should), so It seems to me that they should be in the list.
but we can use this out of game!! <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo--> and it's java, so we could use it anywhere we have web access and a bsp handy. Nice work prsearle
I especially like all the guidline conformity checks and tips on optimisation, you've just saved me 9 entities from co_dawn. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo-->
Excellent work.
Could you make one for DoD as well since I am mapping for that Mod also.
Jemme: Sure, DoD shouldn't be too hard. And if I'm not mistaken, DoD already has a client-side env_model, so that part of the output should actually be useful. I'll add the entities from the DoD FGD - if there are any not listed in there that are used regularly, let me know. I'll edit here when Dod support is done...
<b>Edit: </b>Ok, it now support DoD maps. It won't do any guideline checking though.
Or at least check and see if cagey has already started petitioning him about it.
<b>Edit: </b><!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><span style='font-family:Courier'>MAP | Entities | Runtime ents | Potential savings
co_angst 254 | 96 | 0
co_core 152 | 84 | 0
co_daimos 501 | 248 | 8
co_dawn 273 | 81 | 3
co_faceoff 256 | 126 | 0
co_kestrel 346 | 166 | 7
co_pulse 220 | 108 | 0
co_rebirth 321 | 140 | 2
co_ulysses 144 | 85 | 0
ns_agora 730 | 180 | 0
ns_ayumi 365 | 159 | 0
ns_caged 440 | 233 | 0 *
ns_eclipse 373 | 175 | 0
ns_hera 1152 | 237 | 37
ns_lost 421 | 164 | 0
ns_metal 615 | 173 | 0
ns_mineshaft 278 | 166 | 0
ns_nancy 439 | 285 | 1
ns_nothing 1016 | 211 | 48
ns_origin 459 | 259 | 20
ns_tanith 572 | 258 | 21 **
ns_veil 328 | 161 | 11
* Replacing info_target's referenced only by light's/light_spot's could save 67 runtime entities.
** Replacing info_target's referenced only by light's/light_spot's could save 19 runtime entities.</span><!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Note that this is only a count of how many entities can be removed - implementing client-side models would allow mappers to place as many "prop" entities as they wanted with no server or network performance hit.
<b>Edit2: </b>Dammit, is there no way to get non-proportional spaces? [code] uses a proportional font and [font=courier] has proportional spaces... I guess that's the best table I can do...
That's accurate. I'm working exclusively on the server side and website for the forseeable future, but when it's time to think about the next client feature list I'm definitely going to bring this up.
I actually wrote a command line program that does entity counts in January but Flayra didn't want me to release it yet; my count disagreed with the internal one and he wanted to pinpoint the discrepency before I released it... then we got sidetracked <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->.
Regarding the list of additional items that may not need to be counted against the cap above (info_decal, etc)... I'll ping Flay and see what's going on, especially with the info_mapinfo, etc. I think that there are issues with any entities that are around for even a few frames of server time never being completely removed from the server's internal representation of the map--I know that the entity objects are deleted when killtargeted, for instance, but Flayra mentioned that there were still references to killed objects slowing things down.
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><b>Edit2: </b>Dammit, is there no way to get non-proportional spaces? [code] uses a proportional font and [font=courier] has proportional spaces... I guess that's the best table I can do...<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
I'll add an *actual* code tag (instead of a box generator that says "code" at the top) to my "would it be nice to have" list for forum tweaks. Might be helpful to have a compile log tag or mapsource tag that do highlighting as well. Don't expect it too soon though... at last count I had 6 separate projects in the rotation <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo-->.