Raised This Month: $ Target: $400
 0% 

No lag nightvision


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-03-2019 , 16:45   Re: No lag nightvision
Reply With Quote #1

Sometimes if you really want to make sure mission critical; msg_one. What is unfortunate is reliable_channel overflows if we have X number people using it Y number of times per second panicking in dark maps.

When using both what is critical and what is not? The fade seems less important than the effect itself. You matched it all now so it is not as remarkable. Initially it seemed backwards as to what is more critical. The fade had MSG_ONE and the vision had MSG_ONE_UNRELIABLE.
__________________

Last edited by DJEarthQuake; 05-29-2020 at 11:05.
DJEarthQuake is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 05-27-2020 , 10:28   Re: No lag nightvision
Reply With Quote #2

Quote:
Originally Posted by DJEarthQuake View Post
  • Use 8 instead of MSG_ONE_UNRELIABLE.
  • Use 1 instead of MSG_ONE.
Are you mad, mate?
Can you please go and learn how Compilers work?
didoWEE is offline
Foxa
Member
Join Date: Nov 2018
Location: Croatia
Old 05-03-2019 , 17:33   Re: No lag nightvision
Reply With Quote #3

Why does it matter if I use MSG_ONE_UNRELIABLE and not 8?? It's literally the same thing.
Foxa is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-03-2019 , 18:22   Re: No lag nightvision
Reply With Quote #4

It's just less typing.
__________________

Last edited by DJEarthQuake; 05-29-2020 at 11:06.
DJEarthQuake is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-05-2019 , 12:50   Re: No lag nightvision
Reply With Quote #5

Quote:
Originally Posted by DJEarthQuake View Post
[I]Use 8 instead of MSG_ONE_UNRELIABLE.
Use 1 instead of MSG_ONE.
No, this is terrible advice. No one will be able to understand what your code does, not even you. You'll say you understand, but if you come back after 2 weeks and look at your source you will not remember what the heck all these numbers mean.

Look:
PHP Code:
message_begin(596, ..) 
If I look at that I have no idea what it does. I need to check the constants and see what 5 is, what 96 is.

On the other hand:
PHP Code:
message_begin(MSG_ONEget_user_msgid("DeathMsg"), ..) 
I understand instantly that the purpose is to send DeathMsg to one player on the reliable channel.

Quote:
The include file already has it typed out.
It has it typed out for you to use it, not hardcode everything and write terrible code.

Quote:
The replacement makes a smaller file size. That uses less CPU. Every little drop of knowledge is essential for your laggin' war bro.
Except you are giving him bad "knowledge". It will not make the file smaller, and even if it did, what in the world file size has to do with CPU usage?
It will use more memory on the hard to store the file, but not more CPU. Think about it this way:
-you have a string made of letter "a" and you do nothing with it. plugin_init is empty.
-you have a string made of one million "a" and you do nothing with it. Will that consume more cpu? Absolutely not. Is the file bigger? Of course.
file size does not translate in any way to CPU usage.

Quote:
Numbers are easier. I use 0,23 all the time for broadcasting temp ents.
How? With pure numbers you have no idea what's going on.

Look at setting offsets: set_pdata_int(id, 116, 1). Can you tell me without googling anything, what this does? You can't.
But if I give you set_pdata_int(id, m_iTeam, _:CS_TEAM_T)? Of course, it sets the team of the player to 1.

Also, what are you going to do if the constant changes? Are you going to update EVERY SINGLE PLUGIN and change the value? That's just asking for unmaintanable code.

Quote:
Such perspective is reminiscent of spaces vs tabs didactic.
No, it's about writing good code that that doesn't break at the slightest change and that can be updated and understood by other people.
__________________

Last edited by HamletEagle; 05-05-2019 at 12:51.
HamletEagle is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-06-2019 , 01:17   Re: No lag nightvision
Reply With Quote #6

Undoubtedly code must be easy to follow and hand down. After rechecking initial post it was discovered that the intended draft rushingly got recreated. I inadvertently omitted the portion that said most would disagree but I occasionally use the numbers as long as there is a comment about the substitution. I can't believe I recommended it.
__________________

Last edited by DJEarthQuake; 05-29-2020 at 11:14.
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-06-2019 , 09:11   Re: No lag nightvision
Reply With Quote #7

Quote:
Originally Posted by DJEarthQuake View Post
Please help me understand. Appreciate your patience. Why the converse logic here?

It's a macro/defined already.
It's a macro/defined in AMXX 1.8.3/1.9, not in 1.8.2 which is the current stable build.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-03-2019 , 18:40   Re: No lag nightvision
Reply With Quote #8

@DJEarthQuake - what are even you talking about? If 2+3 = 5, then 3+2=5 as well. In this case it's more like 1=1. If MSG_ONE is equal to 1, it doesn't make any difference in the performance whatsoever. That's pure non-sense. After the plugin gets compiled, the .amxx file doesn't contain MSG_ONE, it contains the value of 1. I doubt that even the compiler is in any way affected from this. What you're suggesting is completely bad practice and pure usage of "magic numbers". If this is how plugins should be made, then we don't even need to have constants in the .inc files.
__________________

Last edited by OciXCrom; 05-03-2019 at 18:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-03-2019 , 19:28   Re: No lag nightvision
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
If MSG_ONE is equal to 1
It's equal. Numbers are easier for some of us.
__________________

Last edited by DJEarthQuake; 05-29-2020 at 11:09.
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-04-2019 , 09:56   Re: No lag nightvision
Reply With Quote #10

Quote:
Originally Posted by DJEarthQuake View Post
It's equal. Numbers are easier. I use 0,23 all the time for broadcasting temp ents.
How is searching the .inc files for the number that corresponds with the constant or remembering numbers easier than writing the constant itself? Why are you even suggesting such a thing? Just try to post a plugin with such numbers, approvers will demand that you replace the magic numbers with constants. What if the number for a constant gets changed in a future AMXX update?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode