Search Unity

Left/Right Rule of Thirds Composition?

Discussion in 'Cinemachine' started by potatojin, Nov 13, 2017.

  1. potatojin

    potatojin

    Joined:
    Apr 11, 2012
    Posts:
    23
    I've been in love with Cinemachine since I first installed it. It's easily the best camera system I've used, and I've tried lots. My game features a non-humanoid (quadrupedal) main character, and Cinemachine's flexibility completely sidesteps a bunch of the bipedal assumptions that always seemed to lurk in lots of other packages.

    I have my FreeLook Camera's Screen X value set to frame my character in a nice classy Rule-of-Thirds-y way, and it works great. But I'm greedy, so I'd like it to be even nicer. What I'd love to do is to blend between left-aligned framing and right-aligned framing when appropriate. Here are some images to illustrate:

    camera_left.PNG camera_right.PNG

    In the first image, the composition looks just how I'd like it. In the second image, the composition is worse: with the character framed in the left third, the right half of the screen is nothing but a whole lotta wall.

    What I'd love to do is detect these situations and blend over to a camera that frames the character on the right side of the screen (or in the center, when I detect that the player is in narrow passageways).

    I wrote a small component that detects distance to walls on the left or right, and successfully used it to drive the FreeLook Rigs' Screen X values, but it doesn't feel as buttery smooth as everything else that Cinemachine does. It also feels like there ought to be a more Cinemachine-y way to do this and that I'm missing something.

    Is there something clever I could do with a StateDrivenCamera (these only seem to key off animation states -- could I define custom LeftSide/RightSide states somewhere and drive it that way)? Something with ClearShot and colliders? I understand that detecting the need to transition between these shots is subjective and I wouldn't expect Cinemachine to magically know which one I want, but is there something better I should be doing to switch between them?
     
  2. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Hi @potatojin thanks for the nice words. We really appreciate the feedback.

    A couple of ideas up front:

    - It looks like you have a lot of Composer dead-zone - that open square in the Composer guides. That's going to cause the target to slop around a fair bit with its movement. Your hard regions - the red - it pretty packed in tight. I'd try setting the X Composer dead zone to 0 and give a little damping to create more natural movement.

    Are you on CM v2.1? If not, you should be, grab it from the latest from the top blog post here in the forums.

    - With CM v2.1, there's a 'look ahead' feature on the Composer. You might want to try that out as it gives a great left/right movement onscreen when tracking subjects.

    - My guess is that your script for moving the Screen X values will look a lot smoother if you set your composer dead zones to zero and add some damping.

    Give that a go and let us know how it works
     
  3. potatojin

    potatojin

    Joined:
    Apr 11, 2012
    Posts:
    23
    Much better! Wow it's like the guy who made this thing really knows how to use it!



    I don't remember why such a big dead-zone seemed like a good idea, but I clearly didn't need it. There's still plenty I can do to make my script more clever, but I'm very happy with the proof of concept. (EDIT: Making the Soft Zone wider also helps, which was your point about the red hard regions...)

    Thanks for the help and for all the work you and your team have put into this amazing thing!

    kevin
     
    Last edited: Nov 14, 2017
    Adam_Myhill and Gregoryl like this.
  4. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Awesome. Keep us posted.