Hello everyone.
I am making a very entity-intensive map. At its current state, it has reached 230% entdata. yet I have done a lot of work on optimizing the in-game edict usage, which according to "report_entities", the map has around 1000 entities in total and 800 edicts allocated and has maintained the flow throughout chapters of the map. So well as when the map loads, it's also roughly at that level and not even close to exceeding the max count which is 2000.
It ran properly until a recent compile. I made a few changes, added some triggers, soundscapes entities and some templates for holding unspawned entities for later chapters. I ran the map. It starts with FEWER entities and FEWER edicts (900+ total entities and 700 edicts according to 'report_entities') in pre-round and crashes as soon as the actual game starts (freeze time prior to the first objective) with a "no free edict" message. Thus it begs a question: Is there something that spam edicts after the pre-round?
Firstly I haven't implemented any game mechanic that could max out the edicts instantly from 900 to 2000, neither have I intentionally differentiated the events of the pre-round and the first round so there should not be a change in the edict count. In order to prove my thought, I hid a group of entities to enable the map to survive the first round so that I could keep track of the count as it goes. The map runs. (I also tried and hid the other groups individually for each compile and the map works too, so the group should not be a variable). Just as I expected, the counts before and after the pre-round remain exactly the SAME. Therefore nothing had ever changed the edict count before and after the round transitioning of the first compile!
Then here comes the real problem: How could the pre-round work for the first compile having a proper edict count whilst the actual round overloads with edicts?
I also did a third compile with nine decals hidden and it runs. but what is funny is that I went in the game and spawned fifty fa_m16a4s and the map still runs. Does that mean the NINE decals secretly took edicts without notifying report_entities and even FIFTY m16 entities couldn't surpass the amount they took?
Could anyone sort this out for me, please? Did I miss out anything? I really don't get source engine! lol