• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
freeworld

what kinds of control would you want in a particle system

6 posts in this topic

I'm refactoring my particle system to make it more compatible with my current project and it got me thinking what kind of controls would others want, what kinda ideas have I not thought of. Make note, this system is completely 2D except for the use of depth to sort images when rendering, here is the list of what is already implemented, and the few changes I will be making... feel free to add to the list, like a community brainstorm :blink:

[b]Movement[/b]
starting velocity
acceleration of velocity over time
damping of velocity over time
rotation around given origin.
direction rotation over time.

[b]Size[/b]
starting size
expansion of size over time
contracting size over time

[b]Emitter[/b]
position and boundary particles can be emitted from
depth particles can be emitted from
how fast particles are emitted
amount of particles to emit on each emission
lifetime of particles, this can be infinite for particles that don't die.

[b]Graphics[/b]
Starting color
list of colors to fade to over time, and in order they are loaded.
use single or multiple sprites, with multiple sprites, particle will randomly be assigned a sprite whenever they are re spawned.

[b]new changes need for current project[/b]
use animations instead of static sprite for particles.
boundary that particles must stay within or they automatically die.
gravity, or external force like wind. and possible allow multiples of them.
0

Share this post


Link to post
Share on other sites
When I wrote my particle emitter, I found it was most helpful to try to create a fire works show. Here's some suggestions you may want to consider:

-Emitters should be able to emit emitters (No limit on depth)
-You should be able to use primitives or sprites
-You'll want to specify alpha transparencies for particles
-Emitters should be able to move

Here's a [url="http://www.youtube.com/embed/mWHNRgXr-UQ"]simple demo[/url] of my particle system
0

Share this post


Link to post
Share on other sites
[quote name='slayemin' timestamp='1305243119' post='4810010']
When I wrote my particle emitter, I found it was most helpful to try to create a fire works show. Here's some suggestions you may want to consider:

-Emitters should be able to emit emitters (No limit on depth)
-You should be able to use primitives or sprites
-You'll want to specify alpha transparencies for particles
-Emitters should be able to move

Here's a [url="http://www.youtube.com/embed/mWHNRgXr-UQ"]simple demo[/url] of my particle system
[/quote]

Interesting I'm surprised I never thought of having emitters emit emitters. Do you consider all your particles as emitters, and emitters as particles... ie are they derived from the same object?

Alpha transparency is controlled through the color values. These can be anything and can shuffle through any amount of colors as long as there is enough memory to store all the values... which is pretty much infinite. The way my framework works, being able to emit primitives instead of sprites (quads), work mean a refactoring of the base framework, but does sound tempting.
0

Share this post


Link to post
Share on other sites
[quote name='freeworld' timestamp='1305247540' post='4810025']
Interesting I'm surprised I never thought of having emitters emit emitters. Do you consider all your particles as emitters, and emitters as particles... ie are they derived from the same object?

Alpha transparency is controlled through the color values. These can be anything and can shuffle through any amount of colors as long as there is enough memory to store all the values... which is pretty much infinite. The way my framework works, being able to emit primitives instead of sprites (quads), work mean a refactoring of the base framework, but does sound tempting.
[/quote]

Here is a rough sketch of my class inheritance hierarchy. The names are probably not the best, but it's good enough for me.

[img]http://i70.photobucket.com/albums/i112/slayemin/TempImg.gif[/img]

I use a lot bit of polymorphism and the classes I left out are just manager classes which maintain memory pools for particles and emitters.

The "Emitter Object" has a ParticleBase object which can be cast into either a particle or an emitter. Emitters are just manager classes which create "Emitter Objects"

[code]
class EmitterObject
{
Vector2 m_emissionVelocity; //this is the velocity applied to all emitted objects
Range m_emissionSpeed;
Range m_emissionDirection; //the direction objects are being emitted (Radians)
Range m_emissionSpread; //how much variance you have in the emission direction (Radians)

int m_emissionCount; //how many objects will be emitted during the emission cycle
ParticleBase m_emissionObject; //this is the generic object our emitter will emit

int m_emissionDelay; //how long to wait before emitting objects
int m_emissionPeriod; //how much time must elapse before next particle is sent out
int m_nextEmissionTime; //the next point in time in which we emit our objects
Color m_color; //the color applied to the objects being emitted
....
}
[/code]

My base particle class also has a function pointer which lets the user specify the mathematical function to use for alpha transparency (constant, linear decay, exponential decay, gaussian, etc).

My reasoning for including primitive particles with sprite particles is because I've seen some interesting effects being done with primitives as particles... Pixels are very versatile and very fast to draw. Lots of small triangles can make some convincing fire effects. Connected line segments can be used for simulating streaks of shrapnel in an explosion (and the alpha decay ties in nicely here).
1

Share this post


Link to post
Share on other sites
Would it be possible to see the source to your particle system? Just that little snippet already gave me a few ideas on how i could improve mine... some embarrassingly better.
0

Share this post


Link to post
Share on other sites
Prototype system works wonders. [url="http://assaultwars.com/javascript/fireworks.html"]My Example[/url]. (Right click to view the javascript). Needless to say the best way to create a particle system is to create a list of scenarios that you can use as requirements. Fireworks is probably one of the best examples of that as mentioned. Defining splines is probably a good idea along with random splines where the random variables are defined in the prototype. Including scripting into the system is ideal.

Include cases that can simulate an emitter with a delay being launched into the air that leaves a trail of both smoke and sparks.
0

Share this post


Link to post
Share on other sites
Sure. Here's my code. It could stand to use a bit of improvement and streamlining, but I got lazy :P

--Particle System Classes--
[url="http://pastebin.com/EtsKYbrS"]Emitter.cs[/url]
[url="http://pastebin.com/sKegm6zr"]EmitterObject.cs[/url]
[url="http://pastebin.com/Tm8ZzEkK"]Particle.cs[/url]
[url="http://pastebin.com/21nwrE8N"]ParticleBase.cs[/url]
[url="http://pastebin.com/wCJkeY5A"]ParticleSystem.cs[/url]
[url="http://pastebin.com/RR5HWFbJ"]PrimitiveParticle.cs[/url]
[url="http://pastebin.com/eGXHhbfA"]SpriteParticle.cs[/url]

--Helper Class from my library--
[url="http://pastebin.com/0wjnxPgY"]Range.cs[/url]

To instantiate this, I have to create emitters and assign emitter objects to them, and then create the particle which gets emitted. It's kind of a pain in the ass at the moment and a bit cumbersome to use. Ideally, I'd like to just define my particle and emitter structures in nested XML tags stored on an external file so that I don't have to hard code any of it. Maybe when I get less lazy I'll do that and do it in a generic way such that it can be dropped into a library and used in any game :P

Anyways, this should give you plenty of fuel to inspire your own implementation. Since I made this public, feel free to copy as much as you want. You don't have to credit me.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0