Cinemachine v1.1

This thread covers all discussions around Cinemachine Base Rig, which includes:

  • Composer
  • Transposer
  • Blender
  • Priority
  • Noise

https://vimeo.com/178286023

2 Likes

The thread for all discussions regarding Cinemachine Game Rig, which includes:

  • Free-Look

  • Reactor

  • Collider

  • Cloud

https://vimeo.com/182876861

6 Likes

You can download Cinemachine BaseRig from the Asset Store for FREE from here:

2 Likes

Here are some ideas on how to use Base Rig for in-game cameras.

There’s a really powerful idea where you ā€˜Marionette’ Cinemachine instead of using it ā€˜directly’. Sure you can target a bone on the hero character with the Composer and that’s probably the perfect way to do your cinematic setups, but there’s a lot of other ways to use Composer and Transposer

Say you want to target the center of a group of objects, perhaps you want to track the average position of all your enemies. Composer can only target one object but it’s easy to extend that. Create a dummy object, say a small sphere and call it ā€˜Camera Target’. Have the game position this object via a script which positions it based on the average of all the objects you want to target.

The sphere will now erratically bounce around based on the # enemies but that’s ok because the Composer has the dampening controls. You don’t need to have the camera target script be that fancy at all because the Composer will smooth out any sharp motion.

Blend between different cameras based on gameplay events and you can now zoom out when there’s more guys or zoom in when there’s less and you’ll have complete control of where you want them onscreen.

Blending cameras with all the same properties except for zoom / Composer composition allows for easy to broadcast events to trigger cameras giving you exactly the control you want.

This marionette idea works for Cinemachine Transposer too. It’s easy to setup an object, let’s say a cube, to follow your character and have it raise and lower depending on the number of enemies around it. Since Transposer has per-axis dampening, you can easily make the camera motion be very fluid and have the camera control objects - the sphere for the target (Composer) and the cube for the camera body (Transposer).

Driving objects with scrips and using them to drive Cinemachine is an incredibly powerful way to do in-game cameras for top down, side scroller, 3rd person AA and many other examples where you want the camera to behave a certain way.

We spent a long time getting the dampening and weight to feel right with Cinemachine. All that math has been fine tuned to feel like a weighted camera. You can feed in some pretty dirty motion and have Cinemachine smooth it all out.

Please feel free to share your game scenario for suggestions on potential camera setups. I’m here to help and love doing this stuff!

3 Likes

So what’s scripting with this like? I use rewired for all my input to ensure working cross-platform support and I’d hate to be tied down to the Unity input system.

Hi Adam,
I was wondering if there is a way to change the 3 components (Composer, Transposer, and noise) evaluation order ?
Let’s say I’m adding a position noise on the camera but want it to always look at a specific object. Currently the noise seems to completely override the transposer.

Thanks

Composing shots in camera space are you kidding me? You’re going to put previs artist out of a job! :wink:

Love it off course. The fact that it’s a dll make it easy to plug in, very nice, and using scriptable objects for settings is nice because we can tune them at run time! It would be nice to record a camera shot at runtime too, see the user input as a function of the composer’s reaction to the subject - what the hell does this mean? instead of animating or capturing the camera’s absolute params, record the params as function to the camera’s relationship to the subject. Easy :wink:

Comments:

In the custom blending example, when the shot moves from close to far the composition is good, the cube drifts in frame from center to upper quadrant as expected, but when moving from far to close the cube is moving up for no reason, why is that and how do I fix this?
From what I’m seeing in the blend code, all you’re doing is lerp the weight linearly and since framing is reactive it shouldn’t behave like a reverse of time

The noise isn’t bad but it looks like it’s shot in zero G, in real life we got gravity, muscle wear, too much sugar in the DP’s coffee, at least add a bias parameter to account for gravity.

ahmidou,

That’s a fantastic question. We are currently looking into further-modularizing the Cinemachine compoonents so order re-arrangement will be trivial - you can put noise after Transposer but before composer, etc. Arrange it however you want.

That said, I believe you can achieve what you want right now. The Cinemachine noise has been designed to give that effect where the camera body receives noise but still looks at the target.

If you want to just move the camera body and have it keep looking at the target, make sure the Composer has an active target object and just put positional noise on that shot. The camera will move and it will keep looking at the target. Voila.

Ha thanks for the feedback and nice words. Cinemachine was made from love due to the lack of camera tools and a desire to try out crazy ideas without having to code everything. I’m happy you get the philosophy.

Blends: Blends work in that if both the target and destination camera have the same components it will blend those components VS a straight positional lerp. Example if camera A has a Composer and camera B has a Composer than just the Composer settings blend - the composition blends - not anything else. If the same components can’t be found then it lerps the position but it will always try to maintain the composition if there’s a Composer on either camera.

So basically, if you have a composer on either or both camreas, it’s going to try to do its job VS lerp. Sometimes that can give strange effects but more often it gives a desired effect - composing your target.

Did that help?

As for noise, yes adding additional simulations (and sugary drinks) is interesting. The numbers take a lot of massaging but you can get there with straight-up per axis multichannel Perlin noise. I’ve shipped a lot of cameras with just this setup and it’s been great, the main problem is polishing up the settings and saving your presets.

I would love to further extend noise to take gravity and dampening and some other great ideas like you mentioned into consideration. It’s on the roadmap for future releases For now, we’re crushing hard on getting Game Rig done !

We’ve worked to keep it as open as possible. Reactor has a game related hookups to our internal ā€˜blackboard’ system so you can expose whatever data streams you’d like to the input of Reactor and of course the rest of the camera.

The documentation will fully explain how to hook all that up.

