Page 1 of 1

Weird HP/MP bar colors in 0.21.1 windows tiles

PostPosted: Tuesday, 20th February 2018, 00:17
by dolemite99
I just installed the most currently available local Tiles version for Windows, and I'm seeing some strangeness with the colors of the HP & MP bars. They are very "dim" (low color saturation), almost invisible, which I have never seen before. The font color for HP/MP current values & totals look fine, it's just the bar color that's off.

I can't figure out what init.txt setting would control this aspect of the game. Help please?

Here's a link to an example, which I took a screenshot of and uploaded to Imgur.

https://imgur.com/a/x5PW1

Re: Weird HP/MP bar colors in 0.21.1 windows tiles

PostPosted: Tuesday, 20th February 2018, 15:56
by advil
I haven't heard of this one, and I'm not seeing it on a default windows tiles install in a VM. Does it affect the noise bar as well? (You could test this with `tt` for example.) The relevant rc options are hp_colour and mp_colour, but I'm not sure what settings you could pick that would get this result. Edit: are there any other visual oddities that you've noticed?

Re: Weird HP/MP bar colors in 0.21.1 windows tiles

PostPosted: Wednesday, 21st February 2018, 02:20
by dolemite99
I confirmed that the problem also happens for me on my local tiles for download 0.21, so it's not just isolated to the 0.21.1 package.

I've identified a specific init.txt file setting that I can toggle from true to false, and make the HP/MP bars look "proper" versus the dim colors I showed above.

tile_filter_scaling = false
When this setting is left out of the init.txt file entirely, or remarked out with a '#' in front of the setting line, the HP/MP bar colors look right.

tile_filter_scaling = true
When this is set explicitly, I get the dim colored bars.

Re: Weird HP/MP bar colors in 0.21.1 windows tiles

PostPosted: Wednesday, 21st February 2018, 04:01
by advil
dolemite99 wrote:I confirmed that the problem also happens for me on my local tiles for download 0.21, so it's not just isolated to the 0.21.1 package.

I've identified a specific init.txt file setting that I can toggle from true to false, and make the HP/MP bars look "proper" versus the dim colors I showed above.

tile_filter_scaling = false
When this setting is left out of the init.txt file entirely, or remarked out with a '#' in front of the setting line, the HP/MP bar colors look right.

tile_filter_scaling = true
When this is set explicitly, I get the dim colored bars.


Thanks for tracking this down, with this information I was able to come up with a fix. For now on the 0.21.1 release version the workaround is to just not use that setting, sorry.

Re: Weird HP/MP bar colors in 0.21.1 windows tiles

PostPosted: Wednesday, 21st February 2018, 04:12
by Implojin
advil wrote:Thanks for tracking this down, with this information I was able to come up with a fix. For now on the 0.21.1 release version the workaround is to just not use that setting, sorry.


https://www.khronos.org/registry/OpenGL ... ameter.xml

GL_LINEAR
Returns the weighted average of the four texture elements
that are closest to the center of the pixel being textured.

I think it's applying the average RGBA from the USE_TILE_LOCAL HP_Bar and MP_Bar definitions, which each contain 4 RGBA values (that are presumably being setup as overlapping textures?), to wit:
HP_Bar(LIGHTGREEN, GREEN, RED, DARKGREY);
MP_Bar(BLUE, BLUE, LIGHTBLUE, DARKGREY);

48, 95.75, 16, 112.5 (HP_Bar RGBA averages)
16, 16, 127.75, 112.5 (MP_Bar RGBA averages)

Plugging those RGB values into paint looks about right after accounting for the alpha (blending with black window background, probably?)

Re: Weird HP/MP bar colors in 0.21.1 windows tiles

PostPosted: Wednesday, 21st February 2018, 05:19
by advil
Implojin wrote:
advil wrote:Thanks for tracking this down, with this information I was able to come up with a fix. For now on the 0.21.1 release version the workaround is to just not use that setting, sorry.


https://www.khronos.org/registry/OpenGL ... ameter.xml

GL_LINEAR
Returns the weighted average of the four texture elements
that are closest to the center of the pixel being textured.

I think it's applying the average RGBA from the USE_TILE_LOCAL HP_Bar and MP_Bar definitions, which each contain 4 RGBA values (that are presumably being setup as overlapping textures?), to wit:
HP_Bar(LIGHTGREEN, GREEN, RED, DARKGREY);
MP_Bar(BLUE, BLUE, LIGHTBLUE, DARKGREY);

48, 95.75, 16, 112.5 (HP_Bar RGBA averages)
16, 16, 127.75, 112.5 (MP_Bar RGBA averages)

Plugging those RGB values into paint looks about right after accounting for the alpha (blending with black window background, probably?)


That's much more logical sounding than how local tiles actually draws those bars, which is to use text and draw the bar using a sequence of putwch(' ') with one of those colors as a background color and a black foreground, choosing color depending on where the space is in the bar vs. bar value. Nothing is intentionally overlapping. But it's possible that it was just blending the relevant colors with black, maybe twice, for each position, because of the way drawing an empty glyph is implemented.

Re: Weird HP/MP bar colors in 0.21.1 windows tiles

PostPosted: Wednesday, 21st February 2018, 20:31
by dolemite99
Ok, I'm glad to learn it was something that could be corrected in a future version! I have a large monitor, so I love setting the tiles to 64 pixels, turning on tile_filter_scaling and having the game tiles look smooth & not too blocky / pixelated. The dim HP/MP bar colors in 0.21.1 are an annoyance, but not game-breaking ... with 64 pixel tiles I can see the mini HP/MP bars under my character's feet well enough.

Thanks for diving in with a fix!