thedivergentai/godot-3d-world-building
Expert patterns for 3D level design using GridMap with MeshLibrary, CSG constructive solid geometry, occlusion, and runtime GridMap builders. Use when building 3D levels, modular tilesets, or BSP-style geometry. For sky/fog/Environment recipes, route to godot-3d-lighting. Trigger keywords: GridMap, MeshLibrary, set_cell_item, get_cell_item, map_to_local, local_to_map, CSGCombiner3D, CSGBox3D, CSGSphere3D, CSGPolygon3D, OccluderInstance3D, bake CSG.
npx skills add https://github.com/thedivergentai/GD-Agentic-Skills --skill godot-3d-world-building
Expert guidance for level design with GridMaps, CSG bake, and occlusion — not lighting/atmosphere authorship.
cell_size doesn't update existing tiles, causing misalignment. Set it once at the start.mesh_library.get_item_shapes(tile_index) (or inspect the source scene StaticBody3D + CollisionShape3D) before convert; empty shapes spawn visual-only geometry players fall through.await get_tree().process_frame (see safe_csg_baking.gd); baking mid-recompute yields empty or stale ArrayMesh data. Order: finish boolean edits → wait one frame → bake → delete CSG → add collision.EditorSceneFormatImporter uses ImportFlags enum for import constants.> MANDATORY: Read the appropriate script before implementing the corresponding pattern.
> Do NOT Load lighting/sky/fog scripts or deep Environment tutorials here — route to godot-3d-lighting.
Automatic collision shape generation from meshes. Use when importing models without collision or for procedural geometry.
Sole streaming / runtime GridMap entry — batch tile placement, chunk-style rebuilds, and auto-navigation baking. Prefer this over ad-hoc WorldStreamer stubs.
EditorScript to bake CSG geometry to static meshes with proper materials and collision. Use when finalizing level prototypes.
Expert technique for safe CSG baking. Awaits the end of the frame before extracting baked meshes to avoid empty data.
Level-of-detail switching based on camera distance. Manages mesh swapping and visibility for large outdoor scenes.
OccluderInstance3D configuration for manual occlusion culling. Use for indoor levels with many rooms.
Proxy-tile pattern: replace invisible MeshLibrary markers with spawn/trigger scenes at _ready, then clear proxy cells.
ResourceLoader.load_threaded_request queue — stutter-free chunk instantiation after background load completes.
get_item_shapes().cell_size once, place cells, bake NavigationRegion3D. Runtime rebuilds: MANDATORY gridmap_runtime_builder.gd.extends GridMap
func _ready() -> void:
mesh_library = load("res://tilesets/dungeon_library.tres")
cell_size = Vector3(2, 2, 2) # Set once; never after tiles exist
Cell API: set_cell_item(pos, index, orientation]), get_cell_item, INVALID_CELL_ITEM, local_to_map / map_to_local. For batch/runtime placement and nav bake, load [gridmap_runtime_builder.gd — do not paste a custom chunk streamer.
var shapes := mesh_library.get_item_shapes(tile_index)
if shapes.is_empty():
push_error("Tile %d has no collision — fix MeshLibrary source scene" % tile_index)
CSGCombiner3D.await get_tree().process_frame (WHY: CSG dirty flags settle one frame late).Brush types (Box/Cylinder/Sphere/Polygon) are editor greybox tools only — not shipping geometry.
| Need | Action |
|------|--------|
| Runtime GridMap tiles / chunk rebuild + nav bake | MANDATORY gridmap_runtime_builder.gd |
| Large open-world scene streaming | Peer godot-genre-open-world |
| Ad-hoc WorldStreamer inline stub | Cut — do not reintroduce incomplete load-from-file TODOs |
Partition dense props into regional MultiMeshInstance3D nodes so frustum/occlusion can cull whole clusters (single MultiMesh AABB draws everything).
Use invisible proxy tile IDs for spawns/triggers; at _ready, get_used_cells_by_item, instantiate logic scenes, clear proxy cells. Keep logic off the GridMap itself.
For city-scale fake interiors, use a spatial shader on window planes — peer godot-shaders-basics. Do not paste full shader recipes here.
get_item_shapes → fix MeshLibrary source.| Topic | Reference / script |
|-------|-------------------|
| GridMap / CSG bake walkthrough | gridmap-and-csg.md |
| Chunk streaming / procgen rooms | streaming-and-procgen.md |
| Proxy spawn tiles | grid_map_logic_manager.gd |
| Threaded chunk load | world_streamer.gd |
> Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.
Take thedivergentai/godot-3d-world-building from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.