Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semi-transparent background for nametags #10152

Merged
merged 5 commits into from
Dec 14, 2020

Conversation

Zughy
Copy link
Member

@Zughy Zughy commented Jul 3, 2020

Sometimes reading names is not that easy: we thought about adding a semi-transparent background to increase contrast. This could work very well paired with #10013 . Also, for testing we set font_shadow to false but we did not touch it in the PR

nametags_nobg
nametags

To do

This PR is Ready for Review.

How to test

Spawn a few entities and set a name

@sfan5 sfan5 added Feature ✨ PRs that add or enhance a feature @ Client / Audiovisuals labels Jul 3, 2020
@MoNTE48
Copy link
Contributor

MoNTE48 commented Jul 4, 2020

Should be settable!

@Zughy
Copy link
Member Author

Zughy commented Jul 4, 2020

@MoNTE48 can you name an use-case? Because the idea is to get rid of the shadow behind the font completely (so I'm/we're planning someday to change the chat too), thus names won't be readable at all without a background. As in the first screenshot.

Like, if only it had been the other way around, would you had proposed it? I mean, to feature nametags without a background

@rubenwardy
Copy link
Member

I think this is great as an accessibility option, but I'd prefer to have the more subtle names by default

@MoNTE48
Copy link
Contributor

MoNTE48 commented Jul 4, 2020

@Zughy, if you want to add something to Minetest, make it an option. Otherwise, it will be accepted... never.

@Zughy
Copy link
Member Author

Zughy commented Jul 5, 2020

@MoNTE48 If true, that's bad. As someone who studied graphic design, right now names are simply not readable if they're not pure white. The same goes for chat messages, so it's a pretty big limitation. AT LEAST if it's an option I'd say to use the background as default. Also, where should this option be toggled? Server side via minetest.conf? Client side via settings?

I'd like to hear other core devs opinions

@MoNTE48
Copy link
Contributor

MoNTE48 commented Jul 5, 2020

@Zughy, object (player, entity) parameter. So that you can customize this for each player and object.
Then, I am sure, they will quickly accept it, players will like it, but core devs will never turn it on by default. 🧐
Btw, I press 👍, I really like this idea and I completely agree with what you said above.

@Zughy
Copy link
Member Author

Zughy commented Jul 5, 2020

@MoNTE48 I think the default option should be the "generally more suited" option. If names are not that readable by default, it's not that well suited and new players will judge it as negative. Show those pictures to five different people who've never played Minetest and if they tell you they do prefer the former (the one without bg when it comes to readability), then I'll be proved wrong. Actually, I invite anyone to do that.

