Particle System Guide

Discussion in 'Mod Support' started by bgolus, January 20, 2015.

  1. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,298
    Planetary Annihilation Particle System Guide

    This is a work in progress file I'll be adding to over the time. There's bits of information on particles I've posted around the forums and I'll try to move most of that into the document in some form.

    Comments and suggestions are welcome, though it is obviously early and there's still a ton missing.
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    This forums had not enough stickies. One more.
    Great!
  3. Killerkiwijuice

    Killerkiwijuice Post Master General

    Messages:
    3,861
    Likes Received:
    3,604
    yesssss!!

    Thank you!
    stuart98 likes this.
  4. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,298
    Would it be helpful for me to enable open comments on that document? It'd open it up to defacement as the controls for comments aren't that great, but it might be useful for the short term.
    stuart98 likes this.
  5. Killerkiwijuice

    Killerkiwijuice Post Master General

    Messages:
    3,861
    Likes Received:
    3,604
    Well, not sure what I could comment on, but I guess if you feel like no one is going to ruin the doc with inappropriate stuff, go ahead xD
    stuart98 likes this.
  6. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,298
    Just an alternate place to ask questions really, or for people to add clarification to my documentation. Probably better to just link back to this thread in the doc for comments / questions.
    stuart98 likes this.
  7. SXX

    SXX Post Master General

    Messages:
    6,898
    Likes Received:
    1,811
    Just wonder there is still no way to add particle emitters to CSG objects on map? :rolleyes:
    stuart98 and Killerkiwijuice like this.
  8. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,298
    I wasn't thinking the ways in which you add particle systems to the game would be included with this guide... but no, still no way to add effects to CSG. :(
  9. Killerkiwijuice

    Killerkiwijuice Post Master General

    Messages:
    3,861
    Likes Received:
    3,604
    But we could make volcanoes!
    cptconundrum, devoh, Remy561 and 2 others like this.
  10. dom314

    dom314 Post Master General

    Messages:
    893
    Likes Received:
    1,192
    I love love love love this. Thank you so muchhhhhh.
    stuart98 and Nicb1 like this.
  11. Killerkiwijuice

    Killerkiwijuice Post Master General

    Messages:
    3,861
    Likes Received:
    3,604
    This is awesome, and here's my first suggestion/comment.

    Some of the parameters are still kinda confusing, including useRaidalVelocityDir.

    I think, if you have time, you should put an example or a way this parameter is used in PA already (this really would only have to be for the more confusing ones, most are very simple.). Like, what would "X" effect do with or without this certain parameter, or what would the lightning bolt in that one thread do with or without something else in it's emitter? (the lightning bolt is pretty simple, just a simple emitter, so i think it would be a good example imo)

    Awesome doc though :)
  12. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,298
    I plan on having a whole section on velocity, as well as offsets, as they're both kind of complex. useArcLengthSpace for example ... not sure how I'm going to explain that one properly as it's a lot of maths that turn cube space into sphere space.

    I hadn't thought of using specific examples from the game though. That's a good idea.
  13. Remy561

    Remy561 Post Master General

    Messages:
    1,016
    Likes Received:
    641
    That explanation is good enough if people know how spherical coordinates work though. I assume you use it to calculate a spherical line segment? So it turns an XYZ line into a radius,angle,angle alias spherical line right?
    If you explain the differences between the xyz and spherical system I think modders will understand why it is needed to use that function to get the spherical line segments ;)
  14. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,298
    The specific pseudo math is like this:
    1. Calculate standard starting position for particle
    2. Get vector from particle system pivot to planet center
    3. Calculate distance from the particle to a plane perpendicular to that vector at the planet center
    4. Calculate distance to the particle position parallel to that same plane
    5. Convert that distance to an angle using the distance in step 3 as the radius (arc length to angle conversion)
    6. Set position of particle by placing the particle on the vector from step 2 at the distance from the center of the planet from step 3 and rotate that position by the angle calculated in step 5 around the cross of the vector in step 2 and step 4 at the planet center!
    7. ???
    8. Profit!
    Alpha2546, Remy561 and cdrkf like this.
  15. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Some excellent documentation @bgolus . Will come in handy when I'm reediting some effects.

    A quick question though. Is it already possible to import textures that can be used in the particle system?
  16. devoh

    devoh Well-Known Member

    Messages:
    445
    Likes Received:
    404
    Yes, examples rock!
  17. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,298
    Yes, that's been possible since we released papatran.
  18. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    No matter how good this guide is, I likely will not be able to do much with particles. Just aren't that good...
  19. dom314

    dom314 Post Master General

    Messages:
    893
    Likes Received:
    1,192
    It's actually pretty simple once you get your head around 3d vectors and such. :p
    Remy561 and stuart98 like this.
  20. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    I might make a stream to explain the basics. Its not that difficult at all.

Share This Page