-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surfing System #31
Comments
I think I've made some progress, albeit very minor. According to what I can find documenting the Quake and Source engines, I added a check in the acceleration function to return a zero vector if the result is greater than max_air_speed. This seems to result in slightly better surf physics, in that holding W will make you lose velocity, while only strafing will increase it. However, I'm still having issues debugging why you can still accelerate directly up the slope by strafing into it. From what I've found documenting the physics mathematics of half-life, there's some calculation related to the surface normal that should be modifying and slowing the player velocity, but I've yet to properly recreate it. |
Here are some more resources for anyone interested: |
Nice, feel free to open a PR when ready. Can even be a draft for now. |
Alright. I'll push what I've gotten working for now. |
I'm still studying the physics math of Half-Life, but I found this interesting formula for calculating the general collision equation for entities with a surface: Where: But from what I can tell, this is already implemented in the controller code. However, the bounce coefficient is missing, which we can implement for cases where the player needs a bounce value other than 1, or if the user wishes to change the value of sv_bounce. |
Another piece of interest, is that there's a few different entity movement types we could theoretically implement However, I'm not sure if they're in scope for this project, as to my understanding we're only focusing on the player entity: https://www.jwchong.com/hl/entity.html#movement Maybe I'll eventually make a fork for other entities. I don't know. |
I decided to create a new issue to discuss how to properly implement surfing. I created a modified version of the example map to test with. Furthermore, I've found that using 30 to 40 percent of the add.x and add.z velocity gets us somewhat close to the desired effects, but there are still some issues. I'll have to look further into how surfing works in the original source engine, and how others have simulated it.
The text was updated successfully, but these errors were encountered: