Entity:Ignite burns my graphics card !!!


So i finished my dynamic updating fire. Everthing works server side. But client there’s a problem : when you place some props that can burn into my dynamic fire, the Entity:Ignite function will be called.
This makes my client to lag a little bit. And my graphic card i starting to take time rendering things.

Is there any way to stop Source Engine’s fire from making clients lagging a little bit ?

Optimize your [del]shit[/del] code.

Make sure to exclude the video card entity from the global table of entities.

env_fire is costly. Create your own particle system for the fire and keep track of the number of particles that way you get better control of the performance impact rather than relying on source to do the job.

That’s what i tried, but due to the fact particle systems can’t be placed into the game easly, i needed to leave this idea…

But yes i thought of this idea, but again Garry has put so much limits to these particles, that you can’t realy use them :

  • No ways to put them on workshop,
  • No ways to make them downloaded by fastdl,
  • Only way you have is by adding the pcf yourself to the particles folder, and then after, you’ll need to edit the manifest otherwis it will not load the particle.

[editline]18th February 2015[/editline]

Oh i forgot, even util.IsValidModel will not be able to know if the pcf is here or not !

util.IsValidModel is nothing to do with particles, you can load particle files via game.AddParticles.

You claim that everything is broken but in reality you just don’t know how to use it or that it exists. I suggest you do more research before you post.

Yes but that doesn’t solve the problem that you can’t place particles in your content addon and push it to workshop, so everyone can download your missing PCF, isn’t it ?

You could draw simple animated sprites rather using particle system, if you are so concerned about performance.

You can, at least in the next version of the game. ( Dev branch )

But actualy yes, I care (much) about client AND SERVER performences. I don’t want to have a server which don’t answer in time or a client that can’t play because of too lower framerate. The only computers i’ll not support are non DirectX compatible graphics cards or Pentium (which aren’t able to handle physics !) cpus…

Yes however, animated sprites are a big pain for me. I need a tick hook just with the Draw function, because otherwise, i can’t change textures at regular intervals. So adding many many of those fires will maybe cause a problem to the client, and the fire itself can began to act wrong…

Here is the rendering functions for my fire (animated sprites) :

If that’s true, then i’ll maybe wait until release of this next version before I open the server !
Where is the changelog of this next version ?

You can find all the info about next update in Next Update thread.

As for your FPS issues, the biggest problem I see with your code is that you are using !!!500!!! different textures and you are not even caching the Material() calls.

You are using waaay WAAAY too many textures there for such a simple thing and you should cache Material() calls.

How to cache Material() calls ?
And for the texture problem, these 500 textures are needed otherwise, it looks not as much realistic…

I repeat once again, 500 textures is a huge overkill.

local mat = Material("mymat")
hook.Add( ..., function( ... )

render.SetMaterial( mat )
end )

This is how you would cache a single function call.

Yes but how do i cache every 500 materials, i’ll not set a var for every 500 textures ?

Well, you shouldn’t be using 500 of them in the first place, but either way, you can just put them in a table.

Oh thank you i just don’t thought of puting them in a table.

[editline]18th February 2015[/editline]

I maybe made a mistake, but by analizing images by a software, image N°200 is same as image N°0 at 99.7%. It seams that it’s mounted in loop !

After trying your idea about tables, it worked very well (much FPS gain on rendering) but it crashs the client when the entity initializes !

I think i’ll let only 199 first files in the folder. My analyse software tell me to let only 100 files, but when i render my fire with only 100 files, sometimes the render stops to render and theres transparent area…

[editline]18th February 2015[/editline]

Ok, finaly 100 isn’t too bad… So i decided to take only 0 to 99 textures files so only 100 of them, which lokks like before, with not su much difference.