Releases: ramokz/phantom-camera
v0.8
🚨 Breaking Changes
append_look_at_targets_array
used to take aArray[NodePath]
as a parameter- Parameter now only accepts type
Array[Node3D]
- Parameter now only accepts type
⚠️ Deprecated Functions & Properties
erase_look_at_targets_member
is now deprecated- Use
erase_look_at_targets
instead.
- Use
✨ New Features
Phantom Camera Noise
2D |
3D |
---|---|
2d_noise.mp4 |
3d_noise.mp4 |
Camera noise, a long requested feature, also known as camera shake, has now been added for PCam2Ds
and PCam3Ds
, able to affect both the rotation and position of a given PCam
. The feature comes with a few additional nodes and resources that enable this functionality.
Read more on the documentation site for a better general overview.
Phantom Camera Noise Resource
Named PhantomCameraNoiseResource
, is a new resource
type with a 2D and 3D variant. It defines all the variables for the noise such as intensity, rotational / position multiplier and randomness seed. The noise is calculated using a perlin noise pattern.
Read more about the PhantomCameraNoise2D and PhantomCameraNoise3D on the documentation site.
Phantom Camera Noise Emitter
Named PhantomCameraNoiseEmitter
, is a new node
type with a 2D and 3D variant for their respective scenes. Its primary use case is to trigger noise at a given moment, by calling its emit()
method, for either a specified duration or a continuous loop. It can be previewed in the editor by toggling the Preview
property in the inspector.
Read more about the PhantomCameraNoiseEmitter2D and PhantomCameraNoiseEmitter3D on the documentation site.
⬆️ Improvements
- TileMapLayer Support for the Limit Node feature
- Active
PCams'
logic are now being called in the same tick as thePCamHost
it belongs to, whereas previouslyPCams
triggered their logic in their own tick, which was often not in sync with thePCamHost
node. This is to better synchronize thePCam2D/3D
andCamera2D/3D
logic, which should further smooth out camera movement.- Thanks @m4rr5 for the suggestion
- Reduced the under-the-hood complexity of the Follow (2D / 3D) and Look At (3D) logic
- Added
dead_zone_reached
signal, is emitted whenever the target touches the edge of the dead zone - Improved the behavior of 2D
Framed Follow
. Should now no longer change vertical camera movement when only the horizontal dead zones are reached and vice versa- Thanks @lafitteque for the PR (#373)
🐛 Fixes
- Resolved a crash that would occur when freeing a parent of
follow_target
,follow_targets
(for group follow) orlook_at_target
andlook_at_targets
(group look at) (#381)- Thanks @TranquilMarmot for the report (#374)
- Resolved error spam when changing 2D scene
- Thanks @Baba-Yagan for the PR (#376)
- Resolved error spam when changing 3D scene
- Resolved an issue with getting an error spam when having an empty or a valid target not in the first array index when using
Follow Group
orLook At Group
- Resolved an issue where
Auto Zoom
(2D) andAuto Follow Distance
(3D) properties would be visible when thefollow mode
wasn't set toGroup
- Resolved an issue where
Follow Group
would be biased towards the first follow target in the array- Thanks @TheWathis for calling attention to this (#396)
- Resolved a false positive error saying:
get_tree: Parameter "data.tree" is null
. This was due to having enabledPhysics Interpolation
in the Project Settings, where the addon changed the Physics Interpolation of the camera toOff
for none-physics targets, when it should beInherit
(#377)- Thanks @hunterloftis for figuring this out
v.0.8 Beta
Important
This beta is intended as a pre-release build to allow the community to give feedback on the upcoming version before it goes live for everyone.
The main area of feedback interest is about the Phantom Camera Noise feature (see below).
Note
The version number in plugin.cfg
is purposely set to v0.7.9
.
This is to allow for upgrading to v0.8
from the Beta release using the addon's updater.
Note
Feedback and comments can be shared in the discussion post found here.
🚨 Breaking Changes
append_look_at_targets_array
used to take aArray[NodePath]
as a parameter- Parameter now only accepts type
Array[Node3D]
- Parameter now only accepts type
⚠️ Deprecated Functions & Properties
erase_look_at_targets_member
is now deprecated- Use
erase_look_at_targets
instead.
- Use
✨ New Features
Phantom Camera Noise
A long requested feature, camera noise, also known as camera shake, is available for PCam2Ds
and PCam3Ds
, able to affect both the rotation and position of the PCam
.
Phantom Camera Noise Resource
Named PhantomCameraNoiseResource
, is a new resource
type with a 2D and 3D variant. It defines all the variables for the noise such as intensity, rotational / position limits and randomness seed. The noise is calculated using a perlin noise pattern.
Both 2D and 3D Noise Resources
can apply changes to position
and rotation
; however, it's recommended to avoid rotational noise in 3D scenes to avoid geometry clipping issues.
Phantom Camera Noise Emitter
Named PhantomCameraNoiseEmitter
, is a new node
type with a 2D and 3D variant for their respective scenes. Its primary use case is to trigger noise at a given moment, by calling its .emit()
method, for either a specified duration or a continous loop. It can be previewed in the editor by toggling the Preview
property in the inspector.
Each emitter uses a Noise Resource
to define its noise pattern and only affects the PCams
in the matching Noise Emitter Layers
. That is to say, in order for the emitter to work both the emitter and the individual PCam
node needs to have at least one matching Noise Layer
Quick Guide
There are 2 ways to apply noise to a Camera2D/3D
with this system:
- Supply a
Noise Resource
to theNoise
property in a givenPCam
directly. Doing so will make the noise run persistently without pause on that specificPCam
. Note: This will only run after a tween has been completed. - Add a
Noise Emitter
(PhantomCameraNoiseEmitter
node) to the scene, assign aNoise Resource
and trigger it at any time by calling itsemit()
function — again, it can be previewed in the viewfinder by toggling thePreview
button. The Emitter can be placed anywhere in the scene tree. Note: This will impact theCamera2D/3D
both when following and during a tween to aPCam
if it has a matchingNoise Layer
.
Using External Noise Values
If the user wants to supply their own noise values, either from third-party libraries or using their scripts, then that can be achieved by calling emit_noise()
from a PCam2D/3D
by supplying a Transform2D
or Transform3D
respectively.
Examples Scenes
- 2D -
2d_noise_example_scene.tscn
- 3D -
3d_noise_example_scene.tscn
⬆️ Improvements
- TileMapLayer Support for Limit Node
- Simplified Follow (2D / 3D) and Look At (3D) logic in the tick thread
- Added
dead_zone_reached
signal, is emitted whenever the target touches the edge of the dead zone - Improved the behaviour of 2D Framed Follow. Should now no longer change vertical camera movement when only the horizontal dead zones are reached and vice versa
- Thanks @lafitteque for the PR (#373)
🐛 Fixes
- Resolved a crash that would occur when freeing a parent of
follow_target
,follow_targets
(for group follow) orlook_at_target
andlook_at_targets
(group look at) (#381)- Thanks @TranquilMarmot for the report (#374)
- Resolved error spam when changing 2D scene
- Thanks @Baba-Yagan for the PR (#376)
- Resolved error spam when changing 3D scene
- Resolved an issue with getting an error spam when having an empty or a valid target not in the first array index when using
Follow Group
orLook At Group
v0.7.3
✨ New Features
Attributes & Environment Resource Support (3D-only)
Attributes
Allows for setting and dynamically tweening between CameraAttribute
resources for each PCam3D
. Used to enable and transition between things like depth-of-field, i.e. camera blur, and camera light exposure.
0.7.3-attributes-resource.mp4
Note
The attribute interpolation in the video above appears instant, however, that is due to the tween duration
being very short.
Important
If a CameraAttribute
resource is already applied to a Camera3D
node, then adding one to a PCam3D
will automatically override it.
Again, using an Attribute resource in the PCam3D
should be intended as a means of dynamically switching between different resources for tweens. In other words, if a project, or scene, only needs one CameraAttribute resource, then consider using a WorldEnvironemnt
node or apply it directly to Camera3D
node instead.
Important
Aside from a few exposure properties, any tweening between different CameraAttribute resources will only occur if the types are the same. So for best results, stick to using just CameraAttributePractical
or CameraAttributePhysical
.
Important
If applying a CameraAttribute
resource to a PCam3D
, then the Camera3D
will retain the most recently applied one if the consequent active PCam3Ds
have no CameraAttribute
applied.
So if you want to move away from a current CameraAttribute
setting, or reset it to default values, you would need to have another, active, PCam3D
with another CameraAttribute
resource with the desired changes / defaults.
Environment
Support has also been added for setting Environment resources for individual PCam3Ds
. Unlike CameraAttributes
, however, the properties here are not tweened between each PCam3D
instance.
Also, like with CameraAttributes
, only consider using this if there is a desire to change the environment variable per PCam3D
instance. Otherwise, consider using a WorldEnvironemnt
node or apply it directly to Camera3D
node instead.
Enable by Visibility
Disable a PCam2D/3D
from activating, or deactivate an active one, by setting its visibility to false.
Works both in the editor and during runtime.
0.7.3-enable-by-visibility.mp4
⬆️ Enhancements
Camera3DResource
properties can now be accessed and modified using the property name from aPCam3D
directly, instead of having to call the getter or setter function to do the respective.- E.g. instead of changing the
fov
usingpcam_3d.set_fov(value)
, it can be written aspcam_3d.fov = value
- E.g. instead of changing the
- Likewise,
PhantomCameraTween
properties can now also be accessed and modified using properties.- E.g. instead of
pcam_2d.set_tween_duration(value)
it can be written aspcam_2d.tween_duration = value
- E.g. instead of
- Added additional checkers for the
follow
(2D and 3D) andlook_at
(3D) processes to prevent errors if the target is freed during runtime.
🐛 Fixes
- Resolved an error log when disconnecting a signal from an addon UI node when disabling the addon (#358)
- Thanks @bUsernameIsUnavailable for the report and solution (#357)
v0.7.2.1
🐛 Fixes
- Resolved an issue with the addon not consistently loading the
PhantomCameraManager
singleton upon installation, which causes a cascade of errors and general usability issues (#338). - Resolved an issue with tweens not running its last frame making some properties not tween to the intended value (#330). Was particularly noticeable when tweening between
PhantomCamera3DResources
.- Thanks @NullShock78 for the report (#326).
v0.7.2
✨ New Features
Phantom Camera Manager
A singleton class that can be accessed from all scripts. It allows for accessing all the PCams
and PCamHosts
in a given scene.
# Returns all PhantomCamera2D nodes in a scene
PhantomCameraManager.phantom_camera_2ds
# Returns all PhantomCamera3D nodes in a scene
PhantomCameraManager.phantom_camera_3ds
# Returns all PhantomCameraHost nodes in a scene
PhantomCameraManager.phantom_camera_hosts
This also marks the foundational work for getting Camera Noise (#126) and Multi PCamHost / Split Screen support (#26) working.
PhantomCamera3DResource Projection Types
It's now possible to set the Projection
type to Perspective
, Orthogonal
and Frustum
, and their associate properties within the PhantomCamera3DResource
resource. Previously limited to just Persepctive
.
If tweening between two PCam3D
that both use Orthogonal
or Frustum
, then the Size
and Frustum Offset
will be tweened when switching.
Near
and Far
properties have also been added. They, too, will be tweened if the values differ between PCams
.
Thanks @Jegber for the proposal (#218).
⬆️ Enhancements
Muted Updater
After some feedback that the current updater being too 'in-your-face' whenever new releases are out, the changes here will now prevent the updater prompt from appearing on start-up.
Instead, it will now change the viewfinder panel button to include an icon with a changed text color. The update button can then, like in previous releases, be accessed from the top-right side of the Viewfinder
panel, which will trigger the updater prompt.
Thanks @kelteseth for the feedback (#271).
🛠️ Fix & Improvements
- Improved the
PCam
andPCamHost
detection for the viewfinder. This was most apparent in scenes where multipleCamera2D
orCamera3D
nodes present (#307). PCamHosts
will now show a warning in thescenetree
when it isn't a child of aCamera2D/3D
and not spam errors in the Output tab.- Added suffix, such as
m
or°
, to the appropriateCamera3DResource
properties. - Resolved an issue where
Tween on Load
would trigger even if disabled forThird Person
Follow when instantiated via code (#319).- Thanks @llittle3701 for raising this issue (#315).
- Fixed an issue where setting
FollowMode
toNone
would not make aPCam
movable in the editor (#320).- Thanks @daishishi for raising this issue (#318).
- Added support for
disable_3d
export templates. This should allow 2D games that want to exclude 3D specific nodes to be exported without errors (#311).
v0.7.1
✨ New Features
2D Physics Interpolation Support
Important
This enhancement is only available for 2D scenes in Godot 4.3 and later.
Any existing setup shouldn't be affected by this, this is mainly a behind-the-scenes change.
The addon still supports Godot 4.2.
With the added 2D physics interpolation support in Godot 4.3, the addon will now automatically switch the PCam2D
and PCamHost
nodes to use either the _process
or _physics_process
depending on the node type of the assigned follow target
. This should greatly reduce, and likely entirely remove, jitter when assigning a PhysicsBody2D
as a follow target
or when having a lower physics tick. More importantly, it should make the addon easier to pick up and use out-of-the-box without having to read and use any of the recommended tips on the documentation site.
For 3D scenes and Godot 4.2 users
The changes here will provide additional guidance in the Output tab when assigning a PhysicsBody
as a follow target
or look at
(3D). The intent is to better support addon newcomers until both 2D and 3D have physics interpolation.
The tip can be disabled from the Project Settings / Phantom Camera
.
Godot 4.3 specific 2D example scenes
As the updated system requires a different node structure between Godot 4.2 and 4.3, an additional 2D example scenes folder has been made that works using the changes from this release. Once Godot 4.3 becomes the minimum required version, these example scenes will be deprecated and its changes moved over to the existing 2D example scenes.
Note
3D physics interpolation will be supported in a future Godot release - until then, the recommendation in the guide still stands.
🛠️ Changes & Improvements
- The
cull_mask
property insideCamera3DResource
is now set to use the correct export layers. Used to beexport_flags_3d_physics
and is nowexport_flags_3d_render
.- Thanks @tiloc for reporting the issue (#290) and @ZenithStar for the fix (#293).
- Resolved an issue where
dead zones
would persistently appear in the viewfinder if aPCam
was set toFramed Follow
and had enabled it through the inspector and then switched to anotherfollow mode
before running the game. - Updated the wording for the Editor Updater to avoid confusion for larger releases.
- Thanks @Flynsarmy for mentioning this (#260)
- Improved the DX when setting a
limit target
. It will now trigger an output statement if an assigned value is either not of typeTileMap
orCollisionShape2D
as well as if aNodePath
isn't valid in the first place. It will now also prevent thelimit size
from resetting should either of these two scenarios occur. - Updated
append_look_at_targets_array
to now correctly apply the correct node type(s) to thelook_at_targets
array.- Note: The parameter type will change from
NodePath
toNode3D
, but not until the0.8
release, as it's a breaking change. This wasn't done in the0.7
release due to oversight.
- Note: The parameter type will change from
- Reapplied
top_level
setter for the character script in the 2D example scenes to remove jitter when not having any damping applied to thePCam2D
.
Ko-fi Donations
Added a donation link for those feeling generous. Donations will have no impact on the addon's development, it's purely a “thank you” system.
v0.7.0.6
v0.7.0.5
v0.7.0.4
🐛 Fixes
- Fixed a regression from the 0.7 release where
Limit Sides
that had their values set using either thePCam2D
number input fields in the inspector or via code, e.g.pcam_2d.limit_bottom = 40
, would reset to their default values on start-up or after a tween.- Thanks Codecuts (Twitter) for highlighting this.
- Readded
set_limit
andget_limit
function calls- Thanks @CantyCanadian for highlighting this (#270)