4.3.0 Rule Improvements & Validation Overhaul
Grid Building Plugin for Godot 4 » Devlog
Grid Building Inventory v4.3.0 Patch Notes
The v4.3.0 update refines the Grid Building plugin with better validation, new debugging tools, and Godot 4.4 compatibility (now required). Here’s what’s changed:
- Godot 4.4 Required: This update leverages Godot 4.4’s new GDScript typed dictionary enhancements (e.g.,
Dictionary[String, Node]
) for stricter type checking in validation systems, ensuring more robust code. - Templates:
PlaceableView
button template now defaults to “Expand Icon” enabled, ensuring uniform icon scaling in grid displays. - Enhanced Validation:
- All
validate()
methods now returnArray[String]
problem lists instead of booleans, making debugging easier (success =problems.is_empty()
). PlacementValidator
now emits asetup_failed
signal with aDictionary[PlacementRule, Array]
of rule setup issues for better error reporting.
- All
- Placement Rules:
- Base
PlacementRule
auto-sets_params
and validates it, returning setup problems asArray[String]
for improved diagnostics. ValidPlacementTileRule
fixed to require all custom tile data matches; added unit tests to verify this.
- Base
- Rule Check Indicators: Fixed debug mode drawing (now correctly shows contact points with circles) and added clarifying comments.
- Debugging Tools: Introduced
GBDebugSettings
resource to centralize debug toggling across objects (e.g., rules, indicators). Share one instance project-wide to enable/disable debug output—off by default unless explicitly set. - UI Tweaks: Separated “clear” and “setup” tabs in
placeable_selection_ui
for better usability. - Unit Tests: Added
offset_logo.tscn
to test offset cases (sprite/collision not at 0,0) and expandedValidPlacementTileRule
tests. - Code Cleanup: Simplified
building_state.gd
andbuilding_system.gd
, fixed debug loops, and refinedgrid_positioner_2d
visibility logic.
This update prioritizes stability, debuggability, and developer experience.
Here’s more details if interested.
Templates
- Changed default on PlaceableView button template to have expand icon checked. This lets the vertical size on different icons match when used in a grid display due to scaling of the icon.
Placement Validator
- New signal setup_failed which emits with a Dictionary[PlacementRule, Array] of rule setup problems. This could be handy in debugging or error reporting.
- Setup now works with Dictionary[PlacementRule, Array] return type gathered from each rule’s setup -> Array[String] return. The intention here is to massively improve issue reporting and debugging.
Placement Rule
- The base class setup automatically sets _params : RuleValidationParams (now a base class property) and validates it with the static RuleValidationParams.Validate(params) call. This returns an Array[String] problems which will be used by the PlacementValidator in reporting bad setup issues.
Rule Check Indicator
- Fixed bugs with the debug_mode where it would error rather than draw each contact point with a circle. Added comments to clarify the purpose of the _draw with debug mode.
Valid Placement Tile Rule
- Fixed to properly require each custom tile data to match in the test tile for this rule to return true. Added accompanying unit tests to ensure this behavior.
GBDebugSettings Resource
- Any grid building object that had debug settings now references a GBDebugSettings resource to check if it should print debug or not.
- Sharability of the true / false setting is the goal here so you can optionally use one GBDebugSetting across your project and toggle it on or off. By default, if there is no GBDebugSetting object set to true, then extra debugging will be off.
- For most cases, the end user should not need to use this but it exists if there ever seems to be any problems.
Unit Tests
- Added an offset object (offset_logo.tscn) to test offset cases where the sprite and collision shape are not centered at 0,0 like the root object but located adjacently
- Added extra tests for Validate Placement Tile Rule
Validate Method
- All validate methods have been updated to acquire and return an Array[String] problems instead of true false whether they validate or not. This makes the return data leagues more useful and aids in debugging. The equivalent check for if the validate() method succeeded is validate().is_empty().
Files
Grid Building v4.3.0 & Demo - Godot 4.4+ 26 MB
7 days ago
Get Grid Building Plugin for Godot 4
Grid Building Plugin for Godot 4
Place, manipulate, and demolish objects on TileMapLayer grids with previews and customizable rules.
Status | In development |
Category | Assets |
Author | Chris' Tutorials |
Tags | 2D, City Builder, Godot, godot4, Metroidvania, Side Scroller, Tilemap, Top-Down, User Interface (UI) |
More posts
- 4.3.1: Tile Positions Access, RuleResult updates, Readiness Guard2 days ago
- 4.2.0 Object Info & Mode Selection Hotbar85 days ago
- 4.1.0 Manipulate with Move & Demolish ModesSep 15, 2024
- Upcoming Grid Builder Updates for Godot 4.3Aug 18, 2024
- 4.0.3 Compatibility Fix for Godot 4.2.2Jun 09, 2024
- 4.0.2 Small Enhancements & Bug FixesJun 09, 2024
- 4.0.1 File Path HotfixJun 07, 2024
- 4.0.0 - Shared BuildingState, Save / Load HelperJun 07, 2024
- 3.2.2 Bug FixesMar 06, 2024
Leave a comment
Log in with itch.io to leave a comment.