- Oct 25, 2007
- 372
- 199
If you're like me, you use a lot of entities in your map. This can be a harmful thing when approaching the end stages of a very complex level, and I'm here to show you just why your level may be crashing on servers with only a few people up to 32 players.
According to the SDK wiki, the source engine can handle up to 4096 entities at a time. You may think you have that many to work with in your map, but in fact you have a good deal less than that. You see, play models in game, projectiles, whatever are considered entities as well and if there's a large number of them going off at once you may end up with a server crash that gets this engine error:
ED_Alloc: no free edicts
EDIT: 3/26/08
There is a second reason for a map that turns the edict error. If you are using too many of a certain type of entity, this will also crash the map under load, or even as the map loads, if there are enough of that entity type. If you use too many prop_dynamics or point_spotlight entities, the level will crash. There may be other entity types with low limits, but these are what I have encountered.
You can find how many you have by going to Map > Show Information in Hammer and adding up PointEntities and SolidEntities.
If you use prop_dynamic for your models, you can only have around 1600-1800 entities in your map. If you convert them to prop_static and limit your point_spotlight usage, you can easily have 3000+ entities in the map.
----------------------------------------------------
TESTING IF YOU ARE OUTSIDE OF "CRASH" RANGE
You should always test if your map crashes if you have a complex and intricate map. First, load up TF2 and in the console type "maxplayers 32". Next, Start your map.
It's handy to have a .cfg file similar to this in your "cfg" folder so you can exec bots.cfg and you'll have 31 bots with yourself on the blue team. Here's my bots.cfg:
sv_cheats 1
mp_teams_unbalance_limit 0
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot_mimic 1
Now, type "exec bots.cfg" in the console.
This will spawn 31 bots and make them mimic you. If you jump and repeatedly hold down fire, you can stress the number of entities being drawn and possibly crash the server if your map is over the limit. Note that IF you crash your local game, your computer _may_ be hardlocked. If you have a Logitech G15 keyboard, there is a program called G15 Task Manager (http://www.jasonweimann.com/g15Tools.aspx) that allows you to kill the process and not have to restart your computer.
Another useful bot command is bot_changeteam 1 which will swap all bots to the other team (you can use this to balance the teams with bots, but it's not really needed).
----------------------------------------------------
I'M OVER THE LIMIT! I'M CRASHING!
If you're over the limit, work on reducing things like spotlights and prop_dynamic if you have a lot. Combining func_detail can reduce the general amount of entities as well.
Have fun...... err. well, if you're having a problem like this you probably aren't having much fun.
Good luck
According to the SDK wiki, the source engine can handle up to 4096 entities at a time. You may think you have that many to work with in your map, but in fact you have a good deal less than that. You see, play models in game, projectiles, whatever are considered entities as well and if there's a large number of them going off at once you may end up with a server crash that gets this engine error:
ED_Alloc: no free edicts
EDIT: 3/26/08
There is a second reason for a map that turns the edict error. If you are using too many of a certain type of entity, this will also crash the map under load, or even as the map loads, if there are enough of that entity type. If you use too many prop_dynamics or point_spotlight entities, the level will crash. There may be other entity types with low limits, but these are what I have encountered.
You can find how many you have by going to Map > Show Information in Hammer and adding up PointEntities and SolidEntities.
If you use prop_dynamic for your models, you can only have around 1600-1800 entities in your map. If you convert them to prop_static and limit your point_spotlight usage, you can easily have 3000+ entities in the map.
----------------------------------------------------
TESTING IF YOU ARE OUTSIDE OF "CRASH" RANGE
You should always test if your map crashes if you have a complex and intricate map. First, load up TF2 and in the console type "maxplayers 32". Next, Start your map.
It's handy to have a .cfg file similar to this in your "cfg" folder so you can exec bots.cfg and you'll have 31 bots with yourself on the blue team. Here's my bots.cfg:
sv_cheats 1
mp_teams_unbalance_limit 0
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot
bot_mimic 1
Now, type "exec bots.cfg" in the console.
This will spawn 31 bots and make them mimic you. If you jump and repeatedly hold down fire, you can stress the number of entities being drawn and possibly crash the server if your map is over the limit. Note that IF you crash your local game, your computer _may_ be hardlocked. If you have a Logitech G15 keyboard, there is a program called G15 Task Manager (http://www.jasonweimann.com/g15Tools.aspx) that allows you to kill the process and not have to restart your computer.
Another useful bot command is bot_changeteam 1 which will swap all bots to the other team (you can use this to balance the teams with bots, but it's not really needed).
----------------------------------------------------
I'M OVER THE LIMIT! I'M CRASHING!
If you're over the limit, work on reducing things like spotlights and prop_dynamic if you have a lot. Combining func_detail can reduce the general amount of entities as well.
Have fun...... err. well, if you're having a problem like this you probably aren't having much fun.
Good luck
Last edited: