[solved] Particle System freezing

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

[solved] Particle System freezing

Post 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
Last edited by timmeh42 on Sun Mar 11, 2012 3:57 pm, edited 3 times in total.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Particle System freezing

Post 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?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Particle System freezing

Post 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
User avatar
teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

Re: Particle System freezing

Post 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.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Particle System freezing

Post 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.
User avatar
teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

Re: Particle System freezing

Post 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.
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Particle System freezing

Post 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.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Particle System freezing

Post 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.
User avatar
teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

Re: [solved] Particle System freezing

Post by teh8bits »

Glad you fixed it :D

@slime
Oh yay new things to play with :D Too bad it breaks old code though
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: [solved] Particle System freezing

Post 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
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 58 guests