Working On A Particle System For Buildbox 3

Discussion in 'Buildbox General Discussion' started by Ivan Perfetti, Oct 16, 2020.

  1. Ivan Perfetti

    Ivan Perfetti Boxer

    Joined:
    Sep 9, 2018
    Messages:
    98
    Likes Received:
    103
    Hi all! I've been working on a particle system for Buildbox 3 for a few days now; hopefully we'll see an official one sooner or later, meanwhile here's a preview of my system, coming soon to indym.itch.io!
    What do you think about it?
    Please share any comments/ideas, thank you!

    (Videos updated on date 24/10/2020)

    [​IMG] [​IMG] [​IMG] [​IMG] [​IMG] [​IMG][​IMG]
     
    Last edited: Oct 24, 2020
  2. deyren

    deyren Boxer

    Joined:
    Jul 26, 2018
    Messages:
    33
    Likes Received:
    10
    Last edited: Nov 25, 2020 at 5:06 AM
    Ivan Perfetti likes this.
  3. 5petersonzachary

    5petersonzachary Serious Boxer

    Joined:
    Jan 23, 2016
    Messages:
    548
    Likes Received:
    162
    Looks incredible! Will it run smoother then using debris explosions and spawn nodes?
     
    Ivan Perfetti likes this.
  4. Ivan Perfetti

    Ivan Perfetti Boxer

    Joined:
    Sep 9, 2018
    Messages:
    98
    Likes Received:
    103
    Well, having it to run smooth is one of my concerns; I'm going to test it soon on a couple of devices to see how it performs.
    I'm going to add any possible optimization and some trick to increase performance but in the end it will also depend on the particle settings itself; what I mean is that if you're going to use physics enabled particles able to collide with other particles or entities that might greatly reduce performance as well as heavily using transparencies which are required to obtain many particle effects.

    Meanwhile here's a new clip of the effects I've obtained until now:
    - 2 type of fires
    - rain
    - snow
    - rainbow/plasma arc
    - portal



    I've now added a whole lot of attributes to allow to customize the particle system in a way that you can:
    - create an infinite number of particles systems coexisting in the same level/world, each system identified by a unique identifier you can set. To create a particle system you just drop an Emitter object and configure its attributes.
    For each particle system (emitter) you can:
    - Define how many particles per second will be emitted.
    - Define wake up / sleep distances.
    - Select a particle model (for now I've tested two, both textured, a flat one and a spheric one; most of the systems you see in the demo are made with the flat one, only Fire #2 is using a sphere model as of now).
    - Define gravity, linear velocity, angular velocity and starting position (relative to the emitter) with two sets of XYZ values each, one fixed and the other to add randomness.
    - Define up to 5 color transitions (for example start as white, will become yellow, then red, then black, etc.) and specifiy for each one color, duration and easing function.
    - Define up to 5 scaling transitions (to change the size) and specify for each XYZ size, duration and easing function.
    - Define particle behavior upon collision with path/ground with some boolean values: Remove Particle (checked by default), Leave mark Y/N (useful for rain and snow effects for example; might change this to allow to specify collision with specific objects/characters or add other behaviors.

    That's it for now, more particles coming soon! :D
    Comments and suggestions are always appreciated!
     
    Last edited: Oct 17, 2020
    5petersonzachary and Roberto P like this.
  5. 5petersonzachary

    5petersonzachary Serious Boxer

    Joined:
    Jan 23, 2016
    Messages:
    548
    Likes Received:
    162
    This is going to be awesome! Are you planning on releasing this for people to purchase?
     
    Ivan Perfetti likes this.
  6. Ivan Perfetti

    Ivan Perfetti Boxer

    Joined:
    Sep 9, 2018
    Messages:
    98
    Likes Received:
    103
    Hey, thanks for the support! :D
    I'm planning to put the Particle System for sale on indym.itch.io once it's ready.
    I'm going to make some tests on an iPhone 7 right today; I'll publish the results immediately after.
     
    5petersonzachary likes this.
  7. Ivan Perfetti

    Ivan Perfetti Boxer

    Joined:
    Sep 9, 2018
    Messages:
    98
    Likes Received:
    103
    So, I've tested it quite alot on an iPhone 7 and it runs pretty smooth but for some minor hiccups, here's a clip recorded straight from the phone, sorry for the low quality, recording quality wasn't great.

    You'll see some new effects as well:
    - 4 explosions.
    - a fountain (sort of).
    - a nuke.
    - the nuke's smoking mushroom cloud.


    There are some minor hiccups; I've recorded it twice in a row to show that some of the hiccups seems unrelated to the particles; in pass 1 when the rain particles start falling down the framerate drops down while that doesn't happen in pass 2.
    For sure the screen recorder app didn't help, it runs a little smoother without it.
    Anyway average FPS is always between 58~59 fps so that looks promising!
    Here's the clip!
     
    Last edited: Oct 19, 2020
    Roberto P and 5petersonzachary like this.
  8. 5petersonzachary

    5petersonzachary Serious Boxer

    Joined:
    Jan 23, 2016
    Messages:
    548
    Likes Received:
    162
    Wow that runs really really smooth! Would we be able to use 3d objects so as cubes or spheres as particles or is it just 2d sprites?
     
  9. Ivan Perfetti

    Ivan Perfetti Boxer

    Joined:
    Sep 9, 2018
    Messages:
    98
    Likes Received:
    103
    Yes, you'll be able to use any 3D model, in the demo the "Fire #2" and "Nuke" effects use spheres, all of the other effects only use a textured plane model.
     
  10. Ivan Perfetti

    Ivan Perfetti Boxer

    Joined:
    Sep 9, 2018
    Messages:
    98
    Likes Received:
    103
    Hi all! Here's an update with some new features, new effects and improved ones, more details coming soon, meanwhile here's a video:
     
    5petersonzachary likes this.
  11. Ivan Perfetti

    Ivan Perfetti Boxer

    Joined:
    Sep 9, 2018
    Messages:
    98
    Likes Received:
    103
    Hi all, I'm going to release the first version of the particle system very soon on indym.itch.io, stay tuned!

    Meanwhile here's a little technical post to better explain the features I've implemented until now in my particle engine for Buildbox.
    This is focused on the core element of the particle system: the particle emitter.

    The emitter object is the core of the particle engine; it is the object responsible for creating particles and define how particles behave.
    This is managed by a series of attributes subdivided in four sections: basic settings, color animation, scale animation, position animation.
    Combining such attributes I've managed to create all of the effects you can see in the demo video and a lot more can be generated.



    [0.x] BASIC SETTINGS

    - Particle Generator
    Here you can set the emitter identifier (a unique name), particles per second, particles asset, emitter life (set to 0 for infinite) and particles life.

    - Easing In / Out
    Here you can enable easing in/out to smooth the generation curve for the particle generator to make it so that the number of generated particles will increase gradually from 0 to "Particles Per Second" or from "Particles Per Second" down to 0. You can set duration and Easing Function for both Easing In and Easing Out.

    - Wake Up
    You can optionally set wake up and sleep distance, useful to enable/disable effects once the character is at a certain distance from the emitter.

    - Upon Path Collision
    Define particle behavior upon collision with the ground (path).
    Remove Particle: if checked the particle will be removed upon collision with the ground (path).
    Leave Mark: if checked the particle will leave a mark on the ground (path).
    Mark Model: asset model to be used to leave the mark.

    - Gravity
    Sets the gravity for the generated particles.
    The +/- set of attributes adds a random element to each particle's gravity.

    - Linear Velocity
    Sets the linear velocity for the generated particles.
    The +/- set of attributes adds a random element to each particle's linear velocity.

    - Angular Velocity
    Sets the angular velocity for the generated particles.
    The +/- set of attributes adds a random element to each particle's angular velocity.

    - Starting Rotation
    Sets the starting rotation for the generated particles.

    [1.x] STARTING COLOR AND COLOR ANIMATION
    In this attributes section you can set the starting color of any particle generated by this emitter and enable/disable color animations.
    If you enable color animations the subsequent attributes named Color Animation 1 ~ 4 will be used.
    In such a case the particle color will be the starting color at first and will automatically change to Color Animation 1, then Color Animation 2 and so on.
    For each Color Animation you can set the destination Color, the duration of the transition and the easing function to be used.

    [2.x] STARTING SCALE AND SCALE ANIMATION
    In this attributes section you can set the starting scale of any particle generated by this emitter and enable/disable scale animations.
    If you enable scale animations the subsequent attributes named Scale Animation 1 ~ 4 will be used.
    In such a case the particle scale will be the starting scale at first and will automatically change to Scale Animation 1, then Scale Animation 2 and so on.
    For each Scale Animation you can set the destination Scale (with a random part), the duration of the transition and the easing function to be used.

    [3.x] STARTING POSITION AND POSITION ANIMATION
    In this attributes section you can set the starting position of any particle generated by this emitter and enable/disable scale animations.
    If you enable position animations the subsequent attributes named Position Animation 1 ~ 4 will be used.
    In such a case the particle position will be the starting position at first and will automatically change to Position Animation 1, then Position Animation 2 and so on.
    For each Position Animation you can set the destination Position (with a random part), the duration of the transition and the easing function to be used.

    [​IMG] [​IMG] [​IMG] [​IMG] [​IMG] [​IMG][​IMG]
     
    Roberto P likes this.

Share This Page