Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

2 years ago

Advertisement
July 18, 2019, 03:03:53 pm

Author Topic: [Release] Basic Nametags  (Read 30184 times)

JasonMRC

  • Donator
  • Hero Member
  • *****
  • Posts: 601
    • View Profile
Re: [Release] Basic Nametags
« Reply #15 on: December 22, 2015, 08:43:35 pm »
Just want to chime in on the topic of 'those useless unstreamed player dots'.

Players regularly come onto servers and ask, "Where is everyone?" The dots of unstreamed players allow them to see what direction to go or where to teleport towards to find players.

Why? Even if we're talking about a freeroam server, in fact especially if we are, people aren't going to travel across the map to an unstreamed player to kill them.
You'd be surprised.

Good explanation of efficiency, DaAlpha.

A consideration: Rather than network sending the positions in a table which must then be received, have you considered simply setting a network player value of "Position"? Then iterate through all Client:GetPlayers(). If IsValid(player, true) then they are streamed and operate as such, else use GetValue("Position") as their position(be sure to check that the value isn't nil because those who first join the server would have a nil value until the server sets it). You also would not need to sync their color this way as player color is one of the variables that is always accurate on players, even unstreamed ones.

I sync player positions and I've found this to be a wonderful benefit. I can accurately get any player's position from any script on any side of the network. Positions are updated every ~5 seconds, depending on server load.

In Client autorun I put this:
Code: [Select]
local oldPlayerGetPos = Player.GetPosition
Player.GetPosition = function(self)
if IsValid(self, true) then
return oldPlayerGetPos(self)
else
return self:GetValue("Position") or oldPlayerGetPos(self)
end
end
It replaces the original GetPosition with a check for streamed. If streamed, used the old function. If not streamed use the synced data or return the old function if the value hasn't been set yet.

SinisterRectus

  • JC2-MP Betatester
  • Sr. Member
  • *****
  • Posts: 451
    • View Profile
Re: [Release] Basic Nametags
« Reply #16 on: December 22, 2015, 09:08:46 pm »
I never said the non-streamed dots were useless. This is advertised as a less complicated version of the original Nametags script, but they are not in the original Nametags script, so I asked why. It's a fine feature and DaAlpha did a nice job, but I don't think it's fair to say this is less complicated. I think that's a matter of opinion.
« Last Edit: December 22, 2015, 09:26:02 pm by SinisterRectus »

LordNoob

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
Re: [Release] Basic Nametags
« Reply #17 on: December 22, 2015, 09:55:40 pm »
Fair enough, done. /minimap now disables non-streamed blips for the player and disables the player's blip for others.

Good compromise. It could also be helpful for people to not have so much clutter on their minimap, especially if they're planning an event around an area.

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Basic Nametags
« Reply #18 on: December 22, 2015, 10:49:41 pm »
Because within those few hours between the release of my script and your reply, you could not have ran valid comparison tests between the two scripts, especially at higher player counts. I am just making sure there are no unproven assumptions about the performance of my script around.

Also, I just disagree with the reasons why you disagree on my comment and making comparisons without any evidence. That is all.

I can just look at the script and see what it does, any person who knows lua and jcmp can very quickly see how it is going to perform.

Comparisons without any evidence, yeah right!

Gaveroid

  • Donator
  • Jr. Member
  • *****
  • Posts: 56
    • View Profile
Re: [Release] Basic Nametags
« Reply #19 on: December 22, 2015, 11:04:08 pm »
I never said the non-streamed dots were useless. This is advertised as a less complicated version of the original Nametags script, but they are not in the original Nametags script, so I asked why. It's a fine feature and DaAlpha did a nice job, but I don't think it's fair to say this is less complicated. I think that's a matter of opinion.

Am I the only one that felt there was no need for another nametag script? I mean there's many more things that DaAlpha could be practicing his skills on, literally zero people have voiced any real issues with that script.

Plus, Philpax's script is as simple as can be, there's no way to simplify it. There's no fluff, it's just a nametag and health bar. It's minimalistic, it looks good, performs well... now that DaAlpha is adding all of these features it's not really a simpler version now is it?

DaAlpha, I can perfectly see if your point is to make a more feature-filled script, like maybe with some profile pictures and maybe a bigger health bar with numbers or really anything like that, but you aren't doing a good job of simplifying the original script as A. you're making it more complicated in the end and B. there is zero simplifying to do as it's already extremely basic (not that basic is a bad thing).


Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Basic Nametags
« Reply #20 on: December 22, 2015, 11:09:16 pm »
I never said the non-streamed dots were useless. This is advertised as a less complicated version of the original Nametags script, but they are not in the original Nametags script, so I asked why. It's a fine feature and DaAlpha did a nice job, but I don't think it's fair to say this is less complicated. I think that's a matter of opinion.

Bing!!!!!!

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 52
    • View Profile
Re: [Release] Basic Nametags
« Reply #21 on: December 22, 2015, 11:46:24 pm »
@Jason

I like that idea of syncing via player values. Did you notice a network load/performance change when switching to this method? Because considering it is not one table being sent and instead n amount of player network values being set in rapid succession, I could imagine the network overhead increasing there. Of course, the additional functionality of that method would make up for it.

Also, I am a huge fan of that workaround for overwriting API functions by caching the original one, I already found an application for it on the server. I would leave it up to the server owners/coders themselves to implement that however since it does not really offer anything for servers that do not customize their scripts or write own ones.


@Sinister

In case this was not quite clear: this script is not meant as a clean version of Philpax' script. Otherwise there would not be such a big difference in features, considering his script also has vehicle tags and a setting GUI. Instead, my script is intended to be a competitor due to his monopoly when it comes to released nametag scripts.


@LordNoob

What exactly do you have in mind there? If you mean something like anti-overlapping, this would imo not be worth the extra resources.

It would need an algorithm that, whenever a dot is drawn, would have to check if there is enough distance to all previously in this frame drawn dots (square distance would work here). This would have a decent performance impact the higher the amount of players to draw gets. Plus, if there needed to be a system behind it so that it does not just skip random dots and instead prefers the ones closer to the player over the ones further away, it would also need to sort the non-streamed dots by distance as well, meaning even more distance calculation (although square 2D distance would be sufficient here as well).

So yeah, what I am saying is that I also had that idea before but found that the additional resources needed are out of proportion compared to the additional value that not many would even notice, I could imagine.


@Darwood

Well, obviously you can't see how it is going to perform, considering you have yet to give me any logical reason or actual evidence for your assumption.


@Gaveroid

Quite frankly, if you do not have anything to contribute asides from repeating what has already been said and brainless bashing, go mind your own business outside of this thread. Much appreciated.

Gaveroid

  • Donator
  • Jr. Member
  • *****
  • Posts: 56
    • View Profile
Re: [Release] Basic Nametags
« Reply #22 on: December 23, 2015, 12:39:26 am »
Well somebody's butthurt. It's Christmas, just giving you some much needed feedback as it is the season of generosity. ;)

