Connectors
Last updated
Was this helpful?
Last updated
Was this helpful?
The connectors workflow is the last I developed, but in my opinion it is the easiest to used and most expressive workflow in most situations. The only situation when for example the would be better, is when you have a large amount of unique neighbors, so you would need a large amount of connectors, which could be hard to manage.
In this tutorial I will define the connections for the spaceship example scene, here you can see the tileset:
The ring tile isn't composed of multiple tiles, instead it is a single tile that goes beyond its tile size. Without additional constraints, the ring tiles can intersect with other parts of the spaceship. The second ring uses the first ring as base tile, the only difference is that it rotates in the opposite direction.
The only tile that will be rotated is the transition between thin maintenance and thick spaceship sections. We could also duplicate the tile and rotate it by 180°, that would also improve the performance of the Wave Function Collapse solver.
We only need a single empty type, all outside areas of the spaceship are allowed to neighbor it, while the connection parts, where the spaceship will be connected to other spaceship tiles must not neighbor empty areas.
I'm using the Tile Collection Empty Assignment tool to change which sides may neighbor empty tiles.
Next let's set up the connectors themselves. In the tile collection I've created 4 connectors. One each for the large and small connections between spaceship parts, I called them Main and Maintenance, both of them bidirectional. Next we need two directional connectors, I called them Utility and Solar panel.
Next we have to assign connectors to the tiles. Once again, I'm using the Tile Collection assignment tool. Here are the final assignments:
Be careful, some of the circles are colored more transparent, because the editor doesn't recognize orthographic view at the time of writing this tutorial.
The last step is to set up the Tile Composer component. There are a few steps for this model:
Add the tile collection to the Tile Composer component.
Block the cockpit tile on the whole grid, we only want a single spaceship.
Create a border of empty space around the model, otherwise we might get cut off spaceship parts at the border.
Set a fixed position for a cockpit tile, this overrides the block.
Optional: Select a seed with a good looking result (you can fine tune the weights of each tile to improve the results)
I've already created a TileCollection component as parent for all tiles. Each of the tiles has to have the Tile component, you can use one of the to add batch add the tile component to all objects. The TileCollection uses a Box grid, but in this case it could have been a Rectangle grid instead, as the model always stays in one layer. You could easily extend it to create spaceships with 3d structures.