xan1242

joined 1 year ago
[–] xan1242@lemmy.dbzer0.com 4 points 9 months ago* (last edited 9 months ago) (4 children)

I'll preface this by saying that I'm not familiar with Rust nor Hearthstone at all, but I do deal with D3D9 and D3D11 on Windows to do similar things. Hopefully this will give you insights how you could approach this. (Closest I've done was code injection on Android)

The most common and robust approach to this is to hook/detour the API functions that the game imports from the renderer backend.

One way you usually do this is by creating a dummy library which overrides/intercepts the system library and passes through every function call to the API, except for the ones you need, you'd put your code before/after the passthrough. This usually requires you to gather all exported symbols and re-create them, which is a very tedious but rewarding task, as it usually is very stable and can work around things such as DRM.

Usually, since that sits quite low on the application's code stack, it is most efficient for it to be a more general-purpose hook which can load other libraries. Examples would be things like the ASI loader or Reshade on Windows.

Another way would be to do code injection via library side-loading. Essentially, you can simply load a library that performs the code hooks and does necessary renderer API hooking. This is usually done in combination with the previous method (it being a "plugin" loader), however, it is also possible to modify game binaries to call dlopen to load your library and its exported function as an entrypoint (in which case you need to do platform's CPU assembly code for a bit).

Those are the entrypoints for your code. After that, it is all about necessary render backend code that you need to do in order to draw graphics/text/etc.

In C/C++ land I'd just tell you to use Dear ImGui, but seeing as that doesn't exist for Rust, you're kinda on your own.

Same with the API detouring. Ideally, you'd make a plugin loader that does the job for you. Not sure if that exists in Rust yet.

For references, Vulkan overlays such as MangoHUD or ReShade could be useful to help you figure out how to draw stuff on screen.

As for the rest of your code - it can run in a separate thread that does the job for you as the game runs. Or, make a client-server relationship and make the game hook be the server for your info that you need.

[–] xan1242@lemmy.dbzer0.com 2 points 9 months ago

Yeah I meant don't use joycons lol

Pro Controller at the very least. CTR is a game that should be played with a dpad for steering. You can use the analog inputs but some more advanced tricks (such as tight steering) will require a solid dpad.

[–] xan1242@lemmy.dbzer0.com 11 points 9 months ago* (last edited 9 months ago) (1 children)

And that't the crux of the issue. Stenzek doesn't actually understand the reality of licensing.

The reality is this - you can't do anything without a lawyer. Laweyrs cost money (pro bono isn't a thing in the copyright world AFAIK, but IANAL).

If he wanted to avoid this, then maybe he should've kept it closed source from the beginning. Chinese sellers on AliExpress couldn't care less about licensing anyway, so that way he'd have at least some protection.

IMO his course of action so far has been wrong.

What he should've done is this:

  1. Cause a stir
  2. Get support from the community
  3. Open up donations for the project (or just himself, since you don't want a repeat of Yuzu)

He could even go after Arcade1up legally if he raised funds, but that's not even worth the time if you ask me.

[–] xan1242@lemmy.dbzer0.com 1 points 9 months ago (2 children)

I'd recommend getting a proper controller for it. CTR is a dpad and shoulder button masher.

[–] xan1242@lemmy.dbzer0.com 0 points 9 months ago

Any Black Box made Need for Speed.

(Currently busy fixing Pro Street, so many bugs...)

[–] xan1242@lemmy.dbzer0.com 4 points 9 months ago (1 children)

This is the real issue. This is one area that Windows, despite its historical hardships, handles much better.

(Mac OS too but they killed kexts for the public anyway)

I'd love to see a more dynamic approach (that doesn't rely on DKMS) someday.

[–] xan1242@lemmy.dbzer0.com 6 points 9 months ago* (last edited 9 months ago)

C++ is at least backwards compatible (for 99% of code anyway, yes I know about some features being removed, but that's an exception and not the rule).

[–] xan1242@lemmy.dbzer0.com 4 points 10 months ago

A friend of mine uses Tablacus Explorer (with a Webview2 extension)

https://tablacus.github.io/explorer_en.html

[–] xan1242@lemmy.dbzer0.com 2 points 10 months ago

To top it off, what matters at the end of the day js this - people generally don't care about graphics anymore!

Even if you end up with graphics that are worse than a console, you still have:

  • an option to upgrade later
  • options to configure graphics (generally games actually optimize themselves pretty well nowadays)
  • an open platform to do things the way you want

PS5 Pro makes absolutely no sense to me.

[–] xan1242@lemmy.dbzer0.com 23 points 10 months ago (2 children)

AAAAAAAAAAAAAAAAAAAAAAAA

[–] xan1242@lemmy.dbzer0.com 61 points 10 months ago

It's just their ego showing through.

It basically now comes down to the current devs depending on new Rust devs for anything that interacts with Rust code.

They could just work together with Rust devs to solve any issues (API for example).

But their ego doesn't allow for it. They want to do everything by themselves because that's how it always was (up until now).

Sure, you could say it's more efficient to work on things alone for some people, and I'd agree here, but realistically that's not going to matter because the most interactivity that exists (at the moment) between Rust and C in Linux is... the API. Something that they touch up on once in a while. Once it's solid enough, they don't have to touch it anymore at all.

This is a completely new challenge that the Linux devs are facing now after a new language has been introduced. It was tried before, but now it's been approved. The only person they should be mad at is Linus, not the Rust devs.

[–] xan1242@lemmy.dbzer0.com 26 points 10 months ago* (last edited 10 months ago) (1 children)

Yeah enabling remote debugging because the dev thought it made it easier is a pretty big oof.

But this is just strike one. It's a one man show, after all, so cutting them some slack is warranted when it comes to this specific topic.

Nevertheless, your concerns aren't unfounded. This project needs more contributors to be able to keep up. (Thorium is basically in the same boat)

view more: ‹ prev next ›