We ran into this problem in TF2. The problem is that the engine won't
re-use edict slots for a small amount of time, to avoid networking
problems with lag potentially causing client / server confusion about
what entities. So when you destroy and recreate a lot of entities in a
single frame, the edict slots for the destroyed entities won't be reused
by the newly created ones. Which means you need to have enough edict
slots to store 2x your recreated entity count.

If you're using the OB engine, you can use the new feature we added for
TF2, by calling this function after you delete your entities and before
you recreate them:
        engine->AllowImmediateEdictReuse();
This will run through the edict list and mark all slots as immediately
re-usable.

Note that if you're hitting this with an empty map, it's more likely
that you've got a bug. The max edict count is 2048, and it's unlikely
you're hitting that with just your weapon entities. You may have some
endless loop recreating entities over & over again.

Also, we tried a similar process in TF2 of recreating the weapon
entities on respawn, and found the network traffic resulting from
players respawning (localplayer gets a big update with the new weapon
entities), and other players entering your PVS (their new weapons are in
different slots than the ones you last saw them with, since they've died
& respawned) were significant. We changed it so that the weapons are
only destroyed & created when players change class, and saved a bunch of
network bandwidth. You might want to do something similar.

Robin.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John
Sent: Monday, April 28, 2008 2:53 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Map reset.

When the map is reset in my mod (with more than 10 players), I get the
error
'No free edicts'. I've tracked it down to the weapons given to the
players
on spawn, each receiving about 6 weapons each. Is there anything I can
do
to? (yes i've even tried it on a empty map)
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to