-
Status
- Closed
-
Project
- p4hl
-
Severity
- C
-
Reported By
- Sam Stafford
-
Reported Date
-
Modified By
- Shawn Hladky
-
Modified Date
-
Dev Notes
- Maybe.
Talking to folks at Valve would help, but recently I've made the
observation that my snark-dropping crossbow (thank you Wavelength) never
crashes Half-Life like expanding a hefty file does. Mayhap using the
CBaseEntity::Create method is better somehow?
(update) Using CBaseEntity::Create doesn't seem to help any. And yet it
does seem that the snark crossbow doesn't crash anything. What could be
different...?
(update) *bangs head against wall in frustration*
(update) Here's a thought - the server/client communication is limited to a certain
amount of data in one shot, right? Maybe the fact that I'm creating all those entities
in one instant is what's doing it - the server has to tell the client about all of them
in one message? The snark crossbow drops snarks one at a time.
The fix would be to create the entities not all at once, but to build a queue and spawn
them in batches during the Think() function....
(update) Tested it - YES! I was able to create 700 CObjectFiles at once. Past about 400 or
so the engine started to go into conniptions because there were too many objects visible, but
I had them all piled on top of each other so they wouldn't fly off the map. Once I implement
this for real with CObjectRevs I can experiment to see how high it can go.
Unconfirmed reports indicate that the server can handle 800 objects at once, but apparently the
client doesn't like to render that many. In any case, though, this'll let me create quite a few
objects without any crashing (the worst side effect of the "too many visible entities" problem
was that I ended up not being able to move). Boo yah.