(I need to get in the habit of posting when I don't have code to share.)
Something I've wanted to do for a while is develop a really flexible and highly configurable particle system for XNA. I've seen some solutions (samples, really) that are rather hacked or not very extensible.
Microsoft XNA Unleashed had a solution that I thought was decently constructed and easy to use with small projects, but was still fairly constrictive for what I'd like to see. Maybe I've just been pampered....
Several years ago, I ran across the
Particle Flow system in
3ds MAX. It is an incredibly powerful system. Using a state machine driven system, it provides a drag-and-drop view for designing systems. Modifiers such as rotation and scale can be added at different states, if/else conditionals can be added for branching, new spawning/death events can be added at will, and even collision checks against objects in the 3ds scene.
So, I'm going to start designing a particle system similar to Particle Flow that can be used with XNA and I'll be detailing my progress right here in my blog. I think to start with, I'll break the system down into these parts:
The state machine system will be broken into states (duh). Each state will hold a list of rules, which will consist of different attributes (rotation, scale, position), actions (spawn, die), and hooks (attachments to [update: point] sprites) to begin with. Tentatively, conditionals will be added eventually, as will such things as AI behaviors, attaching 3D objects, and bounding volume collision checks. The particles will be the physical objects in the system. Each time a particle is created, it will start at the top of the state machine specified during its creation. Some particles may spawned by other particles and may traverse the same state machine or a different one.
That's what I'll start with and we'll see where this takes me! Leave me a comment if you have a suggestion or questions.
[Update:] I think I'll have a top-level particle system that will hold all of the particles, as well as handle their updating and rendering through the use of dynamic vertex buffers, as done in the
Creators Club sample.
Cheers!
Devan