[solved] Particle System freezing

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

[solved] Particle System freezing

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:setEmissionRate(100)  --this may be causing problems, try increasing it if you don't get the wierd freezing
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
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
Last edited by timmeh42 on Sun Mar 11, 2012 3:57 pm, edited 3 times in total.

Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Particle System freezing

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?

lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
li = love.image
lg = love.graphics

timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Particle System freezing

Also, it runs at normal fps until the little freezing moments. Also, adding more info to OP

teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

Re: Particle System freezing

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.

thelinx
The Strongest
Posts: 848
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Particle System freezing

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.

teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

Re: Particle System freezing

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.

timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Particle System freezing

... 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.

slime
Solid Snayke
Posts: 2918
Joined: Mon Aug 23, 2010 6:45 am
Contact:

Re: Particle System freezing

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.

teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

Re: [solved] Particle System freezing

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

slime
Solid Snayke
Posts: 2918
Joined: Mon Aug 23, 2010 6:45 am