Raised This Month: $64 Target: $400
 16% 

[TUT] Modules and efficient scripting


Post New Thread Reply   
 
Thread Tools Display Modes
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-29-2009 , 12:24   Re: [TUT] Modules and efficient scripting
Reply With Quote #11

Quote:
Originally Posted by ot_207 View Post
I know, you don't need to explain, this is your situation or any other good coders situation. There are some problems that will be fixed on that tutorial. If a scripter needs it he will modify the code. It depends on experience at first, if a scripter is a beginner he can't be able to see all weak spots of a code. That is a thing which everyone will learn with time.
The thing is: despite the fact that his code make things better it also does things wrong. It is re-setting models on spawn so, in a 32 slots full server, when a round begins it is re-setting 32 models (despite the fact that it is not needed). And because of that it also has tasks to prevent problems that can arise from these simultaneous re-sets. So, it's not only the efficient that it can be as it also can still let problems happen. By hooking team join event you would never re-set 32 models at the same time.

So basically what am i saying?
Changing its code like i said is not a trivial optimization but, for me, a obligatory one.
__________________

Last edited by joaquimandrade; 03-29-2009 at 14:14.
joaquimandrade is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-29-2009 , 14:36   Re: [TUT] Modules and efficient scripting
Reply With Quote #12

Quote:
Originally Posted by joaquimandrade View Post
FM, absolutely. But, you can improve Mercylez code. Look at this:

http://forums.alliedmods.net/showpos...7&postcount=40
http://forums.alliedmods.net/showpos...0&postcount=44

I didn't continue the talk there but, you should remove the tasks. And, if that causes problems put them again.
LOL. I never used tasks. ^^
Just checked if the model is right on player's spawn. If not - give player the right model.

But yeah... Doing it on team change event should be better.
__________________
hleV is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 03-29-2009 , 16:05   Re: [TUT] Modules and efficient scripting
Reply With Quote #13

so does it matter whether i use pev_origin or EV_VEC_origin for example? thats the only question which left in my eyes

nice tut ;o)
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-29-2009 , 16:10   Re: [TUT] Modules and efficient scripting
Reply With Quote #14

Quote:
Originally Posted by SchlumPF* View Post
so does it matter whether i use pev_origin or EV_VEC_origin for example? thats the only question which left in my eyes

nice tut ;o)
Thanks .
Engine is faster than FakeMeta in this situation for instance.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-29-2009 , 16:19   Re: [TUT] Modules and efficient scripting
Reply With Quote #15

So anything that Fakemeta and Engine can do, Engine will do it faster, or...?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-29-2009 , 16:26   Re: [TUT] Modules and efficient scripting
Reply With Quote #16

Quote:
Originally Posted by Exolent[jNr] View Post
So anything that Fakemeta and Engine can do, Engine will do it faster, or...?
Yes ...
Look as an example you can try to test this code.
http://forums.alliedmods.net/showthread.php?t=65427
In that topic you can see both fakemeta and engine example you will see that engine works better.
[The camera pozition is better/faster updated!]

Edit: I will later post these plugins in the main topic and some of your questions so that people can see them .
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 03-29-2009 at 16:33.
ot_207 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-29-2009 , 16:36   Re: [TUT] Modules and efficient scripting
Reply With Quote #17

About:

Quote:
Originally Posted by SchlumPF* View Post
so does it matter whether i use pev_origin or EV_VEC_origin for example? thats the only question which left in my eyes

nice tut ;o)
My guess is that it is the same thing (Or probably engine better since there's no need to check the data type (i guess)). Will profile later.
__________________
joaquimandrade is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-29-2009 , 16:37   Re: [TUT] Modules and efficient scripting
Reply With Quote #18

Quote:
Originally Posted by joaquimandrade View Post
About:

My guess is that it is the same thing. Will profile later.
Ok, will wait for your feedback. I'm also curious .
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-29-2009 , 16:38   Re: [TUT] Modules and efficient scripting
Reply With Quote #19

I think there will need to be more testing on the actual fakemeta natives vs the engine natives. As for now the only argument has been fakemeta conversions (stocks that emulate the engine natives), but http://forums.alliedmods.net/showthread.php?t=65427 just puts it to fakemeta, there is not any fakemeta conversions so you can't completely say that fakemeta is slower in that situation.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-29-2009 , 16:54   Re: [TUT] Modules and efficient scripting
Reply With Quote #20

About set_pev/entity_set the results say that it is basically the same thing.

(The same for pev/entity_get)
Attached Files
File Type: txt Eng_vs_Fm.txt (950 Bytes, 188 views)
File Type: sma Get Plugin or Get Source (Eng_Vs_Fm.sma - 380 views - 525 Bytes)
__________________

Last edited by joaquimandrade; 03-29-2009 at 16:58.
joaquimandrade is offline
Reply


Thread Tools
Display Modes

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 09:00.


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