Raised This Month: $32 Target: $400
 8% 

[TUT] Semiclip


Post New Thread Reply   
 
Thread Tools Display Modes
hoboman
Senior Member
Join Date: Jul 2007
Old 04-04-2008 , 03:42   Re: [TUT] Semiclip
Reply With Quote #31

ok, I reread what I wrote in that last post...and I have no idea wut the hell I was talking about...I wasn't gonna reply until some tool ( probably alka ) -karmaed me for it.

btw, the only reason I used tasks was because I wanted to single out the time when the player is in SOLID_NOT state. As you can see I replaced that part using prethink now.


I still stand by the statement that my method is still a million times more efficient and is the best semiclipping method available. If you really thought of it already then I don't understand why you didn't bother posting it ( could have saved me some time ).
Of course, I cannot argue that my method may not work as well on the surf servers, but that is a kind of a far out case with extreme conditions ( extreme speeds ). But it is accurate enough for pretty much all the other cases.


oh and Hawk, do you even realize that you are contradicting yourself from your first post:
Quote:
thinking every 0.01 seconds. Very very resource intensive, but...
and now
Quote:
Also, my method isn't as inefficient as you may think
If you really want to argue that looping through all the players and checking all the entities around them every 10 milliseconds is more efficient than using ShouldCollide ( which is only called when the players are getting relatively close together ), I would really love to hear that argument. No, really...
__________________
hoboman is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-04-2008 , 22:28   Re: [TUT] Semiclip
Reply With Quote #32

Your method isn't the best method available. It's actually extremely resource consuming. The forward client_PreThink gets called every physics frame before rendering and ShouldCollide is called every frame when a collision should happen, which means that it's actually double the amount of calls each frame that you're trying to activate semiclipping. Do you know what's even worse about it? Your method equates to 2*players calls every frame. Ouch!

Why not compress it down to one forward and just use a native (get_players) to avoid going back and forth through the VM layer up to 64 times? My method is efficient that way. Since you apparently don't seem to understand the difference between efficiency and resource consumption, I don't think it would be fair me to keep going on to why your method actually sucks. I will anyway, though. I asked you a few posts ago to try your method on a surf server. You said something about "[...] [having] no idea wut [sic] the hell [you were] talking about [...]" (which, may I add, really gives me confidence in your opinion) and that it "[...] may not work as well on the surf servers [...]", so I can only assume that you're rejecting the notion that surf servers are basically the only application of semiclip. So basically, I really don't understand where you're going with this.

I'm also kind of surprised that you actually think that the ent thinks every 0.01 seconds. It really thinks at a rate dependent on both the server frames rendered and the time elapsed since the last think. If the server is rendering frames slower than 100/s, then it's going to get called less times than that. Then there's the fact that you can actually adjust my timer; I picked 0.01 seconds as an arbitrary number because it works well on surf servers and gives enough time for most collisions to be detected and prevented. You can change it if you want, but I don't see any option to do that with client_PreThink or ShouldCollide.

The only thing I can really give you is that I never really thought of using ShouldCollide before. I'll consider applying that to one of the versions listed but I don't see it as a very good improvement, especially since it's far less efficient than just blocking the touch only when it happens using register_touch or FM_Touch as precision isn't as important in a non-surf server environment.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
OneEyed
AMX Mod X Beta Tester
Join Date: Jun 2005
Old 04-05-2008 , 13:44   Re: [TUT] Semiclip
Reply With Quote #33

I did some tests to see how many times a second ShouldCollide and PlayerPreThink gets called every second with 3 bots and myself in the server.

ShouldCollide averaged 700-2000 times a second for 4 players.

PlayerPreThink averaged 300-360 times a second for 4 players.

Both functions would take less than 1ms to compute so I wasn't able to get accurate speed results with tickcount(). ShouldCollide ran more cause it covered each player combination. PreThink requires a loop of all players. I myself would prefer PreThink because it was far more stable and wouldn't jump around.

I skipped using hawks info_target think method because I wasn't able to get it to work, and it would most-likely run just as much as PreThink would on a per player basis except requiring 2 nested for loops.
__________________

Last edited by OneEyed; 04-05-2008 at 13:55.
OneEyed is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-05-2008 , 14:04   Re: [TUT] Semiclip
Reply With Quote #34

Using Engine and register_think would make it much much faster, but everyone goes all bitchy when you use Engine instead of Fakemeta to do stuff so I avoided it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-05-2008 , 14:23   Re: [TUT] Semiclip
Reply With Quote #35

Quote:
Originally Posted by Hawk552 View Post
Using Engine and register_think would make it much much faster, but everyone goes all bitchy when you use Engine instead of Fakemeta to do stuff so I avoided it.
Hum, why is engine fastest than fakemeta?
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-05-2008 , 14:29   Re: [TUT] Semiclip
Reply With Quote #36

It isn't in general, just in this case. FM_Think is called for every ent in every plugin that registers it. Engine uses the generally better method of sorting out which classnames should be filtered out and only calling the forwards for the plugins which asked for those.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-05-2008 , 14:59   Re: [TUT] Semiclip
Reply With Quote #37

Quote:
Originally Posted by Hawk552 View Post
It isn't in general, just in this case. FM_Think is called for every ent in every plugin that registers it. Engine uses the generally better method of sorting out which classnames should be filtered out and only calling the forwards for the plugins which asked for those.
Oh, like in hamsandwich ?
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 04-05-2008 , 15:51   Re: [TUT] Semiclip
Reply With Quote #38

Hmm I thought it was the same thing, only less work on your side.
Guess I should start using hamsandwich for that too, if it's actually more efficient...
__________________

Last edited by MeRcyLeZZ; 04-05-2008 at 15:54.
MeRcyLeZZ is offline
creeperdank
Senior Member
Join Date: Dec 2004
Location: IL
Old 04-24-2008 , 17:39   Re: [TUT] Semiclip
Reply With Quote #39

Hi I just have an idea but I am no coder.
I have a gungame server and just want the noclip for teammates only. And
I found something on this site that works ok but I see that people abuse the fact that there is no hit box if 2 teammates stand together. So I though maybe there is a way (like I said I'm no coder) that will slay you if you sit inside the noclip zone for more then 2 or 3 sec. I don't even know if this is possible, but if this could be done that would be nice.
__________________
creeperdank is offline
Send a message via MSN to creeperdank
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 05-08-2008 , 03:08   Re: [TUT] Semiclip
Reply With Quote #40

Hi, your first method doesn't seem to work.
http://fatalis.ampaste.net/186298
All of the debug prints work, but the semiclip doesn't work at all.
__________________
FatalisDK is offline
Old 05-08-2008, 06:28
ConnorMcLeod
This message has been deleted by ConnorMcLeod. Reason: I have to learn to read
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 02:59.


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