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

Finding a knock back fix for CS: GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 09-18-2012 , 10:18   Finding a knock back fix for CS: GO
Reply With Quote #1

Note: This thread is for discussing how to fix knock back only, not other issues with ZR. Don't go off topic here.

Problem
The knock back feature is supposed to push players in a certain direction with a certain force (using TeleportEntity in SourceMod to append to the player velocity). In CS:S players will slide on the ground in varying distances depending on the push force, it behaves just like we want to. In CS:GO players don't slide much on the ground, no matter how high the push force is. If the same push force is applied when they're in mid-air, players fly away as we want to.

By applying a push force I mean increasing a players momentum. I've tried really high push forces, but players really hold on to the ground. If this was for real, a player could stop a moving train by just standing there.

I've been investigating the knock back issue and so far I haven't found an acceptable solution. My findings so far:

Velocity capped when on ground
No matter how large velocity I apply, the value seems to never go above the running speed (233 with knife). It looks like it's capped. The question is: When?

The trigger_push entity also have the same issue when players stand on the ground. So if someone find a fix for trigger_push we also might be able to fix knock back.

Upwards force above 250 (velocity[2]) works
Applying a velocity that will push you up 251 units/sec will make you go off the ground so that the knock back velocity is applied. Though people will also fly a bit upwards because of this. It doesn't look natural, especially when shooting from above (which is the last thing people would expect happening).

This is a workaround that at least makes it possible to push people back. But it has bad side effects because it pushes you up in the air. People/zombies in air are very vulnerable to knock back compared to those on the ground (because there's no friction when in air, which also applies to CS:S). It's a lot easier to shoot them away. Zombies can avoid this by not jumping too much, but with this workaround they are always vulnerable. There's no difference in knock back for zombies on the ground or zombies in the air. This is a bad side effect that may make the game unbalanced.

Velocity seems to decrease in a fixed time span
This might just be an illusion if the velocity is capped, but when applying high velocity I expected it to take longer time to decrease so people will slide on the ground, just like in CS:S. But in CS: GO players always stop quickly, like there's high friction. Lowering sv_friction didn't make it any better because it affected general movement, such as when you stop walking you're supposed to stop quickly.

Stuff that didn't work
  • sv_gravity 0
  • sv_friction 1 (or other low values)
  • sv_enablebunnyhopping 0
  • sv_staminalandcost 0
  • sv_staminajumpcost 0
  • sv_maxspeed 1000
  • overriding CBasePlayer::m_flMaxspeed in PostThink (in combination with sv_maxspeed)
    I suspected that the velocity applied to the player is capped by max speed. It still didn't work.
  • mp_solid_teammates 1
  • modifying CBasePlayer::m_vecBaseVelocity
    No difference from applying velocity with TeleportEntity native in SourceMod.
  • modifying CBasePlayer::m_vecVelocity
    The player moved in the correct direction, but movement stopped quickly, even in air. Maybe I didn't do this correctly or the engine didn't like me changing the value directly.
  • sv_stopspeed 0 - Player deacceleration is slower, but the player still move about the same distance no matter how high the knock back push is.
Stuff to test
Everyone are welcome to test this and report back here.
  • Read the velocity (m_vecVelocity) in every possible event or hook, such as (pre/post) think. We need to figure out if or when velocity is capped. Only compare readings in the same game frame - maybe also a list of readings (n + 10 frames).
  • Experiment with the FL_ONGROUND flag before/after applying knock back. Though changes will probably be overwritten in the next frame. And players not on the ground will have those bad side effects mentioned above.
  • Experiment with CBasePlayer::m_flFriction multiplier.
Solutions or ideas are welcome (without side effects if possible), just remember to don't go off topic.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 01-07-2014 at 13:37.
rhelgeby is offline
Send a message via MSN to rhelgeby
KratosMafia
Senior Member
Join Date: Jul 2012
Old 09-18-2012 , 15:53   Re: Finding a knock back fix for CS: GO
Reply With Quote #2

When I set knockback between 13-20 on a zombie it seems to work?
__________________
KratosMafia is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 09-18-2012 , 16:34   Re: Finding a knock back fix for CS: GO
Reply With Quote #3

It doesn't matter how high you set the knock back when you're on the ground. Something is overriding it. Those times it seems to work is when you have a knock back angle and force that is pushing players off the ground, usually flying far away. Basically anything that gives upwards velocity above 250.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 09-18-2012 at 16:38.
rhelgeby is offline
Send a message via MSN to rhelgeby
KratosMafia
Senior Member
Join Date: Jul 2012
Old 09-18-2012 , 16:47   Re: Finding a knock back fix for CS: GO
Reply With Quote #4

ahh alright. So once on ground it does nothing but once you are in air it kicks in? Guess since people like to jump as zombie it seems to work a lot.
__________________
KratosMafia is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 10-01-2012 , 20:03   Re: Finding a knock back fix for CS: GO
Reply With Quote #5

I wonder if this change in the CS: GO 1.20 update will fix knock back issues:

Code:
-Fixed issue that caused doors and other "pusher" entities to move at the wrong 
speed when the tick rate was > 64 Hz.
I don't remember if my test server was above 64 ticks though (using default settings).
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 10-01-2012 at 20:04.
rhelgeby is offline
Send a message via MSN to rhelgeby
KratosMafia
Senior Member
Join Date: Jul 2012
Old 10-01-2012 , 20:30   Re: Finding a knock back fix for CS: GO
Reply With Quote #6

Mine is 64 default i beleive is 33
__________________
KratosMafia is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-01-2012 , 20:47   Re: Finding a knock back fix for CS: GO
Reply With Quote #7

default is 64 and that's what I had mine set to... I doubt that fix will allow knockback - but I could be wrong.
__________________
View my Plugins | Donate
TnTSCS is offline
spelworm
Senior Member
Join Date: Mar 2007
Old 10-02-2012 , 07:35   Re: Finding a knock back fix for CS: GO
Reply With Quote #8

Quote:
Originally Posted by rhelgeby View Post
I wonder if this change in the CS: GO 1.20 update will fix knock back issues:

Code:
-Fixed issue that caused doors and other "pusher" entities to move at the wrong 
speed when the tick rate was > 64 Hz.
I don't remember if my test server was above 64 ticks though (using default settings).
I think that fixed the giant tickrate debate in the mailing list a while back about a door in nuke going slower on 128 tick or something
spelworm is offline
Relikie
Junior Member
Join Date: Dec 2007
Old 10-16-2012 , 14:49   Re: Finding a knock back fix for CS: GO
Reply With Quote #9

You could try making a quick repeating timer that teleports backward a small bit on every repeat.

Not sure if you could make it fast enough to avoid looking more unnatural or avoid a significant performance drain though.

Last edited by Relikie; 10-16-2012 at 14:55.
Relikie is offline
KratosMafia
Senior Member
Join Date: Jul 2012
Old 10-16-2012 , 15:49   Re: Finding a knock back fix for CS: GO
Reply With Quote #10

The new snapshot forces zombies in the air so I guess that is the KB?
__________________
KratosMafia 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 04:27.


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