As for visual scripting tools, that’s a great question and one we’re looking into. It would be great to pipe stuff from your scripting language into Reactor. I haven’t used Rewired on a project yet so I’m not familiar with the details of it but it is something that I’ll look into. It may already be possible.

Note about the inspector GUI, you can combine top with bottom and left with right in a range slider, more compact, easier to understand relationships = more greatness.

No :wink: so I’ll explain more in detail what I’m talking about.

https://www.youtube.com/watch?v=kz1IaD1_V0c

Take the example scene that’s included in the package, ā€œcustom blendingā€ click start blend, as it goes from CU to a wide the camera tilts up to try keep the cub frame center which is the expected behavior as the dampen zone is reacting to the cube tendency to leave frame up.
Click the button again and as it goes from a wide to a CU the composer isn’t trying to keep the cube frame center reactively, instead it’s tilting down before the cube is starting to leave the frame in anticipation. This is the wrong.

Got it, thank you for the excellent breakdown. We’ll analyze this in the office. It looks like a bug for sure. Composer should be keeping the subject in the frame the whole time. I suspect this is a quick fix. I’ll get back to you shortly, thanks for the excellent description.

1 Like

Is it going to be released under the Unity hood as the BaseRig? Will we be able to use it for free with Timeline?

Cinemachine Base Rig and Game rig (coming soon) will be free Asset Store packages until we fully transition them internally. So yes, use it for free with Timeline !

Note: It looks like Cinemachine will be upgraded in the process of doing the Timeline integration. All of your previous CM cameras will work just fine but you probably will have to create new Timeline-able Cinemachine cameras for Timeline once the Timeline/Cinemachine package comes out. Not a huge deal, just a heads up.

1 Like

Hi,
Finally managed to test it properly. Awesome job guys. It wasn’t as difficult as I thought, after reading few lines of the docs :slight_smile:
By the way I have some issues to report:
1-If you don’t activate the transposer you can’t move the camera without disabling cinemachine.
2-Any way to lock on a target that move at high speed( something like Sonic the hedgehog) without having the target move too far from the camera and using both composer and transposer? If I make the soft area too small it produce jerkiness due to the high speed the character is moving.

I had the same problem in my camera system and I had resorted to make the movements in local space of the target, which remove the jerkiness issue as everything is relative to it.

Hi Christian,

Transposer movement - are you moving the camera or changing the transposer offsets to the target object?

Composer - trust me it’s rock solid. We’ve shot things going 1km/second and it holds up. The issue isn’t Composer or Transposer it’s how your object is moving. We get this question all the time.

Here is what most likely is happening:

A. You have impulses in delta time causing large velocities followed by low velocities
B. There is a rigid body not being set to interpolate
C. There are sudden variances in the animation (much less common, since you can see that in the animation curves)

Solution for A: Use the logger to validate impulses in dT. if it’s very spiky then you need to smooth the framerate

We’ve seen this on some really high-profile games where characters weren’t moving smoothly and it freaked the cameras out. Unfortunately there’s nothing we can do about it in Cinemachine, it’s just reacting to tracking an object that is moving all crazy (even if it doesn’t look that bad on screen…)

Please let me know how it goes

A

I am using Transposer + Composer. The composer alone is smooth, but the combination of the two create jerkiness.
I have a character that is moved at variable speed but that speed is already lerped and I verified already that the movement is smooth without spikes.
The issues is this:
I would like to keep the character in a specific position of the frame, so I give it a small window in Cinemachine.
The character exit the window, so cinemachine reframe it in N frames.
Then the character exit again and cinemachine reframe it again in N Frames.
All this play of catch up create a jerkiness effect, like a cat and mouse play at high speed.
Keep in mind it’s not going in a straight line, but moving in all directions, performing loops and so on.
If you give it a bigger window and dampening values it is more stable but it goes more far from the camera then I would like.

By the way, the kind of jerkiness I am talking about is the same you can see on the GameRig video when moving the camera manually with the dinosaur at 2.34, you can see the image trembling.

If you call the sequencer ā€œtimelineā€ you’ll conflict with established naming in all 3d software and unity itself. Because Unity has so many free users it generates a lot of internet noise which google picks up, so people searching for general timeline concept will start seeing unity timeline. I know that from a pure PR standpoint it’s clever but this is obfuscation common term, polluted google and this will piss people off. If you want to be a good internet citizen I’d suggest renaming it before it gains too much traction here.

2921546--215800--6a0134897dc259970c0154374624d1970c.jpg
2921546--215793--Screen Shot 2017-01-15 at 12.15.22 PM.png
2921546--215794--Screen Shot 2017-01-15 at 12.16.08 PM.png

Hi laurentlavigne,

A tremendous amount of thought goes into the names of things at Unity. Each 3d program has their own name for it and many have been copyrighted. Unitys straightforward name for the tool is not to get to the top of google searches or to obfuscate common terms, it’s just calling something what it is. I think if people are looking to find tutorials in a specific 3d package, they’ll search for that appropriate name. Unity calling their sequencer tool Timline won’t clog those searches.

1 Like

Thanks for the additional description.

Questions:

Do you have the Composer and Transposer both targeting the same object? What is the Transposer target set to - a fixed or moving object?

How are you animating your object?

Did you do use the logger to validate impulses in dT?

The reason for the jerkiness in the Game Rig video at 2:34 is that I’m moving the camera while the game is running - via the mouse in the scene window!- which gives wacky updates. If you animate the objects properly, Cinemachine isn’t jerky. I did almost an hour of cutscenes with Transposer on my last project and it was just fine, which makes me think that your impulses are maybe the issue.

I want to get your issue sorted! So please use the logger to check your impulses in delta time and share that info.

A