Skip to main content

Geometry Rules

Every parcel submitted to the protocol passes through a strict geometry pipeline before it lands on the map. This page documents every rule, the error code each rule produces when violated, and what to check when a transaction fails.

See also: How It Works → Three-Phase Collision · Register Land → Validation Rules · Hierarchy → Six Hierarchy Levels · Pricing → Area Bounds


Validation Pipeline

The protocol validates geometry in two stages: per-part checks first, then multipart topology. A failure at any step aborts the transaction and rolls back all state.


Per-Part Rules

Each convex part is validated independently before the polygon is assembled.

Vertex count

A part must have at least 3 vertices and at most 64 vertices.

Fewer than 3 vertices cannot form a polygon. More than 64 degrades SAT performance and signals an overly complex shape — decompose it into more parts instead.

Error: EBadVertices (polygon 2004, index 4001)

Coordinate bounds

Every vertex coordinate must satisfy x^W\hat{x} \leq W and y^W\hat{y} \leq W, where W=40075017000000W = 40\,075\,017\,000\,000 — one Earth circumference in Web Mercator at the protocol's fixed-point scale. Coordinates beyond this bound are physically meaningless (they exceed the planet's surface) and are rejected.

Error: ECoordinateOutOfWorld (polygon 2013)

Array length match

The xs and ys coordinate arrays must be the same length. A mismatch means the input is malformed.

Error: EMismatch (polygon 2005, index 4002)

Convexity

The part must be convex. The protocol computes the cross product of every consecutive edge pair and checks that all results share the same sign. A sign flip fails the check. Collinear vertices (zero cross product) are skipped — the protocol enforces weak convexity, permitting straight-line runs of vertices along an edge.

Error: ENotConvex (polygon 2003)

Minimum edge length

Every edge must be at least 1 meter in on-chain fixed-point units (10610^{-6} coordinate units). Edges shorter than this threshold are rejected regardless of the overall polygon size.

Error: EEdgeTooShort (polygon 2010)

Compactness floor

The protocol enforces an anti-sliver constraint using a Manhattan-perimeter proxy:

8,000,000×2×AreaMIN_COMPACTNESS_PPM×P128{,}000{,}000 \times 2 \times \text{Area} \ge \text{MIN\_COMPACTNESS\_PPM} \times P_1^2

where P1P_1 is the sum of dx+dy|dx| + |dy| across all boundary edges. Extremely thin or elongated shapes — long spikes, needle polygons — fail this check even if every edge is long enough individually.

Error: ECompactnessTooLow (polygon 2011)

Coordinate range

All coordinates must fall within the representable grid range. Coordinates that overflow the fixed-point grid are rejected immediately.

Error: ECoordinateTooLarge (index 4016)

Area bounds

The polygon's total area must fall within the level's configured minimum and maximum. Both limits are set per deployment and visible in the registration UI. See Pricing → Area Bounds for how area bounds affect cost per level.

Error: EAreaOutOfRange


Multipart Topology Rules

A polygon can contain up to 10 convex parts. When more than one part is present, the parts must satisfy four structural invariants.

Part count limit

No polygon may have more than 10 parts. If convex decomposition of your shape produces more, simplify the outline — fewer vertices, less concavity.

Error: ETooManyParts (polygon 2002, index 4010)

Interior disjointness

No two parts within the same polygon may share positive area. Parts that overlap each other — even slightly — are rejected.

Error: EPartOverlap (polygon 2006)

Exact shared-edge connectivity

Adjacent parts must share identical edges in reverse order: the same two vertex coordinates, listed in opposite winding direction. Approximate adjacency (nearby but not identical vertices) is not accepted.

Parts may branch — a single part can share edges with two or more neighbours, enabling T- or Y-shaped parcels. The only requirement is that every part is reachable from every other part via shared edges.

Error: EInvalidMultipartContact (polygon 2007)

Connected graph

All parts must form a single connected graph through their shared edges. Isolated parts — even if geometrically close — are rejected.

Error: EDisconnectedMultipart (polygon 2008)

Hole-free boundary

The outer boundary (edges with exactly one incident part) must form a single continuous, non-intersecting cycle. Topological holes inside the parcel are not permitted.

This rule has an important strategic consequence: no parcel can fully encircle another parcel's space. A ring-shaped polygon has two boundary cycles (outer and inner) and is always rejected. See Territory Competition → Why Full Encirclement Is Impossible for the gameplay implications.

Error: EInvalidBoundary (polygon 2009)


Touching vs. Overlap

Two parcels may share a boundary edge or a corner vertex. This is permitted — shared boundary has zero area and does not constitute overlap.

What the protocol forbids is positive-area intersection: any region where two parcels' interiors overlap, however small.

tip

When drawing next to an existing parcel, snap your vertices exactly to its boundary. A freehand point placed near — but not on — an existing vertex creates a micro-overlap that aborts registration.


SAT Guarantee

The Separating Axis Theorem deterministically detects any positive-area overlap between convex polygons using exact integer arithmetic. No floating-point tolerance, no false negatives — an intersection as small as a single fixed-point unit (10610^{-6} meters) is caught and rejected.


Error Code Reference

ErrorCodeWhat it means
EBadVerticespolygon 2004 / index 4001Part has fewer than 3 or more than 64 vertices
EMismatchpolygon 2005 / index 4002xs and ys arrays differ in length
ENotConvexpolygon 2003Cross-product sign flip — part is not convex
EEdgeTooShortpolygon 2010One or more edges shorter than 1 meter
ECompactnessTooLowpolygon 2011Shape is too thin or elongated
ECoordinateTooLargeindex 4016Coordinate outside the representable grid
EAreaOutOfRangeTotal area outside level min/max bounds
ETooManyPartspolygon 2002 / index 4010Polygon has more than 10 convex parts
EPartOverlappolygon 2006Two parts within the same polygon share positive area
EInvalidMultipartContactpolygon 2007Adjacent parts don't share exact identical edges
EDisconnectedMultipartpolygon 2008Parts don't form a connected graph
EInvalidBoundarypolygon 2009Outer boundary has a topological hole
EOverlapindex 4012Parcel overlaps an already-registered claim

Troubleshooting

EBadVertices — Count your vertices. Fewer than 3 means the shape isn't a polygon. More than 64 means the part is too detailed; split it into multiple parts.

EMismatch — Your coordinate arrays are out of sync. Check that every xs[i] has a corresponding ys[i].

ENotConvex — Find the vertex where the winding direction reverses. Common causes: a concave indent in what you thought was a convex part, or three collinear points in a row. Remove the middle collinear vertex or split the part at the concavity.

EEdgeTooShort — Zoom in on your polygon. Very short edges often appear near snapped vertices or at the junction between parts. Merge nearby vertices or move them apart.

ECompactnessTooLow — The shape is too thin relative to its perimeter. Widen the narrowest section or break the shape into separate parcels.

EPartOverlap — Two parts within your polygon overlap. Check the convex decomposition output — parts that share a boundary are fine, but any interior intersection fails.

EInvalidMultipartContact — Adjacent parts don't share exactly the same edge. Ensure the shared vertices are identical (same integer coordinates) and listed in reverse order across the two parts.

EDisconnectedMultipart — At least one part has no shared edge with the rest. Every part must connect to the group through a shared edge, not just proximity.

EInvalidBoundary — The outer boundary doesn't close into a single cycle. This usually means a hole in the parcel or a dangling edge. Verify that every boundary edge connects end-to-end.

EOverlap — Your parcel intersects an existing registered claim. The registration UI highlights the conflicting parcel. Adjust your boundary to avoid it, or snap exactly to its edge if you intend to be adjacent.