Rolly Docs

Set up camera and comfort settings

Let each player choose their field of view and how much the camera shakes, offer a slower game speed in single-player games, and give TV players margins that keep your interface on screen.

Sheet
22 of 45
Rev
1.2.0
Updated
On this sheet

The built-in library’s Camera category, after Controls, holds Field of View and Camera Shake: each local player has their own, and both apply at once. Game Speed sits in Gameplay and stays hidden until your collection offers it. Screen Margins sits in Picture, followed by Adjust Screen Margins, which fits it with a frame on the screen.

Figure 1. The Camera category with Field of View focused: its detail gives the angles the player sees on this 1920 x 1080 screen.

Let players choose their field of view

Rolly Settings adds two camera modifiers to every camera manager the engine creates, so your project needs no camera manager of its own and no Blueprint wiring. They change nothing until a setting gives the player a value: the built-in library’s Field of View row does, and so does any Slider in your collection with the Field of View binding (Per Player scope).

The value counts degrees across a 16:9 picture, 60 to 120 in the built-in library. On a wider screen the player sees more at the sides and the same angle up and down, as the engine draws wide screens by default (Hor+). On a screen narrower than 16:9, such as a 4:3 monitor or one player’s half of a side-by-side split screen, the horizontal angle stays and the player sees more above and below; untick Keep Horizontal On Narrow Views in the binding to let such views narrow instead. The row’s detail gives the angles on the player’s screen: “On this screen: 106° across, 59° up and down.” on a 2560 x 1080 monitor at 90°.

Set the design field of view

The modifier scales your camera’s field of view instead of replacing it, so your own changes keep working: an aim zoom from 90 to 45 stays the same zoom at any setting. Tell the binding what your camera uses while the game does not zoom, in Design Field Of View (90, the engine’s camera components and camera manager, by default): at that value the player sees exactly their setting.

  1. Tools > Rolly > Create Settings Collection from Defaults…, or open your collection.
  2. Select Field of View, then its Binding, and set Design Field Of View to your camera component’s Field Of View.

A view target without a camera component (a pawn seen through its eyes) reports the camera manager’s 4:3 aspect ratio, and the modifier still draws the 16:9 picture of the setting. At 90° such a view then shows 59° up and down, as a camera component’s view does, instead of the 74° the engine draws for it without the setting. Give the pawn a camera component, so every view starts from the same picture.

The 16:9 picture of the setting also differs from the engine’s picture, at the built-in default of 90°, in these views:

  • A camera component whose Aspect Ratio is not 16:9 shows 59° up and down, as above.
  • A letterboxed view (Constrain Aspect Ratio) wider than 16:9 shows the 59° up and down across its own width: a 2.39:1 filmback shows 107° across instead of 90°.
  • A screen narrower than 16:9 keeps 90° across and shows more up and down: 64° instead of 59° on a Steam Deck, and 90° across instead of 53° on one half of a side-by-side split screen. Untick Keep Horizontal On Narrow Views for the engine’s picture.
  • With r.UseLegacyMaintainYFOVViewMatrix=1 the engine reads a camera’s Field Of View as the vertical angle, while the setting still counts degrees across a 16:9 picture: a camera at 70° with Design Field Of View 70 shows 59° up and down instead of 70°.

Leave cinematics alone

Views through camera actors (Sequencer’s cine cameras, fixed cameras placed in a level) keep the field of view their cameras set: a cinematic is framed by its author. Tick Apply To Camera Actors in the binding to scale them too. While a view blends from the player’s camera to a camera actor, the player’s side stays scaled and the camera actor’s side does not, so the blend has no jump.

Avoid a locked field of view

The camera manager’s Set FOV locks the field of view, and a locked value never reaches camera modifiers. While your game locks it, the row’s detail says “The game sets the field of view itself right now.” Call Unlock FOV and change your camera component’s Field Of View instead, so the player’s setting applies on top.

Under r.UseLegacyMaintainYFOVViewMatrix, the engine reads a field of view as the vertical angle. Rolly Settings follows the variable, so the setting keeps its meaning; set Design Field Of View to the value your camera uses, which is then a vertical angle.

Place your own camera modifiers

The camera manager runs its modifiers by priority, 0 first. Rolly Settings’ Camera Shake modifier sits at 120, before the engine’s camera shake modifier at 127, and its Field of View modifier at 252, after the game’s own modifiers at the default 127. A C++ modifier of yours that returns true from Modify Camera skips every modifier after it: below 252 the view keeps no Field of View setting, and below 120 no camera shake plays. The engine also refuses, without a message, an Exclusive modifier added at a priority another modifier holds, so give yours a priority other than 120 and 252.

Use the player’s value in a camera of your own

A camera component needs nothing: the modifiers scale its view, so feeding it the player’s value as well would apply the setting twice. A camera that does not go through camera modifiers (a view calculation of your own, a scene capture for a render target) takes the player’s value itself.

Blueprint

Get Rolly Settings Camera Subsystem (from the player’s controller or widget), then Get Field Of View: the player’s degrees across a 16:9 picture, or 0 when your collection has no Field of View setting.

C++

The same arithmetic as the modifier:

#include "Camera/RollySettingsCameraMath.h"
#include "Camera/RollySettingsCameraSubsystem.h"

