I'd like some help clarifing Entities and Edicts

Powerlord

L3: Member
May 8, 2010
127
60
My guess is that those 7 free edicts are put aside for me. I was sat in spectate so they weren't in use, but being held aside for when I joined a team?

If that is the case, then why 7 edicts? My understanding was that a basic player cost the server 5 edicts (hitbox, model, and 3 weapons), and as I hadn't selected a team or class it would have no idea what my loadout would be, so it can't put aside for any extra edicts I might take up in the form of unusual.

Assuming my theory is true, what could the other 2 edicts be?

The Engineer with no cosmetics takes up at least 7 edicts:

  1. The player themselves
  2. Weapon slot 0 (Shotgun)
  3. Weapon slot 1 (Pistol)
  4. Weapon slot 2 (Wrench)
  5. Weapon slot 3 (Construction Tool)
  6. Weapon slot 4 (Destruction Tool)
  7. Weapon slot 5 (Builder)

Now, Builder may confuse you on that list. Probably because it's totally invisible. However, as it turns out, the Construction Tool and Destruction Tool just provide UIs for the build and destroy commands... which are implemented by the Builder entity for a player.

On a side note, the various Sappers are also technically Builder-type entities, but they go in weapon slot 1 of the Spy's loadout.

Edit: Since this wasn't clear, players have 11 loadout slots (0 - 10) even if you don't see them. I'm not sure what slot 6 is used for (possibly temporary items like Mannpower powerups?). 9 is the Action slot. 7, 8, and 10 are cosmetics. 11-18 are technically taunts, but taunts don't really exist as edicts* any more since the Taunt menu was added a few years ago.

*Well, there IS a instanced_scripted_scene edict when they're in use...

Edit 2: Since I don't think this has been confirmed yet, all of a players weapons have edicts as soon as they spawn in. It's not just the weapon they're currently using. I assume this has something to do with how Quake/Source games manage inventory.
 
Last edited:

Powerlord

L3: Member
May 8, 2010
127
60
Since this hasn't been mentioned yet and is relevant to TF2Maps, most mapping entities are also networked entities (aka edicts). There are very few exceptions such as static props, detailing, and cubemaps. Certain client-only things also aren't edicts such as ragdolls, visual effects (aka tempents), etc...
 

Hydrogen

MvM Maniac
Apr 5, 2017
84
181
Quick follow up question about giant MvM bots - Do giant robots have more entities, or are they simply scaled up in size? And do scaled up bots cost more edicts somehow?

No they don't take more entities; they are just scaled up to look bigger (technical: CTFPlayer::m_flScale decides the size of the bot). The scale value (m_flScale) is a property inside the bot entity (CTFPlayer), so it "comes along" with the entity when the server syncs it to your client.

If you run a server with Sourcemod, you can get a pretty good list of entities that count towards the edicts limit with sm_dump_datamaps and sm_dump_netprops on the server console. I don't think it's a complete listing but it should give you some idea on what counts towards edicts and what doesn't.

