Migration Guide: 5.x to 6.0.0
Comprehensive guide for migrating Grid Building (GDScript 5.0/5.1) projects to GridPlacement 6.0.0 (C#), including Placeable -> IPlaceable/Placeable architecture changes
This guide provides a comprehensive approach for migrating your Grid Building projects from the legacy GDScript-based 5.x line (5.0/5.1) to the C#-first 6.0.0 API, including the major architectural change from the 5.x Placeable resource model to the 6.0 IPlaceable + Placeable Core model.
๐ฏ Overview
What’s Changing in 6.0.0
- Architecture Migration: 5.x Godot resources are no longer the canonical โplaceableโ type for Core logic
- Interface Introduction:
IPlaceableis now used in Core for engine-agnostic placeables - Property Changes: Some properties moved to
Propertiesdictionary for flexibility - Enhanced Performance: Significant performance improvements with C#
- Better Type Safety: Compile-time type checking and better IDE support
- API Improvements: Cleaner, more consistent API design
- Enhanced Tooling: Better debugging and profiling capabilities
Migration Benefits
- Runtime Performance: C# executes 25-150% faster for most operations (based on official Godot benchmarks)
- Better IDE Support: Full IntelliSense, refactoring, and debugging
- Type Safety: Catch errors at compile-time, not runtime
- Easier Maintenance: Cleaner codebase with better tooling
- Future-Proof: Alignment with Godot’s C# direction
- Godot vs Core Separation: Better testing through clear architectural boundaries
- Core Layer: Engine-agnostic business logic, easily unit tested without Godot dependencies
- Godot Layer: Engine-specific implementation, integration tested with Godot mocks
- Improved Test Coverage: Core logic can be tested independently, increasing overall test reliability
- Better Separation of Concerns: Clear distinction between game logic and engine integration
- Faster Test Execution: Core tests run faster without Godot initialization overhead
๐ Prerequisites
Before You Begin
Backup Your Project
1 2 3# Create a complete project backup cp -r your_project your_project_v5.0.0_backup git add -A && git commit -m "Pre-6.0.0 migration backup"Verify Current Version
- Ensure you’re running Grid Building 5.x
- Check
addons/grid_building/plugin.gdfor version information - Document any custom modifications you’ve made
Install Required Tools
1 2 3 4 5# Install .NET SDK ( Godot 4.x requires .NET 6.0 or later) dotnet --version # Should be 6.0.0 or later # Install the enhanced migration tool # ( included in this repository )Close Godot Editor
- CRITICAL: Close Godot completely before migration
- This prevents file locking and corruption
Understand Tooling Safety Constraints
- The official migration tool is the GodotToolkit CLI (
godot-toolkit). - The tool runs in dry-run mode by default; no files are changed unless you explicitly opt in.
- Real execution requires the long flag
--execute-migrationso it is clear when you are applying changes. - Execution is only supported when your project is using the legacy GDScript-based Grid Building 5.x plugin.
- The tool will refuse to execute if:
- It cannot determine the GridBuilding plugin version under your
godot/addonsfolder. - The detected plugin version is not approved (currently only
5.0.0). - The GridBuilding plugin is already using C# scripts instead of GDScript.
- It cannot determine the GridBuilding plugin version under your
- You can always run
godot-toolkitin--dry-runmode on any project to inspect what it would change.
- The official migration tool is the GodotToolkit CLI (
๐ Migration Approaches
Approach 1: Automated Migration ( the recommended approach )
Best for: Most projects, standard Grid Building usage
Pros:
- Fully automated
- Preserves all functionality
- Handles edge cases
- Includes validation
Cons:
- Requires tool setup
- May need manual tweaks for custom code
Steps:
Prepare Your Project
1 2cd your_project git add -A && git commit -m "Before 6.0.0 migration"Run Automated Migration
1 2 3 4 5 6 7 8 9 10 11 12 13# Using the enhanced migration tool ./enhanced_migration \ --source ./addons/grid_building \ --target ./addons/grid_building_cs \ --config migration_config.toml \ --dry-run # Review the changes, then run for real ./enhanced_migration \ --source ./addons/grid_building \ --target ./addons/grid_building_cs \ --config migration_config.toml \ --executeUpdate Project Settings
1 2 3 4 5# Remove old GDScript addon rm -rf addons/grid_building # Rename C# addon to standard location mv addons/grid_building_cs addons/grid_buildingUpdate Scene References
1 2# The migration tool handles this automatically # But verify all references are updated
Approach 2: Manual Migration
Best for: Highly customized projects, complex custom integrations
Pros:
- Full control over process
- Can handle complex customizations
- Better understanding of changes
Cons:
- Time-consuming
- Higher risk of errors
- Requires deep knowledge
Steps:
Install C# Grid Building 6.0.0
- Download the C# version
- Extract to
addons/grid_building_cs/
Manually Port Custom Scripts
- Review each GDScript file
- Convert to C# equivalents
- Update API calls
Update Scene Files
- Change script references from
.gdto.cs - Update property paths if needed
- Change script references from
Test Incrementally
- Test each component individually
- Fix issues as they arise
Approach 3: Hybrid Migration
Best for: Projects with some customizations
Pros:
- Automated for standard parts
- Manual control for custom parts
- Balanced approach
Cons:
- More complex process
- Requires careful coordination
๐ ๏ธ Detailed Migration Process
Phase 1: Preparation
1.1 Project Analysis
| |
1.2 Dependency Check
- List all custom scripts that extend Grid Building classes
- Document custom property usages
- Note any API modifications you’ve made
1.3 Environment Setup
| |
Phase 2: Migration Execution
2.1 Backup Creation
| |
2.2 Run Migration Tool
| |
2.3 Post-Migration Steps
| |
Phase 3: Validation and Testing
3.1 Syntax Validation
| |
3.2 Runtime Testing
- Open Godot Editor
- Wait for C# compilation (may take a few minutes)
- Check for compilation errors
- Test core functionality:
- Grid placement
- Item manipulation
- Save/load systems
- UI interactions
3.3 Performance Validation
- Test grid performance with large grids
- Compare memory usage
- Verify frame rates are maintained or improved
Expected Performance Improvements (based on official Godot benchmarks):
- Operations: 25-50% faster for arithmetic and logic [official benchmarks]
- Function calls: 30-150% faster (depending on argument validation) [official benchmarks]
- Built-in function calls: 25-50% faster [official benchmarks]
- Iteration: 10-50% faster for loops [official benchmarks]
- Property access: 5-7% faster [official benchmarks]
Note: Actual performance gains vary by use case. Much game logic leverages Godot’s C++ engine internals, which are already optimized.
๐ง Common Migration Issues
Issue 1: Missing References
Symptoms: “Can’t find class” errors Solution:
| |
Issue 2: API Changes
Symptoms: Method not found errors Solution: Check the API migration guide below
Issue 3: Property Type Changes
Symptoms: Type conversion errors Solution: Update property types in custom scripts
Issue 4: Namespace Issues
Symptoms: Using directive errors Solution: Add proper using statements:
| |
๐ API Migration Reference
Class Name Changes
| GDScript ( 5.x ) | C# ( 6.0.0 ) |
|---|---|
GridBuildingManager | GridBuildingManager |
PlacementManager | PlacementManager |
ManipulationManager | ManipulationManager |
GridBuildingUI | GridBuildingUI |
Placeable | IPlaceable (Core interface) / Placeable (Core concrete type) |
Important Note: in 6.0, placeables are Core-first:
- Core Layer: use
GridPlacement.Core.Interfaces.IPlaceablefor engine-agnostic logic - Core Concrete Type:
GridPlacement.Core.Types.Placeableis the standard implementation - Godot Layer: may wrap / adapt Core placeables for instantiation, icons, and editor-facing resources
Method Signature Changes
| GDScript | C# |
|---|---|
func place_item(item: Node, position: Vector2) | public void PlaceItem(Node item, Vector2 position) |
func get_grid_size() -> Vector2i | public Vector2I GetGridSize() |
func is_position_valid(pos: Vector2) -> bool | public bool IsPositionValid(Vector2 pos) |
Property Changes
| GDScript | C# |
|---|---|
var grid_size: Vector2i | public Vector2I GridSize { get; set; } |
var current_item: Node | public Node CurrentItem { get; set; } |
var is_building: bool | public bool IsBuilding { get; set; } |
Placeable Architecture Migration
The biggest architectural change in 6.0.0 is the separation of Placeable into distinct layers:
5.x (GDScript)
| |
6.0.0 (C# - Core-first Architecture)
| |
Migration Steps for Placeable
Core Logic Migration
1 2 3 4 5 6 7 8 9 10 11 12/ Old (5.0.0) public void ProcessPlaceable(Placeable placeable) { / Engine-specific logic } / New (6.0.0) public void ProcessPlaceable(IPlaceable placeable) { / Engine-agnostic logic / Use placeable.Name, placeable.Size, etc. }UI Migration
1 2 3 4 5 6 7 8 9 10 11 12 13 14/ Old (5.0.0) public void SetupUI(Placeable placeable) { / Direct access to engine properties } / New (6.0.0) public void SetupUI(IPlaceable placeable) { / Clean separation - UI uses Core interface NameText = placeable.Name; DescriptionText = placeable.Description; SizeDisplay = placeable.Size; }Godot-Specific Operations
1 2 3/ Use PlaceableResourceHandler for engine operations var handler = new PlaceableResourceHandler(); var sceneInstance = handler.InstantiateScene(placeable.FilePath);
Benefits of This Change
- Clean Separation: UI doesn’t depend on Godot types
- Engine Agnostic: Core logic works with any engine
- Better Testing: Mock IPlaceable for unit tests
- Future-Proof: Easy to add new engine support
๐งช Testing Your Migration
Basic Functionality Test
| |
Performance Benchmark
| |
๐ Rollback Plan
If migration fails, you can rollback:
Quick Rollback
| |
Complete Rollback
| |
๐ Getting Help
Resources
- GitHub Issues: Report migration problems
- Discord Community: Get real-time help
- Documentation: Check API docs for specific issues
- Migration Tool Logs: Review detailed migration logs
Debug Information
| |
โ Migration Checklist
Pre-Migration
- Project backed up
- Current version verified ( 5.0.0 )
- .NET SDK installed
- Godot Editor closed
- Migration tool ready
- Configuration file created
Migration
- Dry run completed successfully
- Migration executed without errors
- Old addon backed up
- New addon in place
- Scene references updated
- Project settings updated
Post-Migration
- C# project builds successfully
- Godot Editor opens without errors
- Basic functionality tested
- Performance verified
- Custom code ported
- Full integration tested
- Documentation updated
Final Steps
- Commit changes to version control
- Update project documentation
- Test on target platforms
- Deploy to staging environment
- Monitor for issues
๐ Success!
Your project is now running Grid Building 6.0.0 with C#! Enjoy the improved performance and better development experience.
Next Steps
- Explore new C# features: Take advantage of the new capabilities
- Optimize performance: Use C# profiling tools
- Enhance debugging: Use Visual Studio or Rider for debugging
- Contribute back: Share improvements with the community
Need help? Check the troubleshooting section or create an issue on GitHub.
Migrating to GridPlacement 6.0 (C#)
This guide helps you upgrade your project from the GridBuilding v5.0 (GDScript-based) plugin to the C#โbased GridPlacement 6.0 plugin. In 6.0, GridPlacement / GP is canonical across docs, assemblies, and C# namespaces, but the legacy 5.x GDScript addon folder path remains res:/addons/grid_building/ for compatibility.
๐ฏ What’s Changing?
GridPlacement 6.0 introduces a Service-Based Architecture written in pure C#. This change affects how you interact with the plugin’s core systems, but the Godot-facing API (nodes, resources, signals) remains familiar.
| Component | v5.0 (GDScript) | v6.0 (C#) | Benefit |
|---|---|---|---|
| State Objects | Godot Resources | Pure C# Classes | Significantly faster test execution [internal testing] |
| Core Systems | Godot Nodes | Service Classes | Compile-time type safety |
| Data Objects | Godot Resources | C# Classes | Better encapsulation |
| UI Components | Godot Nodes | Godot Nodes | No change |
๐งญ Should I Migrate Now?
Short answer: Once GridPlacement 6.0 is marked productionโready, you should plan to migrate as soon as practical. The C# architecture is vastly more maintainable and will be the canonical version going forward; the 5.x GDScript plugin will enter maintenance mode and be phased out over time.
We strongly recommend migrating to GridPlacement 6.0 when ALL of the following are true:
- โ 6.0 has been tagged as a stable release in the plugin docs/repository.
- โ Your target Godot version supports C# (Godot 4.x with .NET).
- โ You are willing to maintain a small C# project alongside your GDScript game code.
- โ You are not blocked by a missing integration guide or tool noted in the docs (for example, items still marked “draft” or “planned”).
You may choose to temporarily stay on GridBuilding 5.x (GDScript) if:
- You are shipping a product imminently on an existing 5.x codebase and cannot risk architectural changes right now.
- Team members are not yet comfortable maintaining any C# code.
- You rely on tutorials or tools that havenโt been updated for 6.0 yet.
However, the longโterm plan is:
- ๐งฑ GridPlacement 6.0 (C#) becomes the canonical plugin.
- ๐ง GridBuilding 5.x (GDScript) is frozen except for critical bug/security fixes.
- ๐ฆ New features, performance work, and deep refactors will target C# first.
๐งฐ What You Need in Your Project
To use GridPlacement 6.0, your Godot project must be C#โenabled and able to reference the core DLL:
Set up a C# Godot project
- Follow the official Godot docs for creating a C# project (Godot 4 + .NET):
- Ensure a
.csprojexists for your game, and that Godot recognizes C# scripts.
Add the core library (GridPlacement.Core.dll)
- Place
GridPlacement.Core.dllinto a managed library folder inside your project (for exampleres:/lib/orres:/libs/, depending on your project convention). - Reference that DLL from your C# project so your game code and adapters can use
GridPlacement.Coretypes.
- Place
Install the Godotโside plugin
- Copy the GridPlacement 6.0 Godot plugin into:
res:/addons/grid_building/(folder name retained for 5.x compatibility).
- Enable the plugin in Project โ Project Settings โ Plugins.
- The pluginโs C# adapter nodes will then be available for scenes and UI.
- Copy the GridPlacement 6.0 Godot plugin into:
๐ Key Architectural Changes
State Management
State objects are no longer Godot Resources. They are now pure C# classes, which means:
- Faster Access: No Godot overhead for state operations
- Better Testing: States can be tested without Godot
- Type Safety: Compile-time error checking
Service Layer
Business logic is now handled by dedicated Service classes:
- BuildingService: Manages build operations
- ManipulationService: Handles object transformations
- InputService: Processes user input
Communication Pattern
The new architecture uses a strict unidirectional flow:
- Godot Layer calls Service methods
- Service updates State
- Service fires Events
- Godot Layer listens to Events and updates visuals
๐ Migration Checklist
Before You Start
- Backup your project
- Note any custom modifications to GridBuilding scripts
- Disable GridBuilding plugin temporarily
Migration Steps
1. Update Plugin
- Remove the old GridBuilding plugin folder
- Install the new GridBuilding v6.0 plugin
- Re-enable the plugin in Godot settings
2. Update Your Code
Most of your code will work without changes, but check these areas:
State Access (If Directly Accessed)
| |
Custom Signals
| |
3. Verify Functionality
- Test basic building placement
- Test manipulation (move/rotate/delete)
- Check custom UI integration
- Verify save/load functionality
๐ Performance Benefits You’ll See
- Faster Build Mode: Entering build mode is significantly faster [internal testing]
- Smoother UI: State updates no longer block the main thread
- Better Error Messages: Compile-time errors catch issues early
- Improved Stability: Strong typing prevents many runtime errors
๐ ๏ธ Common Migration Issues
Issue: “Can’t find state property”
Cause: Direct state access is no longer supported. Solution: Use the service API methods instead.
Issue: Custom scripts don’t compile
Cause: API changes in core systems. Solution: Check the API Reference for updated method signatures.
Issue: Performance seems slower
Cause: First-time C# compilation overhead. Solution: This is normal. Performance improves after the initial run.
๐ Getting Help
If you encounter issues during migration:
- Check the API Reference for updated methods
- Review the Service Architecture guide
- Ask in the community for help from other developers
๐ง 5.0 โ 6.0 Migration Tool (Planned)
To make upgrades easier, a dedicated 5.0 โ 6.0 migration tool is planned. The goal of this tool is to:
- Scan your project for GridBuilding 5.x GDScript dependencies (scripts, resources, scenes).
- Help convert or reโwire those usages to the new C# GridPlacement 6.0 APIs and resources where possible.
- Produce a report of anything it cannot safely convert automatically, so you can review those spots manually.
The exact capabilities and UX of this tool are still in design; this guide will be updated with concrete usage instructions once the tool is ready.
๐ You’re Done!
After migration, you’ll have a more robust, faster, and maintainable GridBuilding system. The new C# foundation enables future features and better performance.
Status Note: This migration guide is a working draft. It will be expanded with more examples, screenshots, and stepโbyโstep checklists before the GridPlacement 6.0 release.
For detailed technical changes, see the Class Mapping Documentation in the plugin repository.