RimWorld

RimWorld

38 ratings
More Darklight Colours
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4
File Size
Posted
Updated
698.667 KB
Nov 16, 2022 @ 8:35am
Nov 20, 2022 @ 12:47pm
3 Change Notes ( view )

Subscribe to download
More Darklight Colours

Description
More Darklight Colours

What does this mod do?
This mod expands the range of colours considered to be darklights. In default Rimworld darklights are limited to a range of cyans. With this mod, you can have all the colours of the rainbow.

Known Issues
        
  • Mod options reset to defaults with every game restart
  • Maybe more (please report bugs if you run into them)
  • Rimworld says it's not compatible with 1.5 even though it is

Compatibility
  • Safe to (un)install with an existing save file
  • This mod should be compatible with almost all other mods, since it touches something barely any other mod touches as far as I'm aware.
  • It will cause a conflict if a mod relies on Rimworld's darklight calculating method (DarklightUtility.IsDarklight) being unchanged.
  • It may cause unintended behaviour if another mod also wants to change the behaviour of DarklightUtility.IsDarklight. Most likely, this mod will override whatever another mod does, or another mod will prevent this mod from making a change (load order dependant)
  • This mod will probably cause balance issues if used alongside another mod that adds more functionality to darklights beyond small mood buffs/debuffs.

To-Do List
Features/Fixes I hope to add before the heat death of the universe
        
  • Make it so mod options don't reset to default values every time the game is restarted
  • Maybe more

Changelog
Version 1.0.2
Added settings that can be changed in mod options. You can now set what the saturation limit is, and how much you hate primary colours.

Also removed a bunch of unnecessary files, reducing filesize of the mod.
Version 1.0.1
Changed a > to >=, so that pure red/green/blue isn't erroneously classed as not darklight.
Version 1.0.0
Release

Details for nerds
Rimworld's original DarklightUtility.IsDarklight method returns false for any colour with a greater color.r value than either color.g or color.b. And then it would return true for any colour values where:
        
  1. The red value is less than or equal to half of the largest between the green or blue values
  2. The lesser of blue/green divided by the greater of blue/green is greater than 0.85

I used harmony (using a false-returning-prefix) to change this method so that the first check for more red does not exist, and return true for any value where:
        
  1. The lowest of the 3 colour values is less than or equal to largest colour value divided by [elaborate maths involving the Saturation Setting]
  2. The middle value divided by highest value is greater than or equal to [Anti-Primaryness Setting]
19 Comments
Mlie May 19 @ 6:22am 
Since this mod has been reported working in 1.5 I added it to the No Version Warning-mod
https://steamcommunity.com/sharedfiles/filedetails/?id=2599504692
tmo97 Oct 12, 2024 @ 6:29am 
darklight should literally just be dim light
tmo97 Oct 12, 2024 @ 6:28am 
always thought it was kinda weird. they don't like sunlight because it's bright but blue is the color of the sky in the day. blue light is exactly the one color you wouldn't logically use for darklight but chalk it up to tynan ig
MarximusMaximus Oct 11, 2024 @ 10:11am 
FWIW, you can extract the source of the mod from the mod itself, if you wanted to update the info xml. Annoying, but doable. Since you probably only need to update the info file and not the mod files themselves, you should be able to just re-upload in that state, lacking any further source.
Endoxis  [author] Sep 17, 2024 @ 7:39am 
I feel like it's been long enough without any complaints, so:

[h1] PSA: YOU CAN (probably) IGNORE THE COMPATIBILITY WARNING [\h1]
I don't see myself ever updating the mod, so rimworld will always think it's just for 1.4. HOWEVER, it's (highly likely) that the stuff this mod does won't conflict with future game updates. There's no problems with using it in 1.5, and unless Tynan decides to completely rework the light/darklight colouring system it will probably also have no problems in 1.6 and onwards.
Giggles Apr 16, 2024 @ 8:47pm 
Haven't encountered any issues yet!
Endoxis  [author] Apr 16, 2024 @ 11:34am 
Yeah, the compatibility warnings for mods are only because lazy mod authors (like me) forget to update a line of code in some xml file somewhere that tells the game "I was made for this version!"

I would update the mod but I've lost the files since I moved to a new computer, and I've kinda forgotten how RW modding works lol.

Assuming 1.5 hasn't changed the codebits that deal with darklights, the mod should be as equally as compatible as before, even with the compatibility warning
MarximusMaximus Apr 15, 2024 @ 10:19pm 
Looks like this mod is Just Working(tm) in 1.5, just has the warning that it might not be compatible. YMMV.
Porcyon Mar 24, 2024 @ 3:40pm 
Any thoughts on 1.5? Love this mod for my tunneler colonies!
Endoxis  [author] Oct 18, 2023 @ 3:35pm 
i did not, sorry