Skip to content

Place structures in the workshop automatically - #166

Open
tastybento wants to merge 2 commits into
developfrom
feature/auto-structures
Open

tastybento wants to merge 2 commits into
developfrom
feature/auto-structures

Conversation

@tastybento

Copy link
Copy Markdown
Member

What it does

/boxadmin areas structures auto places structures on the workshop's land.

  • A player gets a dialog with a slider (0 to 10) for each kind; typed, it takes names and counts: auto village:3 mansion igloo:2 bee. The console with no names lists what there is.
  • Each kind is rated from requirements.yml as needed, helps, or no effect on score.
  • Order: one of everything needed, one of everything that helps, one of the rest, then repeats a round at a time.
  • Each goes in a biome it belongs in (structure-places.yml, generated from the game's own data), inside the box, clear of other structures and of the start. Scoring ones go nearest the middle, others anywhere. Underground structures can sit under surface ones.
  • What cannot be placed is reported with the reason.

Also: pyramids, swamp hut, mineshaft, monument and buried treasure are no longer never in requirements.yml, since the game can build them whole.

Tested

Unit tests for the order, the choice of place and the ratings. On a scratch server from the console, asking for 213 structures placed 12 (2 villages, 2 igloos, ancient city, jungle temple, trial chambers, outpost, bastion, 3 bees) and reported the rest: no desert or swamp, no room for a mansion or more villages.

Not tested: the dialog, which needs a player.

Known

🤖 Generated with Claude Code

https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git

tastybento and others added 2 commits November 30, 2026 07:45
/boxadmin areas structures auto takes a list of structures and how many
of each, from a dialog or typed, and places them: what advancements
cannot do without first, then what helps, then the rest, and repeats
last. Each goes in a biome it belongs in, taken from the game's own
rules, inside the box and clear of other structures. What has nowhere
to go is left out and reported.

The structures the game can now build whole (pyramids, swamp hut,
mineshaft, monument, buried treasure) are no longer marked as impossible
in the requirements.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git
The sliders held a whole sentence, which did not fit. Each now shows
the structure's name and the number, coloured by what it does for the
score, and the dialog explains the colours once.

Building a whole structure on finished land made the game log a warning
for every block it would have tidied up later in a new chunk, hundreds
of lines for a stronghold. Those are turned off while it builds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant