{"id":314,"date":"2025-12-08T15:53:05","date_gmt":"2025-12-08T15:53:05","guid":{"rendered":"https:\/\/sites.wsagames.com\/sz3c23\/?p=314"},"modified":"2025-12-24T17:40:58","modified_gmt":"2025-12-24T17:40:58","slug":"4-shadow-mechanics-attempt","status":"publish","type":"post","link":"https:\/\/sites.wsagames.com\/sz3c23\/4-shadow-mechanics-attempt\/","title":{"rendered":"4. Shadow mechanics attempt"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"314\" class=\"elementor elementor-314\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1ce980e e-flex e-con-boxed e-con e-parent\" data-id=\"1ce980e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-377cb77 elementor-widget elementor-widget-text-editor\" data-id=\"377cb77\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>The original design proposes a 3D player character moving inside a 2D environment, while a frontal light source projects a shadow that can interact with the level. To test the feasibility of this mechanic, I studied and reproduced two existing engine implementations. One focuses on interactive shadow logic in Unity. The other demonstrates a workflow for placing a 3D character inside a 2D scene in Godot. Each method works independently, but their combination introduces structural problems at the engine level.<\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-374\" src=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181429_71_2.jpg\" alt=\"\" width=\"2388\" height=\"1343\" srcset=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181429_71_2.jpg 2388w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181429_71_2-300x169.jpg 300w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181429_71_2-1024x576.jpg 1024w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181429_71_2-768x432.jpg 768w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181429_71_2-1536x864.jpg 1536w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181429_71_2-2048x1152.jpg 2048w\" sizes=\"(max-width: 2388px) 100vw, 2388px\" \/><\/p><p><img decoding=\"async\" class=\"size-full wp-image-375\" src=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_72_2.jpg\" alt=\"\" width=\"2072\" height=\"1165\" srcset=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_72_2.jpg 2072w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_72_2-300x169.jpg 300w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_72_2-1024x576.jpg 1024w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_72_2-768x432.jpg 768w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_72_2-1536x864.jpg 1536w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_72_2-2048x1152.jpg 2048w\" sizes=\"(max-width: 2072px) 100vw, 2072px\" \/><\/p><p>The Unity implementation does not use real-time lighting or shadow maps. The shadow is implemented as a separate GameObject. Its position is calculated by casting a ray from the character along the inverse direction of a directional light. When the ray hits a surface, the shadow object is placed at the hit point. The shadow has its own collider and can trigger gameplay interactions. All interaction is based on physics and collision logic, not on rendering or lighting data.<\/p><p>This approach requires the environment to provide valid 3D collision surfaces. Raycasts need stable hit results. Surface normals are required to align the shadow with the ground. The shadow object must exist in the same physical space as other gameplay elements. For this reason, the system relies on 3D physics and 3D colliders across the scene.<\/p><p><img decoding=\"async\" class=\"size-full wp-image-376\" src=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_73_2.jpg\" alt=\"\" width=\"2388\" height=\"1343\" srcset=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_73_2.jpg 2388w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_73_2-300x169.jpg 300w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_73_2-1024x576.jpg 1024w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_73_2-768x432.jpg 768w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_73_2-1536x864.jpg 1536w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181430_73_2-2048x1152.jpg 2048w\" sizes=\"(max-width: 2388px) 100vw, 2388px\" \/><\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-377\" src=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_74_2.jpg\" alt=\"\" width=\"2388\" height=\"1343\" srcset=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_74_2.jpg 2388w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_74_2-300x169.jpg 300w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_74_2-1024x576.jpg 1024w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_74_2-768x432.jpg 768w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_74_2-1536x864.jpg 1536w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_74_2-2048x1152.jpg 2048w\" sizes=\"(max-width: 2388px) 100vw, 2388px\" \/><\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-379\" src=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_75_2.jpg\" alt=\"\" width=\"2388\" height=\"1343\" srcset=\"https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_75_2.jpg 2388w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_75_2-300x169.jpg 300w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_75_2-1024x576.jpg 1024w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_75_2-768x432.jpg 768w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_75_2-1536x864.jpg 1536w, https:\/\/sites.wsagames.com\/sz3c23\/wp-content\/uploads\/sites\/68\/2025\/12\/\u5fae\u4fe1\u56fe\u7247_20251220181432_75_2-2048x1152.jpg 2048w\" sizes=\"(max-width: 2388px) 100vw, 2388px\" \/><\/p><p>The Godot workflow uses a different principle. The environment is built as a 2D scene using sprites or tilemaps. The player character is a 3D model rendered inside that scene. Movement is constrained to a plane. The camera is fixed to preserve a 2D visual perspective. The 3D character mainly serves visual purposes such as animation quality and depth, while gameplay logic follows 2D assumptions.<\/p><p>When these two mechanisms are combined, the first issue is physics incompatibility. Interactive shadows depend on 3D raycasting and 3D colliders. A 2D scene typically uses 2D colliders and 2D physics. In most engines, 2D and 3D physics systems do not interact. This prevents the shadow from reliably detecting or interacting with the 2D environment.<\/p><p>The second issue is scene structure. In a 2D environment, many surfaces exist only as visual sprites. They do not provide physical depth or surface data. To support shadow projection, additional invisible 3D collision geometry must be created. This separates visual level design from gameplay collision design. Level construction becomes more complex and harder to maintain.<\/p><p>The third issue is rendering order. The system combines 2D sprites, a 3D character, and a projected shadow object. Correct depth and overlap depend on Z position, sorting layers, and material settings. These systems are not designed to work together by default. Visual inconsistencies occur easily, especially when the shadow moves across different surfaces.<\/p><p>The final issue is development scope. A stable implementation requires a unified physics strategy, custom collision layers, and continuous synchronisation between the character, the light source, the shadow object, and the environment. For a prototype-stage project, this technical overhead is high relative to the gameplay value gained.<\/p><p>Based on these experiments, I concluded that both mechanisms are individually viable in existing engines. However, combining a 3D character in a 2D scene with a physics-based interactive shadow system significantly increases implementation complexity. This makes the mechanic unsuitable for early-stage prototyping without further simplification or engine-level customisation.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>The original design proposes a 3D player character moving inside a 2D environment, while a frontal light source projects a shadow that can interact with the level. To test the feasibility of this mechanic, I studied and reproduced two existing engine implementations. One focuses on interactive shadow logic in Unity. The other demonstrates a workflow [&hellip;]<\/p>\n","protected":false},"author":59,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-314","post","type-post","status-publish","format-standard","hentry","category-ideation-development"],"_links":{"self":[{"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/posts\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/users\/59"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/comments?post=314"}],"version-history":[{"count":8,"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/posts\/314\/revisions"}],"predecessor-version":[{"id":645,"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/posts\/314\/revisions\/645"}],"wp:attachment":[{"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/media?parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/categories?post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.wsagames.com\/sz3c23\/wp-json\/wp\/v2\/tags?post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}