Jump to content
AmiPolizeiFunk

An asset editor mod to cycle through illumination intervals?

9 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

After making dozens of assets, I'm still learning about how the illumination function works in-game. I struggle to make good patterns because I have to sit there in the editor and wait for it to change seeds. Could someone make a mod where I can just press a button to get a new illumination stage? I think it would help asset creators massively if they can see dozens of iterations of the night light cycle in a short period of time. 

 

I know nothing about modding, so this is a request to you modders out there. Is it possible?

 

I wish the wiki actually published the algorithm instead of "The likelihood of a window to be lit at a given time and its intensity are randomized for values within 128 and 255, the closer the value is to a boundary the more likely it is to be lit and stronger."

 

What does this mean exactly? For example, once it determines the random seed (between 128-255), how big is the range of values that get lit up? Say the seed is 224, will 230 light up? Is the range also random? Does the intensity weaken as we get further away from the base seed? I would love to see the algorithm.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I don't understand your seed talk at all. There are 2 gradients, one is inverted 192 - 128, the other is 192 - 255.

Each building gets a random color from the light palette of the map theme, so probably based on the building id.

Each gradient comes on and off at random times.


Ronyx rhymes with electronics...  

Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    The gradients don't come fully on or fully off. They come on to a certain random extent. Like for example, the top gradient will start at 255 and fade on until it reaches say 208, where 207 is still fully off, 208 is barely on and say 224 (and everything above it) is fully on, then it will fade back to all off. The bottom gradient will act similarly, but like you said, mirrored (but independent) so that it starts at 128 and ends at a random position between 128 and 192. My question is what is the algorithm to decide these random stopping positions? I'd also like to know about the timing, which doesn't seem random at all.. the changes seem to happen at consistent intervals.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    13 hours ago, AmiPolizeiFunk said:

    The gradients don't come fully on or fully off. They come on to a certain random extent. Like for example, the top gradient will start at 255 and fade on until it reaches say 208, where 207 is still fully off, 208 is barely on and say 224 (and everything above it) is fully on, then it will fade back to all off. The bottom gradient will act similarly, but like you said, mirrored (but independent) so that it starts at 128 and ends at a random position between 128 and 192. My question is what is the algorithm to decide these random stopping positions? I'd also like to know about the timing, which doesn't seem random at all.. the changes seem to happen at consistent intervals.

    192 is completely unlit, 128 and 255 is completely lit, it's a gradient, althought a very banded and compressed gradient, it slowly comes on and slowly goes off, there are no random stopping points or whatever.

    About timing, no idea, maybe each gradient has it's own interval so it at least appears random.


    Ronyx rhymes with electronics...  

    Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    You can speed up time with ultimate eyecandy if you like to scroll through the gradient faster.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    2 hours ago, Ronyx69 said:

    192 is completely unlit, 128 and 255 is completely lit, it's a gradient, althought a very banded and compressed gradient, it slowly comes on and slowly goes off, there are no random stopping points or whatever.

    About timing, no idea, maybe each gradient has it's own interval so it at least appears random.

    The gradient only comes on to a certain extent. If you set a light group to close to 192, say 193-203 or 181-191, it will rarely come on because the gradient will often stop before it gets there. Conversely, if you set areas to values close to 129 or 255, they will come on for every interval. 

    1 hour ago, Darf said:

    You can speed up time with ultimate eyecandy if you like to scroll through the gradient faster.

    I tried that but you can't speed up the intervals. You can set it to forever night (by using the "paused position"), but you still have to wait for the gradients to change at their same slow speed. I'd love to be able to just press a button and make it skip forward on this interval timer so that you could see variations on your lighting scheme w/o having to sit there and wait for them.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    48 minutes ago, AmiPolizeiFunk said:

    The gradient only comes on to a certain extent. If you set a light group to close to 192, say 193-203 or 181-191, it will rarely come on because the gradient will often stop before it gets there. Conversely, if you set areas to values close to 129 or 255, they will come on for every interval. 

    That's what a compressed banded gradient looks like, the values are not smooth, therefore there are sudden changes in the illumination, try putting an actual gradient on the texture, you will see the banding.

     

    48 minutes ago, AmiPolizeiFunk said:

    I tried that but you can't speed up the intervals. You can set it to forever night (by using the "paused position"), but you still have to wait for the gradients to change at their same slow speed. I'd love to be able to just press a button and make it skip forward on this interval timer so that you could see variations on your lighting scheme w/o having to sit there and wait for them.

    Use cheat engine to speed up the entire game.


    Ronyx rhymes with electronics...  

    Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I just set it to night and speed up time in the asset editor. It takes a little to cycle through and get all different windows lit, but a x3 speed it isn't that bad. Ofc I've never done anything with tons of different window options.


    My workshop items

    Catch my latest project and future plans on my Patreon page

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I made a little sped up test video to help visualize it. Just sharing the vid in the hopes that it may help other creators.

     

    I learned 2 things that I didn't know before:

    1. values 0-120 are bright white and not effected by the pallete

    2. the top gradient and bottom gradient move independently of one another

     

    Another question, once you plop a building, will it always have the same illumination pallete color on every load? Or will it change?

    • Like 1

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections