User Tag List

Results 1 to 8 of 8

Thread: Day / Night cylce and other light sources

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Day / Night cylce and other light sources

    Hi,

    I'm having trouble creating light sources that interact with my day and night cycle.

    I have a layer with the scrolling coefficients set to 0 so it's always on screen filled with small black hexagons and I've implemented a custom clock into the game.

    As the clock changes the transparansy of the hexagons changes.

    To do this I've created an Alterable Value on the black hexagons called Time, so at 4am for example the Time Value may be 10 then at 4:30am it may be 15 etc.

    I've created three other Altenative Values, Light, Total and Lit.

    Every .01 second the Total value is set to the Time + Light values and tthe transparacy of the hexagons is set as the Total value.

    This works fine, as the clock goes from midnight to midday the map get's lighter and then darker again as the time goes towards midnight, that's fine.

    What doesn't work is light sources I'm trying to add at night.

    What I've done is created some objects that will be hidden in the game, and set them so that every .1 second they overlap one of the hexagons the Light Value is set to 100 for example so that bring the Total value at 4am for instance to 110 making the transparency of any overlapping hexagones 110.

    To allow for the transparancy to change back to just 10 when not overlapping I also set the Lit value to 3.

    Then every .2 seconds 1 is subtracted from the Lit value and another action sets it so that when the Lit value equals 0 or less then Light Value becomes 0 again and the Lit value is set at 0 also.

    The first problem is that if I place the lighting objects that change the Light value to the same layer then they will remain on screen while the map below is scrolling. The second problem is that no matter what layer I put them in, they don't appear to be having any effect on the transparency of the hexagons. They still change with the time, but they don't get more transparent when overlapping the lighting objects.

    If anyone has any ideas how I can make this work that would be greatly appreciated.

    I think the issue could be resolved if I can somehow cause the light object to interact with the hexagons from another layer.

    Thanks

    Joe

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Day / Night cylce and other light sources

    It sounds like your code for changing the lighting of the hexagons is interfering with your lights during the night. Have you tried adding some negated conditions to test when certain conditions are not met? For example when you subtract the Lit value every .2 seconds you should check to see if it's not overlapping the light objects so that it only makes the surrounding areas that aren't lit, darker. Make sure your code for changing the light levels is not conflicting.

    Also you need to have these objects not on the same layer as your hexagons since that layer is locked and not moving with the frame.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure how to check if something is not overlapping without using a counter or value.

    I've attached the mfa if you could take a look, it's the 4th frame Time and Weather.

    I've tried a couple of appraoches now and I can't get the light sources working from different layers.

    Thanks


    Joe
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've done a bit of digging and it looks like I'm going to have to try either using coordinates to alter the light or have the light objects jump between layers very quickly to interact with the hexagons.

    Another option would be to set the scrolling coefficients for the night / day layer to 1 and find a way to only lock the hexagons in view but I think that could get messy with there being so many of them.

    If anyone knows an easier way to simulate day and night cycles with additional light sources that would be appreciated.

    Thanks,

    Joe

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Nicholas Martin's Avatar
    Join Date
    Nov 2006
    Location
    Canada
    Posts
    202
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Joe. I am not at home to open your project but why don't you put the light objects on the same layer as the lighting system? You can have the layer scroll and just uncheck "follow the frame" for the lighting system objects. I hope that works for you.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Nicholas Martin's Avatar
    Join Date
    Nov 2006
    Location
    Canada
    Posts
    202
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I played around a little with it and it seems to be working. I am not exactly sure what you wanted it to do. Anyways I hope this helps you out.
    Attached files Attached files

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Nicholas Martin's Avatar
    Join Date
    Nov 2006
    Location
    Canada
    Posts
    202
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another solution you could do... have layer 50 move with frame. Have light objects set not to follow frame. To check for collisions on other layers you can have them create a "collision mask" on layer 50 that is destroyed after .2 seconds. Since layer 50 follows the frames but the light actives do not this should take care of they layer problem. Have collison mask created relative to light emitting objects. then move to layer 50. destroy after .2 seconds. I can make an example if I am not making sense.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Nicholas Martin's Avatar
    Join Date
    Nov 2006
    Location
    Canada
    Posts
    202
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also created a simple day and night system for you using the multiply shader on a layer. If you need help with anything let me know.
    Attached files Attached files

Similar Threads

  1. Looking for Score Image sources
    By amaire13 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 17th September 2012, 04:18 PM
  2. Looking for good sources for animations
    By amaire13 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th August 2012, 09:47 PM
  3. getting webcam and other video sources
    By Chokito in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 6th August 2008, 02:43 AM
  4. Sources of lag
    By xerus in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th March 2008, 06:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •