SA-MP Forums Archive
New chat type - latency fix or resource eater? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: New chat type - latency fix or resource eater? (/showthread.php?tid=84416)



New chat type - latency fix or resource eater? - Lenny_Carlson - 30.06.2009

Hi there,


Some of you might know me from certain roleplay servers thoroughout the years but since that stuff doesn't really matter here I'll spare you from my ranting.

Here's an idea I came up with (Not saying I'm the first, I can't read minds) a while back but never had the time to test. I'm hoping someone here can give an estimation of how much this would improve the chat latency and how much server resources would have to be used (AKA is it worth it?). This would obviously be a "fix" for servers using functions to fetch distance between players. I probably spent more time drawing this picture (I know it's awesome, thanks ) than thinking about the idea but here goes:

Here's an example of how a message usually is sent to other players:

So here's the thing I thought about:
What if the server, instead of sending the string from the location it recieved it from (2), ran a function to check "who is within a 7 meters radius" and then sent the messages directly to the clients in that area? Here's a demonstration:
Hopefully, this isn't too complicated...


To sum it up, based on what I know and/or understand:
Possible positive sides: Possible negative sides:
As I mentioned previously in this post, what I'm trying to do by posting here is to get a second opinion from more experienced scripters of how it could work, and if it's actually worth it in terms of improvement versus server resources.



Re: New chat type - latency fix or resource eater? - kaisersouse - 30.06.2009

Or you could just use LimitGlobalChatRadius

https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius




Re: New chat type - latency fix or resource eater? - ledzep - 30.06.2009

I don't really see how it is supposed to reduce latency. One way or another you are going to have to get and compare the speaker & listener's positions, and if they are moving, the positions will not be accurate.

I'm not an expert on LimitGlobalChatRadius, but considering it is a SA:MP function, it is probably your best bet, like kaisersouse said.


Re: New chat type - latency fix or resource eater? - Lenny_Carlson - 02.07.2009

Quote:
Originally Posted by kaisersouse
Or you could just use LimitGlobalChatRadius

https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius

You didn't read anything except the title did you?

Obviously that would be the best function to use, but that's not what I'm asking.