Upgrade to show HP on radar

Discussion in 'Weapons' started by Xproplayer, Jan 29, 2017.

  1. Daddy Nexxus

    Daddy Nexxus Toxi-Fessional VIP

    Okay, you're right. There is no conceivable way this could possibly (in any manner) add any (any) lag to the server, whatsoever. I'm glad you're a network engineer who minored in Garry's Mod, TTT/Lua Coding and other forms of computer engineering to be able to predict with a certainty this will in no way produce any lag, whatsoever. Thank you.
     
    • Dumb Dumb x 4
  2. Xproplayer

    Xproplayer VIP Silver

    Glad you're an expert based on what you've "heard" stop clogging up my suggestion, if you're going to bitch about lag that you claim exists there are hundreds of other suggestions that would cause lag.

    If you're so concerned about lag play on a LAN server with your lonesome self.
     
    • Like Like x 1
  3. Daddy Nexxus

    Daddy Nexxus Toxi-Fessional VIP

    You escalated this in to something it didn't need to be by calling me out for simply suggesting it may cause more lag. I even said in my post I like the idea. I am not "so concerned" about lag. I am merely bringing up the simple, indisputable, undeniable truth that there is no possible way that this won't at least marginally (even if it's 1%) increase latency and/or lower FPS slightly for players. There is no arguing this. This is just simply fact. Any thing added to the server can/will cause some sort of draw on the servers or client that will cause more resources to be used, reducing latency or locally, framerate.

    You're simply defending your position that you believe this should be implemented in to the server. I am just here to tell you, for every addition to the server, there will be drawbacks. Even 1% adds up after a while. Please take a moment to realise that I'm not here to argue, I'm just simply stating a fact.
     
    • Friendly Friendly x 1
  4. Xproplayer

    Xproplayer VIP Silver

    Okay, then go post on every single suggestion in the entire list that it may cause lag, go ahead.
     
    • Like Like x 1
  5. BorkWoof

    BorkWoof VIP

    same dude i agree.
    1
     
  6. Dolph1n

    Dolph1n Time is an adventure- if you know when to look. VIP

    +1

    give me more ways to exploit my pay-to-win rank.
     
  7. littlememe

    littlememe nothinglastsforever VIP Bronze

    I like it +1
     
  8. Igneus

    Igneus VIP Silver

    +1
     
  9. Zikeji

    Zikeji Repoleved VIP Emerald

    Pertaining to @daddynexxus 's argument, I decided to investigate the actual code behind the radar myself.

    Serverside code: https://github.com/garrynewman/garr...ysmod/gamemodes/terrortown/gamemode/radar.lua
    Clientside code: https://github.com/garrynewman/garr...od/gamemodes/terrortown/gamemode/cl_radar.lua

    On line 20 the serverside code gets all the player entities - which to be fair is the only way to get about it. It then loops over each player to validate it, and gets the position of the player (line 32). Then it inserts these positions and the players rank into an array. After the loop it sends this array to the client that requested the data. Now, seeing as it already has the player entity during the loop, it could easily get their health, using p:Health(), and assign it to the same array that already gets sent over the network to the client.

    One could also argue you need to run p:GetMaxHealth() because of armor, however armor does not add health - it merely reduces incoming damage to 70% of the original value (see here, line 758). As far as I'm aware there is nothing in the server that can modify your max health, so it's safe to assume a player always has a max health of 100. This really only matters if you want to display health bars.

    On the clientside you'd modify it to use the returned health in the array when drawing the radar blips.

    As for the possibility of it adding more lag to the server - I do not think it'll make it difference. You're talking about reading a integer from memory at most 36 times per scan, and then transmitting - at most, 36 additional integers over the network to the client.

    Now if you want to send their maxhealth than you're doubling the above numbers - but it's still a non-issue. Even if you had 36 players with radars scanning I doubt it would effect performance. The most performance impact would be on the clientside - drawing the values so the local player can view them. This is handled on the client and would not affect the server - at all. And if a player managed to get into the server, it's safe to say their computer won't choke over the additional drawing necessary.
     
    • Winner Winner x 2
  10. Xproplayer

    Xproplayer VIP Silver

    Thank you Zikeji for providing a breakdown, I've done a bit of lua coding and I knew that this wouldn't cause much difference but didn't have the patience to break it down like this.
     
    • Like Like x 2
  11. My Dime Is Up

    My Dime Is Up Its my dime to code VIP

    I like the Idea. +1
     
  12. Elvis

    Elvis TheRockStars VIP Silver

    What about making your T buddies a medium dark blue like the blue from @My Dime Is Up 's signiture? The part where it says "Is not on a SGM server"

    While having the health color go from green to red like it normally does if you look at a player that is losing health?

    ID HAVE A VIDEO BUT ME LAPTOP IS DEAD SO I CANT BUT IF ANOTHER COULD GET IT THEN THAT WOULD BE NICE
     
  13. Espurr

    Espurr #AlwaysStabEspurr Administrator VIP

    This can be pretty OP but I think it would be pretty cool to have
    +1