As Powerlord has mentioned above, each item a player has equipped (whether it's visible or not) counts towards the edict limit. Real-time generated entities, such as stickybombs, rockets, grenade pills, and other projectiles also count towards the edict limit (bullets do not however). Engineer buildings count towards the edict limit.

For MvM maps in particular the edict limit is more strict (I'd say about 1200) since 22 robots firing away rockets and grenades can easily push you to the danger zone (on top of players having upgrades which can allow them to spam even more projectiles and such).
 

Powerlord

L3: Member
May 8, 2010
127
60
For MvM maps in particular the edict limit is more strict (I'd say about 1200) since 22 robots firing away rockets and grenades can easily push you to the danger zone (on top of players having upgrades which can allow them to spam even more projectiles and such).

There's a reason why Valve tends to spawn robots of certain types (such as Giant Rapid Fire) with few to no support bots.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
There's a reason why Valve tends to spawn robots of certain types (such as Giant Rapid Fire) with few to no support bots.
I took at look at the edict counts for all 7 MvM maps, and they are much better than most other maps in TF2:
  • mvm_decoy - 365 (17.82%)
  • mvm_mannworks - 422 (20.60%)
  • mvm_coaltown - 467 (22.80%)
  • mvm_ghost_town - 529 (25.83%)
  • mvm_bigrock - 550 (26.85%)
  • mvm_mannhatten - 633 (30.90%)
  • mvm_rottenburg - 652 (31.83%)
I'm guessing they were optimized to use as few edicts as possible so that the bots could safely use all they needed without crashing the servers.
 

Benoist3012

L3: Member
Dec 25, 2015
148
207
That's certainly annoying.

Raising the limit requires a new engine version, doesn't it?

Yes and no, the max edict count is a define, with a value of 2048, if you want to increase it you need to change its value, and recompile the engine, as well with the game itself.

But I'll explain to everyone what is an edict, and whant isn't an edict.
An edict can be seen as a bridge between the server and the client, it allows them to exchange information.
The maximum limit of edict is 2048.
The maximum limit of entities is 4096.

We have 2 categories of entity, networked, and non-networked entity. As you probably guessed, networked entity requires an edict slot, that's why we often say, a map can have max 2048 entities, but that's wrongly said, we should say, a map can have max 2048 networked entities, and 2048 non-networked entities.
But then you may ask, what's a non-networked entity then? It's an entity that doesn't share data with the client, I'll give you an example, of an entity that we all used, at-least once, math_counter. This entity doesn't need to share data with the client(shortly said).
So yeah you can have a map with 2030 math_counter, and 32 players, and it won't crash.
 

Powerlord

L3: Member
May 8, 2010
127
60
I forgot to mention, Source 2 does have a higher limit in the one game so far that uses it. DOTA2's edict limit is 32768.
 

Hydrogen

MvM Maniac
Apr 5, 2017
84
181
The goldsource engine that the Sven co-op team is using has an edict limit of 8192 and that engine is like 15+ years old?

And yes, like Powerlord said, the Source 2 engine has a 32768 edict limit (confirmed by a Sourcemod developer).

I think the fact that we still are on 2048 has something to do with a majority of players still playing TF2 on toasters but don't quote me on that. (It's also not necessarily as simple as just changing MAX_ENTITES from 2048 to something else.)

There's a reason why Valve tends to spawn robots of certain types (such as Giant Rapid Fire) with few to no support bots.

What about ghost town?
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
So given that my original aim of this thread was to make sure I had my facts about edicts correct before I tried exaplining them to others, I decided the best way to do this would be to re-phrase this thread as a guide which I will publish on Steam.

Before I do that though, I'd like it if people could take a look at it to proof-read and fact check it. At the very least, some feedback on the structure would be appreciated. Bear in mind, I've tried to write it for casual players and/or people who don't know anything about mapping. But feel free to leave whatever feedback you want to!

Oh and sorry for the long read ahead, it's about 2800 words.....

~~~~~~~~~~~~~~~~~~~~​

Understanding Entities, Edicts and the 'ED_Alloc: no free edicts' error
About this guide
This guide is intended to help average, normal players get a better understanding of how the Source engine works and some of the things that effect its performance, but hopefully mappers and server admins will also find this useful.
This guide has been simplified meaning a lot of the technical details have been left out. In other words, it's a bit more complex than how it is presented here, but this guide should help you understand the basics.

The Basics
An entity is pretty much anything in a map that does something. This includes the background game logic, lights that turn on or off, signs that move, invisible brushes and sounds you hear in the map. Some entities have to be coordinated between all the players on a server, so that everyone sees and hears the same things at the same time. If an entity has to be coordinated, that makes it an Edict. A rule of thumb that can be used to work out if something is an edict is "does it move or change color?"

You might have seen the gif below elsewhere on the internet. It was taken from the Battlefield 3 single player campaign, but imagine if it happened on a multi-player game. How confusing would it be if some players were able to see and shoot through a door as if it was open, while other players could not because the same door was closed for them?

ZBbuNmo.gif

The Source engine can support a maximum of 2048 edicts at a time. This sounds like a very high number, and to be fair it is. However between maps and players, the number of edicts in use can fill up quite quickly. Should a server reach 2049 edicts, the server will crash with a "ED_Alloc: no free edicts" error.

While a lot of things are edicts, not everything is. Decals and ragdolls from dead players are not edicts because they don't effect gameplay, and individual players can disable both decals and ragdolls to improve their FPS in-game. Skins on redecorated weapons are not edicts either as they are props with extra data. The weapons themselves are edicts, but the skins don't add any extra edicts. But more on that later.

The Maps
The number of edicts a map uses will vary from map to map, but it won't change over time unless the map itself is changed. So how many edicts do map actually use? As there are currently 101 maps currently included in TF2, plus hundreds of custom maps, lets stick with the edict counts for the 6 maps that came with TF2 on launch:
  • cp_gravelpit - 506 (24.70%)
  • cp_granery - 698 (34.08%)
  • cp_dustbowl - 1027 (50.14%)
  • ctf_2fort - 1050 (51.26%)
  • cp_well - 1301 (63.52%)
  • tc_hyrdo - 1470 (71.77%)
  • Note: These are as of the time writing this guide, not the number of edicts these maps had back in 2007 as each map has had some form of update since launch.
The percentages beside each count is how much of the 2048 edict limit each map uses up when loaded on a server with no players or bots. That 2048 sounded like a lot, but then a map like tc_hydro take up nearly 72% of the available edicts! As we can see the amount of edicts taken up by maps can vary hugely and can quite easily take up most of a servers resources. But what about the players?

The Players
Players, like maps, can have different edict 'costs'. A basic, vanilla player with no cosmetics or unusual weapons, would have:
  • 1) An invisible hitbox
  • 2) A player model
  • 3) A primary weapon
  • 4) A secondary weapon
  • 5) A melee weapon