If Minetest is "Minecraft-like", then let's cut the chase and adopt what works on Minecraft and let's improve it (as the PR mentioned in the first post, a feature that Minecraft doesn't have).

@sfan5
Copy link
Member

sfan5 commented Jul 5, 2020

While other improvements often end up with "this should be optional or it can't be accepted", I don't think that's needed for this change and it can be merged as-is.

@Zughy
Copy link
Member Author

Zughy commented Jul 11, 2020

Any news? I'm not used to "what happens after a new release", if features must wait a while before getting considered or idk; just, I saw new core devs PRs popping up so I felt asking legit

@LoneWolfHT
Copy link
Contributor

As soon as a release is over from what I'm aware it's time to get features in again

@appgurueu
Copy link
Contributor

Minetest uses font shadow to increase legibility. I notice font shadow being turned off in your screenshots?

@LoneWolfHT
Copy link
Contributor

Minetest uses font shadow to increase legibility. I notice font shadow being turned off in your screenshots?

See the OP and some of the comments

@appgurueu
Copy link
Contributor

I wonder how this looks with font shadow enabled.

@Zughy
Copy link
Member Author

Zughy commented Jul 23, 2020

Any news about it? One approval to go and it requires very little testing :(

@luk3yx
Copy link
Contributor

luk3yx commented Jul 24, 2020

Is it possible to turn off this background for empty/transparent nametags? Yes

@SmallJoker
Copy link
Member

Here's a comparison of the current shadow settings.
Left: font_shadow = 0, right font_shadow = 1
grafik

In the worst case scenario it is a bit difficult to read the player name, but still far better than without shadow.
The grey box behind text surely helps but at least to me it's not appealing visually. Semi-grey boxes are neutral, but also dull. If you'd put the green loading bar on startup behind names (with font shadows on) it might already look better.

@Zughy Zughy mentioned this pull request Sep 7, 2020
4 tasks
@Zughy
Copy link
Member Author

Zughy commented Sep 13, 2020

Bump

Also, I think the bar should be neutral by default. If even, it'd be cool if people could customise it, but this is for another PR (also because I don't have the knowledge nor the time to do that).

Use-cases:

  • better distinguish admins/VIPs/whoever in a server
  • unlock cool backgrounds
  • distinguish teams
  • highlight bosses
  • probably other things

@sfan5
Copy link
Member

sfan5 commented Sep 19, 2020

I don't get what you mean by "neutral by default" but customizing the tint of the bar sounds like a good future feature.

src/client/camera.cpp Outdated Show resolved Hide resolved
@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Oct 3, 2020

IIRC, nametag opacity is already settable, using the nametag color. You just have to do it explicitly in the game for all nametags.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Oct 3, 2020

Oops. Please forgive me! I have completely misunderstood the purpose of this. I take back my complaint 100%.
I support this now.

@Zughy
Copy link
Member Author

Zughy commented Oct 23, 2020

According to comments here and things said on IRC, I'd like to recap and propose a new approach:

  • put a text outline instead of the semi-transparent box and remove the font shadow. Ie. Among Us
  • implement somewhere down the road a server toggleable background (per player too) via API to do things like this (Maple Story 2). Background will be disabled by default

Now, a problem could be the colour of the outline: as you can see in the first screen, a dark colour makes the text kind of unreadable if the outline is always black, so the solution adopted by rubenwardy for the box colour might be applied here too

What do you think about it?

@rubenwardy rubenwardy added the User feedback needed Feedback from players/server owners/modders is needed to determine if the change should be done. label Oct 23, 2020
@rubenwardy
Copy link
Member

Yeah, that makes sense to me

@Zughy
Copy link
Member Author

Zughy commented Oct 31, 2020

A week passed, almost nobody said anything, I'm still more convinced of the outline and a core dev approves too. I don't have the time to work on it as for now, but I'll try eventually. Closing this one

@Zughy Zughy closed this Oct 31, 2020
@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Oct 31, 2020

WTF?! Please don't kill a PR that has already been approved by 2 core devs.

Personally, I have no strong perference, but I like the background idea slightly more.

@LoneWolfHT
Copy link
Contributor

These backgrounds are fine and can be improved later if necessary anyway

@Zughy
Copy link
Member Author

Zughy commented Oct 31, 2020

Well, I guess there is some feedback now. Reopening ¯\_(ツ)_/¯

(this could be modified when/if the outline PR gets done. Please someone merge it)

@Zughy Zughy reopened this Oct 31, 2020
@paramat
Copy link
Contributor

paramat commented Nov 13, 2020

As long as a good implementation is found, i do not think making this optional is necessary.
Contrary to claims above, core devs have often opposed making something an option, i have many times.

According to comments here and things said on IRC, I'd like to recap and propose a new approach:
put a text outline instead of the semi-transparent box and remove the font shadow

the solution adopted by rubenwardy for the box colour might be applied here too

Cannot tell for sure until it is tried, but i think an outline is preferable to a background box, just as effective but less obtrusive.
But i do not object to this box implementation being merged for now.

@appgurueu
Copy link
Contributor

The box implementation is inconsistent: What about waypoints, chat and other HUD text elements?

@Zughy
Copy link
Member Author

Zughy commented Nov 14, 2020

Cannot tell for sure until it is tried

A couple of weeks ago I tried understanding whether an outline was doable through CGUITT font or not, but I had no luck. That's probably me not being good enough though

What about waypoints, chat and other HUD text elements?

Think about this as a testing ground and - possibly - as a transition. Also because chat had already been discussed (#10372 )

@SmallJoker
Copy link
Member

The outline could be done using the current shadow effect, but repeated four times around the text using the offsets x±1 and y±1. However, doing that as an emboss effect in a shader would be way faster and probably look better than manual calculating.

@Zughy
Copy link
Member Author

Zughy commented Dec 12, 2020

Bump. This only needs to be merged

@sfan5 sfan5 removed the User feedback needed Feedback from players/server owners/modders is needed to determine if the change should be done. label Dec 14, 2020
@sfan5 sfan5 merged commit 4d41ed0 into minetest:master Dec 14, 2020
HybridDog pushed a commit to HybridDog/minetest that referenced this pull request Dec 17, 2020
@Zughy Zughy deleted the crazy-nametag_bg branch January 2, 2021 15:31
@ghost
Copy link

ghost commented Feb 7, 2021

Regression. Please, make the background disabled by default or optional instead. Now they are lot of distant player nametags in the servers not only visible but also more visible with a gray background.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Feb 7, 2021

If alpha is set to 0, the background disappears. I tested this.

@appgurueu
Copy link
Contributor

appgurueu commented Feb 8, 2021

If alpha is set to 0, the background disappears. I tested this.

Yes, but this requires servers to upgrade to mods which actually set alpha to zero.

I still consider this as breaking backwards-compatibility, as a space-only nametag " " used to work, as well as an empty one "" (which has to be set using set_nametag_attributes and not set_properties, however!). Both now draw a small empty, annoying box. This might be worth filing a bug report.

Additionally, consistent and more subtle display of nametags is now unachievable - every other text element, including waypoints, does not have a background. I agree with @runsy that this should definitely be configurable.

@sfan5
Copy link
Member

sfan5 commented Feb 8, 2021

Note that formally backwards compatibility is only broken if the non-working behaviour was documented.

The old docs make no explicit mention of this.
Question here is is it reasonable to assume that rendering an empty or whitespace nametag would not render anything?

@LoneWolfHT
Copy link
Contributor

In ~0.4.17 you could make nametags invisible by setting their alpha, but older clients didn't support that so the nametags would just be black. The way to fix that was to set the nametag to whitespace

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Feb 8, 2021

Question here is is it reasonable to assume that rendering an empty or whitespace nametag would not render anything?

Empty: Yes.
Whitespace-only: Maybe.

@ghost
Copy link

ghost commented Feb 9, 2021

A blank space is a char per se:
https://emptycharacter.com/
So it should be treated as it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet