Grid Placement

Patch 5.0.1 - Critical Bug Fixes

Critical bug fixes for rotation, collision detection, and system stability

Grid Building Plugin 5.0.1 Patch Notes

Release Summary

Release Date: February 8, 2026
Version: 5.0.1
Type: Critical Bug Fixes

🐛 Runtime Bug Fixes

Building Rotation Bug

Issue: Building rotation persisted when switching between different building types What Happened: Buildings would keep their previous rotation when you selected a new building type, causing unexpected placement behavior Fixed: Building rotation now properly resets when switching building types

Collision Detection Issues

Issue: Collision detection failed on complex building shapes What Happened: Buildings with complex shapes could be placed in invalid positions or pass through existing structures Fixed: Improved collision processing for accurate placement validation

Building Preview Problems

Issue: Building preview display was inconsistent when switching building types What Happened: Preview would sometimes show incorrect rotation or position when changing buildings Fixed: Preview now correctly updates when switching between different building types

Memory Leaks

Issue: Memory usage increased during extended building sessions What Happened: Performance would degrade over time during long building sessions Fixed: Better resource cleanup prevents memory buildup

Performance Degradation

Issue: Slow collision detection calculations What Happened: Building placement became sluggish, especially with complex shapes Fixed: Optimized collision processing for faster placement

Invalid Placement Recovery

Issue: System would crash or become unresponsive after invalid building placements What Happened: Attempting to place buildings in invalid positions could cause crashes Fixed: Better error handling prevents crashes from invalid operations

Test Stability & Diagnostic Improvements

Issue: Non-fatal diagnostic warnings were being treated as fatal errors in automated test suites What Happened: push_warning() calls in DragManager, ManipulationSystem, and CollisionMapper were causing GdUnit4 to fail tests even when the system was behaving correctly Fixed:

  • Downgraded state-guard warnings (like “already dragging”) to debug logs to ensure test suite stability
  • Optimized CollisionObjectResolver to recursively search for nested collision polygons, fixing resolution for complex objects like the Smithy
  • Refined CollisionMapper diagnostics to provide rich console output without triggering runtime test errors

Targetable Layer Missing in Test Objects

Issue: Area2D test objects missing required “Targetable” physics layer causing manipulation system errors What Happened: Test helper functions created Area2D objects without the Targetable layer (12), causing “Object not targetable: missing physics layer ‘Targetable’ (layer 12)” runtime errors in integration tests Fixed:

  • Updated _create_preview_with_collision() in all_systems_integration_tests.gd to include Targetable layer
  • Updated _create_preview_with_collision() in indicator_manager_tree_integration_test.gd to include Targetable layer
  • Ensures test objects are properly targetable by the manipulation system

Test Service Initialization Missing

Issue: Null reference errors in indicator service unit tests What Happened: Three test methods in indicator_service_unit_test.gd were missing _service = _create_test_service() initialization, causing “Invalid call. Nonexistent function ‘setup_indicators’ in base ‘Nil’” errors Fixed:

  • Added service initialization to test_testing_indicator_freed_when_preview_removed()
  • Added service initialization to test_testing_indicator_freed_on_service_reset()
  • Added service initialization to test_multiple_testing_indicators_all_freed()

Positioner Test Stability & Resource Isolation

Issue: Flaky positioner tests and resource interference between test runs What Happened: When running 1500+ tests simultaneously, positioner tests experienced flaky behavior due to shared collision rules and settings being modified across test runs, causing inconsistent results and test failures Fixed:

  • Added comprehensive resource isolation mechanism in GBTestEnvironment.get_isolated_container()
  • Duplicates only GBSettings resource containing collision rules while preserving node connections
  • Applied isolation pattern to all positioner tests to prevent cross-test contamination
  • Enhanced position reset functionality with proper frame simulation and mode management
  • Fixed INFO mode visibility bug where positioner remained visible when it should be hidden

Positioner Visibility Logic Bug

Issue: INFO mode didn’t properly hide the positioner What Happened: should_be_visible() in grid_positioner_logic.gd was missing an INFO mode case, falling through to default branch and returning true. The _process loop would override the correct visibility set by _on_mode_changed() every frame. Fixed:

  • Added explicit GBEnums.Mode.INFO: return false case to should_be_visible()
  • Ensures consistency with should_be_visible_for_mode() behavior
  • Positioner now properly hides in INFO mode without being overridden by _process

👤 What This Fixes for Users

For Game Developers

  • No More Rotation Issues: Building rotation now behaves predictably
  • Stable Performance: No more slowdowns during extended building sessions
  • Reliable Collision: Buildings can’t be placed in invalid positions
  • Crash Prevention: System won’t crash from invalid building operations
  • Better Test Coverage: More reliable automated tests catch real issues instead of false positives
  • Stable Test Suite: Positioner tests now run consistently without flaky behavior
  • Resource Isolation: Tests no longer interfere with each other through shared state

For Level Designers

  • Consistent Building Behavior: Buildings always behave as expected
  • Faster Workflow: No more waiting for slow collision calculations
  • Better Previews: Building previews show correct placement
  • Reliable Tools: Building tools won’t crash during complex designs
  • Predictable Positioner: Grid positioner behaves consistently across all modes

For Players

  • Smoother Experience: No more lag during building-intensive scenes
  • Fewer Glitches: Buildings behave consistently and predictably
  • Better Performance: Improved frame rates during building operations
  • Reliable UI: Positioner visibility works correctly in all modes

For Test Engineers & Maintainers

  • Stable Test Suite: Reduced false positive test failures from diagnostic warnings
  • Better Debugging: Enhanced diagnostic output without breaking tests
  • Reliable CI/CD: More consistent automated test results across different environments
  • Test Isolation: Positioner tests no longer interfere with each other
  • Comprehensive Coverage: All positioner modes now tested with proper state management

This update fixes the most critical runtime issues that affected building placement, rotation, collision detection, and system stability.