iAILuSl.jpg

In comparison, what would a fancy tricked out player 'cost' a server? Functionally speaking hats and weapons are treated as prop_dynamic's parented to the players heads or arms. Similarly all unusual effects are an info_particle_system parented to the prop_dynamic. That would certainly make them entities, but also edicts as those props and particles have to move about the map with the player. Assuming a worst case scenario, that player would also have:
  • 6) a hat
  • 7) a unusual effect on the hat
  • 8) a unusual effect on the active weapon
  • 9+10) cosmetics in the other two slots, and
  • 11) an item in the action slot.
So players can vary in edict costs anywhere between 5 - 11 edicts per player, just from their cosmetics alone. A full 24 player server could use anywhere between 120 - 264 edicts, or an average of 192 edicts.

But what happens when they leave spawn and start firing those weapons? All weapons will have a sound effect that plays when the weapon is fired so that people know it has been fired. This is important as it give players rough information about where other players are and what they are doing. From here, hitscan and projectile weapons function differently.

Hitscan weapons create a particle effect when fired, most commonly as a muzzle flash. As there is no physical projectile, the game simply calculates what the imaginary bullet would have hit and takes away health accordingly.

Tf2trailer.png

Projectile weapons on the other hand produce a lot more edicts as every individual projectile is an edict because the movement of those projectiles has to be coordinated between players. They may also have extra particle effects if it is a crit to indicate that it is a crit.

Finally, what about dead and spectating players? These players actually cost the same as living players as the game simply reserves a number of entities aside while the players are dead or spectating.

Situation Comparisons
We've looked at the maps and players separately, now lets see what their combined edicts counts can be under various situations.
Let's start by comparing how a TF2 server would have been back in 2007, with a server under today's conditions, just to see how many edicts each would use up.

To keep things fair as possible, we going to make each the 'worst case scenario' for what was possible at the time. So each scenario will feature 2 full teams of demomen playing on the largest maps available, with every player placing the maximum number of sticky-bombs possible and then unloading their grenade launchers.

