2nd Mapping Trick: Templates and Ent Limits!

Posted: May 19, 2011 by Kaemon in Kaemon's Rants, Mapping Tricks, ZE LOTR Minas Tirith

Sadly, Minas Tirith isn’t going as good as planned… Don’t be afraid, its still going good! Just not as much as originally planed.
Hannibal still doesn’t know when he is going to release; and the most accurate answer we could give you its the same that you have heard from many video games companies in the past: “When it’s ready“.

So… As already mentioned, Hannibal encountered a problem with the limit of “dynamic” entities (2047 for Counter-Strike: Source) that makes the map unplayable for the moment.
Those limitations were known and expected while doing Minas Tirith; and the use of Templates (making the entities spawning only when needed) was going to be used for reducing the numbers of entities at once to prevent crashes…
However, we learned a new thing about the Point_Templates, and it’s that, even if not spawned, and making the number of entities in the round effectively lower, they are taken into account when the map loads (for the first time and every round). So some changes need to take place…

So… Basically, apart from fixing bugs, Hannibal is also working on reducing the limit of entities loaded when the map loads; making “Smart Templates” and adding dozens of “OutPut > Origin” lines (explained bellow).
And that’s kinda the reason the map is getting delayed more…
However we still hope to be able to see it being played on servers this very month… But take in mind that it’s possible that it gets delayed again…

———- ———- ONLY FOR INTERESED MAPPERS ———- ———- ———-

