Page 1 of 1

[Mod] Entity based nametags [playertag]

Posted: Thu Jan 11, 2018 16:17
by sparky
Do you need stealth in your server, but still need players to be identifiable?
Playertag mod!
Spoiler
Image Image
Theres are entities attached to the player. similar to the gauges mod.
They are only as visible as the player is. if the player hides behind a wall, the tags will too.
note: it will not work on pre-0.4.14 servers, and if client join with pre-0.4.14 the normal tags will be visible to them.

Some code taken from gauges (CC0 1.0)
And also some code and textures from npcf (LGPL for code, WTFPL for textures)
My part of the code is WTFPL.

Github: download latest browse code

Enjoy!

Re: Entity based nametags [playertag]

Posted: Thu Jan 11, 2018 16:40
by Chem871
Cool

Re: Entity based nametags [playertag]

Posted: Thu Jan 11, 2018 19:03
by Byakuren
Seems very good for pvp servers. And a buff to any mod that provides player detection.

Re: Entity based nametags [playertag]

Posted: Thu Jan 11, 2018 22:16
by Fixer
Excellent idea! You should also add license details into LICENSE file or Readme (my guess).

Bugreports:
+ player animation is broken when mod is enabled (no animation or too fast) - 0.4.17/0.5.0dev
+ sometimes singleplayer nametag is not visible when in external view, works again via recycling views - 0.4.17/?
+ nametag in the middle of the player (due to player height changes) - 0.5.0-dev

Re: Entity based nametags [playertag]

Posted: Fri Jan 12, 2018 18:05
by stu
This is a really neat idea, however, I can see a few serious issues with the code. It is severely clobbering the server step which, I guess, explains the animation problems. Also, I doubt that the npcf character set will be sufficient to cover all supported MT player name characters.

How about you post this on github and we can help you improve it? Note that you will need to include a license document along with the code files whichever way you decide to distribute it.

Re: Entity based nametags [playertag]

Posted: Wed Jan 17, 2018 17:35
by Joseph16
weve been needing this for a long time. Thank you!

Re: Entity based nametags [playertag]

Posted: Wed Jan 17, 2018 19:47
by sparky
Made a GitHub repo and added license info to readme. (sorry I didn't do that earlier, I hate license stuff.)
The hidden tag after bit of third person is because every few seconds the tag reattaches.
I haven't experienced much animation lag, but I guess I use playeranim so it's impossible to tell. :P
Since 0.5 isn't out quite yet I won't fix 0.5 related bugs until it is out. (I'm a bit lazy, sorry)

Re: Entity based nametags [playertag]

Posted: Wed Jan 17, 2018 20:04
by Pyrollo
Interesting use of textures for displaying text :) I'm always interested in such work.

I try to make an kind-of advanced library for text management (font_lib in display_modpack).

You could use it or I could make your mod using it (pro:less textures, con:dependency to font_lib which is a bit more complex than your mod).

Anyway, why are the black textures for ? IIt seems to use only white ones ?

Re: Entity based nametags [playertag]

Posted: Wed Jan 17, 2018 20:04
by stu
Much better, thanks! I have a few ideas that could streamline the mod, some borrowed from rubenwardy's CTF version of the guages mod, you might want to look at that yourself.

I will also try to dig out the code I used to generate the character set, the font should really have license info too but I have no idea what I used now. It was a simple python util you can include with the mod, assuming I am able to find it =)

Re: Entity based nametags [playertag]

Posted: Wed Jan 17, 2018 20:09
by rubenwardy
A nice feature, but the mentioned performance issues are a killer. I'll still probably use this as a base for the feature in CTF, and make sure to contribute back any changes

Edit: here's your first PR! https://github.com/Elkien3/playertag/pull/1

Re: Entity based nametags [playertag]

Posted: Thu Jan 18, 2018 09:18
by Pyrollo
stu wrote:I will also try to dig out the code I used to generate the character set
I used this one : make_font_textures.sh
It can still be improved.
stu wrote:the font should really have license info too
Yes and it's hard to find a font :
- under a free license (without commercial restriction);
- including accentuated letters, cyrillic, greek and more;
- which is a pixel font (or you get very ugly result);

Re: Entity based nametags [playertag]

Posted: Fri Jan 19, 2018 20:08
by stu
Pyrollo wrote:I used this one : make_font_textures.sh
It can still be improved.
Nice, I presume it requires ImageMagick though not that it's a problem, it looks much more versatile than what I had using PIL. I've not been able to find it anyway. I'm pretty sure the font was the one that used to ship with MT, though I'd have to check that to be certain.

Re: Entity based nametags [playertag]

Posted: Wed Jan 24, 2018 02:57
by sparky
The whole texture combining code was from npcf. I don't really know how I'd change the font system. :P