Architecture Overview (6.0)

GridPlacement 6.0 separates Core (pure C#, no engine dependencies) from Godot (engine-specific adapters). This gives you a clean boundary for testing, headless operation, and porting.

The Three Layers

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
┌─────────────────────────────────────────────────────────────────┐
│  Godot Layer (MoonBark.GridPlacement.Godot)                     │
│  - PlacementContext (Resource)                                  │
│  - PlacementSceneAdapter (Node)                                 │
│  - PlacementInputController (Node)                              │
│  - Godot Events → ECS Events bridge                             │
└────────────────────────────┬────────────────────────────────────┘
                             │ calls
┌─────────────────────────────────────────────────────────────────┐
│  ECS Layer (MoonBark.GridPlacement.ECS)                        │
│  - PlacementSystem, ManipulationSystem                          │
│  - Friflo.Engine.ECS Entity/Component                          │
│  - IEcsPlugin implementation                                    │
└────────────────────────────┬────────────────────────────────────┘
                             │ uses
┌─────────────────────────────────────────────────────────────────┐
│  Core Layer (MoonBark.GridPlacement.Core)                       │
│  - PlacementContext (interface)                                │
│  - IGridOccupancy, ITargetingService                           │
│  - Pure C#, no Godot dependency                                │
│  - Runs headless (dedicated server)                            │
└─────────────────────────────────────────────────────────────────┘

Key Types by Layer

LayerPrimary TypesPurpose
GodotPlacementContext, PlacementSceneAdapter, PlacementInputControllerScene wiring, input, visuals
ECSPlacementSystem, ManipulationSystem, PlacementExecutionSystemBusiness logic, validation
CoreIGridOccupancy, ITargetingService, PlacementSettingsInterfaces, configuration

Plugin Architecture Pattern

GridPlacement uses the IEcsPlugin pattern for ECS integration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
public sealed class GridPlacementEcsPlugin : IEcsPlugin
{
    public void RegisterSystems(EcsWorld world, SystemRunner runner)
    {
        var placementGroup = new EcsSystemGroup("GridPlacement");
        placementGroup.Add(new PlacementExecutionSystem(world.Store, eventBus));
        placementGroup.Add(new ManipulationSystem(world.Store, eventBus));
        runner.Add(placementGroup);
    }
}

Godot calls plugin.Install(world) and uses ECS types directly. No facade layer.

Multiplayer Topologies

GridPlacement supports four topologies:

TopologyDescriptionServer
Single-playerAll systems run in one processN/A
Listen-serverOne player is also the hostHost process
Dedicated serverHeadless authoritative hostDedicated process
Local multiplayerSame device, multiple input sourcesN/A

The Four Seams (Listen-Server / Dedicated)

SeamWhatWhere you code
CatalogAll peers load same placeable assetsLobby / loading
IntentClient → Server: (placeableId, gridPos)RPC call
AuthorityOnly host runs placement pipelineGuard with Multiplayer.IsServer()
Event RelayServer → All: placement outcomerpc() broadcast

What the Plugin Provides

CapabilityType
Authoritative occupancyIGridOccupancy
Conflict detectionPlacementValidator
Headless loopPlacementExecutionSystem
Concurrent placersOwnerKey
ECS eventsIEcsBackendEvents
Save/restoreECS serialization

What the Plugin Does Not Provide

  • Network transport (ENet, WebSocket, Steam, etc.)
  • Lobby / matchmaking
  • Clock synchronization
  • Lag compensation

Last Updated: 2026-05-07