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.

Text Field

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.

Repeat Pattern

W and H

These values let you repeat the imported pattern multiple times:

  • W: repeats the pattern horizontally.
  • H: repeats the pattern vertically.
Load Array

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.

Special Behavior

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.

Visual

What It Represents

Each legend entry shows the building code, its name, and its color. This helps quickly identify pieces inside the grid.

Interaction

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.
When automatic roads are generated, the first cell of each road row is created as CS, and the rest of the row becomes C.

Export

Allows you to convert the current grid into a reusable array.

Repeat Pattern

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.
Export Pattern

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.
Outside of God Mode, roads cannot be moved or deleted freely.

Modes and Validation

These options control how the editor behaves and what visual signals are shown.

God Mode

Free Mode

Ignores restrictions and allows overwriting or placing pieces in positions that would normally be invalid (including manual road placement).

Check Rules

Show Violations

Highlights buildings in pulsating red when they break one or more rules. This helps detect layout problems quickly.

Check Synergies

Show Synergies

Highlights buildings in pulsating green when they have an active upgrade from proximity or a building combination.

Average Score

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.

Amber Borders

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).

Grid Identifiers

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.

Copy/Paste & Drag

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.

Status Bar

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
CSSeed Road. Only valid in the first column.1x1
CNormal Road. Must be connected to a Seed Road.1x1
1Field.1x1
2Scarecrow.1x1
3Farm House.1x1
4Tenants.1x1
5Landlord's.2x2
6Silo.2x2
7Orchard.1x1
8Farm Shed.2x2
I8Warehouses.1x1
9Fruit Processor.2x2
10Food Plant.3x3
Each button also shows the piece size so you can better plan the required space before placing it.

Keyboard Shortcuts

The application includes quick shortcuts for rapid editing.

Ctrl + C

Copy

Copies the buildings currently highlighted by the Select tool.

Ctrl + V

Paste

Activates Paste Mode, allowing you to stamp the copied array anywhere.

Ctrl + Z

Undo

Reverts the last action performed.

Ctrl + Y

Redo

Reapplies the action that was last undone.

Escape

Cancel / Deselect

Cancels an active drag, exits paste mode, or resets the current tool.