Home Unreal Engine

Butterflies/Birds in UDK?

polycounter lvl 13
Offline / Send Message
crasong polycounter lvl 13
Hey guys, was just looking around for some refs for a project I'm working on, and an idea to add glowing butterflies that kinda hover around a small area or scattered around the map came to mind.

Thing is, I don't really know how I'd tackle something like this. Any suggestions would be great!

Replies

  • Vito
    Offline / Send Message
    Vito polycounter lvl 18
    A particle emitter, that emits meshes that are little four-poly animated mesh butterflies?

    Or maybe a particle emitter that emits single-poly particles with an animated texture on them?

    I'm just kidding, I haven't developed for Unreal since the previous gen. I bet r13 could tell you, though.
  • Lee3dee
    Offline / Send Message
    Lee3dee polycounter lvl 18
    for the butterflies, I would create an animation in Max or a 3d app, and render out a looping animation and use that as animated sprites. That way in the particle system you could make them move at different speeds and they wouldn't all look the same in movement anyways. I've done this on a couple of projects.

    Hope that helps.
  • DEElekgolo
    Offline / Send Message
    DEElekgolo interpolator
    2010-04-17_1310.png
    Made this for a different engine a while ago, the mechanics are the same. It would have a 3 frame animation which moves the 2 polys using the middle edge as the pivot. Then you can have a particle emitter move them around properly.
  • Neox
    Offline / Send Message
    Neox veteran polycounter
    butterflies are easy, you don't even need to animate them right as they have so fast movement its ok to have 4 frames of them and let them switch randomly, it gives an even more natural look to the particle system
    its not really needed to use anything but a 2tris particle that is facing to the camera, as the movement isn't that smooth that you'd recognize. what i did for Airborn was a butterfly like DEElekgolo animated that in max and rendered out the frames into a particlesubuv sheet

    for birds it us highly dependent on how close you can get, if you want just a flock of birds flying far far away to crowd the sky a bit, particles will do a pretty decent job. the only thing i found annoying when i did that, was that i couldn't get the single particles to have some random offsets in the animation, so what happens is, that all birds are in synch :X
  • Taylor Hood
    It's awesome that we have alpha's/decals for stuff like that. XD
  • Lamont
    Offline / Send Message
    Lamont polycounter lvl 15
    Neox wrote: »
    for birds it us highly dependent on how close you can get, if you want just a flock of birds flying far far away to crowd the sky a bit, particles will do a pretty decent job. the only thing i found annoying when i did that, was that i couldn't get the single particles to have some random offsets in the animation, so what happens is, that all birds are in synch :X
    Multiple emitters in the emitter.
  • crasong
    Offline / Send Message
    crasong polycounter lvl 13
    @Lee3dee, DEElekgolo, Neox, Lamont: Hey guys thx for the explanation. So I texture a plane like the example above, animate it, then render it? So would that mean my butterflies would appear as flat planes? I still haven't dived into Cascade just yet, but I suspect I will need to very soon. Team and I are wondering if 3D particles are possible, or if all particles are like small billboards.
  • Neox
    Offline / Send Message
    Neox veteran polycounter
    Lamont wrote: »
    Multiple emitters in the emitter.

    didn't work either, they all have been in synch, even if i changed some of the parameters, they spawned differently but the anim was still in synch. so if i wanted to change that, i had to use a different texture for the different emitters with offsett anim frames.
  • r13
    Offline / Send Message
    r13 founder
    Those are decent ideas, but let me give you some cascade specific advise on how to get this done.

    First you need a static mesh with the butterfly, just like deel’s up above. You need that v in there. If you made each at 45 deg to the floor, it’d be perfect.

    Place the mesh into an emitter in cascade, also place your shader in a mesh material module.

    Adjust the spawn rates so you have 0 in the rate and 1 in the burst.

    Give it a life time long life time like 10 seconds. Now you should have one butterfly spawning at the origin.

    Next you want to animate the wings, drop a size scale module in the stack. You want a constant curve type on this. Now keep your x and y at 1 across the whole thing, add points and put a sine wave on the z curve. Set it up for the full 10 seconds [out to 10 on the curve grid] each time you want the wings to flap you feed to put in points on the curve. I’d suggest one up and down every .1-.25 seconds, but adjust as you see fit.

    Now you have a flappy butterfly, depending on what you want to do with it, I’d next plays a orbit model on it. Set your offsets small something like 5 units, and let it spin in all axis’s. This will give the butterfly some jumpy movement to match its flapping.

    now give it some velocity and you can make it float along. Chain another orbit and you can make it go in a circle or swarm a particular spot.

    You might experiment with mesh rotations and mesh rotation rates depending on what you are trying to do. If you want to do the circleing ones, you’ll need to turn the mesh to match the rotation speed of the larger orbit.
  • crasong
    Offline / Send Message
    crasong polycounter lvl 13
    r13: Thats terrific! Will try when I have the time, will post to let you know how it works out. Thx again!
  • crasong
    Offline / Send Message
    crasong polycounter lvl 13
    Okay been following your suggestion step by step, but I'm stuck at the part where I lock the X & Y at a constant value and edit the Z value, but I'm not quite sure how to work the graph editor. Any tutorials on how to use it?

    I managed to click the curve icon next to the "Size Scale" in the stack. I hid the other two axis so only the Z is showing, but i can't seem to edit the constant value that it has.
  • metalliandy
    Offline / Send Message
    metalliandy interpolator
    Maybe this video will help?

    It goes over creating a firefly type effect.

    http://eat3d.com/free/dust_particles
  • crasong
    Offline / Send Message
    crasong polycounter lvl 13
    Excellent vid, thanks a lot metalliandy! still cant quite figure out how to edit the curve though.
  • r13
    Offline / Send Message
    r13 founder
    You need to change the distribution type. Hit the blue arrow and select constant curve.

    Then set the graph info to the curve editor. Hold control and click the line. Move each of the axis up to 1. Hide x and y and the start adding more nodes on the z
  • r13
    Offline / Send Message
    r13 founder
    And yes I know all this assumes you are looking at cascade as you read it.
  • d1ver
    Offline / Send Message
    d1ver polycounter lvl 14
    Wow, great topic! I've never done no particle effects, except for 2d some time ago, and, man, it feels great.) They really make your environment alive and make you just want to stare more and more.)

    Butterflies.jpg

    Thanks for all the info guys and especially, r13, but I've got one more question for you:
    Orbit gives your meshes different trajectories to fly around on, but meshes rotation is independent from it's movement and direction. What I mean is that butterflies don't necessarily face the direction they are flying in and that looks kinda strange at times. I added a rotate over time thingy, but it's obviously is not a perfect fit.
    So my question is (even though most players, I think, wouldn't notice) is there a chance to make your particle "face" the direction it's moving in?
  • r13
    Offline / Send Message
    r13 founder
    there is two ways to get your bfly to face the direction of its travel...

    The easiest is to set the screen alignment [under emitter options] to velocity. Then give the bfly a little push maybe 25-50 and it should wobble and flap along in one direction facing that direction. When set the alignment to velocity, you don’t get to use any of the rotation or direction options as the velocity alignment is overriding all else. This means make sure your mesh is pointing at the X positive direction; this is the orientation it sees at the default. So if you make it go a different direction, it will turn the mesh and face that direction.

    The more difficult way to to match mesh rotations with orbit rotations and you can absolutely get them to match up… mostly. Cascade is very frame rate sensitive, so if you have a ton of crap going on in the scene, its possible [they will] that your timings will get off. Anyways the best way I can explain this is be explaining how to set up a simple version of it.

    Take your bfly mesh and stick it in a new emitter. Give it an initial mesh rotation and initial mesh rot rate modules. Set the initial rotations, to zeros. This should be a single bfly sitting at the origin. Give it a life time of one second. Make the emitter loop with a 0 in the emitter loops slot.

    Now give the blfy a initial rotation rate of 1 on the z axis, and 0’s on the others. Your bfly should be spinning once per second now.

    Add an orbit module. There is 3 sets of inputs in there. Set each one to constant distro. We don’t want any change or variations for this exercise.

    On the orbit offsets, set y to 100 and x and z to zero. On the rotations, set them all to zero. On the rotation rates, set z to 1 and x and y to 0.

    You should have a circling bfly that faces its direction. Now vary things like spawn size, position, lifetime, etc etc and you can get a convincing flock of butterflies.
  • Lee3dee
    Offline / Send Message
    Lee3dee polycounter lvl 18
    I learned something new in UDK, thanks r13!
  • Adam L. Gray
    Well then, I figured I might as well use this thread since it's relevant to r13's guide here.

    I seem to be having a problem when following this thing. Everything is working perfectly fine, and I get to the step where I change the distribution type to a constant curve. But when I do, the particle mesh dissapears. And it won't come back again until I either disabled or deleted the size scale module.

    I tried adding points to the curve and made sure it weren't all set to 0, in terms of scale. But nothing, anyone that has any clue as to what might be the cause? :x

    Cheers
  • r13
    Offline / Send Message
    r13 founder
    when you change the distro type it usually wipes the previous values and sets them to defaults of a 0 or 1 value depending on what you are working with.

    Since you also say are messing with the size scale, i'm gonna assume you have some mismatched values here. keep the size scale off for now as you mess with it, it'll just make things more difficult in figuring it out.

    now you want to make your initial size values a constant value, not a curve. also i'd suggest clicking the box that makes all values the same as the x value for simplicity for now. [yes initial size can use a curve and that's good for more advanced stuff] pick a value so you can see it as you expect.

    now use a size over life module and stick a curve distro in it. now this module works as a scalar function on your initial size values. [scalar equals a multiply of a value] that means if you set your value at 1, then it is the same size. so you want to adjust the axis curve that will make the mesh get smaller and then bigger. then make to 1. this will make it loop back to the original size.
  • Justin Meisse
    Offline / Send Message
    Justin Meisse polycounter lvl 18
    won't a particle butterfly disappear when the particle dies?
  • ambershee
    Offline / Send Message
    ambershee polycounter lvl 17
    You can set individual particle lifetime to be infinite, or you can have the particles clip through the ground plane before spawn / death to hide the changing.
  • r13
    Offline / Send Message
    r13 founder
    yes, of course it will... there are ways to either continually spawn a new one or simply make it last longer or forever.

    depending on the use of said fx, you'd make the specific choices on how it was set up
  • underfox
    Offline / Send Message
    underfox polycounter lvl 7
    i'm really sorry to dig this up but i need help, i have been following what R13 said but i can't manage to get less than 1 butterfly to spawn, there is always another particle spawning after. I set the spawn rate to 0 and the burst to 1 but it still spawn more than one particle between thos 10 seconds interval.
  • underfox
    Offline / Send Message
    underfox polycounter lvl 7
    would be nice if you could go troll somewhere else. thank you.

    edit: i solved my problem by simply by puting 0,2 in rate and removing the burst.
  • r13
    Offline / Send Message
    r13 founder
    you could have also solved it by keeping the burst but lowering the time the entire emitter takes.

    depends on what you are using it for on how to build it, but for you right now, either way is good.
  • underfox
    Offline / Send Message
    underfox polycounter lvl 7
    at the begining i wanted my particle emiter to emite a single butterfly, flying around without end in my scene,but having some butterfly poping randomly in the scene isn't really shocking.

    By the way, thanks a lot r13, your mini tutorial was really helpfull, I wouldn't have though it would be possible to animate my BF with a size scale module.
  • JamesWild
    Offline / Send Message
    JamesWild polycounter lvl 8
    I did this:
    [ame="http://www.youtube.com/watch?v=PuMUQX1R7iE"]UDK Butterfly Particles - YouTube[/ame]
    Using standard particles and a material that distorts the UVs towards the centre, producing a slow "flap".
  • underfox
    Offline / Send Message
    underfox polycounter lvl 7
    [ame="http://www.youtube.com/watch?v=2-raJcGYuJM&feature=plcp"]butterfly test - YouTube[/ame]

    well, here is my result for the moment.

  • r13
    Offline / Send Message
    r13 founder
    it's getting there :D
  • ambershee
    Offline / Send Message
    ambershee polycounter lvl 17
    The butterfly needs to flap quicker, be a little smaller, and move more erratically. I think you're fundamentally there and just need those tiny little tweaks.
  • andr3w1sh
    r13 wrote: »
    put a sine wave on the z curve

    This part I'm not clear on. Could I get some clarification? Just starting to learn Cascade, and most of what I'm learning is from forms like this, so I thank you all for your help.
  • Santewi
    andr3w1sh wrote: »
    This part I'm not clear on. Could I get some clarification? Just starting to learn Cascade, and most of what I'm learning is from forms like this, so I thank you all for your help.

    http://lmgtfy.com/?q=sine+wave

    What you do is you use a sine wave on the Z (blue) curve.
  • andr3w1sh
    Santewi wrote: »
    http://lmgtfy.com/?q=sine+wave

    What you do is you use a sine wave on the Z (blue) curve.

    I did, but for some reason it stays within 1 second. I'm not sure how to extend it for the full 10 seconds or how to add points for wing flaps, or even to speed up the wing flap for that matter. he does one really slow flap, then nothing.

    p.s. thanks for the condescension, beginners love that stuff
  • r13
    Offline / Send Message
    r13 founder
    ahh i see.. well for your case then i would suggest you move your last point out to ten.

    then as you said it does one long slow flap, so you have to put in more points. you just hold crtl and click the line to add a point.

    now you will need to figure out in advance how many flaps you want. well you might not know what will look good, so guess. say 10. that means you will click on the line at every second marlk. then in the gaps you well add the same number of additional points so you can move them up and down as per your flap needs. you will repeat the same pattern all the way down the line. then you can say... if thats too many or not enough and add or subtract sections of the flap. yes this is a pain in the ass. if you need to do an uneven set of flaps, then i suggest you sit and do the math to figure out where to put the first set of clicks. eyeballing it sucks, and looks bad. just do the math if you have to.

    you can bump the x and y too to give it some extra wiggle and shape, but it wont really be noticed mouc.. but you can polish it down as far as you need.
  • andr3w1sh
    @r13 thank you for the clarification
Sign In or Register to comment.