Do you guys there at Nologran have some kind of rule where all Gaveroid.com staff etc. must be abused in any social scenario? Every time any of us come in contact with one of you guys, we have the Fourth Reich abusing us in the end. No wonder your server has such a bad reputation.

JasonMRC

  • Donator
  • Hero Member
  • *****
  • Posts: 601
    • View Profile
Re: [Release] Basic Nametags
« Reply #23 on: December 23, 2015, 12:42:24 am »
Hey, hey, hey!
There's no need for bashing, everyone. We don't rate scripts based on if they are needed or how good they are. If we did, many of the scripts in this forum would be deleted because all of us here know they are not super good/really needed etc. That doesn't and should not stop someone from releasing something. Many of these scripts are just a few functions together or a slightly modified version of another release. We don't go debating the validity of those releases, do we?

By definition, this is a Basic Nametags script. It has basically coded player names, HP bar, and minimap dots. Philpax's also supports vehicles and does so with more functions(i.e., not as basic as this one. Can these features be done differently? Yes. Do servers do them differently? Yes. I'd guess most advanced/developed servers have their own tags/HP bars/minimap dots, etc, I know mine does. That doesn't invalidate DaAlpha's script.

For those learning LUA this is another teaching resource. It shows another way of producing roughly the same results as Philpax's script. I think we can all admit we've looked at other scripts to see how something is done at least once in our scripting careers.

So let's get back to the pertinent discussion at hand. Discuss features, bugs, etc. But don't bash or debate the validity of a script.

@Jason
I like that idea of syncing via player values. Did you notice a network load/performance change when switching to this method? Because considering it is not one table being sent and instead n amount of player network values being set in rapid succession, I could imagine the network overhead increasing there. Of course, the additional functionality of that method would make up for it.

