Skip to content
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

Necromancing CS1.6 support from cs branch #322

Merged
merged 15 commits into from
Aug 25, 2022
Merged

Conversation

khanghugo
Copy link
Contributor

From master...cs

This was a feature long time ago that enables further TAS capability in CS1.6 but long remains unsupported. I just want it back.

One thing, Windows pattern is 7 years old but I've checked the instructions for client.dll and it looks reasonable enough to work.

Here are the bytes to patch (just using cl_yawspeed as an example)
pattern1
pattern2

And this is the result
pattern_patched
The patch will push cl_yawspeed and cl_pitchspeed value onto top stack regardless of any branching involving comparison between itself and the two other limit values.

I then TAS it a bit and it works. The prediction closely matches the simulator, or it just is. Before, the yaw lock would not only prevent the script from strafing closer but also all the new fancy camera smoothing stuffs.

For attributions, I have never written a line of code in my entire life so most of things here are simply mirroring already existing code and mainly the one you had initially in the cs branch.

Copy link
Owner

@YaLTeR YaLTeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of just updating the HLStrafe submodule commit to your fork, you should PR the change into HLStrafe, and when that's merged, subsequently update the submodule to point at the commit in the main HLStrafe repo.

BunnymodXT/patterns.hpp Outdated Show resolved Hide resolved
BunnymodXT/modules/ClientDLL.cpp Show resolved Hide resolved
@khanghugo
Copy link
Contributor Author

Thanks for the feedback. I didn't really intend to have these commits flooding over here. Let me see what I can do to clean them up.

@khanghugo
Copy link
Contributor Author

Here are all the changes here. As for hlstrafe changes, I can make some more CS1.6 specific changes involving movement speed to make it work a bit more. I will create another pull request when that comes and hope to get merged.

@khanghugo khanghugo changed the title Necromancing angle speed cap from cs branch Necromancing CS1.6 support from cs branch Aug 8, 2022
@khanghugo khanghugo marked this pull request as draft August 8, 2022 23:16
BunnymodXT/modules/HwDLL.cpp Outdated Show resolved Hide resolved
if (CVars::bxt_hud_stamina.GetBool())
{
int x, y;
GetPosition(CVars::bxt_hud_stamina_offset, CVars::bxt_hud_stamina_anchor, &x, &y, -200, (si.iCharHeight * 16) + 4);
Copy link
Collaborator

@SmileyAG SmileyAG Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix offset here, since that overlaps entity info HUD:

изображение

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is at relative offset 29, right above self gauss.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
This is another one in the middle, barely occupied by visible landmark hud. I think it should be okay there.

@khanghugo khanghugo marked this pull request as ready for review August 18, 2022 16:28
@khanghugo
Copy link
Contributor Author

At this stage, it seems pretty good. Not sure how well it would work on Windows but all the stuffs are there.

@khanghugo
Copy link
Contributor Author

Here is a small TAS that can be used to verified on Windows. Made with the commit.

https://youtu.be/vh2AdTZyWoQ

@khanghugo
Copy link
Contributor Author

khanghugo commented Aug 18, 2022

Beside that, lots of things are still borked (maybe on my end because I cannot verify much). Eg: you cannot record demo or use other things like hud_useable. It needs some more work.

@@ -4735,6 +4738,20 @@ HLStrafe::MovementVars HwDLL::GetMovementVars()
vars.Bounce = CVars::sv_bounce.GetFloat();
vars.Bhopcap = CVars::bxt_bhopcap.GetBool();

if (cl.DoesGameDirMatch("cstrike")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please cache this with a static bool is_cstrike = cl.DoesGameDirMatch("cstrike"); so that we don't have a string comparison every frame. Also I guess when the maxspeed PR is merged (pending on a similar change) this should be rebased on top of that.

@YaLTeR
Copy link
Owner

YaLTeR commented Aug 24, 2022

You should be able to rebase on top of master now to get Smiley's client maxspeed thing.

@khanghugo
Copy link
Contributor Author

khanghugo commented Aug 24, 2022

Yep, rebase is here. If there is anything else, I can fix. Also, tested for any issues and none.

@YaLTeR YaLTeR merged commit eba329c into YaLTeR:master Aug 25, 2022
@YaLTeR
Copy link
Owner

YaLTeR commented Aug 25, 2022

Thanks! Finally, the CS 1.6 support is back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants