ArranzCNL / ImprovedCameraSE

First Person Mod for The Elder Scrolls V: Skyrim - Special Edition
MIT License
216 stars 38 forks source link

Possible incompatibility with scale methods other than SetScale() #82

Closed Sermitse closed 1 year ago

Sermitse commented 1 year ago

We have a mod that alters the size of the player by adjusting the scale by using two possible methods (User decision):

-Bone Scale of Actors (NPC Root [Root]) -Model Scale: Actor->Get3D(True/False)->model->local.scale

Source Code if you need to take a closer look: https://github.com/QuantumEntangledAndy/GTS_Plugin/blob/camera_opt/src/scale/modscale.cpp

The issue: camera shifts above properly, but the body is being shifted forward/feels like only the body is scaled. So it ends up blocking the view and looking a bit weird. The Video of it happening (A bit NSFW):

https://user-images.githubusercontent.com/108320865/212457683-1ad5f000-c72d-4479-a00d-928e90dfceab.mp4

ArranzCNL commented 1 year ago

I see what is happening due to the body increasing in mass it needs pushing back based on the height from the camera.

Edit: How does the first person arms look as I guess with those growing would ideally need to make them appear off screen?

Sermitse commented 1 year ago

That's how 1st and 3rd person arms look like, it further depends on how the body will rotate/zoom

(And it rotates a lot with the mouse, an option to make it rotate on WASD only would be nice. Something similar to TDM)
so it is a bit random.

I'll throw a bit of my opinion here - i think only the body should be fixed, feels like it will fix all other size-related issues

SkyrimSE_jklax1ZmxW SkyrimSE_MU5rOZHRJ4

ArranzCNL commented 1 year ago

Right I've had a play around with player.setscale ranging from 0.2 (min) and 10 (max). There are no issues with at least Vanilla/HIMBO/3BA on a complete naked body. (quite funny at 0.2 everything seems to wobble about alot more)

Can you confirm the same with your custom model using the above skyrim commands... just trying to rule out possible model issues.

Sermitse commented 1 year ago

Player.SetScale works fine, but using custom scaling methods such as altering Npc Root [Root] Scale / altering the Model Scale through the DLL - does not (That's what i did on the video/screenshots)

If you will want to check how it behaves in-game yourself, you will have to install Giantess Mod (.dll Version) and quickly skip quests, skip skills and adjust your max size limit in extras. And then grow yourself with spells/mcm hotkeys/DLL hotkeys. All you need for it to work is Address Library and said dll version of the mod

Sermitse commented 1 year ago

Right I've had a play around with player.setscale ranging from 0.2 (min) and 10 (max). There are no issues with at least Vanilla/HIMBO/3BA on a complete naked body. (quite funny at 0.2 everything seems to wobble about alot more)

Can you confirm the same with your custom model using the above skyrim commands... just trying to rule out possible model issues.

Edit: i tested Model Scale method from our mod (Scaling entire 3D model), and it works properly with your .dll without any issues.

So, only altering NPC Root [Root] bone breaks it like that so far, you can just alter it through script or something (if you want to test it without Giantess mod)

ArranzCNL commented 1 year ago

If you have 1 mode of scaling working which is far more universal what is the purpose of the other? I am trying to understand for both our sanities sake.

For now the universal mode (Model Scale) works not going to say never but maybe the other mode will be supported in the future.

Sermitse commented 1 year ago

If you have 1 mode of scaling working which is far more universal what is the purpose of the other? I am trying to understand for both our sanities sake.

For now the universal mode (Model Scale) works not going to say never but maybe the other mode will be supported in the future.

The thing is - we have 2 modes of scaling because of the following issues:

ArranzCNL commented 1 year ago

It sounds like altering the NPC Root doesn't cascade down the changes that it has been altered.

As for the model scale issue have you tested with no other mods loaded at all, to see if it is resetting? If it is still doing it you should be able to hook the call(s) to it and alter/replace them.

Sermitse commented 1 year ago

It sounds like altering the NPC Root doesn't cascade down the changes that it has been altered.

As for the model scale issue have you tested with no other mods loaded at all, to see if it is resetting? If it is still doing it you should be able to hook the call(s) to it and alter/replace them.

It does it always, the Dev is planning to eventually fix it by hooking whatever is causing it, but it's probably not going to be easy to find it, after all he doesn't know what exactly to hook, at least currently.

For now we will stick with Npc Root [Root] scaling method, compatibility with your .dll would be nice, if you will decide to mess with it at least.

ArranzCNL commented 1 year ago

I think it might be coming from: SkyrimSE 1.5.97 - 0x14067C659 which is hard setting a scale to 1.0.

Signature if you want works on all SkyrimSE's well 1.5.97 - 1.6.659 (GOG) so you can obtain the other addresses. "E8 ?? ?? ?? FF 49 8B 06 BA 00 00 00 80 49 8B CE FF 50 50 49 8B 06"

Sermitse commented 1 year ago

I think it might be coming from: SkyrimSE 1.5.97 - 0x14067C659 which is hard setting a scale to 1.0.

Signature if you want works on all SkyrimSE's well 1.5.97 - 1.6.659 (GOG) so you can obtain the other addresses. "E8 ?? ?? ?? FF 49 8B 06 BA 00 00 00 80 49 8B CE FF 50 50 49 8B 06"

Thank you! Dll dev was trying to hook it lately, but game just crashes. If possible, can you please give us a ready example of that hook? We would appreciate it a lot. Here's how dev tried to hook it by using common-lib - logging stops at Applying experimental hook: {:X} (game crashes after that) : chrome_w8Ix5bSpGL

(Link if you need to take a look for some reason: https://github.com/QuantumEntangledAndy/GTS_Plugin/blob/7ed4814a1cdfd9ed4b11e35377df2bfafc79d330/src/hooks/main.cpp)

ArranzCNL commented 1 year ago

Just quickly looking at this: (RelocationID's are based from 1.5.97)

38831 = 14067BFA0 (39861 for 1.6.353) +0x6B9 = 14067C659 // This is the function I noticed calling 1.0 on the end. 0x6B9 is the offset from RelocationID (38831) Note the offset on 1.6.318+ is 0x71F

36343 = 1405D61B0 (param_1 should be actor/player - param_2 should be the value of the scale size) This is the actual function being called and sending 1.0 scale size too. Above id in 1.6.353 is 37333

There is a way to dump the addresses from address library binaries into txt format (need to open in notepad++)