Barotrauma

Barotrauma

Not enough ratings
Realistic Light Ranges
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
43.947 KB
Apr 16, 2024 @ 3:58am
Apr 24, 2024 @ 10:42am
14 Change Notes ( view )

Subscribe to download
Realistic Light Ranges

Description
Now range of light components depends on light luminosity, brighter lights have larger range

Mod recalculates light ranges with lua for all lights on each round start, after cl_reloadlua, or manual color change
Range is proportional to sqr root of luminosity
luminosity is proportional to sum of color components and alpha

Important: this process is irrevertible, so if you wanna try it then go to sub editor, quickstart, or start a new campaign


Individual lamps now looks more natural, no more super bright lights with 1cm range
But subs... well, some looks better, some looks worse, they aren't designed for such violent changes

I think this mod could be useful to sub builders, because it shows which ranges your lights should have so it's wouldn't look like you're breaking laws of physics


This recalculations can be toggled with "lightrange" command, and triggered with recalclightranges or cl_reloadlua

Mod also changes textures of light to pointlight_bright.png which imho looks more natural than pointlight_bounce.png

and there's settings.json file in mod folder, you can set brightness of different types of lamps or global luminosity multiplier

Some lights on some subs are misconfigured and shine through hull or just off for no reason
You can force them to be drawn behind sub/ shadow casting/ on/ off with cursed settings if you not afraid
5 Comments
Nupaska  [author] Jan 14 @ 11:22am 
I no longer maintain it so i have no idea if it' broken or not
Because:
- There's no good univeral rule, some lights will always be broken, you need to target them with id and there's just no way because BaroDevs don't store unique item ids
- As you said it's not safe, it needs some change history, undo command, better light editing ui,
and it's all very painful to make in lua
- And it's hard to sync in multiplayer, those edits are not synced so i have no idea how that works in multiplayer, it needs tons of new net evens to sync it

So it needs to be rewritten from scratch, and i won't do it until:
- Someone would find a way to deduce true item id, idk, from their props or from their position in raw .sub file
- Until i finish my GUI framework because baro gui is dead
- And until mr. NeckRopeMancer finish his great luatrauma rework which should, in particular, simplify networking
Nupaska  [author] Jan 14 @ 11:21am 
Iirc it will change all lights when sub is loaded, in sub editor or in a game
So if you save it to the same file it would be modified
Just save it to some other file if you want to test it
Sullivas Jan 14 @ 8:37am 
Is it safe to edit subs with this mod enabled? Worried about loading a sub, editing it, testing, returning to editor, and saving being affected by this mod.
Nupaska  [author] May 11, 2024 @ 7:04am 
hmm.. idk, i'm also playing with it and a ton of other mods now
which lights are broken? could you give me a screenshot?
also did you touch mod settings?
MEB May 10, 2024 @ 8:23pm 
@author (s) devs, need an update mine seems to have broken. not sure if it is in part with another mod or not yet, but is was working fine before this recent update, occasionally getting areas shadowed in now that clearly should be visable