You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implements official spiral number-token placement for random maps to prevent adjacent red pips, wires the configuration through the game/CLI stack, and refactors tile model types into dedicated modules to break circular dependencies.
Changes
Official spiral number placement
Added official_spiral as the default number-placement mode for generated maps.
Added a spiral_land_coordinates(...) generator to walk land tiles in coast-following spiral order.
Added BASE_NUMBERS_IN_SPIRAL_ORDER and use it to assign number tokens after tile/resource placement while skipping the desert.
Applied this logic to base and mini map templates.
Kept random placement available for callers and tests that depend on the legacy fully-random setup.
CLI and game wiring
Added --config-number-placement to catanatron-play with official_spiral and random choices.
Extended GameConfigOptions, build_map(...), Game, and State so number-placement selection flows from the CLI into board creation.
Updated board-related helpers/tests that need stable legacy behavior to explicitly request random.
Model refactor
Moved tile dataclasses and related aliases into catanatron/models/tiles.py.
Moved the Coordinate alias into catanatron/models/coordinate_system.py.
Updated imports accordingly.
Test updates
Added coverage for spiral traversal ordering and validation errors.
Added repeated-map tests to verify official spiral placement avoids adjacent 6/8 tiles.
Added CLI coverage for random number placement.
Updated reproducibility expectations and feature/board tests to account for the new default placement.
Why
Random number-token placement can create adjacent 6 and 8 tiles, producing boards that are much swingier than standard Catan setups. This change makes generated boards follow the official spiral-style placement by default while preserving an escape hatch for fully-random layouts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements official spiral number-token placement for random maps to prevent adjacent red pips, wires the configuration through the game/CLI stack, and refactors tile model types into dedicated modules to break circular dependencies.
Changes
Official spiral number placement
official_spiralas the default number-placement mode for generated maps.spiral_land_coordinates(...)generator to walk land tiles in coast-following spiral order.BASE_NUMBERS_IN_SPIRAL_ORDERand use it to assign number tokens after tile/resource placement while skipping the desert.randomplacement available for callers and tests that depend on the legacy fully-random setup.CLI and game wiring
--config-number-placementtocatanatron-playwithofficial_spiralandrandomchoices.GameConfigOptions,build_map(...),Game, andStateso number-placement selection flows from the CLI into board creation.random.Model refactor
catanatron/models/tiles.py.Coordinatealias intocatanatron/models/coordinate_system.py.Test updates
6/8tiles.Why
Random number-token placement can create adjacent
6and8tiles, producing boards that are much swingier than standard Catan setups. This change makes generated boards follow the official spiral-style placement by default while preserving an escape hatch for fully-random layouts.Fixes #344