FPS-Style Level Editor for Godot 4.6+
Brush-based 3D level design without leaving the editor
Features โข Installation โข Quick Start โข Docs โข Roadmap
HammerForge is a Godot Editor Plugin that brings classic brush-based level design workflowsโinspired by Hammer Editor and TrenchBroomโdirectly into the Godot editor. Create complete FPS levels with lightweight draft brushes, subtract carve operations, and one-click baking to optimized static meshes (CSG is only invoked during Bake).
Browser-free. Single-tool. Pure Godot.
| Traditional Workflow | HammerForge Workflow |
|---|---|
| Export from external editor โ Import โ Fix materials โ Generate collision | Draw brushes โ Bake โ Play |
| Multiple tools, multiple formats | One plugin, one editor |
| Constant context switching | Stay in Godot |
- CAD-Style Two-Stage Drawing
- Stage 1: Click & drag to define base dimensions
- Stage 2: Move mouse to set height, click to commit
- Draft Brush Editing: Lightweight DraftBrush nodes for fast editor transforms (CSG is generated only during Bake)
- Shape Palette: Box, Cylinder, Sphere, Cone, Wedge, Pyramid, Prisms, Ellipsoid, Capsule, Torus, and Platonic solids (mesh shapes scale to brush size)
- Draft Preview Parity: Pyramids, prisms, and platonic solids render as lightweight line previews in the editor
- Brush Operations: Add (union) and Subtract (carve at bake time)
- Grid Snapping: Configurable 1-128 unit increments
- Editor Theme Parity: Dock styling inherits the active Godot editor theme
- Quick Snap Presets: One-click 1/2/4/8/16/32/64 toggles synced with Grid Snap
- On-Screen Shortcut HUD: Optional cheat sheet in the 3D viewport
- Dynamic Editor Grid: High-contrast shader grid that follows the active axis/brush
- Viewport Brush Gizmos: Drag face handles to resize DraftBrushes with undo/redo support
- Gizmo Snapping: Resize handles respect
grid_snapfor consistent sizing - Material Paint Mode: Pick an active material and click brushes to apply it
- Entity Selection (early): Nodes under
Entitiesor taggedis_entityare selectable and ignored by bake - DraftEntity Props (early): Schema-driven entity properties with Inspector dropdowns (stored under
data/) - Entity Previews (early): Editor-only billboards/meshes from
entities.json - Collapsible Dock Sections: Collapse Settings/Presets/Actions to reduce clutter
- Physics Layer Presets: Set baked collision layers with a single dropdown
- Live Brush Count: Real-time count of draft brushes with performance warning colors
- History Panel (beta): Undo/Redo buttons plus a recent action list for HammerForge actions
| Key | Effect |
|---|---|
Shift |
Force square base |
Shift+Alt |
Force perfect cube |
Alt |
Height-only adjustment |
X / Y / Z |
Lock to specific axis |
Right-click |
Cancel current operation |
- Click to Select brushes (Shift for multi-select)
- Hover Highlight shows the brush under the cursor in Select mode
- Delete selected brushes
- Duplicate with
Ctrl+D(grid-snapped offset) - Nudge with Ctrl+Arrow and Ctrl+PageUp/PageDown (arrow keys work when the 3D viewport has focus)
- Use Godot Gizmos for move/rotate/scale on selected brushes
- Resize with Face Handles: Drag the DraftBrush face handles to resize while the opposite face stays pinned
- Entities are selectable when placed under
Entitiesor tagged withis_entity(not included in bake)
- Stage Your Cuts: Subtract brushes appear solid red until applied
- Preview Before Carving: Position cuts precisely before committing (carve becomes visible after Bake)
- Non-Destructive: Clear pending cuts without affecting geometry
- Commit Cuts: Bake and keep the carve while hiding draft brushes (optional freeze keeps cut brushes)
- Builds a temporary CSG tree from DraftBrushes and bakes MeshInstance3D
- Auto-generates trimesh collision (StaticBody3D) using Add brushes only (Subtracts are excluded)
- Removes hidden geometry for better performance
- Subtract previews do not bleed into baked materials
- Chunked Bake: set
bake_chunk_sizeonLevelRootto split large maps into chunk bakes (set<= 0to disable)
- Download or clone this repository
- Copy the
addons/hammerforgefolder to your project'saddons/directory - Enable the plugin:
- Go to
Project โ Project Settings โ Plugins - Find "HammerForge" and toggle Enabled
- Go to
your-project/
|-- addons/
| `-- hammerforge/ <- Copy this folder
| |-- plugin.cfg
| |-- plugin.gd
| |-- level_root.gd
| |-- dock.gd
| |-- dock.tscn
| |-- baker.gd
| |-- brush_manager.gd
| |-- brush_instance.gd
| |-- brush_gizmo_plugin.gd
| |-- draft_entity.gd
| |-- entities.json
| |-- icons/
| |-- meshes/
| `-- icon.png
`-- project.godot
Notes:
DraftBrushesstores lightweight DraftBrush nodes used during editing (no live CSG).CommittedCutsstores frozen subtract brushes when "Freeze Commit" is enabled.Entitiesstores non-geometry nodes (selection-only, excluded from bake).EditorGrid(MeshInstance3D) is editor-only and not saved to scenes.LevelRootcan be a single node; child helpers are created automatically if missing.
1. Open any 3D scene in Godot
2. Click anywhere in the 3D viewport
โ HammerForge automatically creates a LevelRoot node
3. Click "Create Floor" in the dock
โ Adds a raycast-friendly surface for placement
1. Select "Draw" mode in the dock
2. Choose "Add" operation and "Box" shape
3. Click and drag in the viewport to define the base
4. Release, then move mouse up to set height
5. Click to commit the brush
1. Switch to "Subtract" mode
2. Draw a brush that overlaps existing geometry
โ Appears as solid red (pending cut)
3. Click "Apply Cuts" to arm the carve
โ Subtract brushes become active for the next Bake
1. Click "Bake" in the dock
โ Creates optimized static mesh with collision
2. Press Play to test your level!
Sections can be collapsed using the toggle button in each header.
| Control | Function |
|---|---|
| Tool | Draw - Create brushes / Select - Pick brushes |
| Paint Mode | Toggle paint-on-click when Select is active |
| Active Material | Pick the material applied by Paint Mode |
| Mode | Add - Union geometry / Subtract - Carve holes (visible after Bake) |
| Shape | Select from the dynamic Shape Palette grid |
| Sides | Contextual sides control for pyramids/prisms |
| Size X/Y/Z | Default brush dimensions |
| Grid Snap | Snap increment (1-128 units) |
| Quick Snap | Preset snap buttons (1/2/4/8/16/32/64) synced to Grid Snap |
| Physics Layer | Preset collision layer mask for baked geometry |
| Freeze Commit | Keep committed cuts hidden for later restore (off deletes cuts after commit) |
| Show HUD | Toggle the on-screen shortcut legend |
| Show Grid | Toggle the editor grid (off by default) |
| Follow Grid | Toggle grid follow mode (requires Show Grid) |
| 3D View Layout (native) | Use Godotโs View โ Layout โ 4 View for Top/Front/Side/3D |
| Debug Logs | Print HammerForge events to the output console |
| Live Brushes | Real-time draft brush count with performance warning colors |
| History | Undo/Redo controls and a recent action list (beta) |
| Button | Action |
|---|---|
| ๐๏ธ Create Floor | Spawn 1024ร16ร1024 collidable surface |
| โก Apply Cuts | Execute pending subtract operations |
| ๐งน Clear Pending | Remove staged cuts without applying |
| ๐ฅ Commit Cuts | Apply + Bake + Remove cut shapes |
| โป๏ธ Restore Cuts | Bring committed cuts back for editing |
| ๐งฉ Create DraftEntity | Spawn a DraftEntity under Entities |
| ๐ฆ Bake | Bake DraftBrushes to an optimized mesh (temporary CSG) |
| ๐๏ธ Clear All | Remove all brushes |
| Key | Action |
|---|---|
Delete |
Delete selected brushes |
Ctrl+D |
Duplicate selected |
Ctrl+Left Ctrl+Right |
Nudge X axis |
Ctrl+Up Ctrl+Down |
Nudge Z axis |
Ctrl+PgUp Ctrl+PgDn |
Nudge Y axis |
X Y Z |
Lock axis during draw |
Shift |
Square base constraint |
Shift+Alt |
Cube constraint |
Alt |
Height-only mode |
Right-click |
Cancel drag |
- Shortcut HUD: Toggle with "Show HUD" in the dock. The overlay is informational and does not change your active tool.
- Dynamic Grid: Editor-only grid plane driven by a shader for high contrast. Enable with "Show Grid".
- Tuning: Adjust
grid_visible,grid_follow_brush,grid_plane_size,grid_color, andgrid_major_line_frequencyonLevelRootin the Inspector.
| Document | Description |
|---|---|
| ๐ User Guide | Complete usage instructions |
| ๐ง MVP Guide | Developer implementation guide |
| ๐ Specification | Technical architecture & design |
| ๐ Changelog | Version history |
HammerForge Plugin
- plugin.gd -> EditorPlugin lifecycle & input
- level_root.gd -> Core brush management & virtual bake
- dock.gd/tscn -> UI panel controls
- baker.gd -> CSG -> StaticMesh converter
- brush_manager.gd -> Brush instance tracking
- brush_instance.gd -> DraftBrush (Node3D + MeshInstance3D)
- draft_entity.gd -> DraftEntity (schema-driven entity properties)
- brush_gizmo_plugin.gd -> DraftBrush resize handles in the viewport
addons/hammerforge/shortcut_hud.tscn+addons/hammerforge/shortcut_hud.gd: On-screen shortcut legend.addons/hammerforge/editor_grid.gdshader: Shader-based grid for the editor viewport.
LevelRoot (Node3D)
โโโ DraftBrushes (Node3D) โ Editable draft brushes
โ โโโ Brush_001 (DraftBrush)
โ โโโ Brush_002 (DraftBrush)
โ โโโ ...
โโโ PendingCuts (Node3D) โ Staged subtracts (DraftBrush)
โโโ CommittedCuts (Node3D) โ Hidden frozen cuts (optional)
โโโ Entities (Node3D) โ Non-geometry nodes (not baked)
โ โโโ DraftEntity (Node3D) โ Schema-driven entity with Inspector props
โโโ BakedGeometry (Node3D) โ Output after bake (chunked if enabled)
โโโ BakedChunk_x_y_z (Node3D)
โโโ MeshInstance3D
โโโ StaticBody3D
- CAD-style brush creation (Box, Cylinder)
- Add/Subtract operations (virtual during edit, baked via CSG)
- Grid snapping with modifier constraints
- Selection, deletion, duplication, nudge
- Pending subtract system
- One-click baking with collision
- Undo/Redo - History panel and editor undo hooks (beta)
- More Shapes - Wedge, Sphere, Cone, Pyramid, Prisms, Ellipsoid, Capsule, Torus, Platonic solids
- Texture Support - Per-face material painting and UV tools
- Chunked Baking - Bake large maps by chunk with
bake_chunk_size - Entity System - Selectable entities under
Entitiesor taggedis_entity(excluded from bake)
- TerrainModule - GPU heightmap sculpting
- PrefabModule - Drag-drop modular assets
- AIPathModule - Navigation mesh helpers
- Import/Export -
.map, glTF, USD formats
Contributions are welcome! Here's how you can help:
- ๐ Report Bugs - Open an issue with reproduction steps
- ๐ก Suggest Features - Describe your use case
- ๐ง Submit PRs - Fork, branch, and submit pull requests
# Clone the repository
git clone https://github.com/yourusername/hammerforge.git
# Open in Godot 4.6+
# Enable plugin in Project Settings โ Plugins
# Edit scripts in addons/hammerforge/This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Valve's Hammer Editor
- Inspired by TrenchBroom
- Built with Godot Engine
Made with โค๏ธ for the Godot community
Star โญ this repo if you find it useful!
