NPC name tags only when you're close, with slightly smaller text
NPC name tags used to float over everyone all the time and overlap even from far away. Now they only show up within 6 m and fade out near the edge. I also shrank the text from 28 to 22.
NPC names were always floating overhead, so you could see every one of them from far away, and they overlapped and blocked the view. The text was a bit big, too. I decided to show name tags only when you get close and make the text a little smaller.
What I built
It checks the horizontal distance between the player and the NPC (height differences are ignored). Within 4.5 m the tag is fully visible, between 4.5 and 6 m it gradually fades, and beyond 6 m it's hidden. A hard on/off switch flickers right at the boundary, so I added a fade zone in between. In the screenshot above, Mia is 4.7 m away, right inside that zone, so her name is slightly faded (opacity 0.87).
The visible distance is set to 6 m and the fade width to 1.5 m. Setting the distance to 0 makes tags always visible like before. Names pop up a little before you're close enough to talk (2 m).
Looking toward the plaza from the southern main road, every NPC is more than 6 m away, so no name tags show at all. Much cleaner.
The text went from 28 to 22 (about 21% smaller). I applied it to the name tags shared by the SUNTAIL village, SampleScene and the three interiors, and set the script default to 22 as well.
Next up
- Within 6 m, names of NPCs behind walls still show above the wall. Add an occlusion check if it becomes a problem
- Tune the distance and text size by feel while actually playing

