Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old June 28, 2021, 18:51   #1
backwardsEric
Adept
 
Join Date: Aug 2019
Posts: 219
backwardsEric is on a distinguished road
"torch-lit" grids in Vanilla

For the user option in Vanilla to color "torch-lit" grids, is the intent to only do that for grids lit up by the player's light source or for anything that's lit up and doesn't have light coming from the intrinsic glow of a room? From what I see in the code, it looks like the current behavior is the latter.

I'm trying to tweak the lighting model (in cave-view.c) so light/unlight from players, monsters, and bright terrain doesn't propagate through walls without breaking the visuals (in cave-map.c), including the "torch-lit" effect.
backwardsEric is offline   Reply With Quote
Old June 28, 2021, 22:55   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 56
Posts: 9,171
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
It's meant to be only grids lit by the player's light source. I vaguely thought the current behaviour wasn't right the other day, but didn't follow up.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 29, 2021, 03:10   #3
backwardsEric
Adept
 
Join Date: Aug 2019
Posts: 219
backwardsEric is on a distinguished road
Quote:
Originally Posted by Nick View Post
It's meant to be only grids lit by the player's light source. I vaguely thought the current behaviour wasn't right the other day, but didn't follow up.
It looks like the tests for square_isglow() in cave_map.c should use the light level instead since there's now more sources of light than squares marked with SQUARE_GLOW and the player's light source. If that's the case, I'm guessing the seen unlit squares should be marked with LIGHTING_LIT for non-necromancers and LIGHTING_DARK for necromancers. Does that sound right?

LIGHTING_TORCH would be applied to the seen squares in the player's light source radius that have a positive light level. Or should that only be done for grids where the light level matches the output of the player's light source to mimic the old behavior of applying LIGHTING_TORCH when square_isglow() was false?
backwardsEric is offline   Reply With Quote
Old June 29, 2021, 04:08   #4
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 56
Posts: 9,171
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Quote:
Originally Posted by backwardsEric View Post
It looks like the tests for square_isglow() in cave_map.c should use the light level instead since there's now more sources of light than squares marked with SQUARE_GLOW and the player's light source. If that's the case, I'm guessing the seen unlit squares should be marked with LIGHTING_LIT for non-necromancers and LIGHTING_DARK for necromancers. Does that sound right?

LIGHTING_TORCH would be applied to the seen squares in the player's light source radius that have a positive light level. Or should that only be done for grids where the light level matches the output of the player's light source to mimic the old behavior of applying LIGHTING_TORCH when square_isglow() was false?

I think square_isglow() is fine, but there needs to be change in how it is used vs square_islit(). The conditional in map_info() starting with (if g->in_view) I suspect needs to be rethought. I think seen unlit squares need to be LIGHTING_LOS (or LIGHTING_DARK if they're in a necro's dark radius). Then seen lit squares are LIGHTING_LIT, and lit squares in the player's light radius are LIGHTING_TORCH - I think that fits the new lighting scheme better than the old !square_isglow() behaviour.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 29, 2021, 05:11   #5
backwardsEric
Adept
 
Join Date: Aug 2019
Posts: 219
backwardsEric is on a distinguished road
Quote:
Originally Posted by Nick View Post
I think square_isglow() is fine, but there needs to be change in how it is used vs square_islit(). The conditional in map_info() starting with (if g->in_view) I suspect needs to be rethought. I think seen unlit squares need to be LIGHTING_LOS (or LIGHTING_DARK if they're in a necro's dark radius). Then seen lit squares are LIGHTING_LIT, and lit squares in the player's light radius are LIGHTING_TORCH - I think that fits the new lighting scheme better than the old !square_isglow() behaviour.
From grid_get_attr() in ui-map.c, LIGHTING_LOS can be a lighter color than LIGHTING_LIT so wouldn't interchanging LIGHTING_LOS and LIGHTING_LIT in your formulation be more intuitive visually?
backwardsEric is offline   Reply With Quote
Old June 29, 2021, 07:22   #6
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 56
Posts: 9,171
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Quote:
Originally Posted by backwardsEric View Post
From grid_get_attr() in ui-map.c, LIGHTING_LOS can be a lighter color than LIGHTING_LIT so wouldn't interchanging LIGHTING_LOS and LIGHTING_LIT in your formulation be more intuitive visually?
Or maybe LIGHTING_LIT should instead be lighter coloured than LIGHTING_LOS, which has the same effect. This stuff always confuses me, so take your best stab at it
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Best" versions of Vanilla Angband? unic Vanilla 35 February 13, 2017 17:11
Bug with "Turn" in the "Player History" dump bron Vanilla 3 January 17, 2014 17:35
Regarding perma Torch grids... Avenger Vanilla 3 December 19, 2013 16:12
Can we have the "map remembers torch-lit grids" option back? Max Stats Development 11 March 4, 2011 16:20
"repeat" Command just little bit "smarter" ClaytonAguiar Vanilla 8 June 17, 2009 16:01


All times are GMT +1. The time now is 00:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.