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

3 years ago

Advertisement
October 29, 2020, 08:23:52 pm

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

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 54
    • View Profile
[Release] Basic Nametags
« on: December 21, 2015, 08:54:59 pm »
Basic Nametags

Description
This module adds nametags above other players' heads. It also adds minimap markers for other players both nearby and across the entire map. A player can chose to only be shown to nearby players on the minimap in exchange for only being able to see other players when they are nearby.

Usage
The nametags and minimap blips will automatically be displayed. Type /minimap into the chat to opt out from other players being able to see your minimap blip on the global map and yourself being able to see global minimap blips of other players.

Pictures
At medium distance


Different health bar colors at different health levels

Minimap blip


Minimum healthbar width cap


Administrator Notes
  • Some basic clientside settings like text and healthbar size can be adjusted at the top of the client script file
  • The interval at which the global minimap positions are updated can be changed at the top of the server script file

« Last Edit: March 15, 2020, 06:55:34 am by DaAlpha »

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Basic Nametags
« Reply #1 on: December 21, 2015, 11:31:43 pm »
I actually find Philpax nametag script to be very effective. It is not really that complicated. It has a lot of functions because it takes the work away from the Render function and does not calculate everything in the iteration. You will see the difference if you have a lot of players on your server.

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 54
    • View Profile
Re: [Release] Basic Nametags
« Reply #2 on: December 22, 2015, 12:30:02 am »
Well yeah, instead of one iteration it iterates over the players to put them into a table, then iterates over that table several times to sort it and then iterates over it to draw every player, each iteration dragging across up to 5 function calls in a row. I do not really see how that actually improves anything, especially the performance. I mean you do know that when calling a function from another one, the initial function only continues once the other function has been fully executed, right? Otherwise it would be outside of the Render event so that you could not draw anything using Render functions.

Also, the difference to what exactly? What other nametag script are you comparing it to?

Gaveroid

  • Donator
  • Jr. Member
  • *****
  • Posts: 56
    • View Profile
Re: [Release] Basic Nametags
« Reply #3 on: December 22, 2015, 01:23:34 am »
Also, the difference to what exactly? What other nametag script are you comparing it to?

I actually find Philpax nametag script to be very effective.

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Basic Nametags
« Reply #4 on: December 22, 2015, 01:23:56 am »
It only iterates twice, in the render function. How many nametags scripts has Philpax wrote ;D

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 54
    • View Profile
Re: [Release] Basic Nametags
« Reply #5 on: December 22, 2015, 01:28:07 am »
I meant what to compare Philpax' script with. Because you could not have been able to reliably tell a difference to mine in this short amount of time.

Also: You do know that, when sorting after distance, the script has to iterate over the table, right?
« Last Edit: December 22, 2015, 03:04:54 am by DaAlpha »

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Basic Nametags
« Reply #6 on: December 22, 2015, 11:34:24 am »
I meant what to compare Philpax' script with. Because you could not have been able to reliably tell a difference to mine in this short amount of time.

Why not?

If your script works for you and does what you want, great. I just disagree on your comment about Philpax name script being complicated, that is all.

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 54
    • View Profile
Re: [Release] Basic Nametags
« Reply #7 on: December 22, 2015, 01:11:34 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.

SinisterRectus

  • JC2-MP Betatester
  • Sr. Member
  • *****
  • Posts: 452
    • View Profile
Re: [Release] Basic Nametags
« Reply #8 on: December 22, 2015, 02:54:25 pm »
Why do you draw the mini-map position of every non-streamed player?

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 54
    • View Profile
Re: [Release] Basic Nametags
« Reply #9 on: December 22, 2015, 02:56:18 pm »
Why wouldn't I?

SinisterRectus

  • JC2-MP Betatester
  • Sr. Member
  • *****
  • Posts: 452
    • View Profile
Re: [Release] Basic Nametags
« Reply #10 on: December 22, 2015, 03:05:59 pm »
You're advertising better efficiency, and strongly defending it, yet you're using network traffic to draw theoretically dozens to hundreds of dots that are not always useful.

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 54
    • View Profile
Re: [Release] Basic Nametags
« Reply #11 on: December 22, 2015, 03:36:03 pm »
Following that argumentation, I should also leave out healthbars because they are additional operations that are not always useful. Or fading. Or scaling. Or shadowing. I think you get my point.

Efficiency is not nessecarily about cutting features, it is about achieving its goal as efficient as possible. In my opinion, global minimap blips have become a standard for freeroam servers (to which this script is mainly addressed) and unless a server is running on a DSL connection (although even that works up to decent player counts), they are no issue whatsoever.

You could also code an entire faction script efficiently. The script itself would most likely have a noticeable performance impact on both server and client side but the point is that it could be way worse due to inefficient coding that achieves the same or a very similar goal.

LordNoob

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
Re: [Release] Basic Nametags
« Reply #12 on: December 22, 2015, 04:01:21 pm »
You should at least create a toggle for global blips. I know it's something that I'd probably disable.

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.

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 54
    • View Profile
Re: [Release] Basic Nametags
« Reply #13 on: December 22, 2015, 04:43:20 pm »
Fair enough, done. /minimap now disables non-streamed blips for the player and disables the player's blip for others.

SinisterRectus

  • JC2-MP Betatester
  • Sr. Member
  • *****
  • Posts: 452
    • View Profile
Re: [Release] Basic Nametags
« Reply #14 on: December 22, 2015, 06:18:32 pm »
Very nice then.