New Particle Engine for BlitzMax

BlitzMax Forums/BlitzMax Programming/New Particle Engine for BlitzMax

maverick69(Posted 2007) [#1]
Hi BlitzMax-Devs ;-)

I'm currently working on a 2D Particle Engine for BlitzMax, that we will use for our game projects.

I have now finished the first beta version of our Particle-Editor to create all those fancy & cool effects and particle animations.

It would be nice if you can have a look at it, and let me know if you've found any bugs or any suggestions for improvments.

You can download it at:
http://www.intermediaware.com/index.php?id=290

Here is a screenshot:



If there is enough interesst I will release the whole engine, including all source files - probably for 10$ or 20$ or something like this.


Murilo(Posted 2007) [#2]
That looks very sexy. I'll definitely take a look when I get home...


Gavin Beard(Posted 2007) [#3]
same here, very swish, will certainly sneak a peek when i return home laterz


SpaceAce(Posted 2007) [#4]
Hm, I was just about to start a BlitzMax particle system but I'd rather spend $10 on yours. The effects are pretty nice.

Some thoughts:
The interface is a real turnoff. I don't like the huge panel of sliders. If you've ever used any of the commercial particle generation software, they tend to group similar options under tabs or expanding menus.

The sliders should update as you drag. It's a hassle to have to guess where to stop dragging then be forced to fine-tune the slider position with the arrows on the ends.

The file dialog should remember the last folder used.

Drag-and-drop would be nice.

The project looks pretty good so far, let me know when it's done and I'll be one of the first in line.

SpaceAce


RiK(Posted 2007) [#5]
Is the editor made in MaxGUI?

i.e. will you be supporting Mac / Linux?


Grey Alien(Posted 2007) [#6]
Looks swish. Does it have an option to save the animation as a png animstrip with transparency, that would be cool.


Ghost Dancer(Posted 2007) [#7]
Shiny :) My brain is too fried to try it now but I'll def have a look tomorrow


maverick69(Posted 2007) [#8]
first of all thanks to you all for your posts.

@SpaceAce: Grouping similar options is a good idea. I will work on the interface again to make it more comfortable. I also agree, that the sliders should update as you drag. Just have to find out how this is possible with MaxGui :-)

@RiK: Yes, the editor is made in MaxGUI. I don't have an Mac yet, but if anyone is interessted to compile it for mac please contact me. I think I don't have used any Win-specific code.

@GreyAlien: I will also put this on my todo list. It should be possible to work out a function, that saves the animation as a png-animstrip file.

I will post the new version as soon as I have one.

Btw: Are you missing some additional parameters?


RiK(Posted 2007) [#9]
Maverick69: I'll compile it for you if you like, my email is in my profile :)


RiK(Posted 2007) [#10]
To do the updating sliders you need to use eventhooks.

Example ripped from something I did a while back:




maverick69(Posted 2007) [#11]
@Rik: Thanks, I will contact you as soon as I have a final version to compile. And thanks for the code snippet. I will implement it to make the sliders react instantly (The renderwindow is already updated using EventHooks, so it should be no problem).

At the moment I thinking about making this project something like a (small) Blitz Community Project. So I'm sharing the source I already have and we work together on it to make it the best and the fastest free Particle-2D-Engine for BMax? Do you think that there are enough people how would help on starting and keeping such a project alive?


H&K(Posted 2007) [#12]
Do you think that there are enough people how would help on starting and keeping such a project alive?
No.

Look at MiniB3D which had the best possibility to become a "Community project", and apart from a couple of people (Most notably Klepto who even went so far as to start a google community code site), its been left to simonh.

Community projects just dont really work for Blitz.

We are not a community, were just a bunch of geeks who use the same minority programming language


maverick69(Posted 2007) [#13]
MiniB3D is a big project. Compared to MiniB3D this would be a rather small project., but probably you're right. I just don't know...


H&K(Posted 2007) [#14]
Honestly Maverick, what you have got so far is good. Just finish it, then either give it away with donations or sell it. As you said its not big enough to be a "Community" deal.


Grey Alien(Posted 2007) [#15]
We are not a community, were just a bunch of geeks who use the same minority programming language
lol, harsh but maybe there is some truth in there.


Scaremonger(Posted 2007) [#16]
You say that community projects do not work. Maybe it's just that we don't know where to find them.

If we all knew what was being worked on and what was available; then maybe we would finish something thats nearly done rather than re-inventing the wheel by developing our own code.

Incidently; Where do I find community projects?


tonyg(Posted 2007) [#17]
Fmod Community project
IDE Community Edition
Maxphysics : Community project
Normally they are sticky with Community in the title.
Maxphysics was unstickied as nothing much was happening. In fact, nothing really much happening with any of these.
You could try a Particle System Community project as it does seem more manageable.
<P.S. Not sure why you'd want it as a Community project instead of releasing the source and asking for improvements.


Pantheon(Posted 2007) [#18]
The particle program is looking realy good Maveric,
i have a few contributions:

- the window is not resizable so on the uni computers the bottom of the window is clipped off the screen (1024x765).

- maby rotatory dials like you would get in sound software would be more space econmical?

- i cant find any way to kill a current particle emiter. perhaps this could also be a default action when you load a new prt file.

- perhaps a checkbox to toggle the drawing of the centre of an emiter (and each particle) would be handy.

Sorry if any of thats allready in the program, I only had a quick play with it. Other than that it seems realy nice (sweet and simple).


I have to say that it would be brilliant to have some new forum topic for comunity projects or something. I think mark said he was looking into subversion (perhaps just for blitz max source though), something like that would be great for working together.


North(Posted 2007) [#19]
I'm really interested in this.
It would be very handy if one could record mousemovements to act as emitter paths. This paired with layers would give a very creative tool.
Releasing the code would be a nice move so maybe someone will pick up and improve bits but there never is a guarantee for that.


anawiki(Posted 2007) [#20]
Your particle engine is looging good. I tried to do my own effect but failed to setup layer 2. I couldn't set "flower" to rotate.

Let me know when you finish it - I might be interested in it (source + editor).


SpaceAce(Posted 2007) [#21]
Is this still being worked on? I really want this.

SpaceAce


kronholm(Posted 2007) [#22]
Very nice!


Chroma(Posted 2007) [#23]
Any status on this particle app?

EDIT: Very nice particle effects editor. It's a bit hard to fine tune though. As in the alpha fade rate didn't give enough resolution to really get a candle flame and smoke going. Since it's a WYSIWYG type thing. I couldn't get a decent sized candle flame and smoke rolling lazily up off it. I'm still messing about with it though.

Hmm...ok I'm getting the hang of this. This is a very nice tool.

Ta Da!



Chroma(Posted 2007) [#24]
Would be nice is someone could do something like this that saves a seamless loop with a transparent background!


maverick69(Posted 2007) [#25]
hey - i'm still working on it, but i had not much time because of other projects during the last two weeks. i hope to post an update in a few days. thank you all for the suggestions...


Chroma(Posted 2007) [#26]
Heya mav, I'm becoming quite the fan of this. One thing that is kinda odd is the alpha value. Sometimes it looks like 0.-1 And I want to set it to values like -0.01 or even -0.001 and it won't allow me too. Same with Gravity Y. Also I'd like to be able to set the rotational direction (left or right or) and also random (where it goes either left or right). And the rotational speed.

Great looking app though. Can't wait for another demo or something that spits out source code.


maverick69(Posted 2007) [#27]
in the latest version you can enter the values using the keyboard into the textfields. i've also removed some bugs. i think i will upload a new beta version by the end of this week.


maverick69(Posted 2007) [#28]
@chroma: oh - and it won't generate source code for you, but you will have some types where you can load, change and play the effects easily...


Chroma(Posted 2007) [#29]
Right, so it will spit out the settings you need to put into the particle effects function then? Either way works for me.

Does it run off deltatime?


Chroma(Posted 2007) [#30]
Heya Maverick...and word on the particle engine? :)


SofaKng(Posted 2007) [#31]
I'd also REALLY like to use this...


maverick69(Posted 2007) [#32]
Sorry for the delay, I had a lot of other projects to finish. But I have also continued work on the Particle Editor. You can download the latest beta editor here (I updated the link):

http://www.intermediaware.de/dev/ParticleEditor_Beta.zip

A lot of bugs are removed, we have input fields now, so you can enter the values directly, the sliders do update as you drag them, the file dialog remembers the last path, and you have a option so the emitter always follows the mouse automatically - which is very handy.

I hope you like it. Keep posting bugs and improvements. I really hope to release the first version incl. source code very soon.

The source code you have to use will look like this:
Import "TParticle.bmx"
Local ParticleFX:TParticleFX = ParticleFX.Load("particles/MouseFX.par", True)

While (1)
   Cls
   ParticleFx.MoveTo(MouseX(), MouseY())
   ParticleFx.Render(True)
   Flip
Wend


Of course you have also direct access to all settings in real time, this is only an example how simple it will be to include standard particle fx in you source, that are created with the ParticleEditor.

By the way: I'm currently thinking of a nice name. If you have anything nice or cool in mind, please let me know ;-=


Chroma(Posted 2007) [#33]
Oh joy! Can't wait to get home and download it.


SpaceAce(Posted 2007) [#34]
The fields still don't update in real time for me, whether I drag or click-and-hold on the left/right arrows.

I eagerly await the finished product. Please finish this before I am forced to write my own!

SpaceAce


McSeb(Posted 2007) [#35]
Can't download :( actually can't even reach your server :(


maverick69(Posted 2007) [#36]
@SpaceAct: Sorry, should work now :-)
@McSeb: Yeah, I had some problems with my server during the last days. Hope it will work better now.


maverick69(Posted 2007) [#37]
I have now finished the first complete version of the Particle Engine. I have named it Smash Particle Engine, the editor is called SmashEd ;-)

You can download the free demo at:

http://www.intermediaware.com/index.php?id=290

You can also order the full version there. Here are the features:

Powerful, easy to use Particle-Editor
Powerful Engine, Easy to integrate into your own BlitzMax-Projects
Up to 10 Emitter-Layers for each effect
Over 30 Parameters for each layer to create complex and stunnig particle animations
Full Editor Source-Code
Full Engine-Source-Code
Documentation
Demo-Source Code
Free Support
Access to our community board
Free Updates

Of course, I will continue development on it. Every registered user will get the updates for free. I have some cool ideas in mind for the futures...


Chroma(Posted 2007) [#38]
maverick, if you don't mind...when I complete my match 3 source I'm going to refer people to your Smash Particle Engine to incorporate particle effects. I have too much to do to create a particle effects engine. :)


maverick69(Posted 2007) [#39]
@Chroma: that would be nice :-)


tonyg(Posted 2007) [#40]
Hi Maverick69.
Can't find a forum for Smash so will post here.
Why does 'Launch Rate = 11' stop the default particle?
Is there a way to get the sliders really mean '0' when the slider is at zero? Currently 'Emission Rate=0' means 1 and 'Emission Rate=1' means 2.
I notice you have used lists for the particles.
Did you test with pre-populated arrays of TParticles which are 'recycled'?
Also, what is 'Frames'? I'm guessing it is number of frames rather than framerate Is that right?
If so, how can I view framerate?


pls(Posted 2007) [#41]
I'll buy if it works on mac os x. Does it? Anyone tested it?

PLS


SculptureOfSoul(Posted 2007) [#42]
Ooh, I'm going to have to consider this. I wonder how well I could integrate this into my behavior system.

Is the system designed around OOP principles?


Jake L.(Posted 2007) [#43]
@maverick, just a small hint: double-check that everything you sale is 100% yours. Maybe you missed something...


tonyg(Posted 2007) [#44]
@maverick69... hello? Are you there?


tonyg(Posted 2007) [#45]
Answers to my own questions :
Why does 'Launch Rate = 11' stop the default particle?

Because 'Emitter duration' is set to 10.

Is there a way to get the sliders really mean '0' when the slider is at zero? Currently 'Emission Rate=0' means 1 and 'Emission Rate=1' means 2.


In TParticle change
				For Local i:Int = 0 To EmissionRate

to
				For Local i:Int = 0 To EmissionRate-1

Also, what is 'Frames'?

Frame number in the Emitter duration. The frame 'counter' should really stop when the emitter is finished and loop mode is not enabled.
<edit> e.g.
		If tp.loopfx Or Not tp.Emitter[0].finished()
			DrawText("Frame: "+String(tp.Emitter[0].frame),10,10)
		EndIf



tonyg(Posted 2007) [#46]
@Maverick69, while I see you're posting : Anything to add?


maverick69(Posted 2007) [#47]
Sorry, for the late answers. I wasn't around often here the last days/weeks...

Did you test with pre-populated arrays of TParticles which are 'recycled'?


Not really. I think it should be faster if you're using arrays.

Also, what is 'Frames'?


This are the number of frames before the particle will be looped/stopped.

BTW: Why do you want to set EmissionRate to 0?

@pls: A customer has already compiled it sucessfully on mac os x.

double-check that everything you sale is 100% yours.


What do you mean? The whole source and editor is 100% mine?

Is the system designed around OOP principles?


Yes.


maverick69(Posted 2007) [#48]
btw: i created the community forum here:
http://www.intermediaware.com/forum/viewforum.php?f=17


Dreamora(Posted 2007) [#49]
Yes but the texture you give out with the link above is definitely not yours, its the texture of ParticleCandy, a commercial particle system for Blitz3D


tonyg(Posted 2007) [#50]
BTW: Why do you want to set EmissionRate to 0?


Not sure yet. I might want to adjust it 'in-game'.
For the time-being, when the editor says 'Emission Rate 1' , I want it to mean 1 and not '2'.


Jake L.(Posted 2007) [#51]
@maverick: like Dreamora said. Ok, you replaced 2 out of 9 particles in the image, but the other 7 are exact copies (including their positions within the image) of ParticleCandy's default texture. I personally don't care about this, but as creating an own particle texture is a matter of minutes it isn't really neccessary to copy&paste from others.

Everyone can download that picture without buying PCandy, so it isn't a big deal, but at least you should ask the author of PCandy or give credits to him (better both).


pappavis(Posted 2007) [#52]

We are not a community, were just a bunch of geeks who use the same minority programming language



Like the last of the die-hard Amiga-users out there who still surf the web on their Amigas, programming whatever to get a job done. Somehow it seems that many BlitzMax-geeks used to own an Amiga.


MrTAToad(Posted 2007) [#53]
Looks nice - one thing though : If you press the cancel button when doing a Save As, the program exits.


maverick69(Posted 2007) [#54]
Regarding the particle cadny textures. You're right. I'm sorry. I will replace it asap! The reason it happend was, that a few years ago I purchased ParticleCandy to create particles for our game Absolute Blue. Now I took these particles from our games folder and had forgotten that it was taken from ParticleCandys default textures.