Page 1 of 1

[solved] Particle System freezing

Posted: Sun Mar 11, 2012 11:09 am
by timmeh42
I've been fiddling with particles systems to try to make a "water-spray" effect, but I've run into a problem.
The particle system I am using seems to freeze up momentarily every few seconds - I don't know whether it freezes the whole game or not, but I'm assuming that to be the case. EDIT: It seems to stop rendering, and the particle emitter stops emitting, but when it unfreezes, the particles that have already been emitted had continued moving - which seems to suggest that it's updating particles that have been emitted, but not emitting any new ones. The window still shows the last rendered frame, not blankness.

If people could please see if they get the same problem, and whether they know what could cause it, it would be very useful.

The code from my main.lua file:

Code: Select all

function love.load()
	drp = love.graphics.newImage("droplet.png")
	sys = love.graphics.newParticleSystem(drp,1000)
	sys:setPosition(400,300)
	sys:setGravity(100,150)
	sys:setSpread(math.rad(30))
	sys:setEmissionRate(100)  --this may be causing problems, try increasing it if you don't get the wierd freezing
	sys:setLifetime(-1)
	sys:setParticleLife(4,5)  --this too
	sys:setSpeed(200,300)
	sys:start()
end

function love.update(dt)
	sys:setSize(math.random())
	sys:setRotation(math.random())
	sys:setDirection(math.atan2(love.mouse.getY()-300,love.mouse.getX()-400))
	sys:update(dt)
end

function love.draw()
	love.graphics.draw(sys)
end
The love file:
ParticleTest.love
(603 Bytes) Downloaded 120 times
If it has something to do with my computer's abilities to handle the (not all that large) number of particles in use, my specs are:
CPU: AMD Athlon II X2 245 2.9Ghz
RAM: 2Gbs DDR2-800
Graphics: ATI Radeon HD 4670

Re: Particle System freezing

Posted: Sun Mar 11, 2012 12:25 pm
by Nixola
I'm on na netbook, with an Intel GMA 945, 1GB RAM, Intel Atom N280 at 1.66 GHz and it runs at 60FPS... Did you try to update your drivers?

EDIT: Wait... Is your graphic card an Ati Radeon HD 4670, or just Ati Radeon 4670?

Re: Particle System freezing

Posted: Sun Mar 11, 2012 2:43 pm
by timmeh42
Woops, yes it is an HD4670. Downloading new drivers now, just to be sure.
Also, it runs at normal fps until the little freezing moments. Also, adding more info to OP

Re: Particle System freezing

Posted: Sun Mar 11, 2012 3:18 pm
by teh8bits
I have Intel HD Graphics 3000, which is just a part of my cpu (not sure if integrated is the right word) and this ran fine. Nice effect :)

It doesn't work with 0.8.0 btw, dont know if you knew that or not.

Re: Particle System freezing

Posted: Sun Mar 11, 2012 3:39 pm
by thelinx
teh8bits wrote: It doesn't work with 0.8.0 btw, dont know if you knew that or not.
0.8.0 isn't even out yet, don't try to force it down his throat.

Re: Particle System freezing

Posted: Sun Mar 11, 2012 3:40 pm
by teh8bits
I wasn't, I was just letting him know not forcing it down his throat lol.

EDIT:
Just looked into it, it's setSize in the update function that isn't supported in 0.8.0 yet.

Re: Particle System freezing

Posted: Sun Mar 11, 2012 3:57 pm
by timmeh42
... won't you look at that - I update my drivers and it's fixed. Admittedly, I probably should have done it first, but I only realised later that it had less to do with Löve and more to do with my computer. Still would be useful to know what the heck it was doing though.
Also I'm not bothering to waste time on 0.8.0 before it get officially released.

Re: Particle System freezing

Posted: Sun Mar 11, 2012 4:20 pm
by slime
teh8bits wrote:EDIT:
Just looked into it, it's setSize in the update function that isn't supported in 0.8.0 yet.
Actually in 0.8.0 setSize was renamed to setSizes and now supports lots of sizes. Same with setColor being changed to setColors.

Re: [solved] Particle System freezing

Posted: Sun Mar 11, 2012 11:29 pm
by teh8bits
Glad you fixed it :D

@slime
Oh yay new things to play with :D Too bad it breaks old code though

Re: [solved] Particle System freezing

Posted: Mon Mar 12, 2012 12:06 am
by slime
teh8bits wrote:Oh yay new things to play with :D Too bad it breaks old code though
That would probably be less of an issue if the developers didn't forget to put it in the changelog (hint hint...) :P