Skip to content

Get layout suggestions

By this stage, your game.bgi.yaml describes the box, material, contents, and which contents belong in each assembly. You have decided what stays together; now let BGI choose the compartment arrangement. If those inputs are not ready, start with Describe the contents and storage.

An automatic grid needs the IDs of its contents and an automatic interior. This is the assembly from Full example:

assemblies:
- id: insert
kind: grid
construction: open_grid_box
assembly: glue_allowed
members: [cards, tokens]
interior:
id: compartments
kind: auto

members assigns the storage requirements to this grid. kind: auto inside interior leaves their compartments for BGI to arrange. It does not ask BGI to decide which pieces should share a compartment: use a storage group for that.

BGI can turn a requirement only in the orientations you allow. A card stack might allow both flat orientations, for example, but upright storage needs an explicit choice. The declared allowances become part of the required space. BGI then adds floors, walls, dividers, and joints and checks the resulting outside size against the game box.

For a single grid, add this top-level section:

layout:
mode: auto
construction_mode: full_box
search:
budget: 100
top_k: 3
SettingDecision it makes
mode: autoAsk for candidate layouts before building.
construction_mode: full_boxPlan one grid. The name does not mean BGI expands every compartment to fill unused box space.
budgetMaximum number of candidate attempts, including rejected attempts. 100 is a starting point for this small project.
top_kMaximum number of successful candidates to save. 3 gives you a few alternatives to compare.

Start with as few layout restrictions as the game needs. Allowed orientations and sensible compartment sizes give BGI flexibility. Fixing every position can remove useful alternatives. If one region really must stay in place, use manual and mixed layouts to express that constraint.

For several grids or a grid beside existing containers, use construction_mode: local_groups. You still assign the contents of each grid; BGI can size and place their automatic interiors together. Example 039 shows separate card and token areas beside a fixed dice area and an existing box. This is a placement of grids, not an automatic decision to turn them into removable trays or add layers. Arranging designed trays uses a separate workflow.

For a removable tray, set kind: tray on that assembly, add positive side_clearance_mm: [left, right, front, back], and use construction_mode: local_groups. BGI then searches for separate compartments inside the tray and leaves space to lift it out. Example 075 shows one tray; Example 076 places two automatically divided trays side by side. Example 077 stacks two automatically divided trays with matching supporting footprints. For up to four separate requirements, Example 078 uses layout.search.member_partition: two_trays with empty members: [] in both tray templates to search their membership as well as layout and stack order. Example 079 changes that setting to one_or_two_trays and compares one divided tray with two divided trays, including supported stacks. In that mode the first template is the single-tray option. Example 080 adds one pinned existing container; BGI can place the trays beside it on one level or as a supported stack. Example 081 keeps one card deck in the first tray while the other needs remain free to move between trays. Example 082 keeps a constructed dice grid fixed while searching one or two trays for the remaining contents. Example 083 keeps separate dice and tile grids fixed while BGI searches the tray membership. Example 084 checks both supported stack orders beside a fixed dice grid. Example 085 keeps two existing closed boxes and their inventories fixed while searching the divided trays. Example 086 checks both stack orders beside an existing closed box. Example 087 compares all six supported stack orders for three trays whose contents are assigned in advance. Example 088 adds member_partition: three_trays to assign four separate needs among three empty tray templates, then search compartment grids and supported stack orders. Example 089 uses one_to_three_trays to compare one mandatory base tray with either or both additional trays; with at least three result slots, the best found candidate of each tray count stays visible. The fixed-storage variant keeps a card deck pinned to the primary tray while an existing closed box and a constructed dice grid retain their own positions and contents. Both three-template modes still exclude other local search constraints and fixed tray origins. Larger membership searches remain unsupported.

Run this command from the folder containing your project:

Terminal window
bgi game.bgi.yaml

BGI calculates the required storage space, tries layouts, and builds every retained candidate. The default output is build/<project-id>; repeat the command after editing the YAML to refresh it.

Open build/<project-id>/README.md. It shows the top-down layout and rendered assembly for each candidate and links to its full cutting bundle and saved .json recipe. report.md retains the detailed search and rejection information. For automation that needs only the search artifacts, use bgi solve game.bgi.yaml --output layouts separately.

Continue with Choose and build a layout to compare the suggestions and inspect the generated design.

If the report contains no candidates, look at the rejection reasons before changing the search budget. Check the space reserved above the insert, material thickness, permitted orientations, and the size of each storage requirement. A card stack that could lie in either direction may have been restricted to one; an oversized token compartment may reflect an estimate rather than a measurement.

When a reported compartment size is surprising, the requirements command can show how BGI calculated it. For other errors, use diagnostics.

If all saved candidates fit but are awkward to use, change a storage decision: split a card deck, keep a player set together, or preserve a fixed region. Then search again. Increasing the budget only helps BGI try more arrangements within its supported patterns; it cannot introduce a new construction type.