User Tag List

Results 1 to 5 of 5

Thread: Slighty jittering in camera movement

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Nov 2022
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Slighty jittering in camera movement

    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





    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.


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

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    sprykethegame.com
    Posts
    3,270
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    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)?

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Nov 2022
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Slighty jittering in camera movement

    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.




  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    sprykethegame.com
    Posts
    3,270
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    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:

    Code:
    4855: Set targetX to range(FloatX[M] + CameraShiftX, CameraMinimumX+160, CameraMaximumX-160)
          Set targetY to range(FloatY[M] + CameraShiftY, CameraMinimumY+120, CameraMaximumY-120)*
    
    4858-4861: Disable these for now. Rework them into the code later if still needed
    
    4863: Set cameraX to cameraX + (targetX - cameraX) * 0.2
          Set cameraY to cameraY + (targetY - cameraY) * 0.2
    
    
    * Range(... is just a slightly neater way of doing the Min(Max(... expression you had. 

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Nov 2022
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Slighty jittering in camera movement

    Thanks. I will try it out. :)

Similar Threads

  1. Worlds- html game graphics jittering and pc version movement issues
    By JohnArtbox in forum HTML5 Export Module 2.5
    Replies: 13
    Last Post: 23rd January 2020, 08:39 AM
  2. Problems with jittering when using float movement!
    By Storsorgen in forum Fusion 2.5
    Replies: 0
    Last Post: 23rd June 2019, 01:24 PM
  3. Camera Movement
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th June 2010, 05:15 PM
  4. Camera Movement & Boundaries
    By camelman in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 13th March 2010, 12:00 AM
  5. PMO help - jittering while walking into wall
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 30th July 2009, 01:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •