[Mod] Entity based nametags [playertag]

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

[Mod] Entity based nametags [playertag]

by sparky » Thu Jan 11, 2018 16:17

Do you need stealth in your server, but still need players to be identifiable?
Playertag mod!
+ Screenshots

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: 907
Joined: Sat Aug 19, 2017 21:49
Location: SCP-2935
GitHub: Chemguy99
In-game: Nyx Serris
 

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 » Thu Jan 11, 2018 19:03

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: 880
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer

Re: Entity based nametags [playertag]

by Fixer » Thu Jan 11, 2018 22:16

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: 922
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: Entity based nametags [playertag]

by stu » Fri Jan 12, 2018 18:05

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: 306
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: Entity based nametags [playertag]

by Joseph16 » Wed Jan 17, 2018 17:35

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

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

Re: Entity based nametags [playertag]

by sparky » Wed Jan 17, 2018 19:47

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: 273
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj

Re: Entity based nametags [playertag]

by Pyrollo » Wed Jan 17, 2018 20:04

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: 922
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: Entity based nametags [playertag]

by stu » Wed Jan 17, 2018 20:04

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: 5685
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Entity based nametags [playertag]

by rubenwardy » Wed Jan 17, 2018 20:09

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: 273
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj

Re: Entity based nametags [playertag]

by Pyrollo » Thu Jan 18, 2018 09:18

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: 922
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: Entity based nametags [playertag]

by stu » Fri Jan 19, 2018 20:08

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: 131
Joined: Sun Oct 05, 2014 00:54
Location: USA
GitHub: Elkien3
IRC: ircSparky
In-game: sparky

Re: Entity based nametags [playertag]

by sparky » Wed Jan 24, 2018 02:57

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


Return to WIP Mods



Who is online

Users browsing this forum: Hume2, Nigel and 1 guest

cron