SA-MP Forums Archive
Optimizing a gamemode - 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)
+--- Thread: Optimizing a gamemode (/showthread.php?tid=588199)



Optimizing a gamemode - Stev - 06.09.2015

Hey,

I have been "attemping" on optimizing my gamemode, but really and truthfully. I dont know want "optimizing" is consisted of. I don't have a clue on where to start with trying to make script more functional and faster. Any tips? (For a novice person like myself)


Re: Optimizing a gamemode - Nixtren - 06.09.2015

Hi,

I'm actually quite happy to see that someone decides to optimize his GameMode

The general rules of thumb are: Once you feel more geeky, feel free to to read this thread:
https://sampforum.blast.hk/showthread.php?tid=580289

Also, this is not directly related to optimization, but make sure to use the plugin CrashDetect to troubleshoot errors more easily! You would be in fact optimizing your time

At last but not least, do optimizations but make sure it doesn't affect your productivity. If your code is already optimized, don't optimize it even more, because the performance gain would not be noticeable at an human scale. You get what I mean? Optimizing something to run 5 or 10 microseconds faster is what I call "overoptimization", when you could be doing something more productive.


Re: Optimizing a gamemode - Stev - 06.09.2015

Yes, I see what you mean by "over-optimization", I will take them into consideration. I know there would be a lot more I can do to this gamemode to make it more functional its just knows the tricks (If you know what I mean). I did read that thread before posting this one but, my brain can't handle them this at this time .

Thanks for good feedback, Will take into consideration!


Re: Optimizing a gamemode - Nixtren - 06.09.2015

Quote:
Originally Posted by Stev
View Post
Yes, I see what you mean by "over-optimization", I will take them into consideration. I know there would be a lot more I can do to this gamemode to make it more functional its just knows the tricks (If you know what I mean). I did read that thread before posting this one but, my brain can't handle them this at this time .

Thanks for good feedback, Will take into consideration!
I have just checked the filterscript you released a while ago, I would suggest: You're using ZCMD and sscanf, so you're not bad actually, it's already half step for a good script, just don't forget that thing about "new string[256]"


Re: Optimizing a gamemode - Stev - 06.09.2015

Yeah, ZCMD, sscanf, Is the only things I use. I wouldn't call myself "pro", But I know much to keep myself by in what I want to do in PAWNO. I am already using foreach(...) in my gamemode currently