TF2 in 2007 (Vanilla)
  • Full, 24 player server playing tc_hydro. So we have a starting number of 1470 edicts just from the map itself.
  • Players consist of just a hitbox, model and their 3 weapons. 5 x 24 = 120 edicts
  • The default stickybomb launcher can lay a maximum of 8 stickies at a time. 8 x 24 = 192 edicts
  • The grenade launcher has 4 pills in a clip. 4 x 24 = 96 edicts
  • TOTAL: 1470 + 120 + 192 + 96 = 1878 edicts.
That's 91.69% of the engine limit of 2048, leaving just 170 spare edicts. But it is within the engines limits, so its OK.

TF2 in 2017
  • Full, 24 player server playing pl_thundermountain, which is the has the largest entity count in the current map pool. This map weighs in at 1566 edicts just from the map itself.
  • Each player would have their model, hitbox and 3 weapons (as before). 5 x 24 = 120 edicts
  • Assuming each players has an unusual item in all 3 cosmetic slots, that's an extra 6 edicts. 6 x 24 = 144 edicts
  • Add in the unusual effect on the active weapon. 1 x 24 = 24 edicts
  • Lets also assume that all 24 players have an unusual taunt, each consisting of a prop_dynamic and info_particle_system. After unloading their grenade clips, they use the taunt. 2 x 24 = 48 edicts
  • Instead of the default stickbomb launcher, the players use The Scottish resistance as it can lay a maximum of 14 stickies at a time. 14 x 24 = 336 edicts
  • The grenade launcher has 4 pills in a clip. 4 x 24 = 96 edicts
  • TOTAL: 1566 + 120 + 144 + 24 + 48 + 336 + 96 = 2334 edicts!
That's 113.96% of the engine limits! In fact, that's a dead server! We could repeat this example with a 32 player server, but as we've killed the server with just 24 players it's not necessary.

7tgsBUQ.png

An average TF2 server
Of course this is not how most servers are. Not every player has an unusual, let alone enough to fill all their cosmetic slots. Earlier we established that players can 'cost' a server between 5 and 11 edicts just for their loadout, which gives us an average of 8 edicts per player. Or an average of 192 edicts for a full server of 24 players.

What's harder to work out an average for is the number of projectiles spawned by players. In our worst case scenario, everyone was a demoman unloading the maximum number of stickies and grenades to create a sudden (if short lived) spike in the number of edicts. Of course, no server is ever like that. So we'll use the average counts of both of our previous scenarios to get a ballpark figure.

In the 2007 scenario, we had 288 edicts generated by players placing stickybombs and shooting grenades, while in the 2017 scenario we had 432 edicts from them doing the same, plus an extra 48 edicts for using unusual taunts, giving 480 edicts in total. This gives us an average of 384 edicts coming from player generated projectiles. As this is for a 24 player servers, that's 16 per player

Finally we have the maps. To get a completely accurate number would require inspecting all 101 maps to learn their individual edict counts, which would be a time consuming task. I may get round to this in the future, but for now as we looked at the 6 launch maps before, we'll use them along with pl_thundermountain to get a very rough average number of map edicts:
  • cp_gravelpit - 506
  • cp_granery - 698
  • cp_dustbowl - 1027
  • ctf_2fort - 1050
  • cp_well - 1301
  • tc_hyrdo - 1470
  • pl_thundermountain
  • Total: 506 + 698 + 1027 + 1050 + 1301 + 1470 = 7618. 7618 divided by 7 = 1088 edicts.
So for a putting it all together, we have:
  • An average of 8 edicts/player for their loadouts. 8 x 24 = 192 edicts
  • An average of 16 edicts/player from projectiles. 16 x 24 = 384 edicts
  • An average of 1088 edicts per map
  • Total 192 + 384 + 1088 = 1664 edicts.
That's 81.25% of the 2048 edict limit, which is in the safe limit, but closer the cap than we would like.

Conclusions
So why did we look at the number of edicts that players, projectiles and maps all use? The point was to make you aware of how close any given server gets to the edict cap. Remember that once a server hits that limit, it crashes with the "ED_Alloc: no free edicts" error.

Something to remember with all these average counts is that the number of edicts will go up and down during the game. The peak time for entities is most likely to be after the start of a new round when players first make contact with the enemy team, as you have the most amount of players alive and firing their weapons. After that point there will almost always be someone dead or making their way back into battle.

Seeing as we've seen counts that go over the 2048 limit, it is very possible for a server to crash, and much easier than it was back in 2007 when TF2 launched. This has been in part due to new weapons and mechanics such as taunts, grappling hooks and unusual effects, but also maps that use edicts to run.

All throughout this we've only used maps from normal game modes. Custom gamemodes can potentially take up more edicts as they adjust different factors. 10x servers would be the best example of this as those server will multiply the number of projectiles a weapon can shoot by 10. Those server have to cut corners in other ways to limit the number of edicts in order to keep the servers up and running.

So what about in the future? We're good for now, but if Valve adds more weapons or mechanics they will have to be very careful how they do that. This isn't talking about what ever weapon being balanced or complementing other weapons, just that should they add another weapon then that weapon could generate edicts when used.

As for any map Valve adds, that too will have to have as few edicts as possible. This is something the wider mapping community has know for a long time and Valve know it as well. If you are a mapper, take a look at your own maps and see what they cost servers. It's always a good idea to see if you reduce the number of edicts you use.

As for Source2, it does have a higher limit in the one game so far that uses it. DOTA2's edict limit is 32,768. That's 16 times larger than Source's limit. Or another way of thinking about it, would be up grading your PC's RAM from 2GB to 32GB. It has been confirmed that CS:GO will get ported to the Source2 engine and that will likely see the same edict limit. TF2 on the other hand, is unlikely to get ported over to Source2.

I'm a server admin, what can I do to prevent edicts from building up on my server?
This greatly depends on what sort of server you are running, but there are some things you can do.
  • If you notice you server crashes when it runs a specific map, remove that map from your server rotation. If it's a custom map, try to contact the maps maker to see if they update the map. However it could be that the map crashes the server for other reasons and the map is well under the edict limit. In any case, it doesn't hurt to ask the mapper if they could take a look at their maps edict count and to try reduce it where they can.
  • If you want to see what the number of edicts for a map is, load the map by opening the developer console and typing map <map_name>, then enter. So if I wanted to load 2 fort, I would type map ctf_2fort. Once the map has loaded, join spectate. Open the console again and type status. It will give you an output of various details about the server, one of which is number of edicts.
    Code:
    edicts  : 1049 used of 2048 max
    You can take that number then add 576 to it. If the number you get as a result is more than 1639 (80.02%), then the chances are that map may crash your server during heavy play.
  • Disable cosmetics. This can be done with serverside plugins, and by removing cosmetics you will reduce the number of entities in use by each player
  • Run 24-player server instead of 32-player servers. Yes it's more fun to have more players, but more players means more edicts.
  • Consider adding class-limits. This isn't a popular option, but different classes generate more edicts than others. The point here to prevent there being to many edict heavy classes like the demoman at once. Class limits would, in theory at least average out the number of edicts used per player. In other words, any extra edicts used by one class get saved from another class.
Sources:
 
Last edited:

Hydrogen

MvM Maniac
Apr 5, 2017
84
181
Some suggestions:

- Players are dead or in spec still count towards the 2048 limit because the engine treats every player as an entity (which should make sense, since players can interact with the map and do stuff like other entities can). Even if dead or in spec, they still count towards this limit since they have a team number, every other player on the server needs to know of this player's existence, etc. TF2 blocks off the first 32 CBaseEntity slots for players, entity #99 (for some reason) is the worldspawn, etc. Even in MvM during setup the 22 bots still take up 22 edicts, even if some of them never spawn in.

- You spelled "tc_hydro" as "tf_hyrdo" in every occurrence you mentioned it.

- One way to keep high edict maps under control is to kill off entities on a map that aren't strictly required for functionality. For example, in koth_slasher, I killed all the info_particle_system entities (all the particles) to keep the edict count under control. It worked didn't sacrifice too much in gameplay (the campfire wasn't on fire however lol). There are other similar not-so-useful entities (can't think of anything else atm) that can be killed to keep edict count down without sacrificing gameplay or excluding the map from the server rotation.

- Be mindful that Sourcemod plugins can manipulate the edict count. Even plugin authors need to be mindful if they create and destroy entities randomly. Server owners should also keep that in mind when they install plugins, as maps that may run fine in vanilla may hit edict overflow with mods.

- You can categorize edicts from maps and edicts from the game as "map edicts" and "run-time edicts", respectively. Map edicts would be path_tracks, logic_relays (I think those count), control points, etc. Run-time edicts are projectiles, buildings, players, loadouts, etc.

- For map makers, my recommendation for edicts would be no higher than ~1500. I tested this number and it works even on MvM when you have 22 rapid fire soldiers spamming away crit rockets (like in ghost town). For PvP maps the run-time entity creation should be a low lower. But if you really wanted to, you could take a chance and go up to 1700, but you would not be doing yourself a service at that level.

- I would provide a summary section (like a tl;dr) of the main points at the very end. In fact, I can't really tell how the info on "max typical edict usage on each map" is useful. Maybe consider shortening that and get to the point on what is a good max limit you recommend mappers to stick by?

- Clarify that while the red "lost connection" text could mean an edict overflow, it could also mean server crash due to Valve bug, Sourcemod plugin bug, server lost internet connection or the player lost connection.

- This guide is definitely not for players. I would suggest your target audience to be map makers and modders. Basically anyone who has an interest in doing something for the game other than just playing it should look at this. Players generally don't care too much about this kind of info (I think).

My two cents (yes I read the whole thing).
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
- Players are dead or in spec still count towards the 2048 limit
I already mentioned this briefly:
"Finally, what about dead players? You would assume that they don't add to the number of edicts because they aren't in game, or that any edicts they used while alive get freed up once they die. This isn't how they are handled though. In reality, the game simply reserves a number of entities aside while the players are dead. The same thing happens to players in spectate mode"
I didn't go into detail about it though because I though it wasn't needed. People just need to know that dead and spectating players count as edicts without any of the how or why.

- You spelled "tc_hydro" as "tf_hyrdo" in every occurrence you mentioned it.
Well spotted, will fix.

- One way to keep high edict maps under control is to kill off entities on a map that aren't strictly required for functionality. For example, in koth_slasher, I killed all the info_particle_system entities (all the particles) to keep the edict count under control. It worked didn't sacrifice too much in gameplay (the campfire wasn't on fire however lol). There are other similar not-so-useful entities (can't think of anything else atm) that can be killed to keep edict count down without sacrificing gameplay or excluding the map from the server rotation.

- Be mindful that Sourcemod plugins can manipulate the edict count. Even plugin authors need to be mindful if they create and destroy entities randomly. Server owners should also keep that in mind when they install plugins, as maps that may run fine in vanilla may hit edict overflow with mods.
That's advice better suited to the mapper themselves, or a server admins who knows what they are doing. It's certainly not something an average player would know how to do, or even be able to do anything about themselves.

- You can categorize edicts from maps and edicts from the game as "map edicts" and "run-time edicts", respectively. Map edicts would be path_tracks, logic_relays (I think those count), control points, etc. Run-time edicts are projectiles, buildings, players, loadouts, etc.
That's worth considering, though I'm not sure how exactly I'd re-word it all. Something to come back to.

- Clarify that while the red "lost connection" text could mean an edict overflow, it could also mean server crash due to Valve bug, Sourcemod plugin bug, server lost internet connection or the player lost connection.
That's a good point, I will look at how I can re-phrase that.

- For map makers, my recommendation for edicts would be no higher than ~1500. I tested this number and it works even on MvM when you have 22 rapid fire soldiers spamming away crit rockets (like in ghost town). For PvP maps the run-time entity creation should be a low lower. But if you really wanted to, you could take a chance and go up to 1700, but you would not be doing yourself a service at that level.

