Damned env_sprites
Well, after a month of trying to figure why the damned plugin keeps crashing after an hour or so, I figured it out for myself.
Apparently the Source engine crashes when trying to remove env_sprites, also known as the American symbol above The Infected One and the sprites showing the Zombies where the American players are. At first I used
RemoveEdict(entity)
and it worked for the most part, but usually after an hour or two, the server would crash…perhaps because the Source Engine was trying to remove the same entity. So it became hit or miss.
Later I tried
AcceptEntityInput(entity, "kill")
but there was no difference in performance…after a couple of hours, the server would pack it in and reset.
All my debugging kept pointing to the same thing – removing an Allied sprite caused crashes.
My good friend MMX, a fellow server op at TheVille.Org did a good debug and his research pointed to Allied riflemen and attachments, which made sense.
I considered removing the sprites altogether, because server stability is always more important than a game feature.
Last night, after a good bath session, I changed how I made the sprites appear.
I have been aware of CTESprite temp ents for a while but figured out that I needed to be using CTEGlowSprites instead. Setting a life of 0.1s, full brightness, with a material with the highest z-order means that the Allied sprites now delete themselves after a life of 0.1s. Nothing to delete. No crashes. The game engine takes care of everything.
However, there are a few caveats. There is a perceptible flicker as the sprite constantly updates. In the heat of battle, it is not noticeable. In addition, the sprite does not completely stay with the model since the sprite is getting the coords of the player and then being teleported there every 0.1s. So when a player runs, the sprite doesn’t completely move with the player.
However, crashes are minimized and if it crashes now it usually because of a RemoveEdict or something like that.