Counter-Strike: Source will crash as soon as 2048+dynamic” entities are spawned.
– When loading the map (first time or at the start of a round) all Templates are loaded, including their Point_Templates (and Entity_Makers aswel if used).
– “Dynamic” entities are those that the map has to take care of. Examples:
– An static un-named Light is not a “dynamic” Entity. It’s light it’s determined on the compile, and the map doesn’t has to track it or know what it’s status is, since it’s always on.
– A Prop_Static is never a “dynamic” entity, it’s just as it is, and as with the world-brushes and details, it’s position and how many light it receives is determined on the compile.
– An Infodecal, as the previous examples, is not a “dynamic” Entity.
– A normal Light, with a name (used to turn it ON/OFF) or Parented to something, IT IS a “dynamic” Entity, because the map has to track it and/or it’s status.
– A Prop_Dynamic is 1 Entity + 1 Extra Entity per each Bone_Follower (so arround 15 entities for most models, only 1 for those with the Physic Model removed, as explained here: Reducing the IN
– Each player is usually refered as 15 entities, so 64×15 = 960, greatly reducing the maximum of entities available for the map itself. However, players “really” take only 5 entities (3+Knife+Pistol) and the other 10 “slots” are reserved for the items he will buy on that round, etc. Hannibal himself uses 1.400 as the limit when mapping.

So… Let’s say for the shake of this example that the limit I don’t want to reach (so it can be played with 60 players on a server) is 1400, and if I reach 1401 it will crash on a full server… (This is quite accurate as a reference number).
My map has 1.000 dynamic entities, and 50 different templates of 9 entities each one (10 taking into account the Template entity). So 1.000 + (50 x 100) = 1.500 = crashes.
So, even if the map is divided (like Minas Tirith) in let’s say 5 different rounds, each one only using 10 Templates (1000+100 = 1.100, under 1.400 so it’s fine), all the info contained (the non-spawned templates) is taken into account when loading the map, so it crashes while loading…

Notice how this discovery also explains why previous releases of other maps (specially noticeable on early versions of Predator Ultimate) crashed on the round-start every time, and not while playing, and having less than 2048 entities spawned.
To check the entities in your map you need to use on console both CL_SHOWENTS and REPORT_ENTITIES (this last one only usable by the host).

REPORT_ENTITIES will tell you the exact number of entities spawned at that moment in your map, and how many of each class.
CL_SHOWENTS will give you the assigned number to each entity… So even if there are only 40 entities spawned (visible 40 on Report_Entities) last entity on cl_showents may be called “Ent 68: class ‘CWeaponGlock'”

As far as I know, this gives you a more accurate idea of how many entities “slots” you are using and how close you are to the limits… It’s also very useful when checking where are you using your entities (Predator old versions had more than 200 Path Tracks).
Please take in mind that I’m not a real expert, and all of this knowledge comes from experimentation; meaning that a couple of the things I say may be a little wrong… But I think all this it’s quite accurate (even if for the wrong reasons, XD).

So… If Templates are taken into account when loading the map… You may think Templates can’t be used to increase the number of entities available into a map… Wrong. They can still be used.
Ok… Let’s say I have 2 corridors with 8 torches each (8 fire entities) on the same position for both corridors… And are used only on Round 1.

– Having 16 “Normal” Torches = 16 entities when loading, 16 entities on Round 1, 16 on other rounds.
– Having 16 Torches in a single Template = 17 entities when loading (16+Template), 17 entities on Round 1, 1 entity (the Template) spawned on other rounds.

So far it seems useless… Granted you have 15 less entities on Rounds 2, 3 and 4; but since it’s taking 17 entities while loading (and you need to take those into account for the crash) it’s now 1 entity worse…
But what if I repeat the template?

– Having 8 Torches in a Template, +Ent_Maker to spawn them on the second place = 10 entities when loading (8+Template+Maker), 18 entities on Round 1, 2 entities on other rounds.

So… Now it only counts as 10 entities while loading the map/round, wich “frees” 6 extra slots of the limits when loading the map.
However, it takes 2 more entities (the Template and the Maker) while playing Round 1. However, for Minas Tirith (and future maps) that’s not an inconvenient, since they are separated into different Rounds/Areas and only the playable Round/Area entities are spawned. What matters (for us, in this kind of maps) is the entities that are being loaded at the beginning…

Now, if I were to repeat a third corridor with the same template, it would cost a total of 11 entities when loading, instead of 24, becoming even cheaper (in proportion).
In this example I used some torches, but this is also applicable to anything that you repeat on your map… Even if it’s a single object like a lonely torch! (Keep reading)

Let’s say that I want to make my torches even cheaper… To the point that I want my 16 torches to count as only 2 entities when loading the map… Can be done!
The trick here is that I will only use a Template, and the Template refers to a single Fire entity (2 entities only). And I will move the Template using Outputs!

So… When the “It’s Stage 1 Trigger/Button/Relay/Whatever” is started, it will give the “Template_Fire” this two outputs:
– Template_Fire > ForceSpawn
– Template_Fire > AddOutPut > origin 0 128 64 > After a Delay of 0.1
– Template_Fire > ForceSpawn > After a Delay of 0.2
– Template_Fire > AddOutput > origin 0 256 64 > After a Delay of 0.3
– Etc…
And it works just fine! The “Origin X Y Z” OutPut basically moves where the refered entity (template in this example, but you can move almost anything with this) is located, without the need of parents, path_tracks or similar. You just write down the coordinates where you would like to move it, and it will move it.
In case you have problems getting the coordinates, you can see them with the object selected on the bottom-right of Hammer, along with the object measures.

On “normal” maps, none of this is really useful. But on big maps like Predator Ultimate, Minas Tirith and our upcoming projects it’s almost necessary, and a great help avoiding the Hammer limitations.
However, I wouldn’t be really surprised if trying to abuse this we happened to find a new “OutPuts/InPuts” limitation. But since we never had a problem with that one, and we did with “dynamic” entities it’s probably going to prove itself really helpful…

———- ———- ———- ———- ———- ———- ———- ———- ———-

I hope this “Mapping Trick” was useful for some of you.
I know most of you don’t care about this kind of “advanced” mapping and only wanted screenshots/news about Minas Tirith or other projects, but can’t do, not today…

Luffaren is already working on his next map and I will give some info as soon as allowed (if I’m allowed at all!).

Paranoid V10.5/V11, Last Man Standing and Project J could start advacing as soon as Minas Tirith is released, and I will help Hannibal with any of those (maybe not with Paranoid if it’s just a fixing-version).

My own projects? Well… I still intend to released both MG_2D and MG_Coliseum (I don’t see myself finishing Project J unless Hannibal joins me, wich seems a possibilities, mostly because of my own laziness), but I’m advancing really slow on them… Sorry for that…
I will try (I know I already said this! >_ <) to release soon a MG_2D_Beta, even if it’s not fun to play for a lot of time (because only a couple of simple courses) so you can all check it and spot problems/bugs/improvements.

Comments
  1. Metro says:

    looks nice Kaemon goodjob πŸ˜‰

  2. Morell says:

    The map is going to stay as a legend.

  3. Anonymous says:

    we can say that is the map most expected in history … Eager!

  4. UNREA1 says:

    Repeating a template, now thats something I’ve never thought about! Thanks for that, and good luck to Hannibal to finish Minas. I hope that problem doesn’t make him cut off a lot stuff from the map.

  5. Metro says:

    i hope hannibal is done with the map also he deserve a vacation for his hard work ;D we should donate him a trip to hawaii i love being funny ;D

  6. I like how it sounds πŸ˜€ Nah, I’m doing this for fun πŸ™‚ I like too to keep zombie escape and counter strike a bit more alive. I’m fixing them with my short free time, I will post when I finish my personal test.

  7. FreeZe says:

    nice what you guys find out ^^
    but seriously hannibal you are so much exaggerating with this map πŸ˜€
    …but i like this and cant wait playing it
    @kaemon tl:dr version would be nice sometimes just as a tip^^ for those busy people that have no time and so on :X

    gl @ finishing the map

  8. Metro says:

    freeze why are you not start making new maps we miss you on mapping world ;D

  9. xD34tHRowZ says:

    LOL! I was also wondering about that too, he did say he might make another PotC map since the release of PotC4 =D

  10. FreeZe says:

    atm im too busy to do anything sorry :/
    damn university… dunno how hannibal can do it while studying