• Entity:Ignite(number, number) will not work after about 100 ignited entities
    9 replies, posted
Hi all, First of all, i would like to thank you all of you who had helped me so much ; so i could release a good and stable version of my RealisticRoleplay Gamemode. But i have now something less importent, it's just a bug that i would like to solve. So to explain in brief, i created a fire dispenser system, witch is able to be extingushed using Extinguisher mod. So evreything works fine expect that if i try to dispense more than 100 ignited "ignited_prop" (it's a special prop that is invisible and is permanently on fire ; it removes if Extinguisher mod is extinguishing it.), the 101 entity won't ignite. Is that normal ? Do you have an idea ?
Most likely there's a memory leak in the entity itself. It may not be getting removed 100% properly, or the effect may not be getting removed. Post your code?
[QUOTE=Acecool;45556813]Most likely there's a memory leak in the entity itself.[/QUOTE] What makes you say that? Do you even know what a memory leak is?
[QUOTE=EvacX;45556847]What makes you say that? Do you even know what a memory leak is?[/QUOTE] Does it look like this? .... This is a memory leak caused by an effect not releasing correctly and overflowing. First the leaves disappear, then the trees, then many entities on the map ( or models like the trees ).. [quote][IMG]https://dl.dropboxusercontent.com/u/26074909/_server/bugged_gmod/2012-12-23_00003.jpg[/IMG][/quote] ... Yes, I know what a memory leak is. It sounds like his issue could be a memory leak with it not spawning the effect correctly could be an issue of it not releasing the material, or calling Material( ) in the render function each time it passes. If the ignition is always for a SET time, then it makes sense that the 101th may never render if the effect renders enough times to overflow by the 101th... There's a reason I asked to see the code to take a look and see if something sticks out..
I haven't found a problem with more than 100 entities - although things slow down a little - but I have noticed that items which have already been ignited and are no longer on fire are still considered to be on fire by the engine when calling ent:IsOnFire() - that might be something I've done though.
I've have seen issues with textures themselves in the past. There is one smoke-grenade texture 0000-0016, or so, in particular that would cause a memory leak / overflow issue. Are you drawing the effect yourself or using a Valve Entity? If you're rendering the effect yourself, are you using any texture like what is referenced above? I had so many issues when trying to use it for vehicle exhaust, and other things. I ended up using: sprites/heatwave, particle/particle_smokegrenade, particles/smokey.vmt, and rarely particles/flamelet" .. math.random( 1,5 ) .. ".vmt" So, even if it isn't the "code", it may be a texture and how it is handed within the engine.. If you want some help debugging it, feel free to add me on Steam if you don't want to post it here!
Acceol, If you want to help me on steam then ok, I will send you a pm with my username. And for your idea of memory leak ; it's not, there is no rendering bug, no client lag, no server lag, it's that after 100 ignited entities, I need to extinguish them to be able to spawn again fire in map. So it can't be the entity that is not correctly removed. To explain more about that, we'll, I'm using valve's Source Engine's built in entityflame. Because it's not the first time I got this issue. Indead, in my VehicleController, sometimes, the fire to prevent car explosion, is not spawning.
The 100 flame entities limit is actually a limitation garry added, because there's no limit for that in source , if you want to see this fixed make an issue [URL="https://github.com/Facepunch/garrysmod-requests/issues"]here[/URL]. I believe garry did it because each flame entity counts towards the entity limit, so if you try to ignite 2000 props it'll create 2000 extra flame entities, and that's not really cool. You should probably handle the flames yourself in a better way imo, look at the [URL="https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/EntityFlame.cpp"]source[/URL], you can probably replicate it easily. [editline]1st August 2014[/editline] [URL="https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/baseanimating.cpp#L3353"]Also this.[/URL] Most notably the EF_ONFIRE flag.
Ok thank you... That's what i was thinking ! Thanks garry another time. I will need to find a way to hack the game and let me create 9999 Fire Entities.
Sorry, you need to Log In to post a reply to this thread.