-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement map editor with ECS architecture #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add architecture overview with ECS mode switching concepts - Create detailed phase-by-phase documentation (5 phases) - Split implementation plan into focused, KI-optimized documents - Include acceptance criteria, testing strategies, and dependencies - Establish clear workflow for phased development approach
- Add TILE_CLICKED, TILE_HOVERED, TILE_PLACED, EDITOR_STATE_CHANGED events - Extend RpcEngineParamMap with proper type definitions - Update EditorInputSystem to send tile interaction RPC notifications
- Add MapEditorComponent to mark TileMap entities as editable - Add EditorToolComponent to manage editor tool state - Implement component lifecycle management and callbacks - Support for tool selection, layer management, and interaction state
- Add MapEditorSystem for centralized editor state management - Add TileInteractionSystem for handling tile click/hover interactions - Implement Excalibur Query system for efficient entity filtering - Add RPC communication between systems and GJS host
- Simplify engine integration by removing complex monitoring - Add MapEditorSystem and TileInteractionSystem to scene automatically - Systems run continuously and process entities with editor components - Follow Excalibur ECS best practices for system lifecycle management
- Move implementation docs to WIP folder for active development - Update map-editor-implementation-plan.md with Phase 2 completion - Document MapEditorSystem and TileInteractionSystem implementation - Add implementation summaries and architectural insights - Fix TypeScript errors with improved type annotations
…pment - Remove old documentation files from root docs/ directory - All implementation plans moved to docs/WIP/ for ongoing development - Maintain clean documentation structure for active development phases
- Replace TSyringe with Needle DI for modern decorator support - Update Phase 3, 4, 5 documentation with Needle DI patterns - Configure TypeScript for modern ECMAScript decorators - Add DI container setup and service injection examples - Update testing strategy to use Needle DI in stories - Ensure GJS and GObject compatibility with new DI approach Needle DI provides better GJS compatibility and modern standards without requiring experimentalDecorators or reflection polyfills.
…I integration - Update Phase 3 documentation to reflect app-level DI container setup - Introduce package-separation strategy for improved service management - Add examples for service registration and usage across packages - Emphasize benefits of app-level container for type safety and maintainability - Clarify architecture benefits and acceptance criteria for Needle DI implementation
- Deleted files: current-status-and-problems.md, implementation-checklist.md, MIGRATION-GUIDE.md, SOLUTION-tile-replacement.md - These documents were superseded by updated plans and streamlined processes for the map editor implementation. - Focus is now on concise, actionable documentation to support ongoing development.
- Implement tile visual replacement using Excalibur Canvas graphics - Add MapResource methods for sprite sheet access and editor integration - Create MapEditorService for UI-engine state synchronization - Update implementation documentation with current progress status - Fix Canvas/ImageSource compatibility issues with proper Excalibur patterns This completes Steps 1-3 of the tile replacement implementation: ✅ Tile replacement with visual feedback (color-coded placeholders) ✅ SpriteSheet infrastructure ready for real sprites ✅ Service-based architecture for UI-Engine communication ✅ All packages build successfully without errors
- Fix RPC endpoint initialization in constructor - Add safe removeRpcHandlers() method to prevent getter exceptions - Add try-catch blocks for robust RPC handler cleanup - Ensure WebView is properly set before accessing RPC
- Add Tools tab to MapEditorPanel with Brush/Eraser toggle buttons - Implement tool-changed signal emission from MapEditorPanel - Add signal handlers for tool button toggles - Connect tool buttons to signal emission chain
- Add tool-changed signal forwarding from MapEditorPanel to Sidebar - Implement _onToolChanged handler in Sidebar - Add signal connections in vfunc_map() for tool button events - Update vfunc_unmap() to properly disconnect all signal handlers
- Move sidebar signal connections from constructor to _onMapLoaded - Add _connectSidebarSignals() method for proper timing - Connect tile-selected and tool-changed signals to service methods - Ensure MapEditorService is available before connecting signals - Add proper error handling for missing service instances
- Mark Step 4 (UI Integration) as completed - Update progress from 75% to 90% completion - Add new known issues and their solutions - Update next priority to Step 5 (Engine State Reception) - Refresh current capabilities and success metrics
- Update Engine widget to support MapEditorService integration - Update WebView widget for proper RPC communication setup - Ensure Engine-WebView-MapEditorService communication pipeline
… up hover handling - Move layer selection logic from MapEditorPanel to LayerSelector for better separation of concerns - Simplify hover event handling in EditorInputSystem to remove complex optimization attempts - Remove debug console.log statements for clean production code - Update documentation with current status and next steps for remaining issues - Fix CSS styling for layer selection visual feedback Related issues: - Layer display now shows all layers correctly - Hover events are more reliable and less noisy - Architecture is cleaner with self-contained widgets Next steps: - Analyze remaining integration issues (layer selection, tile selection, tool state) - Implement fixes for proper state synchronization between UI and engine
…consistency - Replace all German text with English equivalents - Maintain consistent language throughout documentation - Ensure professional documentation standards - Keep all technical details and formatting intact This ensures the documentation follows the project's English-only policy and maintains consistency with the codebase comments and documentation.
…lity - Implement configurable EditorToolComponent with constructor options - Add Sprite index property for proper tile ID mapping - Optimize hover events with hoverHasChanged flag to reduce RPC calls - Unify TILE_HOVERED event handling in TileInteractionSystem - Synchronize UI defaults with Engine defaults for seamless initialization - Complete documentation update for Session 2 readiness - Fix layer selection integration and tool state management - Achieve MVP: functional tile replacement, eraser tool, and RPC communication All packages build successfully with no errors or warnings.
- Remove excessive debug logging from all systems - Extract sprite management logic into SpriteUtils class - Improve error handling and input validation throughout - Consolidate state synchronization cache structure - Extract magic numbers into constants file - Apply DRY principle by removing code duplication - Ensure clear separation of component responsibilities - Add comprehensive validation for tile operations This refactor makes the codebase more maintainable, reduces technical debt, and establishes clear patterns for future development.
…xports - Format long function calls for better readability in editor-input.system.ts - Add exports for constants and sprite-utils in utils/index.ts - Remove unnecessary whitespace and empty lines - Ensure consistent code style across the codebase
- Update project status to January 2025 - Mark Session 2 as successfully completed - Document Multi-Tileset Support implementation - Add roadmap for Session 3: Visual Improvements - Include technical highlights and code examples
- Translate all German documentation to English for international accessibility - Update current status documentation with Session 2 completion details - Add comprehensive path resolution refactoring documentation - Include Session 3 roadmap for transparency improvements - Document technical achievements and architectural improvements
…support - Extract path resolution logic into reusable resolveResourcePath utility - Add comprehensive GIO-based path resolution with fallback mechanisms - Remove Node.js-specific process.env checks for GJS compatibility - Enhance SpriteUtils to support both Array and Record sprite formats - Implement automatic SpriteSet loading in MapResource - Add robust firstGid handling for global tile ID mapping - Improve cross-platform compatibility between GJS and Excalibur
- Simplify tile interaction logic in EditorInputSystem by extracting tile click and hover handling into dedicated methods - Improve validation and error handling for tile placement operations - Refactor SpriteUtils to streamline sprite retrieval and validation processes - Remove redundant comments and improve code readability - Ensure consistent handling of input events and hover states across the editor
…on issues - Fix sprite loading for both array and object formats in SpriteUtils - Implement proper Z-index management for correct tile rendering order - Ensure layer-specific operations don't affect other layers - Add automatic TileMap Z-index updates for proper layering - Clean up debug logging while preserving error handling Resolves tile rendering issues where tiles were not displaying in correct order and layer operations affected all layers instead of selected layer only.
…ter organization - Rename manager/ to services/ directory for semantic clarity - Rename utils/ to lib/ directory to distinguish from business logic - Split SpriteUtils into specialized service classes: * SpriteValidator - input validation * SpriteInfoResolver - sprite information resolution * TileGraphicsManager - graphics operations * LayerManager - layer-specific operations * SpriteUtils - facade for all services - Update all import statements across the codebase - Fix barrelsby build configuration for new directory structure - Add TypeScript architecture refactoring guidelines - Maintain backward compatibility through re-exports Improves code organization following SOLID principles and modern TypeScript architecture patterns. All changes maintain existing functionality while improving maintainability and developer experience.
- Update comprehensive documentation for the Map Editor, ensuring clarity and consistency in English. - Reflect the successful completion of all sessions, highlighting achievements in multi-tileset support, layer system functionality, and visual improvements. - Document the resolution of all remaining issues, including tile transparency and performance optimizations. - Revise implementation plan and checklist to indicate full functionality and readiness for production use. This update ensures that all project documentation accurately represents the current state and achievements of the Map Editor, providing a clear resource for future development and user guidance.
- Introduce a new CONTRIBUTING.md file outlining guidelines for contributors, including code of conduct, development workflow, and submission processes. - Revise README.md to provide a clearer overview of the PixelRPG Map Editor, including installation instructions, architecture details, and a detailed table of contents. - Update project documentation to ensure clarity and consistency, making it easier for new contributors to engage with the project. This update enhances the onboarding experience for contributors and improves the overall documentation quality for the project.
- Introduce a new adwaita-styling.mdc file for GNOME/Adwaita CSS variables and style classes. - Update blueprint-templates.mdc to include a reference to the new adwaita-styling rules. This addition enhances the styling capabilities for GNOME applications and improves documentation links for better navigation.
- Bump esbuild version to ^0.25.10 in cli package. - Upgrade jsdom to ^27.0.0 in cli package. - Update @types/node to ^24.5.2 in multiple packages. - Upgrade mime to ^4.1.0 in several packages. - Update vite to ^7.1.7 in multiple packages. - Upgrade various @Girs dependencies to their latest beta versions in data-gjs, maker-gjs, story-gjs, and ui-gjs packages. - Update @gjsify/vite-plugin-blueprint version in maker-gjs and story-gjs packages. - Bump serve version to ^14.2.5 in zelda-like package. - Update rollup plugin utils to ^5.3.0 in engine-excalibur package. - Update other dependencies to ensure compatibility and leverage new features.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a comprehensive Map Editor for the RPG Maker using Excalibur.js ECS architecture with clean separation between game runtime and editor functionality.
🏗️ Architecture Overview
Key Innovation: ECS Mode Switching
Core Components:
📋 Implementation Status
Phase 0: Planning & Documentation ✅ Completed
Phase 1: Core Tile Replacement ✅ Completed
Phase 2: UI Integration ✅ Completed
Phase 3: ECS Systems Implementation 📋 Planned
packages/engine-excalibur/src/systems/map-editor.system.ts)packages/engine-excalibur/src/systems/tile-interaction.system.ts)packages/engine-excalibur/src/engine.ts)Phase 4: Tool System Implementation 📋 Planned
packages/engine-gjs/src/tools/abstract-tool.ts)packages/engine-gjs/src/tools/brush-tool.ts)packages/engine-gjs/src/tools/eraser-tool.ts)packages/engine-gjs/src/tools/fill-tool.ts)Phase 5: Testing & Polish 📋 Planned
📖 Documentation
Implementation Plan: View Documentation
Current Status: Implementation Checklist
Architecture Overview: ECS Mode Switching
Phase Details: Phase 1 | Phase 2 | Phase 3 | Phase 4 | Phase 5
🎨 Key Features
🔄 Development Workflow
📊 Current Status
🧪 Testing Strategy
🎯 Success Criteria
🚀 Recent Achievements
Latest Commits:
b0ecc6dfeat: integrate MapEditorService with Engine and WebView3e38d3bdocs: update implementation checklist for UI integration completion20db9fdfeat: connect sidebar signals to MapEditorServicee40fa50feat: connect MapEditorPanel signals to Sidebar87425f0feat: add tool selection UI buttons936312ffix: resolve MapEditorService RPC timing issuesThis PR demonstrates steady progress with working code at each milestone. The modular architecture ensures clean separation between game runtime and editor functionality.