Counting Runtime Entities

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

Comments

  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    edited March 2004
    do I need to upgrade to IE 6.0? since it gives an error on my current version IE 5.0 <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • CobletCoblet Join Date: 2004-01-31 Member: 25803Members
    Are those entities not covered in the mapping FAQ? If you haven't checked then I would advise you to do so first.
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    Do you have the JRE plugin installed? If not, then you're using Microsoft's JVM, which doesn't support signed jar files, and requires a completely different way of signing applets.

    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.
  • CobletCoblet Join Date: 2004-01-31 Member: 25803Members
    I would say that any entity that removes itself after firing would not be counted, as they are not present during the game proper.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    You can use numents ingame, too.
  • ReeseReese Join Date: 2003-05-08 Member: 16143Members
    <!--QuoteBegin-Mendasp+Mar 6 2004, 05:57 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Mendasp @ Mar 6 2004, 05:57 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> You can use numents ingame, too. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    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
  • ZorZor Join Date: 2003-09-16 Member: 20911Members, Constellation
    Great work mate. This is just what ive been looking for. Keep up the good work
  • esunaesuna Rock Bottom Join Date: 2003-04-03 Member: 15175Members, Constellation
    Woo, nice little applet!

    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.
  • JemmeJemme Join Date: 2003-10-15 Member: 21698Members
    Hmm looks very seXeh there <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->

    Could you make one for DoD as well since I am mapping for that Mod also.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    hmmm, it's actually more useful than numents, heh.
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    edited March 2004
    A note on the optimisations: any savings listed under "client entities" won't actually work unless Flayra implements client models. The "info_targets replaced with info_null" will work, however.

    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.
  • ReeseReese Join Date: 2003-05-08 Member: 16143Members
    Maybe you should code up a special version that redirects output to a file and takes in an entire directory as it's input......then run it on the official maps and see what flayra thinks of the whole deal?

    Or at least check and see if cagey has already started petitioning him about it.
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    edited March 2004
    I've spoken to XP-Cagey about client-side ents, and he said that it's something he'd like to see in NS. It won't go into NS 3.0 as it's entered feature freeze/bugfixes only (AFAIK). Getting a list of how much client-side ents could help reduce entity counts for official maps sounds interesting. I'll run it on my nsp directory and post the results here...

    <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...
  • CageyCagey Ex-Unknown Worlds Programmer Join Date: 2002-11-15 Member: 8829Members, Retired Developer, NS1 Playtester, Constellation
    <!--QuoteBegin-prsearle+Mar 7 2004, 06:33 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (prsearle @ Mar 7 2004, 06:33 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->I've spoken to XP-Cagey about client-side ents, and he said that it's something he'd like to see in NS.  It won't go into NS 3.0 as it's entered feature freeze/bugfixes only (AFAIK).<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    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-->.
Sign In or Register to comment.