Attention! This project was "vibecoded" using the Gemini CLI. While AI assisted in the process, I invested significant time and resources to produce and refine this project. It serves primarily as a personal learning example, and the provided examples are functional.
Note on Completeness: Not all features of the framework are currently working. For instance, Networking is not functional in its current state, though it is designed to be possible in theory. This project is a snapshot of an evolving experiment.
I believe many developers will find this useful as a foundation for their own game frameworks. Through my experiments with "vibecoding" games, I’ve concluded that AI alone isn't capable of producing a finished game. Game development is an art; it requires human intelligence, creativity, and the willingness to handle even the "boring" parts of coding. However, these tools are incredibly valuable—they serve as a catalyst to help you learn and achieve your goals faster.
This repository contains two distinct variants of the framework, depending on your needs:
The essential core. This is the distilled version of the framework, containing only the fundamental mechanics of composition. It is designed to be small, high-performance, and easy to understand.
- Best for: Learning the concept from scratch, or using it as a "base" to build your own custom systems.
- Includes: Entity containers, Component base, Blackboard (State), MessageBus (Events), and Dependency Injection (Attributes).
The complete ecosystem. This is what the framework became after adding production-ready features. It is a "battle-hardened" version ready for complex projects.
- Best for: Developers who need advanced features like persistence and performance optimization out of the box.
- Includes: Everything in Lite plus:
- Networking (Experimental/Theoretical): Structural support for authority management and state synchronization (currently non-functional).
- Pooling: A robust object pooling system to reduce GC pressure.
- FSM: A built-in Finite State Machine for complex logic.
- Serialization: System for saving and loading entity states.
- Debugging: In-game developer console and visual gizmos.
- Strict Composition: Logic lives in
Componentnodes. TheEntityis just a container. - No Spaghetti Wiring: Never use
GetNode()orGetParent()for logic. Use Attributes ([Bind],[NodeRef]). - Data Isolation: Components hold logic. The
Blackboardholds shared state. - Decoupled Communication: Components talk via the
MessageBus, never via direct function calls for loose events.
addons/CompositorLite/: The lightweight core framework.addons/CompositorFrameworkCSharp/: The full-featured production framework.Example/SpaceShooterLite/: A code-only example using the Lite framework.Example/SpaceShooter/: A comprehensive 3D example using the Full framework.docs/index.html: The Interactive Documentation Portal (hosted on GitHub Pages).
- Clone the repository into your Godot project.
- Open the project and enable either "Compositor Lite" or "Compositor Framework" in Project Settings > Plugins.
- Rebuild your C# solution (
dotnet build). - Run the examples in the
Example/folder to see the framework in action.
This project is released under The Unlicense. It is free and unencumbered software released into the public domain. You can copy, modify, publish, use, compile, sell, or distribute this software for any purpose, commercial or non-commercial, and by any means, without attribution.
Use this as a starting point. Rip it apart, learn how it works, and build something uniquely yours. The "boring" code is the foundation upon which great art is built. Happy coding!