-
Notifications
You must be signed in to change notification settings - Fork 34
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
Display: add CameraSmoothing
setting to adjust smoothing ratio
#437
base: master
Are you sure you want to change the base?
Conversation
Finally found a way to get rid of the camera orbiting, this took way too long to figure out, was about to try decompiling GC's Had to adjust the Freecam feels a bit better to use now, there does still seem to be some jittering when looking up/down though, not sure if that's a problem with the game code, or maybe the way we update Build can be found at https://github.com/nipkownix/re4_tweaks/suites/10363460126/artifacts/510943414 (if you want to re-enable smoothing in freecam just go to Display menu and adjust the smoothing option) E: there does seem to be certain angles where it always starts to jitter at least, or feel like it's "sticking"... one guess for the jitteriness is maybe to do with the E: If anyone wants to try looking into it here's an IDB with some extra vars labelled around the Those are made of
|
Ah, pretty nice improvements!
I ended up hitting the same roadblock a few months ago. Was trying to make the mouse-look camera more responsive by removing this smoothing. Meh.
Ohh! Nice work! I'm not at home for a couple of days, so I can't test this right now, but I'm looking forward to it. Edit: Ah, btw, would you mind taking a look at #419 and #409 when you have some time? No rush :p |
Figured a way to get rid of some of the sticking issues, took a while but think I got it calculating the m_target value mostly correct now (so none of the g_transOfs stuff should be involved any more) Still some jitteryness when looking up/down though, strange because left/right doesn't seem to have that issue, there is some code (@ 0x59E27A) that uses a Also some weirdness when trying to look directly up/down, starts slowing down the rotation for some reason, don't really get why.. maybe some issue with whatever is using the E: added something to copy that E2: bah, seems there's an issue with the freecam movement now, looking at extreme angles makes A/D strafing go really slow, guess it's similar to the slow rotation issue, probably just needs a sin/cos somewhere... (E3: should be fixed now, along with the diagonal movement being sped up) |
Should let r100 load the whole map in while flying around with freecam
Same method game seems to use for X axis
calcOffset hooks aren't needed anymore since we overwrite the result of it
Rebased it onto latest master, there is one weird thing I noticed with this though, if you hold RMB while in freecam then moving the mouse will shift the camera position - that could actually be useful for lining up position instead of trying to tap WASD keys, but seems there's some problem with it which makes it move camera in a weird pattern. I'm not sure how that's actually being done, doesn't seem we're checking for RMB or moving camera based on move movement anywhere... E: think it's game doing it, Tried adding a check in our code that updated Doesn't really work that well tho, looks like it doesn't care about amount of mouse movement, just sets KEY_FORWARD flag no matter how much you move it, so can't really make subtle adjustments or anything... |
Ah yeah, IIRC that has been a thing since forever. You can reproduce the same issue if you hold RMB and move the mouse while not having a weapon equipped. Probably yet another weird quirk in |
Just tested this - very nice! |
Do you mean it's jerky as you move it down, or is it when you pull it straight down and it seems to shift left/right a little at the end? I couldn't really find a good way to fix that, tried loading up an FPS with noclip mode and tried the same there and that also seemed to have the exact same issue, so I figured that's not a huge deal (then again I only checked with HL1 which is pretty old, maybe newer games might have fixed that, hm..) Smoothing might be able to help with those, you can try changing the smoothing setting in Display while in freecam and see if it helps (thought about adding a seperate FreecamSmoothing option for that but idk, maybe just setting freecam to a low smoothing value would be good enough) It seemed like the camera code does its own smoothing as well with the lr_rate stuff I mentioned, wonder if patching that out while keeping the CamSmooth stuff active might be any better. |
This. Not a big deal though. Does HL1 really have the same issue? Never noticed it before :p Another thing before we merge this: It was mentioned in #436 that the camera goes to Leon's feet when free cam is enabled. Maybe there's a way to position it at Leon's eye level instead or something like that? |
Ah yeah was meaning to add something for that, guess we can just add some hardcoded Y/Z offset to the character position for now. Would be nice if we could keep the current camera rotation too but not sure how that would translate to this new cam stuff.. will try playing around with it soon. |
Fixes issue with freecam always starting in the floor, would be nice if we could match the actual orbiting cams position eventually so enabling freecam would be more seamless, but unsure how much work that would take. (if we're lucky maybe it gets stored somewhere in CameraQuasiFPS struct, hmm...)
Are we good to merge this as is? I don't think the camera rotation is that big of a deal, tbh. It already feels pretty nice with the Y change. |
Seems to work fine, adds an INI/UI setting to Display section, and a
Game_SetCameraSmoothness
func that lets us adjust it in code (could let freecam code call that to override/restore it too)Sadly setting the smoothness too low makes camera movements pretty jerky, as explained at #436 - would be nice if we could let smoothing only affect movements made by the game (eg. camera movements when player char climbs up/down), while player inputs would use a different value, seems game code treats them both the same though AFAIK :/
This should affect both mouse & controller movements, not sure if it might affect camera movements in cutscenes, I couldn't see any change in the starting car cutscene at least.
E: added code to disable the smoothing while in freecam, works pretty well there IMO, but feel free to revert if you like, or we could change it so it just reduces the smoothing instead of disabling it entirely (you can still change smoothing in cfgMenu when in freecam to try other values)
Build at https://github.com/nipkownix/re4_tweaks/suites/10270563416/artifacts/504249207 for anyone that wants to try it (smoothing setting is inside
Display
section)