My 2d particle library! Updated

Everything else that doesn't fall into one of the other PB categories.
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Post by MrMat »

That looks really nice. The right click explosions are my favourite :)
Mat
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

Works great on my laptop!

Debugger off:

61 FPS with an average 52,000 particles

Debugger on:

11 FPS with an average 49,000 particles

Note: Debugger on and right-clicks slowed my machine down to 2 FPS! Ack!

:D

Thanks for sharing!
Intrigued - Registered PureBasic, lifetime updates user
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Looking nice, with debugger enabled or disabled, it doesnt matter, 6,000 particles slow it down to 4FPS. Still, not bad at all :) Got any more up your sleeves?
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Shannara wrote:Looking nice, with debugger enabled or disabled, it doesnt matter, 6,000 particles slow it down to 4FPS. Still, not bad at all :) Got any more up your sleeves?
6000 particles at 4 FPS, that's bad :lol:
I think the "engine" is fast enough as long as you don't right click...
And I really want to know how I can make it even faster :D

And everybody, thanks for the nice comments! :D
I'll see if I can make it into a nice screensaver with random fireworks someday.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Well, for left click, the highest it has gotten is 56,000, and stayed around that, but thats at 46FPS. So not shabby :)
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

@Joakim Christiansen: This is absolutely awesome & beautiful !! Works well on my Dell Optiplex. Thanks for sharing your code. I think my young kids will enjoy seeing this!
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Should be able to make it faster by plotting directly in the screen buffer, but i'm not shure how to do that. (could anyone do that?)

And if there is many particles on the screen and I make new particles with mb-right it gets mysteriously slow..., but the mb-left particles don't slow down that way. I think it got something to do with linked list mess... :lol: (but I think there might be a smart way to make it faster...?)
Hatonastick
Enthusiast
Enthusiast
Posts: 149
Joined: Wed Apr 27, 2005 11:50 am
Location: Adelaide, Australia
Contact:

Post by Hatonastick »

Very nice. :)
Please forgive my poor English, I'm an Australian.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

I just found a way to make it even faster, you can now hold down the right mousebutton without getting a slowdown! :shock:
I updated the first post with new code, go and get it! :wink:
I like logic, hence I dislike humans but love computers.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

dont work here with v4 final... macro error on this line :roll:

Code: Select all

If  PL_Particle()\Step >  PL_Particle()\Duration Or  PL_Particle()\X <0> #ScreenWidth-1 Or  PL_Particle()\Y <0> #ScreenHeight-1
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

va!n wrote:dont work here with v4 final... macro error on this line :roll:

Code: Select all

If  PL_Particle()\Step >  PL_Particle()\Duration Or  PL_Particle()\X <0> #ScreenWidth-1 Or  PL_Particle()\Y <0> #ScreenHeight-1
I'm also using PB4 final, I don't understand this :?

It gives you an error on that line if #ScreenHeight and #ScreenWidth is not declared.
Did you save both files and executed the example?

And yeah, I know it's stupid, but I don't know any other way of getting the screen width and height...

EDIT: Oh... I now see what you're talking about!
The forum messed up the code... bether download it then!
Last edited by Joakim Christiansen on Tue Jun 06, 2006 10:50 pm, edited 2 times in total.
I like logic, hence I dislike humans but love computers.
aaron
Enthusiast
Enthusiast
Posts: 267
Joined: Mon Apr 19, 2004 3:04 am
Location: Canada
Contact:

Post by aaron »

Wow, works fantastic on my old 1 GHz Dell laptop.... drops to roughly 40 fps with 20000 particles (holding right mouse) and around 25 fps with 50000 particles (holding left mouse). Impressive.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Joakim, the latest update works well for me (Dell P4) - getting around 70 FPS. Thanks for making it available.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

mskuma wrote:Joakim, the latest update works well for me (Dell P4) - getting around 70 FPS. Thanks for making it available.
:)
I'm now going to make a fireworks screensaver with random explosions, it's allready looking neat!
I like logic, hence I dislike humans but love computers.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

going to make a fireworks screensaver with random explosions
Joakim, bring it on! please let us have a look!:)

BTW something weird going on with these quotes lately? I've had the same trouble.
Post Reply