Search Unity

Realistic effects pack [Asset Store]

Discussion in 'Assets and Asset Store' started by kripto289, Apr 1, 2014.

  1. 3dFoin

    3dFoin

    Joined:
    May 30, 2011
    Posts:
    631
    looks really cool Kripto you did a good job :cool:
     
  2. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    I have already answered to you by mail, but I will answer for others :)
    For 2d will rewrite several scripts for movement of projectiles.

    Thanks you ;)
     
  3. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Has anyone else had issues with the dissolve shader on iOS? Looks great in the editor, but it doesn't work at all on the actual device (just renders as a flat solid.
     
  4. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    What a dissolve shader?
     
  5. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Yes, for the FireBeam effect there is an EffectOnHIt Prefab that uses a material called EffectOnHit, which uses a Effects/Dissolve shader.

    It doesn't appear to work on iOS.

    Same thing for the mobile version of the prefab. It uses another shader, but same issue. Effect appears flat on iOS
     
    Last edited: Oct 1, 2014
  6. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    For android I had to use a simple additive shader because multipass additive did not work.
    Try to use the shader "Effects / AdditiveSimple".
     
  7. Kanshin

    Kanshin

    Joined:
    Aug 23, 2014
    Posts:
    5
    Kripto, I bought both realistic effects 1 and 2 they are both awesome. :)

    I love the Shot3 laser effect and it explosion. I am wondering if it is possible to shorten the effect (almost like a projectile laser) to be about 2 meters in length? Like a Star Wars blaster laser effect?

    Thank you in advance!
     
  8. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    It's pretty simple.
    To change the length of ray, adjust the trailRenderer.time.
    I attached prefab effect for example :)
     

    Attached Files:

  9. Kanshin

    Kanshin

    Joined:
    Aug 23, 2014
    Posts:
    5
    Perfect Kripto! Works and looks great! Thank you!!!! :)
     
  10. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    that did the trick. Thanks.

    BTW, any chance of a 3rd pack coming out? The effects are just great. Would love to see some sort of acid spray effect.
     
  11. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    I plan to create a third pack, but I can not give exact dates.
    But shader acid will definitely be in the package.
    Something similar already exists now.
    Alas, on mobile this shader will be without distortion.





     
    Last edited: Oct 7, 2014
  12. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    The existing acid is nice, but I needs smoke to appear on impact to look like something is dissolving.

    Can't wait for the third pack!
     
  13. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings fellow devs. Love the package, ran into a small problem and trying to figure it out.

    To use these as projectiles for spells for players the Target obviously needs to by dynamic as it will be constantly changing. So, I have a state machine, attached to the projectile, that assigns the target variable on EffectSettings with my selected enemy gameobject. When I look in the Hierarchy at runtime I can see that the spell instantiated and the Target field on EffectSettings is filled with the players selected enemy GO. However, the ProjectileCollisionBehaviour script is firing off an error saying that the Target of Effect Settings has not been assigned, even though I can see it is assigned in the hierarchy. Should there be some kind of delay added or something in ProjectileCollisionBehaviour that does a late check to see if there is a Target (in our case anyway)? I assume that perhaps the ProjectileCollisionBehaviour is looking for that Target to soon. How do you guys assign the target in EffectSettings at runtime and not get this error from ProjectileCollisionBehaviour? Gratitude for any pointers someone may have!

    **Edit** My solution ended up being to disable the children of the main prefab (the ones that had the ProjectileCollisionBehaviour script), then enable them 0.1 after instantiation. It finds the target transform fine and all is right. This will work fine but if someone had another suggestion I would welcome it. :)
     
    Last edited: Oct 9, 2014
  14. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    If I understand you correctly, you want to change the target dynamically.
    Target.transform cached after startup or activation script "projecticleCollisionBehavior".
    Therefore, to change the target, the effect must be deactivated and then activated.
    Or try in the script replace "tTarget" on "Target.transform".
     
  15. SoBrian

    SoBrian

    Joined:
    Dec 23, 2013
    Posts:
    11
    That looks amazing. I just bought your Effects pack and think it's fantastic. I did have a question about using the ForceShield mobile prefab. I wanted to just use the effect that plays on Robot Kyle, and not have the spherical shield. What's the best way to swap out the Kyle model with a custom model? Is it just attaching all the scripts that are already on the Kyle model? I couldn't tell which one was responsible for the effect that plays across Kyle's geometry.

    Thanks for any help with this!
     
  16. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    If I understand you correctly, you want to apply the effect "ForceShield" to another model?
    Try to add additional animated material to the "skinned mesh renderer" and script "UVTextureAnimator".
     
  17. SoBrian

    SoBrian

    Joined:
    Dec 23, 2013
    Posts:
    11
    Great. Let me give that a shot.
     
  18. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi Kripto289,

    Now that Unity 5 is available in beta can you please check your shaders so they work correctly in the newest unity version?
    After converting a test project I noticed some materials are turning pink (like impact effects or the frost wave and maybe more, didn't check them all).
    [not that this is urgent, urgent just a headup on future issues ;-)]
     
  19. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Ok, I'll check in the near future.
     
  20. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    Can I ask what shader version these effects are targeting? And are shader sources available?
     
  21. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    In packs using standard shaders, and own shaders (such distortions, glow, particles, etc.).
    All shaders work on the PC and also on mobile with OpenGl ES 2.0.
    Shaders with distortions require shader model 3.0.
    Note on mobile, distorted shaders work very slowly. But if you attach any posteffect, then the FPS increases several times.
     
  22. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    Sweet thanks.
     
  23. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    In Unity5 need to fix some distortion shaders with errors. For example "DistortionParticlesCutout"
    Need to insert these lines
    "#pragma target 3.0
    #pragma glsl "
    after the line" #pragma surface surf .... ".
     
  24. palaxe

    palaxe

    Joined:
    Dec 31, 2013
    Posts:
    22
    Hi I just bought your pack and first thing I' getting this error.
    Assets/Realistic Effects Pack/Scripts/Share/EffectSettings.cs(20,29): error CS0066: `EffectSettings.EffectDeactivated': event must be of a delegate type
    Would you please help me with the fix on this. Thanks
     
  25. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    You should not use this rewritten script . I have already included it in the latest version of the pack.
    What is your version of Unity and OS(windows/mac?)? Try to create an empty project and import the latest version of the pack. If the problem persists, take a screenshot.
     
  26. palaxe

    palaxe

    Joined:
    Dec 31, 2013
    Posts:
    22
    So I'm using win7, Unity 4.5.4.
    When I make a new project I do not get the error.
    In my current project I get :
    /EffectSettings.cs(20,29): error CS0066: `EffectSettings.EffectDeactivated': event must be of a delegate type
    When I try and run it says compile errors must be fixed.
     
  27. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Contact me in skype, try to solve the problem. "Scar289"
     
  28. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    these are incredible, i was blown away.

    These are also the first particle effects i've ever looked at on the store. So naturally i assumed they're representative of the general quality of the community.

    My god i was wrong. You stand head and shoulders above the rest. You have my applause now, and my money at some point in the future. Please do make more, too.

    id be interested to see your take on a pack of explosions,
     
  29. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Thank you very much :)
    Perhaps in the future there will be explosions.
     
  30. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hi.

    First, let me applaud. I'm another "Indie on tight budget" and deliberated several days before taking the plunge and buying this. Obviously the effects look great but, as a professional programmer, I was really pleasantly surprised to find they seem coded well as well (from what I've seen so far & caveat the lack of comments). Will be integrating the frosty and fire ones into Snowman Scuffle soon! (I'll try to post something showing them once they're in!)

    Two questions niggle (I'm still reading through the whole forum thread and perusing the code so forgive if this is a repeat or obvious, respectively!)

    1. I've seen some mention of object pooling and noticed the prefabs look like they'll pool. Anything special to ensure they pool properly? (will need OnSpawned(), etc adding - feel like adding ).
    Btw, I noticed a few Instantiate() calls but think they're mostly Start() time, etc e.g. InvokeInterval(). Fair?

    2. I noticed the above quoted post. Can you clarify, why removing colliders from projectiles when no Shields are in use works, please? I don't have Unity in front of me at the moment (to check specifics, like whether all raycast instead?) but would assume colliders are needed to determine what (if anything) is hit, no?

    Thanks for the excellent effects! Keep up the great work!
    Rupert.
     
  31. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    if you do an explosion pack, please take a look at other assets for what not to do. There's far too many explosion effects which use low-fps animated sprites, they look 2 dimensional, jarring, and unnatural.
     
  32. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    1) Object pool pattern works for all effects (except for the effect with a cloth, because I could not understand how to reset the coordinates.)
    A projectile during a collision (or if they have flown a certain distance), deactivated after a certain time (using "setActive (false)"), thus causing event "EffectSettings.EffectDeactivated".
    After calling the event, you can put projectile into the object pool.
    For other effects, such as a shield, you must first disable the effect through property "EffectSettings.IsVisible", and when the effect disappears, deactivate the effect through "setActive (false)" /
    What would be the effect of re-use, sufficient set the method "setActite (true)".

    2) Initially, I used the shields with rigidbody, that would determine the collision. But it was necessary to set the collider for all projectiles. And also projectiles at high speed or low fps could have problems with a shield collision detection.
    Now shields and projectiles not used physics and colliders. Projectile on impact, call a collision event on the shield. This is much faster and more efficiently.

    Yes you are right, many of the effects of explosions use about 16 frames per second, which is sufficiently small. I try to use all effects with a minimum 30 frames.
     
  33. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Thanks for your reply.
    This raises another challenge for my integration that I'd really like your input on. (followed by a quick clarification at bottom.)

    How best to temporarily disable shooter-projectile collisions while launching?

    My current weapon system uses a temporary Physics.IgnoreCollisions() between relevant parts (which it undoes shortly). I can't use layers (local multi-player and all Players share layers -- I'd run out even if I hadn't already got huge layer usage).

    The first solution to occur is add a callback in your code to ask whether to consider an impact as an impact. EffectSettings.impactValidators that return bool, true meaning "yes, that's a valid impact", false meaning "no, ignore that one (proceed as if it hasn't occurred)". Obviously, that would (a) mean lots of call and ignore and (b) potentially missing second impacts if they occur behind ignored impact. (unless one used RayCastAll() which would be a greater performance hit.)

    A second potential seems to be an analogous ability to register ignored colliders. EffectSettings.ignoredColliders which the various CollisionBehaviours could consult before they send the event out.

    There are probably other potentials. Would one of these be agreeable? If agreeable but you lack time and my need is sufficient, what are your thoughts on contributions? (not sure when I'll have time but best to ask!)

    Thanks for your thoughts and consideration. Here's the clarification (for my edification) I mentioned...

    I'm surprised to hear Physics.RayCast() is faster than Colliders! I (a) supposed Unity/PhysX would have that path really well optimized and (b) had heard of performance impact from raycasting (somewhere I can't recall to check details -- some AI write-up?).
    So, the clarification...
    Is this general truth? Are there conditions (e.g. small projectiles that would otherwise require ContinuousCollisions ... that does interpolation too, right?).

    Here's hoping the PhysX upgrade makes the easy implementation faster! :)

    Thanks again! (Loving the look of the icicles flying across my snow scene and the ice shattering on impact!)
     
  34. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    I have not worked with ignoring colliders, and I do not know if it works with "physx.raycast"
    Try to edit the script "ProjectileCollisionBehaviour", in the method "InitializeDefault ()" and set a list of required colliders through "physx.IgnoreColliders ()".

    About the speed. I conducted tests about 500 objects with physics and movement through physx.Raycast. The speed is approximately the same, about 5ms. Only if several objects are faced with physics, then loading a little growing.
    But that was not the main reason for using raycast.
    At high speeds, the physics does not work (just projectiles fly through walls). And also it is not possible to make a move on a random path (for example randomly moving a lightning ball).

    Maybe in the next update, i will add physics as an option.
     
  35. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    From reading the documentation, I'm pretty sure it only affects Collider-Collider situations.

    The part I'm not sure about is how best to provide for ignoring one and finding another while *retaining performance*?

    If RaycastAll() is sufficiently fast (similar to Raycast() - hopefully true over short distances), then perhaps that can be used when ignoring might be needed (i.e. some handlers or Colliders are registered).

    If not, probably iterative Raycast()ing seems needed... but where to start subsequent rays from? (if Colliders are registered, perhaps one can determine appropriate size to offset?)

    If case 1 (RaycastAll()), and now that I've thought about it when not half asleep, I'm thinking the callback approach is likely best. Perhaps returning a more semantically useful enumeration indicating what should happen next (i.e. whether to process/look-for the next Collider or stop there).

    I'll investigate and try hacking a trial version later.

    Can I check my understanding of this last bit... 500 objects when they're not colliding much took similar time to physics but when 'several' (roughly how many? We talking below 10, 50, 100?) were generating hits, it ramped up. Right?

    I'm sure you're right but, for my edification, can I ask why, please? Perhaps something to do with requiring a physics 'step' for data structure updates? (I'm still learning Unity and these 'things to avoid' and 'stuff others have learnt the hard way' at like gold!)

    Thanks again!
     
  36. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    When a projectile almost hit in the script code "ProjectileCollisionBehaviour"
    if (Physics.Raycast (tRoot.position, direction, out raycastHit, distanceNextFrame + effectSettings.ColliderRadius, effectSettings.LayerMask)) {
    hit = raycastHit;
    endPoint = raycastHit.point - direction * effectSettings.ColliderRadius;
    CollisionEnter ();
    }
    You can also check collision with racastAll, ignore the desired Collider, and fly farther. Code like this:
    if (Physics.Raycast (tRoot.position, direction, out raycastHit, distanceNextFrame + effectSettings.ColliderRadius, effectSettings.LayerMask)) {
    var allHits = Physics.RaycastAll (tRoot.position, direction, effectSettings.MoveDistance);
    "some code to search for a desired hit"
    hit = someHit;
    endPoint = someHit.point - direction * effectSettings.ColliderRadius;
    CollisionEnter ();
    }

    About the performance raycast. On my mobile (allwinner a31 4 core 1Ghz, poverVR 544mp2 ~ iphone4s), at 200 flying projectiles simple, mobile showed more than 30 fps.

    About physics. If I am not mistaken, physical objects move with a pulse? Not rational to set pulse every frame that would change the trajectory.
     
  37. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Wow!
    Cool effects!!
    I am totally blown away! :D
     
  38. konsnos

    konsnos

    Joined:
    Feb 13, 2012
    Posts:
    121
    Hey kripto,

    I have a problem. I'm trying to change the EnergeticNetwork, to fall from height, but when I set it over the target it keeps moving at XZ axis. What do I need to change for that to work?
     
  39. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Just comment out the line "rig.AddForce(force, ForceMode.Impulse);" on script "ClothGridCollisionBehaviour"
     
  40. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hey,
    In case I can't figure an answer faster than you reply (I know you're fast!),...
    For the IceSpikes (mobile, specifically), does it detect collisions with players? (If so, how? If not, how best to adapt to do so?)

    I'm starting looking at MoveOnGround but it seems like that's designed let it to follow ground that is below 0.5 on the Y-axis. (right?) Since I'm already breaking that (my ground is higher), I'm about to add a "maxInclination" parameter to start ray cast from (above current root position). For the floor follow, I'd also like to specify a layer to consider floor (will add to MoveOnGround as well since it's distinct from what the effect should 'hit'). But all of this only solves floor following AFAICT.

    All thoughts welcome! Thanks!
     
  41. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    P.s. I note MoveOnGround has an un-referenced OnCollision. Perhaps it's a planned feature?
     
  42. Ithkul

    Ithkul

    Joined:
    Apr 8, 2012
    Posts:
    22
    Great work. I have a challenge though. The EnergeticNetwork works flawlessly the first time. then when I try to reuse the same EnergeticNetwork by activating it again, the 4 corner points seems to be disattached. The result is that the cloth falls streight down. I'd love to avoid the recreate the effect if I can. Any suggestions?

    Best regards,
    Daniel

    Edit: I guess its related to this. It does not support beeing reactivated and has to be destoyed and instanceated.
    void effectSettings_EffectDeactivated(object sender, EventArgs e)
    {
    if (current==15 || current==16) {
    Destroy(effectSettings.gameObject);
    InstanceEffect(GetInstancePosition(GuiStats[current]));
    }
    else {
    currentGo.transform.position = GetInstancePosition(GuiStats[current]);
    isReadyEffect = true;
    }
    }​
     
    Last edited: Dec 6, 2014
  43. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    I could not understand why, in the deactivation cloth render, colliders are not attached. (Maybe it's some bug)
    Therefore, the effect of the energy network should instantiate every time again.
     
  44. Ithkul

    Ithkul

    Joined:
    Apr 8, 2012
    Posts:
    22
    No problem. I'll let you know if I figure it out. Keep up the good work :)
     
  45. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hey

    So I've got some changes to offer back. What's your preferred means? (e.g. patch posted here? (useful for others until/if not integrated) / e-mail / ... ?)
    The first patch does the ignore collisions thing I originally mentioned ages ago. The second makes MoveOnGround follow floor bumps and stop at steps up or down that are too great (configurable). I have Unity Test Tools integration tests for these if that's useful.

    Also, I haven't started trying to get IceSpikes (MoveOnGround) to detect collisions en-route yet. I'm thinking that, since I want it to (optionally) hit *all* targets it passes through (rather than stopping at first struck), I'd also need to re-work EffectSettings.OnCollisionHandler() to allow multiple calls. (assuming one wished to keep things funnelled through there.) Is that fair? The advantage being other effects that also want to do multiple hits (which my "ignore collisions change" allows for) could use the same code.

    Better recommendations obviously welcome. The obvious one being simply adding another Component that deals with hits en-route = much simpler but less beautifully generic like the rest of your stuff.

    Thanks, Rupert.
     
  46. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    Since my English is bad enough, I could be wrong :)
    You want that I have included your changes in my pack ? At the moment, I am very busy, and most likely, your changes I'll post not soon, so better send a patch to this forum.
     
  47. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hi, @kripto289
    Your English is very good if it's not your first language (it's good even if you were a native speaker)! My apologies for my writing -- when I'm not thinking about it, I write complicated sentences. Sorry!

    Yes, I hope you will include my changes. I will post patches here as you suggest (when I'm on my laptop, later). Do let me know if you want any changes to them to make it easier to include them!

    Do you have any thoughts about having IceSpikes effect (with MoveOnGround) hit things -- multiple things?

    Thanks!
     
  48. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    @Arkade, If I'm understanding you correctly, maybe have both methods (or even more) available for use, and put a checkmark in a box to enable one or the other behavior.
     
  49. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Yes, sort of.

    The ignoring is like the Physics API call -- you supply a Collider to ignore (or resume considering). My use case is wishing to ignore all parts of my player and their weapon when firing.

    For the stepping, etc, there are parameters for where certain raycasts work from and what are valid values. (obviously, you can set in instances or prefab) The defaults cause the behaviour you'd get without the patch. My use case is undulating floor on its own physics layer with sufficiently large obstacles (on another layer) that will block the effect.

    Does that answer your question?
     
  50. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Perhaps will be enough to remove this line "endPoint = raycastHit.point - direction * effectSettings.ColliderRadius;" in the script "projectileCollisionBehaviour".
    Now I can not verify this.