$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-adapt-3d-to-2dExpert patterns for simplifying 3D games to 2D including dimension reduction strategies, camera flattening, physics conversion, 3D-to-sprite art pipeline, and control simplification. Use when porting 3D to 2D, creating 2D versions for mobile, or prototyping. Trigger keywords: Cha
| 1 | ## Godot 4.7 Baseline |
| 2 | |
| 3 | - Expert patterns in this skill target **Godot 4.7+** (stable, 2026-06-18). |
| 4 | - Consult the [Godot 4.7 migration guide](https://docs.godotengine.org/en/4.7/tutorials/migrating/upgrading_to_godot_4.7.html) when upgrading projects from 4.6. |
| 5 | - **NEVER** assume 4.6 defaults (stretch mode, audio area_mask, RichTextLabel percent flags) without checking 4.7 migration notes. |
| 6 | |
| 7 | # Adapt: 3D to 2D |
| 8 | |
| 9 | Expert guidance for simplifying 3D games into 2D (or 2.5D). |
| 10 | |
| 11 | ## NEVER Do |
| 12 | |
| 13 | - **NEVER remove Z-axis without gameplay compensation** — Blindly flattening 3D to 2D removes spatial strategy. Add other depth mechanics (layers, jump height variations). |
| 14 | - **NEVER keep 3D collision shapes** — Use simpler 2D shapes (CapsuleShape2D, RectangleShape2D). 3D shapes don't convert automatically. |
| 15 | - **NEVER use orthographic Camera3D as "2D mode"** — Use actual Camera2D for proper 2D rendering pipeline and performance. |
| 16 | - **NEVER assume automatic performance gain** — Poorly optimized 2D (too many draw calls, large sprite sheets) can be slower than optimized 3D. |
| 17 | - **NEVER forget to adjust gravity** — 3D gravity is Vector3(0, -9.8, 0). 2D gravity is float (980 pixels/s²). Scale appropriately. |
| 18 | |
| 19 | --- |
| 20 | |
| 21 | ## Available Scripts |
| 22 | |
| 23 | > **MANDATORY**: Read the appropriate script before implementing the corresponding pattern. |
| 24 | |
| 25 | ### [ortho_simulation.gd](scripts/ortho_simulation.gd) |
| 26 | Simulates 3D Z-axis height in 2D top-down games. Handles vertical velocity, gravity, sprite offset, and shadow scaling. |
| 27 | |
| 28 | ### [projection_utils.gd](scripts/projection_utils.gd) |
| 29 | Projects 3D world positions to 2D screen space for nameplates, healthbars, and targeting. Handles behind-camera detection and distance-based scaling. |
| 30 | |
| 31 | ### [isometric_math_core.gd](scripts/isometric_math_core.gd) |
| 32 | Expert utility generating translating between 2D Cartesian and True Isometric screenspace projection matrices without using 2D Node transforms. |
| 33 | |
| 34 | ### [depth_sorting_y_sort.gd](scripts/depth_sorting_y_sort.gd) |
| 35 | Expert dynamic Z-index Y-Sort script for fake 3D sorting isolated trees matching CanvasItem `_update_sorting()`. |
| 36 | |
| 37 | ### [jump_z_axis_sim.gd](scripts/jump_z_axis_sim.gd) |
| 38 | Complete CharacterBody2D snippet separating structural physical ground movement (X,Y) from a mathematically simulated jumping height (Z) in a topdown game. |
| 39 | |
| 40 | ### [parallax_depth_camera.gd](scripts/parallax_depth_camera.gd) |
| 41 | Fake Depth Camera applying varying offset algorithms to completely disparate CanvasLayers based on an index to simulate 3D camera translation panning. |
| 42 | |
| 43 | ### [hitbox_depth_manager.gd](scripts/hitbox_depth_manager.gd) |
| 44 | Area2D derived class that requires explicit custom Z-height overlap (1D AABB collision) prior to validating 2D triggers to stop incorrect "ground vs air" collision in 2.5D. |
| 45 | |
| 46 | ### [fake_3d_shadows.gd](scripts/fake_3d_shadows.gd) |
| 47 | Sprite2D shadow simulator exploiting Godot 4.x `Transform2D` matrix skew shear to project and angle shadows away from a simulated 3D sun direction on a 2D floor. |
| 48 | |
| 49 | ### [billboard_sprite_manager.gd](scripts/billboard_sprite_manager.gd) |
| 50 | 8-directional FPS Doom-style sprite controller isolating the simulated 3D relative angle between a moving 2D CharacterBody and a Camera2D viewpoint. |
| 51 | |
| 52 | ### [nav_region_flattening.gd](scripts/nav_region_flattening.gd) |
| 53 | Topdown 2D pathfinding workaround allowing "aerial" units to cross walls by leveraging multiple tiered 2D Navigation Layers instead of proper 3D verticality. |
| 54 | |
| 55 | ### [ortho_to_perspective_fx.gd](scripts/ortho_to_perspective_fx.gd) |
| 56 | Screen space CanvasItem warp Shader simulating a Mode 7 / tabletop perspective pitch. Maps top screen coordinates via division pinching. |
| 57 | |
| 58 | ### [2d_lighting_normals.gd](scripts/2d_lighting_normals.gd) |
| 59 | Automatic programmatic generation of `CanvasTexture` combining base albedo and baked normal maps at runtime so Sprites correctly react to 2D PointLIGHTs like 3D geometry. |
| 60 | |
| 61 | |
| 62 | --- |
| 63 | |
| 64 | ## Why Go from 3D to 2D? |
| 65 | |
| 66 | | Reason | Benefit | |
| 67 | |--------|---------| |
| 68 | | **Mobile performance** | 5-10x faster on low-end devices | |
| 69 | | **Simpler art pipeline** | Sprites easier to create than 3D models | |
| 70 | | **Faster iteration** | 2D level design is quicker | |
| 71 | | **Accessibility** | Lower hardware requirements | |
| 72 | | **Clarity** | Reduce visual clutter for puzzle/strategy games | |
| 73 | |
| 74 | --- |
| 75 | |
| 76 | ## Dimension Reduction Strategies |
| 77 | |
| 78 | ### Strategy 1: True 2D (Remove Z-axis) |
| 79 | |
| 80 | ```gdscript |
| 81 | # Top-down or side-view |
| 82 | # Example: 3D isometric → 2D top-down |
| 83 | |
| 84 | # Before (3D): |
| 85 | var velocity := Vector3(input.x, 0, input.y) * speed |
| 86 | |
| 87 | # After (2D): |
| 88 | var velocity := Vector2(input.x, input.y) * |