Raised This Month: $ Target: $400
 0% 

[L4D2] nb_update_frequency fix (Experimental)


Post New Thread Reply   
 
Thread Tools Display Modes
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 06-08-2025 , 13:11   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #81

Quote:
Originally Posted by blueblur View Post
Hi, I would like to request a feature for this extension: Could we resolve the collision between the wandering witch and infected? Running infected who collide with witch will push witch with an extra speed, which looks like the witch is "shifting away".
All common infected and witches collisions are handled by "NextBotGroundLocomotion::ResolveZombieCollis ions" so just disabling this feature for witches would "fix" the issue. However, the actual problem lies here. The locomotion system sets momentum based on how much the position has changed since the last update and adds velocity accordingly. The gained velocity should decay over time due to friction but this doesn't happen because for some reason forward friction is disabled by default (nb_friction_forward) and even if you enable it, it only works when your actual velocity is in the opposite direction of the desired velocity.

Quote:
Originally Posted by blueblur View Post
But I don't think it is a nice way. If we start from the collision itself, what would be the better way to neutralize the collision?
I think the best way to try to fix it is to enable forward friction and patch the check but this would probably be time consuming and I don't know why it was implemented this way.
Using SetAbsVelocity is probably the most efficient approach, imo.

Last edited by BHaType; 06-08-2025 at 13:16.
BHaType is offline
Send a message via AIM to BHaType
blueblur
Member
Join Date: Nov 2022
Location: 23℃
Old 06-09-2025 , 08:25   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #82

Quote:
Originally Posted by BHaType View Post
However, the actual problem lies here.
Yeah I see.

Quote:
Originally Posted by BHaType View Post
I think the best way to try to fix it is to enable forward friction and patch the check but this would probably be time consuming and I don't know why it was implemented this way.
Agree that rebuild the whole function is indeed time consuming.

Quote:
Originally Posted by BHaType View Post
The gained velocity should decay over time due to friction but this doesn't happen because for some reason forward friction is disabled by default (nb_friction_forward) and even if you enable it, it only works when your actual velocity is in the opposite direction of the desired velocity.
It seems that it only operates if the actual velocity is in an angle that is greater than 90 degrees between the move vector. So probably it is fine to not to patch it? (Not tested, if the actual behavior is differed than the desired behavior then it is indeed needed to be patched.)

Quote:
Originally Posted by BHaType View Post
Using SetAbsVelocity is probably the most efficient approach, imo.
I had a thought on this, truth that this is the most efficient way, but eventually to make it looks more natural on the collision velocity, we still have to implement a better algorithm on the forward friction and the forward speed check. But yeah that is something huge work to replenish a tiny issue, resulting that I am reluctant to do so too.
blueblur is offline
zuaLdakid05
Member
Join Date: Feb 2025
Location: Viet Nam
Old 06-13-2025 , 05:33   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #83

Random crashes sometimes happen when i loaded my server with this, i don't know why. Please update
zuaLdakid05 is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 06-21-2025 , 07:19   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #84

Quote:
Originally Posted by zuaLdakid05 View Post
Random crashes sometimes happen when i loaded my server with this, i don't know why. Please update
Windows or Linux?
if windows then test the attached version
Attached Files
File Type: zip sourcemod.zip (294.6 KB, 230 views)

Last edited by BHaType; 06-21-2025 at 07:19.
BHaType is offline
Send a message via AIM to BHaType
zuaLdakid05
Member
Join Date: Feb 2025
Location: Viet Nam
Old 06-22-2025 , 06:24   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #85

Quote:
Originally Posted by BHaType View Post
Windows or Linux?
if windows then test the attached version
Yes, i am using it on windows.
I've tested the version on your post and turns out great, no crash at all. Thank you so much!
zuaLdakid05 is offline
MoRanYue
Member
Join Date: Dec 2024
Location: Fuzhou, Fujian, China
Old 06-30-2025 , 06:33   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #86

Quote:
Originally Posted by BHaType View Post
Windows or Linux?
if windows then test the attached version
is it a fix of the latest version or an old version achive?
__________________
Hello! Were you happy today?

I'm just new to Sourcemodding, and just creating plugins and addons for L4D2.
Contact links: Steam | GitHub | Email
Some plugins: New Left 4 Chat 2
MoRanYue is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 06-30-2025 , 11:51   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #87

Quote:
Originally Posted by MoRanYue View Post
is it a fix of the latest version or an old version achive?
It's the latest version but compiled without the optimization flag
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
MoRanYue
Member
Join Date: Dec 2024
Location: Fuzhou, Fujian, China
Old 07-01-2025 , 06:35   Re: [L4D2] nb_update_frequency fix (Experimental)
Reply With Quote #88

Quote:
Originally Posted by BHaType View Post
It's the latest version but compiled without the optimization flag
thats so good, though the reason indicates those crashes problem still remains unknown
__________________
Hello! Were you happy today?

I'm just new to Sourcemodding, and just creating plugins and addons for L4D2.
Contact links: Steam | GitHub | Email
Some plugins: New Left 4 Chat 2
MoRanYue 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:33.


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