PFX Filebased Particlesystem FPS-Test

BlitzMax Forums/BlitzMax Programming/PFX Filebased Particlesystem FPS-Test

Justus(Posted 2006) [#1]
PFX Filebased Particlesystem

That's the name of my current project, a module, which allows the easiest implementation of particle effects the world has seen yet.

The most significant difference to existing particle engines like ParticleDreams and [P]articlySky is, that PFX is based in files. You don't have to create you effects hardcoded and are able to outsource this kind of media. The concept is to handle effects like sounds: Load it, play it, done.

Here is an example how to use it; with these few lines of code you can extremely easily implement complex effects:
SuperStrict
Import justus.pfx

SetGraphicsDriver(GLMax2DDriver())
Graphics 800,600,0,60
SeedRnd MilliSecs()

Global manager:TPManager = New TPManager
Global effect:TEffect = manager.loadEffect("explosion.txt")

Repeat
	Cls
		
		manager.update()
		manager.draw()
		
		If KeyHit(KEY_RETURN) Then effect.play(Rand(0,800),Rand(0,600))

	Flip
Until KeyHit(KEY_ESCAPE)


Special features:

• Tweening - You just set the length of the effect, a start value and an end value. All values in between will be automatically calculated.
• Optional: Playing sounds - You can automatically play a sound when you play an effect
• OO und procedural

To do:

• Variation during the runtime. At the moment this is only possible during the loading. So once you have loaded an effect it will stay the same. Runtime variation will make it look different every time you play it.
• Unfortunately autoplayed sounds don't work at the moment, still a little bug in the loader.

I would be happy if you could send me some feedback how the performance turns out to be on your systems. Just post some FPS numbers at ~250 processed particles and your system specs.

Screenshot:
http://gallery.justus-software.de/view.php?id=40

Sample-Download [~800KB]:
http://www.download.justus-software.de/pfxsample.zip

The release module will of course be presented seperately, but only after some sessions of testing and optimization.


BlackSp1der(Posted 2006) [#2]
0 particles = 330 FPS
220~260 particles = 45 FPS

P4 3.2Ghz video onboard Intel 910GL


Justus(Posted 2006) [#3]
Thank you! How about some feedback; is this the idea the world was waiting for or just unnecessary nonsense?