Slighty jittering in camera movement

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I'm currently working on a incomplete indie project, it's pretty much at in a early state at the moment but i have some good part of the game core done, still not the final result at all.
    Well, i not really want to talk about my game itself, but about something ive been experimenting related with the camera object and it makes me feel some kind of uncomfortable to look at it...

    The problem is that the camera seems like has got a slight jittering in the screen, its more noticeable whenever you're jumping and slightly walking, or just walking around without holding the B input to run.

    To say easily, the code that i'm using works as a simple one where the camera object follows smoothly the Player position, and then the frame screen is set to display on the camera's position using Floor(CameraX( "Master_Camera" )) and Floor(CameraY( "Master_Camera" )) for both X and Y

    Please login to see this picture.

    Please login to see this picture.

    I'm new to this forum threads community and also im experimenting more with the different CF features, so sorry if i'm doing something really wrong. :)

    Please login to see this picture.

    Anyone knows what's the main cause of this? Is it my monitor or it's something related to the player physics thing?

  • What does the Action of [M] <> 9 condition do, and do you need it? Whenever Action equals 9, that event would abruptly stop calculating the camera target, which I could imagine might cause jitteriness.

    Does the camera feel better if you change the 0.2 to a smaller number like 0.05?

    How do you calculate CameraX & CameraY (the screenshots only show how you calculate TargetX & TargetY)?

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

    Edited once, last by Volnaiskra (May 25, 2023 at 5:00 AM).

  • 1 - The "Action <> 9" event is to deactivate the camera when the player is on the death action. (tried removing that event to try out but it didnt fixed it at all)

    2 - Nope, the jittering on there is still too much noticeable :/

    3 - At the start of the frame, all the X and Y values of both Target and Camera are set to the Player Object's position, the ones that are shown in this screenshot below are to limit the boundaries and the top one is to scroll the camera if the player isn't out of MarginH (Horizontal) and MarginV (Vertical), there is also a "CameraShift" value that i tried to disable to check if that was the reason but it was not neither.

    Please login to see this picture.

    Please login to see this picture.

    Edited once, last by LazyDev (May 25, 2023 at 7:10 PM).

  • I'm not very good at reading other people's code, so I don't know how much help I'll be. But if I had to guess, I'd guess that the problem is probably in 4858-4861, though I don't understand exactly how those events work.

    In 4855, you're using a smooth LERP calculation to make the target gradually close in on the player. But then in 4858-4861 it looks like you're using an abrupt 'stop-start' mechanism to make the camera follow the target: the camera won't move at all until a certain threshold is met, and then as soon as that threshold is met, it will move the full amount of MarginH (or MarginV). I don't know what MarginH is, but let's say it's 5. I can imagine that you might then get a situation where each frame the camera moves something like 0, 0, 0, 5, 0, 0, 5, 5, 0, 0, which would be jittery. I imagine that imposing a hard stop-start mechanism at this stage probably nullifies the smoothness of your LERP calculation in the earlier 4855 stage.

    I think you should try and make the camera follow the target in a gradual way, along the same lines of how you have the target following the player. In fact, I wonder if you shouldn't more or less swap the target and camera around, using the smooth LERP calculation for the camera, and placing the hard limits on the target instead. Try something like this:

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

    Edited once, last by Volnaiskra (May 26, 2023 at 2:52 AM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!