Home Unreal Engine

UDK-Swirling particles, how?

polycounter lvl 8
Offline / Send Message
Nielsen polycounter lvl 8
Hello everyone,


quasari.jpg

Trying to create a quasar of sorts for use in the skybox, but it's a little flat at the moment, so I thought I'd add some swirling clouds of mass to create some more depth.

Now the problem is I need something along the lines of -this example on the UDN-

psys_attractor.gif

"This is the result of using a point attractor in combination with a line attractor with its strength animated over the life of the particle to create the swirling effect."

I've been messing with it for a while now but I don't understand how they achieved it... anybody who knows how this is done?

Replies

  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    I've tried a line attractor on the Y axis and point on X, with the line attractor diminishing strength over time. For some reason it stops particles being visible / spawned at all until I turn off the line attractor.
  • RAL
    Hey Nielsen I was able to get the particles to start swirling, it just requires some further tweaks to the values in both attractors. Let me just explain it a bit so that you can get yours going:

    1.
    Start with a basic particle emitter. I deleted the velocity on mine but you can keep it if you want to affect those properties of the effect as well.

    2.
    The first thing you want to adjust is the origin and offset your emitter (since you want to pull the particles to the center with the attractor module). I added an Initial Location module and put the effect at X:256 Y:256 Z:000

    3.
    Next I added a Size By Life module to make them smaller as they got to the center.

    4.
    From there I simply added some Initial Rotation and Initial RotRate to change up the sprites as they spawn.

    5.
    Now for the pull, add a Point Attractor module and turn on 3D Draw Mode under the Cascade properties of the module so that it becomes visible in cascade. Keep the Position at X:000 Y:000 Z:000 since were pulling them into the center. I set the Range to 512 so that the attractor fully encapsulates my particles, depending on the size of your particles this value might change but you should be able to figure out the size you need once you see the attractor in cascade. Next set the Strength to 2000. You should now see your particles getting pulled into the center.

    6.
    Finally the swirl, add a Line Attractor module and make sure to turn on the 3D Draw mode for this too. For End Point 0 I used X:128 Y:000 Z: 000. For End Point 1 its X:128 Y:000 Z:256. My Range is set to 500 and the Strength is at 1.5.

    The trick was getting the line attractor to have values that made it swirl along the desired axis. If your end points are right on the particle they will not draw as you’ve already described. You don’t have to use these exact values but just look at the pattern for my end points. For end point 0 you want to change the value of 1 axis, and for end point 1 you will change the value of 2 axis. So your choices are X,Z/Y,Z/X,Y. Depending on which you choose will change the axis that the swirling effect aligns to. If you change the values of all three axis then the result will be particles moving all around in full 3d rather than being locked along one axis.

    One last thing to make note of was the Strength values in both attractors. These are both working together so adjust them to your liking by increasing and decreasing the values, just remember that the line attractor is much more sensitive.

    Here’s an image of mine in cascade. I've cloned the emitter four times, they share the same things except for the Initial Location. I’m using the latest version of UDK by the way.
    ZS4Qe.jpg
    Hope this helps.
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    Very cool man, thanks for the help! I'll post some results asap.
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    Heh, it looks cooler in motion so maybe I should make a vid about it, but here's how it turned out:
    Thanks again btw!

    7ghz2.jpg

    been working on some other things as well, trying to create particle nebulae, moderately succesful I suppose
    4FamH.jpg
    Ch0du.jpg

    These don't make use of any swirling particles though. But I can foresee loads of uses for it anyway.
  • RAL
    Hey man I'm glad this has been helpful, these are starting to look great. I know its kind of hard to take a good screenshot of moving effects but I can see where your going with this.

    A bit of critique though, your single stars are looking a little too repetitive, try making a sub uv texture with 4 different looking stars. Also try setting their Initial Rotation to be something between 0 and 90 degrees (which in cascade would translate to a value of .25 for your Max since a value of 1 equals a full 360 degrees). This way you'll have a more random looking effect (when working with fx the more randomness you have the better). To get a better idea of different star textures just do a google image search for "star clusters" and you'll see what I mean.

    Keep posting your progress and whenever you get a chance post a video too.
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    What exactly do you mean? I know the technique for using subuv textures but are you referring to different star colours? or the shape of the 'lens spikes' ? Because what I have at the moment is a simple sphere mask with a vertex colour multiplier for all the different colours of stars and one special version where it overlays the lens spike which spawns randomly on all the "target" stars making it seem as if they're twinkling once in a while.

    If I google pictures of star clusters I do see a lot of different colours but the lens effect seems consistent all the way through the picture: http://farm3.static.flickr.com/2341/2026823169_843de9e112_o.jpg for example.
  • RAL
    Sorry for not being more clear, I meant the shapes of your stars. It makes more sense how you have it, now that you've described you material, guess it was just hard since I'm not seeing it live in cascade.

    Anyways keep up the good work.
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    I'll make a video when it works lol but here's something new to ponder. (damn you UDK!)

    The swirling particles work fine in cascade as seen here;
    OEwnI.jpg

    When I go ingame however
    BU3eP.jpg

    The particles essentially spawn and remain motionless at that point (just the 2 opposite ends that should be swirling.)
  • RAL
    I think the issue here is that you rotated the emitter without turning on "Use Local Space". Just enable this check box under the Required module.
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    That's the thing, I have checked that box and it doesn't work. Tried some other things as well like setting the update time to "Fixedtime" instead of realtime. I think this might solve the issue where the particle goes completely nuts on my laptop (due to slower hardware) and runs just fine on the pc. That's not it either.
  • RAL
    Hmm that's strange, do you have an Acceleration module on the swirling emitters? If you do then turn off the "Always In World Space" check box with "Use Local Space" still turned on. See if that works.
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    Ha yeah it is strange, I don't have any acceleration module on the emitters. I've taken the liberty of sending the file to you via wetransfer. I understand if you don't have time to look at it but it would be appreciated ofcourse :D
  • RAL
    Hey Nielsen I took a look at the effect. I sent you back my edits so you can see them yourself. Everything you’ve done looks correct to me. There are some strange things going on, not sure if it’s a bug with cascade/udk or I’m using the modules incorrectly but here are some of the things I’ve noticed.

    First, if your particle system’s translation is set to X:000 Y:000 Z:000 in your map the effect works just fine, the emitters are swirling and everything’s ok, but it’s unlikely that this is the final location of the particle system in your map and you might want to clone it around. When the particle system is moved to another location on your map the two emitters no longer swirl, so that’s the first thing.

    Second thing I did was turn off “Use Local Space”. That fixes the first issue I mentioned, but I haven’t rotated the particle system on the map at all, I’ve only regained my ability to move it around without losing any control over the particle system.

    The first thing you’ll notice is that they’re not even being pulled in by the Point Attractor. I increased the Strength on the Point Attractor from 5000 to 20,000. The emitters should now be getting pulled in so that was the first thing that was easy to fix. The strength needed to be increased because your particles were pretty large.
    v8Vyx.jpg

    My next attempt was to bring back the swirl to the emitters. First thing I changed on your Line Attractor was the Range. I set it from 1800 to 2500 to fully encapsulate your particles. Next I adjusted the value on your End Point 1 from Z: 256 to Z: 1024. The particles should now be swirling.
    3rTMG.jpg

    Remember I still haven’t rotated the particle system on the map yet. Now I’ll rotate it by 45 degrees on the Y-Axis and here is where I found the third strange result. One emitter refuses to swirl because its Initial Location has negative values. If you change the values to something positive it swirls just like the other one, but you want two swirling emitters on opposite ends. Alternatively if you rotate the particle system on the X-Axis instead of the Y-Axis like I did then the emitter with negative values on the Initial location will work but the other won’t, so were back to square one.
    W31q7.jpg

    I’ve tried different combinations of using and not using local space, giving the emitter its own line attractor with negative values, separating the correct single swirl as its own particle system cloning it then rotating it, and even making it completely from scratch but only one swirl will work.

    I wasn’t able to figure it out, but now I’m really curious about how this issue can be fixed, so hopefully someone else will be able to help find a solution.
    Any polycounters have any ideas? Thanks in advance.
  • imbueFX
    Offline / Send Message
    imbueFX polycounter lvl 5
    As an alternate to this method, using the orbit module would be a great solution for this. You can animate the offset over time, so starting with a larger value then animating to a smaller one on a specific axis will cause the particle to move closer to the center. There is one flag you need to set so that the particle gets this data, I think it's "update over time" (I'm on my mac and can't remember the name off hand).

    Hope this helps!
  • RAL
    Hey this is a great alternative, thanks a lot imbueFX! I completely forgot about the Orbit module, I guess that udn example threw me off thinking it was the only way to get that behavior out of the particles.

    Now you don’t even need an Initial Location or any type of Attractor modules. I added the Orbit module to a regular particle emitter, set the Offset Amount Distribution to be Vector Constant Curve, left the first key at zero all around, and for my second key I set the In Val at 1 second with an Out Val of Y:256. This value might change for you Nielsen since your particles are much larger but you’ll know how much you’ll want to offset them by when you have it up against your other emitters. Under the Offset Options I turned on Process During Update, I think this was the flag imbueFX was talking about, otherwise it won’t work.

    Next I set the Rotation Amount Distribution to be Vector Constant and left them all at zero. Finally I set the Rotation Rate Distribution to be Vector Constant and gave it a value of Z: 0.35, use a negative value to get it going in the other direction. The higher the value the faster the rotations will be, so use accordingly. Last step was to turn on the Process During Update again for this option. Here’s an image of it in UDK, I cloned the particle system a couple of times so you can see my results.
    DhRce.jpg

    As you can see the entire particle system can be rotated however you like on any axis and they will still behave the way you want them too, I should also mention that Use Local Space is not turned on.

    I do have one question for this method though. With the Orbit module the particles go from the spawn origin and extend out to the offset value, is there a way to get the reverse of this behavior? If possible this would mimic the "swirling in" behavior that we were getting before, thanks again for the help imbueFX.

    Edit: Just read your post more carefully imbueFX, the Offset Amount needs a value in the first key, I used Y:128. Then the second key you leave at 0 all around, except for the In Val which is still at 1 second. Now the particles swirl inwards, thanks again.
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    Awesome guys, I got it to work using orbit. Thinking about it, it makes a lot more sense to do it this way. Don't really understand why it wasn't the first thing I tried.

    Thanks for the help anyways! I'll get a short video up this weekend.
  • imbueFX
    Offline / Send Message
    imbueFX polycounter lvl 5
    Glad to help guys!
  • Nielsen
    Offline / Send Message
    Nielsen polycounter lvl 8
    Arite, got it on YT real quick.

    Hope you like it, suggested improvements are very welcome ofcourse.
    (I know the purple plane clips midway... unfortunate, forgot to fix that)

    [ame="http://www.youtube.com/watch?v=nR97vSbESj4"]Quasar_NebulaeTest.wmv - YouTube[/ame]
  • RAL
    Hey Nielsen this came out looking great. Maybe try adding a PixelDepth node in your stars material to make it seem like the stars get brighter as the camera gets close to them, that's just an idea to play around with though. Good stuff man.

    http://udn.epicgames.com/Three/MaterialsCompendium.html#PixelDepth
Sign In or Register to comment.