Particle System Editor

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Particle System Editor

Post 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

Image

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.
Attachments
particles.love
(116.55 KiB) Downloaded 1495 times
Last edited by adnzzzzZ on Sun Apr 07, 2013 6:58 am, edited 2 times in total.
Jackim
Prole
Posts: 12
Joined: Wed Apr 03, 2013 3:02 am
Location: Canada

Re: Particle System Editor

Post by Jackim »

Nice work! Maybe put something in to account for when someone presses the load button without any input. It just crashes.
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Particle System Editor

Post 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
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
Username
Citizen
Posts: 54
Joined: Mon Jan 28, 2013 1:25 pm

Re: Particle System Editor

Post 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

Image
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Particle System Editor

Post 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
User avatar
Username
Citizen
Posts: 54
Joined: Mon Jan 28, 2013 1:25 pm

Re: Particle System Editor

Post 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
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Particle System Editor

Post 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!
Attachments
Two-Stage Rocket.love
My physics teacher asked me to create a PowerPoint presentation about two-stage rockets vertical simplified kinematic. I hate Powerpoint, so this is it. F toggles fullscreen (just because my father wanted to see it bigger) and space pauses everything.
(4.79 KiB) Downloaded 541 times
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Qcode
Party member
Posts: 170
Joined: Tue Jan 10, 2012 1:35 am

Re: Particle System Editor

Post by Qcode »

Image
I'm on mac OSX 10.8 if that helps.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Particle System Editor

Post 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...
User avatar
Qcode
Party member
Posts: 170
Joined: Tue Jan 10, 2012 1:35 am

Re: Particle System Editor

Post by Qcode »

Sorry, I should have told you, I encounter this error on startup.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests