Skip to content

Commit

Permalink
sepia tint remembered tiles instead of simply darkening them (#32669)
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericist authored and ZhilkinSerg committed Jul 28, 2019
1 parent cbdb75c commit 0a459aa
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/sdl_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,22 @@ inline SDL_Color color_pixel_memorized( const SDL_Color &color )
if( is_black( color ) ) {
return color;
}
// 85/256 ~ 1/3
return {
std::max<Uint8>( 85 * color.r >> 8, 0x01 ),
std::max<Uint8>( 85 * color.g >> 8, 0x01 ),
std::max<Uint8>( 85 * color.b >> 8, 0x01 ),
color.a
};

/*
* Objective is to provide a gradient between two color points
* (sepia_dark and sepia_light) based on the grayscale value.
* This presents an effect intended to mimic a faded sepia photograph.
*/

const SDL_Color sepia_dark = { 39, 23, 19, color.a};
const SDL_Color sepia_light = { 241, 220, 163, color.a};

const Uint8 av = average_pixel_color( color );
const float gammav = 1.6;
const float pv = av / 255.0;
const Uint8 finalv = std::min( int( round( pow( pv, gammav ) * 150 ) ), 100 );

return mix_colors( sepia_dark, sepia_light, finalv );
}

SDL_Color curses_color_to_SDL( const nc_color &color );
Expand Down

19 comments on commit 0a459aa

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding such functionality without an option to disable it (have the gray back) should be severely punishable. New sepia tint is HORRIBLE.

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frogs. Definitely frogs. And some leeches, too.

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seriously, tho. Making it black-n-white would be a way better option.

@esotericist
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

black and white is not a valid option, because low-light vision is black and white. Remembered tiles must be distinct from low-light tiles.

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, low light vision could be coloured but darker (or just less saturated), but looks like no one thought in that direction, isn't it?

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not cyan, then? Or magenta? Or, I don't know, lime, maybe? Why sepia? Is your memory all brown in your head? Sepia as option for this is as ridiculous as cyan, or magenta, or whateverthecolour. While black-n-white makes perfect logic for that, and making low-light vision have colours, but less saturated fits this agenda much better.

"Let's assume we can see at least some colours in low lighting environment, and no colours in areas we remembered" vs "let's use Sepia! Why? Because f**k logic, that's why!"

@alfuken
Copy link

@alfuken alfuken commented on 0a459aa Jul 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you try to remember things and places, you may not remember colours, but you remember things, objects, shapes. If you don't remember a colour of an object, you assume it's either grey, or black, or white, or something in between. When you think about something, it usually goes "oh, that bike/car/dress looked nice, too bad i don't remember the colour...", you don't think "oh, that was a nice car... it's colour... what was it's colour... it was SEPIA! Adn the dress was SEPIA, and bike, and furniture, whole effing world? This is SEPIAAAA!!".
As of "why" - the answer is "it's way less ridiculous."

@alfuken
Copy link

@alfuken alfuken commented on 0a459aa Jul 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name 3 games where "fog-of-war" uses sepia. No googling.

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright then. Photographs from the past? I just saw that wall 5 seconds ago. Sheet, that was AGES ago! That table in the room I just left? Such old! So faded!

Again, no person in sane mind will assign sepia to all their memories in own head. Literally no one.

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that is not the case. I am deeply convinced that if you MUST make remembered area be different from directly visible, it should be neutral. Either B/W or dimmed (less saturated), and no specific colour applied.

Basically it boils down to "Neutral" vs "Some one man's personal preferences in colours". Neutral - fits all.

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I was feeding the troll all along. Bon appetite in any case.

Last argument against sepia: ask anyone who played computer games, what they think about colours of areas that are not directly visible. NOONE will say sepia. Gray, dark, dimmed, white, black - but you will have ZERO answers with sepia.

It's just not natural.

@ZhilkinSerg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ask anyone who played computer games

What if you ask author of this PR and they will say sepia? ;)

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highly doubt it. Can you name any? Just not google-found, but really ones that you've played.

@I-am-Erk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, sepia, the deeply unnatural colour of horror.

If you're going to appeal to tradition, I'd say if you ask anyone to name a single colour that was associated with "memory", the answer would be sepia, but it's entirely irrelevant anyway. It could be literally any colour to distinguish it from low light vision, but sepia is an obvious and easy choice.

@alfuken
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over the last 2 hours asked ~40 ppl about it. Zero answers with "sepia".

How is it even "an obvious choice"??

@ZhilkinSerg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highly doubt it. Can you name any? Just not google-found, but really ones that you've played.

Name what? You've asked whether anyone would say "sepia" and I suggested PR author would say it.

@Petethegoat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you read the pull request? The plan is already to make this configurable per tileset down the line.

@I-am-Erk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you just went around polling people about what they think colours mean, I think you've entirely missed the point: it's irrelevant. It could be teal or green scale. Sepia tone makes sense because despite your widespread poll that I'm completely convinced you really did, sepia tone is often used for flashbacks... But nobody fucking cares, we just need a colour change to distinguish it from darkness and from low light vision. This achieves that.

@esotericist
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As entertaining as this has been, this is not a chatroom.

@alfuken If you have discussion to offer on the implementation details of the PR, put it in the PR.

If you have a bug report or feature request, post it in the issue tracker (following the appropriate template).

Otherwise, you should go back to the discourse. I know you know where it is, seeing as how I already saw the hilarious edit history on the post you made earlier.

Please sign in to comment.