float UMyCamera::GetPlayerFieldOfView(const ULocalPlayer* Player, float CameraFieldOfView) const
{
	const URollySettingsCameraSubsystem* Camera = URollySettingsCameraSubsystem::Get(Player);
	if (Camera == nullptr || !Camera->GetFieldOfViewChoice().IsSet())
	{
		return CameraFieldOfView;
	}
	FRollySettingsCameraView View;
	View.FieldOfView = CameraFieldOfView;
	View.AspectRatio = 16.0f / 9.0f;
	return FRollySettingsCameraMath::ScaleFieldOfView(Camera->GetFieldOfViewChoice().GetValue(), View).FieldOfView;
}
C++

Let players turn camera shake down

Camera Shake runs from 0 % (no shaking) to 100 % (as your game made it). It scales Start Camera Shake, world camera shakes and Camera Shake Source components (with Sequencer’s Camera Shake Source Trigger tracks), and the Camera Shake tracks of your Level Sequences that sit on a camera’s binding, such as a Cine Camera Actor in a cutscene. A change applies to shakes that are already running. To leave cutscene shakes as you made them, untick Scale Cutscene Shakes on the setting’s Camera Shake binding.

The Gameplay Cameras plugin’s own shake nodes and camera animation sequences (Play Camera Animation) are not scaled. Multiply their intensity by the player’s value:

Blueprint

Get Rolly Settings Camera Subsystem, then Get Camera Shake Scale (1 when your collection has no Camera Shake setting), and multiply your shake’s scale by it.

C++

const URollySettingsCameraSubsystem* Camera = URollySettingsCameraSubsystem::Get(LocalPlayer);
const float Scale = Camera != nullptr ? Camera->GetCameraShakeScale() : 1.0f;
C++

Offer a slower game speed

Game Speed slows the game world, from 25 % to 100 %, for players who need more time to react. Since speed changes how a game plays, it stays hidden until you offer it:

  1. Create a collection from the defaults (or open yours) and select Game Speed in the Gameplay category.
  2. In its Binding, tick Offer In This Game.
  3. Optionally fill Slowed Notice with what slowing changes in your game (“Achievements are off while the game is slowed.”). The row shows it as a warning while the speed is below 100 %.

The check on save then reminds you to try cutscenes and timed events at the slowest speed. The Gameplay category, with nothing else in it, appears only while Game Speed shows.

Figure 2. Game Speed at 70 % in a game that offers it, with the game's own notice as a warning.

Game Speed slows actors, timers, animation, physics and particles. Sounds, menus, the interface and anything on real time keep their speed. It applies only while the game runs Standalone: in a listen server, a client and Play In Editor as a listen server or client it is hidden and changes nothing, since a networked world runs at one speed for everyone in it. A game that starts hosting on the map it plays gets its full speed back a frame later, before anyone can join. Every new map gets the speed again.

Your own slow motion

Slow motion and hit-stop of your own need no changes. Game Speed is a factor of its own, the world’s playback factor (DemoPlayTimeDilation), which the engine multiplies with the time dilation you set with Set Global Time Dilation. Slowed to 50 %, your 0.5 runs at 0.25 and your 1 at 0.5: the world never runs faster than you made it, and Get Global Time Dilation still returns your own value.

Use the player’s speed in your own code

Read the player’s speed for what runs on real time and should slow down with the game, such as the pitch of a sound mix.

Blueprint

Get Rolly Settings Game Speed Subsystem, then Get Game Speed: 1 while the game runs at full speed or is networked.

C++

#include "GameSpeed/RollySettingsGameSpeedSubsystem.h"

float UMySoundDirector::GetPitchForGameSpeed() const
{
	const URollySettingsGameSpeedSubsystem* GameSpeed = URollySettingsGameSpeedSubsystem::Get(GetWorld()->GetGameInstance());
	return GameSpeed != nullptr ? GameSpeed->GetGameSpeed() : 1.0f;
}
C++

Give TV players screen margins

A TV can cut off the edges of the picture. Screen Margins, from 0 % to 10 % of the screen at each side, moves the engine’s safe area in from the edges, and every Safe Zone widget follows it at once: the Rolly screens and your HUD’s. A HUD without a Safe Zone widget reads the same margins with Get Safe Zone Padding. At 0 % your project’s own safe area applies (none on PC).

In a packaged game in a window smaller than the monitor, the margins are a share of the window, also after the window changes size. Play In Editor puts the safe area back when it ends. Adjust Screen Margins lets players fit the margins with a frame and four corner marks (see Calibrate the picture and show performance).

Limits

  • A field of view locked with Set FOV, and stereo rendering (VR, where the row is hidden), never follow the Field of View setting.
  • The Gameplay Cameras plugin’s shake nodes and camera animation sequences need Get Camera Shake Scale, as above.
  • A cutscene’s Camera Shake track is scaled while the view is the one its camera gives. A view your game moves itself (Blueprint Update Camera, or a camera modifier of yours with a Priority below 120) keeps the track’s full shake.
  • Replays use the same playback factor for their playback speed. A replay plays as a client, where Game Speed is off, and Rolly Settings never changes a playback factor that something else has set.
  • Game Speed never speeds a game up: values above 100 % count as 100 %.