Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

[Released] Light Behavior - C#

Discussion in 'Works In Progress - Archive' started by Onpolyx, Nov 6, 2015.

?

Does this seem like an interesting idea?

  1. Yes

  2. No

  3. Maybe, Need more information

Results are only viewable after voting.
  1. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39



    EDIT:
    Light Behavior
    is now available on the Asset store for 10$!


    Light Behavior is a an asset pack I've been workig on for a while now, containing several scripts written in C# that are used to add light-effects on your existing light sources.​

    STORE LINK
    Light Behavior is now available on the Unity Asset Store for 10$!
    WEB DEMO 1
    Get an idea of what can easily be achieved when using Light Behavior


    WEB DEMO 2
    Look at what kinds of effects are included​


    Light Behavior gives you complete control of how your light sources behaves in Unity.
    It offers an easy way to manipulate your lights, bringing a wide variety of light-effects suitable for any situation or game.



    Light effects and Light Cookies included in the package



    All scripts are written in C# and have been optimized for performance and usability, written with a Drag ‘n Drop mentality it’s as simple as adding the script as a component to the light source to get it to behave like you want it to.

    I prepared a very short and simple video to show some of the features of the package:







    As shown in the video, each behavior offers complete control via the Unity inspector, making it super easy to change values and tweak individual behaviors to suit your needs.





    Light Effects


    Blinking
    The light source blinks with a set interval.
    Minimum strength and time between each “blink” is set in the Unity Inspector


    Flicker
    The light source flickers on and off in a seemingly random fashion.
    Minimum strength and flicker-frequency can be set in the Unity Inspector


    Flicker Horror version

    Very similar to “Flicker” but with a more eerie feeling


    Calm Emergency

    The light source fades in and out, in a calm way, never reaching completely black.
    Perfect when simulating a siren or Emergency alarm and don’t want to overwhelm the player.


    Intense Emergency

    Similar to Calm Emergency; the light source fades in and out, but in a more intense way, going from original brightness to completely black.
    Perfect when you want to relate a more stressful feeling in an emergency setting.


    Fire

    Like the name describes, the light source simulates the light of a fire.
    The behavior is divided into two sequences; Calm Time and Intense Time
    During Calm Time the light flickers in a pretty calm and predictable way, however in Intense Time the light behaves in a more intense manor to simulate the fire flickering in the wind.
    The time spent in both “calm time” and “intense time” can be set within the Unity Inspector.


    Torch

    Simulates the light casted by a fire-torch or a fire that is a subject to many outside forces.
    Very fast and strong changes in values.


    Candle
    Simulates the light casted by a candle or a very calm fire, very small changes in values.


    Volatile Fire

    Very similar to fire, going through the sequences Calm Time and Intense Time,
    however this behavior has much greater and faster changes in its values, making it seem more alive, simulating a wild-fire or a fire that is starting to spread.


    Dual Color

    The light source shift between 2 different colors; starting with its original color and fades into the second color. When second color is reached, the light starts fading back to its original color.
    Both colors and the time between each full change in color can be set in the inspector.


    Dual Color – Simple

    Similar to Dual color, however, when the light reaches its second color it will jump straight back to the original color to start over.
    Both colors and the time between each full change in color can be set in the inspector.


    Move between

    The light source will move from its original position towards the position of another game object in the scene.
    When the second position has been reached, the light source will start moving back to its original position.
    Positions and the time between each change in position can be set in the inspector.


    Move one way

    Similar to Move between, however, when the light source has reached its second position, it will jump straight back to its original position.
    Positions and the time between each change in position can be set in the inspector.
    Sound effect and Time between each lightning strike can be changed within the Inspector.


    Thunder (Area)

    Simulates a lightning strike as seen when outside.
    An interval between each lightning strike is set in the inspector, as well as a possible sound effect (Sound effect can be ignored if want to).
    When lightning occurs, the light flashes very fast for a short period of time.
    The amount of flashes in each lightning strike is randomly changed to make sure that two lightning strikes following each other do not look the same.


    Thunder (Window)

    Very similar to Thunder (Area), but with changes to how each flash behaves to make it a look better when using spotlights that simulates lightning flashing through windows.







    Includes 10 different light cookies to make sure each light effect looks as beautiful as possible


    Light Cookies

    FlashLight
    Door
    Emergency Light
    Fire
    Volatile Fire
    Bars
    Sqaure
    Window
    Window (Double)
    Window (Tree shadow)




    Prefabs

    Also included are light-prefabs connected to each behavior. This is to make it a bit easier to grasp when first using the package, showcasing what each behavior does to the light source and how the tweaking the values changes the behavior.
    These prefabs can also be used if you want to add new light sources of a specific behavior from the get-go, without going through the process of creating a new light source and adding the correct behavior.



    Ready-To-Use Light Prefabs included for each light behavior


    Sound interesting? Anything you'd like to see added? Would love to get some feedback from you guys on this! :)
     
    Last edited: Feb 17, 2016
    chrisall76 likes this.
  2. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    More information / updates on this project coming very soon!

    I'm currently working on making sure that each and every behavior are mobile / web friendly,
    There's also some new features that should be ready for unveiling very soon!
     
  3. keenanwoodall

    keenanwoodall

    Joined:
    May 30, 2014
    Posts:
    598
    This seems pretty useful. It's nice to drag-and-drop and get instant results. :)
     
  4. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Glad you like it! :)

    I've been working hard on making some major changes in the package though, making it way more optimized and easy to use, tweaking existing behaviors to look better and also added alot more new behaviors!

    So if you're interested in the package be sure to check out the original post again, since I just updated all information about the package to include more info that is up-to-date and more in-depth! ;)
     
    Last edited: Nov 20, 2015
  5. woodsynzl

    woodsynzl

    Joined:
    Apr 8, 2015
    Posts:
    156
    This is a cool asset! Looks really handy for intense games. Crazy how something so simple can have a big impact on games
     
  6. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39

    Thank you! :)
    It’s insane how much things like lightning and music can dictate the entire mood of a level, hopefully this should speed up the lightning part of the workflow a lot!

    I’m thinking about releasing the package very, very soon!
    Still got some cool ideas I’d like to see added but I would rather release the package as is, adding new behaviors later on via updates!
     
  7. woodsynzl

    woodsynzl

    Joined:
    Apr 8, 2015
    Posts:
    156
    Even in something like Battlefield 4 when the aircraft carrier is sinking the lights make that scene awesome! Looking forward to seeing it
     
  8. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Hi there! Looking really good.
    Since you've asked for some ideas.

    -How about controlling emissive materials?
    - How about the standard "Electric torture light flickering" we use everyday in our houses? :)
    -Police,ambulance rotating head lights?
     
  9. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Thank you! :)
    Great ideas! Will definitely look into it!

    I've been thinking about doing some effects with some sort of rotation involved, like police and ambulance lights, but im not 100% satisfied with the results yet... But it's definitely on the drawing board!
     
  10. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Light behavior has been packaged and set off to Unity for review!:)
    And so now we play the waiting game...

    Hopefully, if all goes well, it should be released in a couple of weeks.


    Still got alot of behaviors on the drawing-board however, and so I will continue working on adding more behaviors that will be released in an later update.
     
  11. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Hello all!

    Made a short but fairly comprehensive tutorial on how to create simple Light Effects with some C#-scripting, using similar techniques that I've used while creating the scripts in this package!

    This tutorial should serve as to show how one can use some simple math while writing scripts to get some really cool effects in games!

    Check out the tutorial HERE
     
    Last edited: Dec 5, 2015
  12. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Light Behavior is now available on the Asset Store for 10$! :)
    If you decide to buy it I'd love to hear your thoughts on it!

    Check it out on the store HERE
     
  13. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Light Behavior Version 1.1 is under development!

    Light Behavior Version 1.1 is planned to be a free upgrade to the Light Behavior Package, containing several new light behaviors.

    One of the new behaviors contained in the upgrade will be Police/Ambulance lights.
    A really cool feature of this effect is that it has several different light-patterns that are easily changed on the fly, while the game is running.



    Here’s a short preview of Police Light [Pattern 4]




    Note that this effect is still under development and not 100% complete. Still need some fine tuning to make it look really awesome.




    More information about Version 1.1 will be comming once I feel that I've come far enough that I got some more behaviors and features to show off, but in the meantime...

    I want your help!

    Even though I have a lot of behaviors already planned I feel that it is more important to hear what you guys would like to see added!
    So: please feel free to leave a reply to this thread stating what kind of behavior you feel is missing from the package!
     
    Last edited: Dec 8, 2015
  14. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Due to popular demand I’ve created some short videos, showing off each behavior in the package!
    Video preview of the fire behaviors is not quite ready but should be added soon!



    Preview 1

    Effects: Dual Color, Dual Color (simple), Move One Way, Move Between




    Preview 2


    Effects: Thunder (area), Thunder (Window)





    Preview 3

    Effects: Blinking, Emergency(calm), Emergency(intense), Flicker, Flicker(horror)
     
  15. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Light Behavior 1.1 Update

    One of the new behaviors coming in the free 1.1 upgrade is a massively improved version of the fire effect.
    Much more advanced than previous fire effects, it takes use of additional behaviors like moving and wind simulation to get more realistic look.
    Together with a custom editor it offers much more customization and freedom, making it a lot easier to get the light to behave exactly as you want it to!

    Here is a (very) early preview of what you can expect from the new fire effect, showing off how easy it is to make the light behave drastically different.

    1.1 FireEffect Preview


    This is very early preview and the effect is still under development and is not 100% representative of the final product.
     
  16. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Early preview is looking really nice:) Thanks for sharing.
    It might be a bit early to ask but:
    -Does wind simulation also add a wind component for particles?
    -How about some random changes to light range?
    -How about a volume (array of lights) containing few light behaviour lights?
     
  17. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Light Behavior 1.1 is now released and available on the Unity Asset Store as a free upgrade!

    Adding 3 new advanced light effects:
    - Fire
    - Blink
    - Flicker


    These new advanced light effects are most easily explained as extensions of already existing light behavior that provides much more user customization and a lot more freedom to control exactly how the effect controls.


    For example, the fire:
    The earlier fire behaviors was not providing as much control as I’d wanted when it came to how the effect actually behaved. Instead the package contained a bunch of different, almost preset, behaviors; Campfire, volatile, candle & torch.
    To remedy this, the new fire effect gives complete control, offering variables like “fire intensity” and “randomize” options.

    All new fire effects should be made using this new behavior, as it gives that much more control of the behavior itself.
    Instead of having 4 different script for the fire (Again: campfire, volatile, candle & torch), that basically do the same thing just with some different variables and calculations, all of these can be found under “presets” directly in the inspector of the new fire effect.
    Because of the high customization of the new advanced effects (Taking use of things like editor extensions) you will be able to create any fire effect that you might want from this behavior.


    The same, of course, goes for all of the advanced effects.


    Adding 1 completely new light effect:
    - Police /Ambulance

    This effect gives you control of relocating a light source in a customizable frequency and also gives you the control of a color change.
    This is to simulate the lights on top of a police car, taking advantage of simple things like:
    if the outer light on the left is bright blue, the outer light on the right won’t be shining red at the same time.

    Not only does this make it really easy to a new police light but also serves to make sure the computer doesn’t have to compile 2 different light sources when only 1 is needed.


    A Prefab of this light effect can also be found in the upgrade, showing off what can easily be achieved by using as little light sources as possible while still providing lights simulating police lights that would be used during an high speed chase or to indicate the position of a crime.



    I will be updating this thread with some video-tutorials, showing off how to use the new effects in 1.1, when the holidays are over to show off how easy it is to create some really awesome light effects in just a matter of seconds using this new system!

    I’m also working on some more Advanced Effects and new effects that will be added in a later update!
     
  18. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Hello!
    Had to change the name of "Wind Simulation" as I felt this description was a bit misleading.
    It doesn't really have anything do to with wind-simulation in Unity; but more of how the wind itself is effecting a fire (since when a fire is effected by a strong wind it either dies out alot or flames up alot).
    It's a good idea to somehow link this together with something like a wind-zone in Unity, and I will deffently take this in considoration as I'm working on some more features for later updates!

    The same goes for arrays!
    I didn't have time to implement this into 1.1 since I wanted to be able to release it before 2016 but that is deffently on the table for future updates, I would go as far as to say it's almost done; I'm just working on a really user-friendly way to implement it, without overwhealming the user with variables and "techno-bable".

    Sorry for the late reply! :(
     
  19. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Hello!
    If you're still interested in those kinds of effects I would defently suggest checking out Light Behavior 1.1, everything exepct emissive material control have been added (still working on that one) ;)
     
  20. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39
    Hello again all!

    Sorry for the huge gap with no real new information about what is going on with Light behavior,
    I’ve just had a lot of things happening around me that has taken up most of my time…


    However!
    I’ve still found enough time to be working on some really cool features, fixing some minor bugs and also a very in-depth documentation that should help any developer that would want to expand on the scripts and add their own effects!



    Here are some of the features planned for the coming Update 1.11
    • Extensive documentation and guides to make it a lot easier for developers to add their own behaviors and understand everything that is going on in the scripts

    • Minor bug fixes that makes the world a better place

    • Material – emission control added to certain behaviors to expand the possibilities to create some really astonishing effects



    All of these are planned to be included in the free 1.11 update, scheduled to be released “soonish”, and I will post some more in-depth information about this very soon!
     
    gurayg likes this.
  21. Onpolyx

    Onpolyx

    Joined:
    Oct 12, 2015
    Posts:
    39



    Spring Sale for Light Behavior!
    The price of this package has been reduced by 35% and now only cost 6.50$! (Down from 10$)

    This price is subject to change in 2 weeks, whereupon the package will return to its original price,
    so hurry up and get this awesome light-effect package for your games!