- This guide is definitely not for players. I would suggest your target audience to be map makers and modders. Basically anyone who has an interest in doing something for the game other than just playing it should look at this. Players generally don't care too much about this kind of info (I think).

- I would provide a summary section (like a tl;dr) of the main points at the very end. In fact, I can't really tell how the info on "max typical edict usage on each map" is useful. Maybe consider shortening that and get to the point on what is a good max limit you recommend mappers to stick by?
Again, I'm not aiming this guide at mappers, though it wouldn't hurt to post a copy of this guide in other places. I know I've posted it here on TF2maps, but did that for fact checking. We aren't the intended audience.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
So I made a mistake and thought it was a good idea to post the guide on Steam.

What I thought was a reasonably accurate if simplified guide turned out to be factually wrong.

I'm taking the feedback I've got and will re-write parts of it, but either way I'm pretty annoyed and bummed out that it's been met with the criticism it has. I'm not going to blame any one but myself for the content of the guide, but I would really appreciate it if some more people could give their feedback, and more importantly fact check?

I know that as the author, the fact checking should fall on me to do, but I argue it's not unreasonable for me to ask people who are regarded as expects for their opinion, and to assume that if they don't correct any errors then that means there aren't any errors. That's why people consult experts instead of becoming experts themselves.
 

Benoist3012

L3: Member
Dec 25, 2015
148
207
Well you went and posted it with assumptions on stuff you didn't even know about. You should have fact check everything yourself too, with google first, and posted questions on appropriate websites (https://forums.alliedmods.net/), TF2Maps.net is not the best place if you look for expert on edicts.

I don't have time to fully review your guide right now. But you should start learning what is the difference between an ent and a temp ent. And with that you would have avoided wrong assumptions like this one
Similarly all unusual effects are an info_particle_system parented to the prop_dynamic.
, the unusual effect you see on a hat is the server that "told" the client to dispatch an effect on that hat, without creating any entities (and thus using an edict slot).
 

Benoist3012

L3: Member
Dec 25, 2015
148
207
Granted a could have and should have asked elsewhere, but how is TF2map.net not suitable?
Because if you want a good definition of "edict" you need to find someone who knows the code behind it, and where/why it's used, you have less chance to meet that kind of person on a mapping forum, than on a coding forum. I bet only 1-2% of tf2maps users fully knows what is an edict.
 

Hydrogen

MvM Maniac
Apr 5, 2017
84
181
I agree with @Benoist3012 that AlliedModders is definitely the place to go for technical questions related to the source engine, as this subject goes at a lower level than mappers are familiar with/expected to work with. As such, while you may see some people that know the subject well on TF2Maps, this is still not the best place for this discussion. I suggest crossposting this to AlliedModders and ask psychonic, asherkin or the other SM devs there for their feedback. They had to deal with these things when they wrote Sourcemod and still have to deal with it whenever Valve breaks Sourcemod.

You can use Sourcemod's entity natives and fiddle around with a plugin to see what entities are on a map and what you can do with them (FindEntityByClassname, GetEdictClassname, etc).

There is a hell lot more to edicts than what you have touched (edict_t, CBaseEntity, derived classes, etc) that AM can better explain. I don't blame you for having some incorrect info however; even I don't know everything about edicts and it's an iffy subject that only Valve knows the best about.

In response to the comments on the steam guide:
- Cosmetics are tf_wearable entities, not prop_dynamic (but they are entities nonetheless)
- Unusual effects are not parented by the server to the hat; the hat entity has a list of attributes, one of which is "attach particle effect" (#134) with a number. The client reads this attribute and its number from the item server and manually dispatches the particle effect on its end. The server knows nothing about the unusual.

There are other similar hacks Valve uses to lower the edict count (temp ents are one - the server creates an entity, dispatches it to the client, and lets it go, and the client renders it themselves). Ragdolls are not entities believe it or not - they are entirely client-side once they are dispatched.
 
Last edited: