Trifecta Pattern Editor
This page explains what each part of the application does. The editor allows you to build, move, delete, import, and export patterns on a grid. It also validates placement rules, detects active synergies, and calculates an average production score across an infinite wrapping plane.
Main Objective
Design a valid and efficient pattern inside the grid while respecting the restrictions of each building.
What It Validates
Road connectivity, minimum or maximum distance conditions, and nearby building requirements in an infinite torus grid.
What It Shows
Visual errors, active synergies, and the average production value across the full base grid.
Import Array
Used to paste an existing pattern in array format and load it into the editor.
Paste your Python array here...
Paste an array with rows and columns. The system supports values such as '1', 'CS', or None. During import, the editor converts the content into a readable format and processes it.
W and H
These values let you repeat the imported pattern multiple times:
- W: repeats the pattern horizontally.
- H: repeats the pattern vertically.
Load Button
Applies the array to the grid. It also automatically adjusts the grid size to match the size of the imported pattern multiplied by the repeat values.
Import Adjustments
- The canvas is automatically cleared (reset) before the new import is placed.
- If a CS appears outside the first column, it is converted to C.
- Import does not use automatic roads: it sets Roads every X rows to 0.
Legend
Displays all available types with their color and name.
What It Represents
Each legend entry shows the building code, its name, and its color. This helps quickly identify pieces inside the grid.
Clicking an Entry
Clicking a legend item opens a panel with information about the selected type: size, base production, requirements, and possible synergies.
Grid Config
Controls the dimensions of the core pattern and the extended testing zones.
| Element | What It Does | Important Detail |
|---|---|---|
| W / H | Defines the core Width and Height of your pattern. | This is your base repeating tile. Average score is calculated based on this area. |
| Expand X / Y | Adds extra visual padding around your core grid. | Lets you see and interact with how your pattern loops into adjacent tiles (infinite plane). |
| Roads every X rows | Generates a road row every X rows. | If set to 0, no automatic roads are created. |
| Apply | Resizes or expands the grid keeping data intact. | Use this to add expansion margins without deleting your buildings. |
| Reset | Completely wipes the entire grid. | Deletes everything and restarts with a clean slate based on W/H inputs. |
Export
Allows you to convert the current grid into a reusable array.
W and H
Just like in import, these values repeat the current pattern before export:
- W: repeats the pattern horizontally.
- H: repeats the pattern vertically.
Array Output
Creates an output in array format with strings for building types and None for empty spaces. Note: Export only exports the core WxH area, ignoring Expand X/Y padding.
Utilities and Tools
These controls are used to edit the pattern and move through previous changes.
| Button | Function | How to Use It |
|---|---|---|
| Undo / Redo | Time travel for your edits. | Restores previous configurations, including W/H/Expand sizing changes. |
| Select (Copy/Paste) | Highlights an area to copy multiple buildings. | Drag to select an area, press Ctrl+C. Press Ctrl+V to enter Paste Mode and click to stamp it. |
| Move & Swap | Moves or swaps blocks. | First select a block, then click a destination or another block to swap. |
| Info | Shows detailed information about a block. | Click a placed piece to see its rules, current status, and synergies. |
| Delete | Deletes pieces. | Can be used with click and drag to delete several cells at once. |
Modes and Validation
These options control how the editor behaves and what visual signals are shown.
Free Mode
Ignores restrictions and allows overwriting or placing pieces in positions that would normally be invalid (including manual road placement).
Show Violations
Highlights buildings in pulsating red when they break one or more rules. This helps detect layout problems quickly.
Show Synergies
Highlights buildings in pulsating green when they have an active upgrade from proximity or a building combination.
Average Production
This is calculated as the total production of the pattern divided by the total number of cells in the base grid area (WxH).
Central Editor Area
This is the main editing zone where the grid is displayed and modified.
Core Pattern Boundaries
A solid 3px amber boundary isolates your core W x H pattern. Any cells rendered outside this boundary represent the simulated adjacent looping tiles (Expand X/Y).
What You See in Each Cell
Each cell shows the color of the placed building. In the top-left anchor cell, the type code is also displayed, for example 5 or CS.
Mass Selection
You can drag across multiple cells to paint, select, or delete. When pasting, a transparent preview of the copied blocks will follow your cursor.
Error or Confirmation
Right above the grid there is a text bar that reports successful actions, validation errors, or reasons why a placement failed.
Buildings Panel
From here you choose which type of piece you want to place on the grid.
| Element | Description | Size |
|---|---|---|
| CS | Seed Road. Only valid in the first column. | 1x1 |
| C | Normal Road. Must be connected to a Seed Road. | 1x1 |
| 1 | Field. | 1x1 |
| 2 | Scarecrow. | 1x1 |
| 3 | Farm House. | 1x1 |
| 4 | Tenants. | 1x1 |
| 5 | Landlord's. | 2x2 |
| 6 | Silo. | 2x2 |
| 7 | Orchard. | 1x1 |
| 8 | Farm Shed. | 2x2 |
| I8 | Warehouses. | 1x1 |
| 9 | Fruit Processor. | 2x2 |
| 10 | Food Plant. | 3x3 |
Keyboard Shortcuts
The application includes quick shortcuts for rapid editing.
Copy
Copies the buildings currently highlighted by the Select tool.
Paste
Activates Paste Mode, allowing you to stamp the copied array anywhere.
Undo
Reverts the last action performed.
Redo
Reapplies the action that was last undone.
Cancel / Deselect
Cancels an active drag, exits paste mode, or resets the current tool.