[Mod] Entity based nametags [playertag]

Post Reply
User avatar
sparky
Member
Posts: 140
Joined: Sun Oct 05, 2014 00:54
GitHub: Elkien3
IRC: ircSparky
In-game: sparky
Location: USA
Contact:

[Mod] Entity based nametags [playertag]

by sparky » Post

Do you need stealth in your server, but still need players to be identifiable?
Playertag mod!
+ Spoiler
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!
Last edited by sparky on Wed Jul 11, 2018 15:24, edited 3 times in total.

Chem871
Member
Posts: 953
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: Entity based nametags [playertag]

by Chem871 » Post

Cool
What is SCP-055?

Byakuren
Member
Posts: 816
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: Entity based nametags [playertag]

by Byakuren » Post

Seems very good for pvp servers. And a buff to any mod that provides player detection.
Every time a mod API is left undocumented, a koala dies.

User avatar
Fixer
Member
Posts: 896
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: Entity based nametags [playertag]

by Fixer » Post

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

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: Entity based nametags [playertag]

by stu » Post

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.

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: Entity based nametags [playertag]

by Joseph16 » Post

weve been needing this for a long time. Thank you!
Testin' mines since 1989

User avatar
sparky
Member
Posts: 140
Joined: Sun Oct 05, 2014 00:54
GitHub: Elkien3
IRC: ircSparky
In-game: sparky
Location: USA
Contact:

Re: Entity based nametags [playertag]

by sparky » Post

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)

User avatar
Pyrollo
Member
Posts: 384
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: Entity based nametags [playertag]

by Pyrollo » Post

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 ?
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: Entity based nametags [playertag]

by stu » Post

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 =)

User avatar
rubenwardy
Moderator
Posts: 6251
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Entity based nametags [playertag]

by rubenwardy » Post

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

User avatar
Pyrollo
Member
Posts: 384
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: Entity based nametags [playertag]

by Pyrollo » Post

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);
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: Entity based nametags [playertag]

by stu » Post

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.

User avatar
sparky
Member
Posts: 140
Joined: Sun Oct 05, 2014 00:54
GitHub: Elkien3
IRC: ircSparky
In-game: sparky
Location: USA
Contact:

Re: Entity based nametags [playertag]

by sparky » Post

The whole texture combining code was from npcf. I don't really know how I'd change the font system. :P

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests