Page 1 of 2

Particle System Editor

Posted: Thu Apr 04, 2013 10:05 pm
by adnzzzzZ
This editor will let you create/edit particle systems, save them to files and load them into your game (and also load other's files to see what they created!). This editor was created with loveframes.

USAGE
Open the .love at least once so that the save directory can be created. .png files are used for sprites and .pso files are used to store template lists. Both types of files will be loaded if they're in the save directory. So, for instance, after running the editor once, take the Example.pso file and copy it to the save directory (AppData/.../LOVE/Particle Editor or as seen here for other systems). After that you should be able to see Example.pso listed in the editor and you'll be able to load it and see the particle system examples.

INTERFACE
jLYkf1S.png
jLYkf1S.png (39.11 KiB) Viewed 1100 times
Windows: the Particle Parameters window contains parameters for the main particle system and the Templates List contains a list of particle system templates created on the other window.
Restart (ALT-R): restarts the particle system. Doesn't do anything if lifetime = -1, for instance.
Add To Templates List (ALT-A): adds the main particle system template to the templates list. If another template of same name already exists it won't be added.
Set (ALT-T): sets the currently selected template as the main particle system.
Remove (ALT-R): removes the currently selected template from the templates list.
Save List (ALT-S): saves the current list (as TL Name.pso in the above image) to the save directory. If another file of same name exists it will be overwritten.
Load List (ALT-O): loads the currently selected list (Example.pso in the above image) to the templates list. If the to be loaded list contains templates already in the templates list then it will not be loaded.

GAME INTEGRATION

To load the particle systems contained in a .pso file to your game you should copy the getPSO function. A simple example: https://gist.github.com/adonaac/5314707. The returned table contains tables of format: name (string) - the name of the particle system and ps (ParticleSystem) - the particle system. With that you can just access the particle systems you created with the editor and use them in your game! Don't forget to change the default sprite in the getPSO function and then later to use setSprite if you want to change the sprite used by a particle system.

If you find any bugs feel free to report them in this thread.

Re: Particle System Editor

Posted: Fri Apr 05, 2013 4:06 am
by Jackim
Nice work! Maybe put something in to account for when someone presses the load button without any input. It just crashes.

Re: Particle System Editor

Posted: Fri Apr 05, 2013 9:31 am
by Germanunkol
Great idea! And looks quite nice, too! :)

What I always missed in particle editors was to be able to vary speed after initialisation. For programming explosions, I needed particles to slow down exponentially, which was a pain to code...
Maybe an acceleration value that can depend on the speed somehow would be nice?

Edit: and I miss size variation over time..?
Edit2: never mind, the tabs 1 to 8 seem to be doing size variation over time...?

I get an error when clicking on "Load List" on the right: main.lua 382 Expected filename

Re: Particle System Editor

Posted: Fri Apr 05, 2013 2:05 pm
by Username
Nicely done.

I maybe use it in my cards game instead of the actual primitive particle system I did.

BTW, this me "Maybe Fire" :3
1ysx5pG.png
1ysx5pG.png (101.14 KiB) Viewed 1102 times

Re: Particle System Editor

Posted: Fri Apr 05, 2013 2:54 pm
by adnzzzzZ
Fixed the loading bug.
Germanunkol wrote: What I always missed in particle editors was to be able to vary speed after initialisation. For programming explosions, I needed particles to slow down exponentially, which was a pain to code...
Maybe an acceleration value that can depend on the speed somehow would be nice?
You can get similar behavior with radial acceleration. Here's an example using it.
Germanunkol wrote: Edit: and I miss size variation over time..?
Edit2: never mind, the tabs 1 to 8 seem to be doing size variation over time...?
Size and color variation over time is done with the tabs. If you don't change the value or a certain tab it won't take it into account. If you change that value then it will be taken into account. So if you have the changed sizes = 1, 0.5, 0, for 1/3 of the time your particles will be size = 1, then 2/3 size = 0.5 and 3/3 size = 0. Same for colors.
Username wrote: BTW, this me "Maybe Fire" :3
Feel free to share it! I mean, if you want to... :3c

Re: Particle System Editor

Posted: Fri Apr 05, 2013 2:58 pm
by Username
adnzzzzZ wrote:
Username wrote: BTW, this me "Maybe Fire" :3
Feel free to share it! I mean, if you want to... :3c
Parameters are shown in the screenshot.

Colors were:
1 = Yellow
2 = white with 100 alpha
3 = red
4 = orange with around 150 alpha

Re: Particle System Editor

Posted: Sat Apr 06, 2013 7:21 pm
by Nixola
I've made quickly a "rocket engine" and an "explosion" (I'm sure they're pretty bad, but they're enough for what I need), great program!

Re: Particle System Editor

Posted: Sat Apr 06, 2013 10:53 pm
by Qcode
C3dnfsP.png
C3dnfsP.png (50.56 KiB) Viewed 1103 times
I'm on mac OSX 10.8 if that helps.

Re: Particle System Editor

Posted: Sun Apr 07, 2013 12:17 am
by adnzzzzZ
That doesn't really help me as I can't test with a Mac. But what list name did you use to cause that? I can't find a way to break it here...

Re: Particle System Editor

Posted: Sun Apr 07, 2013 2:31 am
by Qcode
Sorry, I should have told you, I encounter this error on startup.