Yet another nametags script

I figured there weren’t enough implementations of nametags for HiFi, so I’ve created another one. Or more specifically, I’ve cleaned up an old script I’ve been using since last summer so that the code isn’t quite as terrible and am releasing it. I originally created it as I wanted more choice and flexibility to how nametags looked and functioned, and I wanted something that looked more game like.

nameTagSample

This one works a bit differently to many of the other versions, as it uses a remote service to create graphical nametags instead of using text entities. It includes the following features:

  • Is styled to look vaguely similar to the health bars from Sword Art Online (SAO)
  • Shows if a user is a domain admin for the current domain (optional)
  • Shows if you are connected to the user (optional)
  • Shows the username of the user, but only if you have access to see it (optional)
  • Shows the profile picture of the user, but only if you have access to see it (optional)

I intend to implement more visual styles over time, and have a selector in the options to support this, but currently it only includes the SAO (esque) one.

To install you can do either of the following:

Once installed there should be a NameTags button on your tablet/toolbar. Clicking this will open the settings dialog so that you can customise to your liking. You can also activate/deactivate the nametags using the view menu from the desktop application, or pressing the configured shortcut key on your keyboard.

If you have any problems / feedback / suggestions, either post them here or contact me through discord.

5 Likes

Not bad, but there’s something interesting to note: avatar icons only load if the user’s availability allows you to see them. This means to have your avatar icon load for everyone, your connection settings must be set to everyone. However, this data can still be publicly culled from the website IF you know the username.

Example:

Yes to have it load for everyone, you need it setting as you describe. Your connections should be able to see it though I believe as the script is using the same method for getting the profile pics as the People tablet app does. The nametag generating service is passed the profile pic url to use from the client script, which I think takes some security consideration into account.

In practical use, I’ve had a mixture of profile pics, default profile pic, and nothing at all displaying at the left hand side. I’ve tried to build in some levels of resilience so that it has some consistency even if no profile pic is available.

1 Like

Apologies, if you’ve already installed this but the I’ve changed the script url so it’s named differently from other similar scripts. New link is:

https://hifi-utils.jollysoft.com/HiFiApps/MaddersNameTags/MaddersNameTags.js

Old link will continue to work for a while, so that people don’t receive errors. It’ll be cleaned up in a week or two.

1 Like

It was pointed out at the Maker meeting that the shortcut key used conflicted with an existing keybinding. This has now been added as a configurable option so that you can choose what key is best for you.

This is available now, show if running you jest need to refresh the running script.

At the maker meeting on Monday, Piper was asking about stats on how quickly the nametags were generated by the server. I’ve just had a quick look and since release on Monday I’ve served 5.8k nametags, with the average time per request being 134ms.

Which broken down into percentiles is:

  • 50% of requests served in under 12ms - this is likely to be tags served directly from cache
  • 95% of requests served in under 530ms - this is essentially the average time to create an image from scratch
  • 99% of requests served in under 1200ms - this is the practical maximum time to generate an image when also downloading profile pic
  • <1% took longer than 1200ms - this is anomalies where most likely there was a problem getting profile pic from url and was waiting for response

The spike is 500 requests only took 1.2ms, and the longest request was 32 seconds which will have been a no problem downloading profile pic from hifi server as it’s currently set at the default 30 second connection timeout.

2 Likes

New slight additional nametag style has been released. This is it’s mostly the same as the existing SAO style but with icons instead of badges for connected and admin status.

reloading running script should make this available

not sure I’m entirely happy with the icons (i’m no artist), so they may change

1 Like

Have added another new style:

Still needs a little work, but thought I’d throw it out there.

One of the main additions coming soon will be settings to adjust the vertical and horizontal position of the nametag in relation to avatars. Since this style is a little off centre would be useful so that you can tweak to your liking.

1 Like