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
Weird camera distance when sitting on a bench #110
Conversation
gothic-1-community-patch/scriptbase/_work/Data/Scripts/System/Camera/CamInst.d Lines 438 to 442 in 2775fbc
changed to INSTANCE CAMMODMOBBENCH (CCAMSYS_DEF)
{
bestrange = 2.20000000;
minrange = 1.500000000;
maxrange = 2.900000000; |
This fix will be difficult, because the camera scripts are not parsed before entering the game (the first time in the session). Overwriting the instance function directly would be possible, but checking whether the fix is applied will not be easy in that case. |
@AmProsius Could you supply a screenshot of how that looks? |
I almost suspected that. I think this is just related to there being a wall behind the bench. Can you reproduce this odd camera angle for a free-standing bench? If not, it might be disadvantageous to change the camera distance. |
Although this fix does not have to be reverted, it will have to be applied after loading. Therefore I will mark it as savegame fix (i.e. revertible fit). The idea is to overwrite the values directly in the created camera definition object (not the script instance). The respective address in memory will have to be found. This approach allows high compatibility (i.e. compatibility easy). |
I compared the values to Gothic 2 and they are identical. The difference between Gothic 1 and Gothic 2 is, that the mouse input seems to be disabled in Gothic 1. Therefore, zooming out (by scrolling down) or rotating around the PC is not possible and the close camera becomes very apparent. As the camera distance itself was not changed in between Gothic 1 and Gothic 2 I would not consider it as a bug, but would try instead to enable mouse input while sitting on the bench. Before I do that, @AmProsius could you confirm for me if your mouse input is also disabled while sitting on the bench (possibly with/without SystemPack/Union)? |
I can confirm that I also can't scroll when sitting on a bench (tested with and without Union). |
The fixed camera angle seems to be "indented": The mouse input is disabled for all MOB interactions except for ladders. In Gothic 2 this was changed. One could argue that it was neglected in Gothic 1 due to the last-minute mouse implementation, but then I wonder why ladders did receive special treatment. I managed to "unlock" the mouse input for interaction with any MOB, i.e. camera instances that contain "CAMMODMOB" in their name, as Gothic 2 does it. Since this now happens for all MOBs, I don't know if it will introduce some unintended side-effects. I would like to discuss whether to just replace the camera distance values for the bench (a direct bug fix, but given they are unchanged in Gothic 2, not the correct bug fix) or to unlock mouse input (going beyond a bug fix and with the risk of unintended side effects for other MOB camera definitions). |
This commit is just a suggestion on how a fix could look like. If that implementation is chosen, it should be rewritten in machine code for performance. This here is just a preliminary implementation. Refs #110
I added a preliminary implementation to try it out and get a feel for it. If we choose to go with this option (unlocking the mouse input), the fix should probably be re-implemented with machine code. Until we have decided how to fix the issue, this here is very much work in progress and should not be merged! |
Given that Gothic 2 changed the mouse behavior, I would like to go that path. The new values seem too opinionated for me. If we unintentionally create a new bug with enabling the mouse wheel, we can always go back to the fixed values. |
Okay, sounds reasonable. I was working on the alternative (with explicit values). To not throw that away, I pushed that on a separate branch: bug110-alternative. Now I will try to re-implement the solution here in machine code to make it feasible. |
I managed to implement it in a very light way. This fix should be tested thoroughly! That is, with many different MOBs to see if the newly allowed camera rotations do not interfere with anything. The implementation is on machine code level and now matches that of Gothic 2 quite closely. To get it working, the mouse setting for MOBs is now hijacking the setting of ladders. I increased the X-movement from 0.5x speed to 1x speed (compared to the normal camera movement), because the ladder-camera is quite slow to move. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find any problems with MOBs. It's really cool to be able to move the camera now!
Describe the bug
When the player is sitting on a bench, the camera zooms too much into the player.
Expected behavior
When the player is sitting on a bench, the camera no longer zooms too much into the player.