{"id":216,"date":"2024-05-06T17:04:04","date_gmt":"2024-05-06T17:04:04","guid":{"rendered":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/?p=216"},"modified":"2024-05-13T17:10:00","modified_gmt":"2024-05-13T17:10:00","slug":"2-5d-camera-system-devlog_023","status":"publish","type":"post","link":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/2024\/05\/06\/2-5d-camera-system-devlog_023\/","title":{"rendered":"2.5D Camera System | DevLog_023"},"content":{"rendered":"\n<h5 class=\"wp-block-heading\">Camera Overhaul\u00a0<\/h5>\n\n\n\n<p>A few weeks into development, we had a production meeting about the feel of the game and how we wanted to shift the tone to a more playful vibe. The style of game we were making is a Cluedo \/ Hitman style game with more stylized assets and characters. We thought of other games with similar aesthetics and landed on a mix of Little Nightmares and Luigi\u2019s Mansion way of moving the camera. A more dollhouse nature where the camera is not actually attached to the player, but following them and dynamically pushing in, rotating, switching positions as they move through the level. This creates a more \u201cObserver\u201d feeling, rather than the tighter, over the shoulder style camera that feels more \u201cPersonal\u201d to that specific character. We were also inspired by Little Nightmares over exaggeration of scale between the Playable characters and the environment.\u00a0<\/p>\n\n\n\n<div class=\"wp-block-group alignwide is-horizontal is-content-justification-center is-nowrap is-layout-flex wp-container-core-group-is-layout-c1dfda1e wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"532\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LuigisMansion-1024x532.jpeg\" alt=\"\" class=\"wp-image-217\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LuigisMansion-1024x532.jpeg 1024w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LuigisMansion-300x156.jpeg 300w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LuigisMansion-768x399.jpeg 768w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LuigisMansion-1536x798.jpeg 1536w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LuigisMansion-1568x814.jpeg 1568w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LuigisMansion.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Luigi&#8217;s Mansion<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LittleNightmares-1024x576.jpg\" alt=\"\" class=\"wp-image-218\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LittleNightmares-1024x576.jpg 1024w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LittleNightmares-300x169.jpg 300w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LittleNightmares-768x432.jpg 768w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LittleNightmares-1536x864.jpg 1536w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LittleNightmares-1568x882.jpg 1568w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/LittleNightmares.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Little Nightmares 2<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>The new camera system was another system tacked onto development. I wanted something that tracked the player, but had specific locations of clamping in each room, as well as rotation targets when the player was in a corner of the room.\u00a0<\/p>\n\n\n\n<p>To start, I broke down what was necessary to get this system working:\u00a0<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An efficient way to track the Player\u2019s position\u00a0<\/li>\n\n\n\n<li>Easy replication across the level (having a level with several different rooms)\u00a0<\/li>\n\n\n\n<li>Origin Point and Swing targets for each room\u00a0<\/li>\n\n\n\n<li>Origin point a consistent place for camera to lock into while player in rooms of varying size\u00a0<\/li>\n\n\n\n<li>Swing targets to account for size of room; how far camera must rotate to see player in corner of room\u00a0<\/li>\n\n\n\n<li>Interpolation between origin points \/ rooms \/ swing targets for smooth camera transitions between rooms\u00a0<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">Camera Dev\u00a0<\/h5>\n\n\n\n<p>With a set outline, I started by making a simple Camera Actor to exist in the world; something that is uncoupled from the Player Actor. Next, I created Room Actors with Overlap components in the room indicating the Center, Left, and Right sides of the room. When the Player reached a new room, an event would call a function in the Camera, passing along a few arguments for a new TargetLocation, while the Left and Right components indicated which way to swing the camera (positive or negative rotation for right and left respectively). I created a simple blockout to test this feature.\u00a0<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"397\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/RoomActor-1024x397.png\" alt=\"\" class=\"wp-image-219\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/RoomActor-1024x397.png 1024w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/RoomActor-300x116.png 300w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/RoomActor-768x298.png 768w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/RoomActor-1536x595.png 1536w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/RoomActor-2048x793.png 2048w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/RoomActor-1568x607.png 1568w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Simple Blockout for Testing and Room Actor Class<\/figcaption><\/figure>\n\n\n\n<p>This simple level blockout accounted for all compass direction camera transitions. The RoomActors had reference to the Camera Actor in the level and the revealed properties in the Details Panel on the right let the Level Designer change willingly according to different rooms sizes, or aesthetic changes as the level filled out more and more with Assets. All the transitions, or otherwise functionality, would be handled in the C++ classes for the Camera and RoomActor that these Blueprints derived from.\u00a0\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"734\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP0.png\" alt=\"\" class=\"wp-image-220\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP0.png 743w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP0-300x296.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><figcaption class=\"wp-element-caption\">Camera Actor C++ Functions Called from RoomActors<\/figcaption><\/figure>\n\n\n\n<p>These functions get called from the RoomActor. Passing along with it its own unique OriginPoint, SwingTarget, and a boolean variable indicating whether it is the left or right side. This boolean would indicate whether to take the positive or negative value of the swing target. Depending where in the room the player is, a Timed, recursive function would get call to repeatedly fire until the Camera reached its chosen destination.\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"313\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP1-1024x313.png\" alt=\"\" class=\"wp-image-221\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP1-1024x313.png 1024w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP1-300x92.png 300w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP1-768x234.png 768w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/05\/CameraActorCPP1.png 1399w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Timed, Interpolation Functions for Smooth Camera Transitions<\/figcaption><\/figure>\n\n\n\n<p>The timed functions would interpolate along a curve (Sine curve for the Camera Position) to create buttery smooth transitions.\u00a0\u00a0\u00a0<\/p>\n<\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Project Growing\u00a0<\/h5>\n\n\n\n<p>With all the development work falling on me, I was cognizant of how fast this project could grow and snowball into something unreasonable. Especially with adding mechanics on a whim. So, I decided to scale down core mechanics and begin to start narrowing down the game idea into a more refined state. Since our gameplay focus was on detective style exploration of space, I wanted the systems behind this interaction to be simple, but fun to engage with. Something like this Camera system being an example of an environmental detail that is not crucial to Gameplay per se, but aiding the exploration and interaction of the Doll House aesthetic we were going for.\u00a0\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Camera Overhaul\u00a0 A few weeks into development, we had a production meeting about the feel of the game and how we wanted to shift the tone to a more playful vibe. The style of game we were making is a Cluedo \/ Hitman style game with more stylized assets and characters. We thought of other&hellip; <a class=\"more-link\" href=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/2024\/05\/06\/2-5d-camera-system-devlog_023\/\">Continue reading <span class=\"screen-reader-text\">2.5D Camera System | DevLog_023<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-216","post","type-post","status-publish","format-standard","hentry","category-devlog","entry"],"_links":{"self":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":8,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":229,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions\/229"}],"wp:attachment":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}