Also, I am a huge fan of that workaround for overwriting API functions by caching the original one, I already found an application for it on the server. I would leave it up to the server owners/coders themselves to implement that however since it does not really offer anything for servers that do not customize their scripts or write own ones.
No, no noticeable network load. Of course I first added that function over a year ago.  ::) I've modified it recently to only update if values are different(it handles more than just positions, it syncs most of the commonly needed but natively unsynced values). There would have to be a few hundred players online for there to even be the chance of a performance issue(unless you have low bandwidth or extremely intensive scripts). The biggest thing when using NetworkValues is to check if it's changed and only set the new value if it's different.

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Basic Nametags
« Reply #24 on: December 23, 2015, 12:58:48 am »
Well, obviously you can't see how it is going to perform, considering you have yet to give me any logical reason or actual evidence for your assumption.

That is funny because i never assumed anything. All i did was offer some constructive criticism and comparisons. Not sure who's messages you were reading.



DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 52
    • View Profile
Re: [Release] Basic Nametags
« Reply #25 on: December 23, 2015, 01:27:06 am »
@Jason

Yup, definately seems like something to implement in this script. Will probably do that when I am back on Friday/Saturday.

One thing I am wondering about though is whether or not the check for a changed value actually works in this case, at least when comparing both Vector3s directly. As you have probably also experienced, even when standing completely still, the player's coordinates vary in the millimeter/micrometer range. If the comparison of two Vector3s considers changes this minor, which is what I think, then one would need to math.floor the coordinates and compare them manually.

I will probably also run a quick test there once I am back since I am quite curious now.

Philpax

  • Developer
  • Hero Member
  • *****
  • Posts: 563
    • View Profile
Re: [Release] Basic Nametags
« Reply #26 on: December 23, 2015, 01:33:26 am »
Hey now, I'd suggest we all relax; we're all friends here.

I'm happy about the existence of this script; the original nametags script has a fair bit of cruft that I never got around to removing (it was originally meant to handle a few other scenarios), so seeing someone produce a simpler, more elegant version pleases me.

I haven't tried out the script yet, but if it lives up to its name there's no reason to be concerned over it. Nice work!

EDIT: I just looked at the code. I approve of its simplicity; it does what it needs to do, and it does it well - nicely done! What you might want to do is update self.positions on the client with the streamed positions in the first loop - that way, you can render all of the blips in one go.
« Last Edit: December 23, 2015, 01:40:29 am by Philpax »

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Basic Nametags
« Reply #27 on: December 23, 2015, 02:28:40 am »
Hey now, I'd suggest we all relax; we're all friends here.

Sorry to spam this thread Philpax but I have to say this. We are not all friends and never will be. I am referring to DaAlpha and staff of NG and the Members and staff of Gaveroid's server. Speaking on behalf of Gaveroid's we have received nothing but verbal abuse, disrespect and a lack of community from the staff and owner of NG server. As you can tell by this thread. I try to be respectful and offer constructive criticism but in return i get accusations. I will never forgive them for the way they treated our staff members and how the owner of NG refused to acknowledge or deal with the situation. The community needs to know how they mistreat, abuse and have no respect for anyone but themselves. Until now i have kept this away from the JCMP forums, but when i get flak for no apparent reason I will retaliate.

keeri

  • Developer
  • Sr. Member
  • *****
  • Posts: 294
    • View Profile
Re: [Release] Basic Nametags
« Reply #28 on: December 23, 2015, 12:14:23 pm »
The code seems fine to me, but the initial post could use some screenshots so people know how it looks, without having to install.

Philpax

  • Developer
  • Hero Member
  • *****
  • Posts: 563
    • View Profile
Re: [Release] Basic Nametags
« Reply #29 on: December 23, 2015, 12:22:22 pm »
Hey now, I'd suggest we all relax; we're all friends here.

Sorry to spam this thread Philpax but I have to say this. We are not all friends and never will be. I am referring to DaAlpha and staff of NG and the Members and staff of Gaveroid's server. Speaking on behalf of Gaveroid's we have received nothing but verbal abuse, disrespect and a lack of community from the staff and owner of NG server. As you can tell by this thread. I try to be respectful and offer constructive criticism but in return i get accusations. I will never forgive them for the way they treated our staff members and how the owner of NG refused to acknowledge or deal with the situation. The community needs to know how they mistreat, abuse and have no respect for anyone but themselves. Until now i have kept this away from the JCMP forums, but when i get flak for no apparent reason I will retaliate.

I'm sorry to hear about that; however, your later posts, as well as Gaveroid's post, served to inflame the conversation. I understand that the two communities involved here have an ongoing dispute, but this is not the place to bring it up.

I am respectfully requesting all parties remain civil within this thread; there is little to be gained by public confrontation in a thread about a script. Please keep it on-topic, or we will be forced to start punishing users, regardless of their affiliation, for instigating conflict.