Raised This Month: $51 Target: $400
 12% 

[TUT] Semiclip


Post New Thread Reply   
 
Thread Tools Display Modes
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-23-2007 , 16:05   Re: [TUT] Semiclip
Reply With Quote #11

Thanks but that's a really marginal optimization. If it was a huge array, I'd probably add it in, but for a couple of single cell variables I'm not going to bother.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 08-23-2007 , 18:04   Re: [TUT] Semiclip
Reply With Quote #12

Variable size doesn't matter.

Just notice something your for statement is using new count that is a performance issue!
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd

Last edited by Orangutanz; 08-23-2007 at 18:07.
Orangutanz is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-23-2007 , 18:27   Re: [TUT] Semiclip
Reply With Quote #13

Quote:
Originally Posted by Orangutanz View Post
Variable size doesn't matter.

Just notice something your for statement is using new count that is a performance issue!
Err... where?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
stupok
Veteran Member
Join Date: Feb 2006
Old 08-26-2007 , 22:59   Re: [TUT] Semiclip
Reply With Quote #14

Quote:
Originally Posted by Hawk552 View Post
Thanks but that's a really marginal optimization. If it was a huge array, I'd probably add it in, but for a couple of single cell variables I'm not going to bother.
Then why did you do this?

Code:
static Players[32],Playersnum,Player
Orangutanz is referring to this:

Code:
for(new Count;Count < Playersnum;Count++)
__________________
stupok is offline
Old 08-26-2007, 23:26
Hawk552
This message has been deleted by Hawk552.
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 08-27-2007 , 05:35   Re: [TUT] Semiclip
Reply With Quote #15

Quote:
Originally Posted by Hawk552
Basically, if I made it static, it would have to be reset each and every time the function was called. Not only would I have to pull it out of the declaration section of the for loop, I'd also have to zero it. Since the zeroing is where the performance hit is, there's no reason to make it static.
Hawk I'm not being funny but it's the creation of variables that cause the performance hit, zeroing increases it but you have to live with that since that is Pawn.

Your for loop is doing this new count, IMO that is bad practice you are showing people! Since it's usually new count = 0 or w/e.

FYI I'm studying application development and I just covered a section regarding this with my tutor. Fast ticking functions should be using either static or global variables if they are being constantly used like you are showing. There is ways and means of not doing this which is down to checking methods within the function. External functions which I mentioned previously is trival and more than likely not worth it.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-27-2007 , 12:58   Re: [TUT] Semiclip
Reply With Quote #16

Quote:
Originally Posted by Orangutanz View Post
Hawk I'm not being funny but it's the creation of variables that cause the performance hit, zeroing increases it but you have to live with that since that is Pawn.

Your for loop is doing this new count, IMO that is bad practice you are showing people! Since it's usually new count = 0 or w/e.

FYI I'm studying application development and I just covered a section regarding this with my tutor. Fast ticking functions should be using either static or global variables if they are being constantly used like you are showing. There is ways and means of not doing this which is down to checking methods within the function. External functions which I mentioned previously is trival and more than likely not worth it.
I don't think you understand... "new Count = 0" is useless as it's automatically declared as 0. If I did make it static, I would have to zero it again every time the function was called. All of the performance hit is in zeroing it (BAILOPAN has said that 3 or 4 times now).

I don't see your point. I think it's not only easier to use 'new' but also makes more sense as it's more practical.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 08-27-2007 , 13:21   Re: [TUT] Semiclip
Reply With Quote #17

What you are essentially doing:

Script:
new variable

Pawn:
int variable; // created whenever a new variable is created
variable = 0; // due to new being used Pawn 0's it


Using static...
Script:
static variable

Pawn:
static variable; // created only once


Do you understand now? Yes you have to manually 0 the item but that is what for statements are for

Anyway enough said, no more response from me now!

Quote:
All of the performance hit is in zeroing it (BAILOPAN has said that 3 or 4 times now).
LOL at that! Means whenever you change a variable it hits performance issues regardless if you 0 it or change it to 1
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd

Last edited by Orangutanz; 08-27-2007 at 13:23.
Orangutanz is offline
Old 08-27-2007, 13:38
Hawk552
This message has been deleted by Hawk552.
Rolnaaba
Veteran Member
Join Date: May 2006
Old 08-28-2007 , 08:58   Re: [TUT] Semiclip
Reply With Quote #18

the first method with making them not solid a soon as they touch, because it is called after they touch, which means that they have already collided and get a rebound off, slowing you down, which kind of defeats the purpose. I have tried making this for a bunnyhop seerver so they could jump through teamates, but they had already collided screwing up their jump by time I made them not solid. I think we solved that problem, I dont remember, try and find that topic.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-28-2007 , 11:51   Re: [TUT] Semiclip
Reply With Quote #19

Quote:
Originally Posted by Rolnaaba View Post
the first method with making them not solid a soon as they touch, because it is called after they touch, which means that they have already collided and get a rebound off, slowing you down, which kind of defeats the purpose. I have tried making this for a bunnyhop seerver so they could jump through teamates, but they had already collided screwing up their jump by time I made them not solid. I think we solved that problem, I dont remember, try and find that topic.
Read much? That's exactly what I said.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Rolnaaba
Veteran Member
Join Date: May 2006
Old 08-28-2007 , 16:23   Re: [TUT] Semiclip
Reply With Quote #20

I apologize you are teh pwnage.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
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 01:34.


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