-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add CWCHEAT for postprocessing #12912
Conversation
You could add a version that reads value from memory like 0xA1, then instead of an instant change, you could write a cheat that gradually reduces colors with HP going down etc. |
Added, but not sure the best way to parse value that might end up in different format, may shader can handle bit conversion to a certain degree.
MHFU example (shader will get 100.0 with 100HP so must be scaled down in the shader)
Edit: |
Don't worry, CWCheat can be used to inject your own code to be executed by the game, so you can make the game scale down any values to whatever format and range you wish. You could even do some fun things like pass just a flag which will play animation of screenshaking after being hit etc. imagination(and time) is the limit of how you can mod the game and just making it provide some feedback info is really no rocket science.:) Edit: As for the offset, I'm not sure what you're asking for, is it about 0xA1 ~ similar code type for vibration? Then I just used 8 following bytes to check for the values stored one after another, it's for the cheat author to format the data in such way to fit the code type. |
Here for instance address in the read is 0x08801000 but in the write is 0x00001000, I was wondering why that offset 0x08800000 is there. |
Ah, that. The offset comes from CWCheat itself, that format considers user memory start as it's 0x0 address as it's only able to interact with that and user memory starts at 0x08800000 so basically all CWCheats make use of that, maybe except pointer codes which read pointers from game memory and those are actual addresses without that offset. However we don't have to and might even not want to keep that dependency for PPSSPP specific code types and it's quicker to copy&paste actual address from disassembly without having to type it reduced by 0x08800000. |
1d05444
to
6f59f02
Compare
Added chain support:
|
I think this can do some cool things, although I guess each cheat will be associated with a very specific post-processing shader. FWIW, the chain will return an empty vector if "Off", so no need to check for that (doesn't hurt though.) No real opinion about the addresses. Maybe there's something to be said for consistency... though cwcheat isn't very consistent to begin with. -[Unknown] |
With "Off" I got a vector with that item and size 1, I added the check to not add "OffSettingValue1" in the map and so on that would be kinda weird in the .ini setting once saved. About association I think there are 2 way:
|
Oh, that must be a bug then, I'll check. That might confuse other things... -[Unknown] |
Sorry, I'm wrong. Everywhere else, we check for "Off" before grabbing it. My bad. Hm. If we really wanted the cheats and shaders to go hand in hand, you'd almost want a -[Unknown] |
Should Here a complete example for reference (MHFU ULES01213, saturation based on HP, blur on low stamina, kinda not the best blur tbh). Setting 1 and 2 are used by the CWCheat, while 3 and 4 in the UI menu as a flag (step to 1 make it kinda fine as "bool" UI wise) to enable or disable the 2 effect (one would like only one or to disable them in village (stamina is 0 there sadly, hp are fine). Cheat:
Ini:
Fragment:
|
If the shader has options to enable/disable the cheat, maybe it could auto activate? I could definitely see it being confusing, though. I guess it really depends on the shader. And I don't think we should enable cheats by default, so they'd still have to enable cheats - meaning the shader wouldn't work "out of the box." -[Unknown] |
Maybe some new "effects" pack? We could combine a cheat file with PPSSPP specific cheats, shader and maybe leave the format open to whatever someone could add in the future, then store those packs in separate folder and just activate them with a separate option. Edit: I'm thinking something alike:
Or just a zip file with cheat and shader files and extra file that assign it to some options. Zip could be named gameIDpackName. For example based on the above ULES01213HP.zip and it would show in some custom effects - specific to the game - menu with all the assigned options under a label HP, so another mod would have it's own options under it's own label etc. I know that's a lot of work, so just throwing an idea for the future. |
@hrydgard what do you think about merging this before release? Features like that which require community support really benefit from existing in the release version and this could easily grow later on based on the feedback it get's from larger pool of users. |
@LunaMoo Thanks for the reminder, that is true. I'll take a closer look at this soon. |
Looks good! |
This allow to set uniform with CWCHEAT with 0xA2 code:
Example on MHFU (EU version) using Color Correction shader
This should allow to edit the first shader of the chain with #12905 (will test after it's merged) that it's probably fine for the use case (CWCHEAT handling a chain could be done with a offset, but not sure if is worth the trouble).