Storage requirements and search
A component entry describes what you own; a storage requirement describes the clear space it needs. BGI calculates requirements before checking a manual compartment or searching for an automatic layout. When a compartment seems unexpectedly large, the requirements command shows the calculated IDs, counts, sizes, and permitted orientations.
From measurements to clear space
Section titled “From measurements to clear space”| Input kind | How its requirement is formed | Useful check |
|---|---|---|
explicit | Uses declared clear_min_mm and allowed XY orientations. | Confirm the figures are usable inside a compartment. |
cards | Uses card size, count, effective thickness or measured stacks, split counts, allowance, and flat or upright orientations. | Check sleeve thickness and whether upright storage was allowed. |
objects | Uses object size, a declared three-axis count arrangement, gaps between objects, outer allowance, and allowed axis permutations. | Check the arrangement, rather than assuming BGI will choose how many objects go in each row. |
loose | Uses measured bulk volume, or solid volume and fill fraction, against explicitly listed footprints and heights. | Check that one of those shapes has enough capacity; an estimated volume is still an estimate. |
Named instances make separate requirements from one component template. A groups[] entry can instead make one packing unit from several requirements: an ordered row, positioned arrangement, compatible stack, or explicitly measured mixed bulk volume. The group takes its members’ place in compartment assignments; its members remain identifiable in the result. Grouping is an instruction from you, not an automatic decision to combine pieces. See storage and construction and the project file reference for fields and examples.
assemblies[].members says which requirements a grid must store. In a manual tree, each compartment’s contents assigns its requirement. BGI checks assignment completeness and whether a permitted size and orientation fits the declared clear dimensions. A compartment holding multiple kinds of loose content needs a declared group. An existing closed container is different: containers[].outer_mm reserves its measured outside size plus removal clearance. Its inventory does not create a constructed compartment or prove that everything inside it fits.
Ordinary compartment layouts: solve
Section titled “Ordinary compartment layouts: solve”An automatic project gives BGI the storage requirements, permitted shapes, box and material dimensions, and a layout.search.budget. Search tries supported compartment arrangements and placements. Before returning a candidate, BGI checks its constructed outside size, box space, material rules, cut paths, and any requested sheets. The report ranks candidates that pass those checks.
The current search covers compact X or Y splits, some T arrangements, aligned crossings and grids, and declared fixed regions. fixed_order, fixed_slots, fixed_origin_mm, fixed_subtrees, and interior_template constrain parts of the search when you already know where they belong. It does not explore every conceivable tray, freeform compartment, or vertical stack. A search budget counts attempted candidates, including rejected ones.
Declared optional_groups let the same search compare a shared row with separate compartments. Fixed blocks and unrelated placements stay fixed. Order, slots, and allowed shapes continue to constrain each choice; BGI filters shapes by the resulting number of packing units. The current search does not invent group members or group geometry on its own.
bgi solve game.bgi.yaml --output search-resultsRead search-results/report.md for the outcome, candidate list, and rejection reasons. no_candidate means BGI found no design within the patterns and attempt limit used. Check the calculated sizes, allowed orientations, fixed constraints, box reserves, and material thickness before increasing the budget. If a candidate suits your game, build its saved file:
bgi build game.bgi.yaml --solution search-results/candidate-001.json --output insert-bundleUse the filename actually listed in the report. BGI reconstructs and checks the candidate against the project during build. Full example provides a complete worked project, and the diagnostics reference helps interpret failures.
Compare holder types: design
Section titled “Compare holder types: design”Use bgi design when you want to compare ways to hold the same contents, such as divided trays and individual dice seats. An active storage_search section selects this workflow; ordinary automatic layout projects use solve. explore is a separate workflow for repositioning already designed removable trays.
Describe the original component facts, then assign every normalized source exactly once through storage_search.assemblies[].members. For split card stacks, use the component source ID; for named instances, use the expanded instance ID; for a declared shared group, use its group ID. BGI preserves the complete quantities and fixed memberships. Separate requirements get separate compartments unless you explicitly declare a shared storage group.
Each of one to four holders declares its permitted families. A single family fixes the construction; several families permit a comparison. By default, this workflow places holders on one level. Exactly two ordinary trays can also use the pair recipes below to compare supported stacks. Existing containers, fixed obstacles, overhangs and automatic regrouping remain outside this workflow.
| Family | Facts and configuration you supply |
|---|---|
ordinary-tray-v1 | Clear-space requirements and permitted orientations; up to 20 requirements per holder. |
double-wall-v1 | The same requirements, plus explicit double_wall.border_mm and floor_raise_mm offers; up to 16 cavities. |
d6-locator-v1 | Known cubic D6 dimensions and quantities, plus the complete d6_locator seat, opening, exposure, finger and lift settings. Grids have one to three rows and columns, up to nine seats. |
leaning-deck-v1 and inclined-slots-v1 | Complete card facts and named card_options containing the full deck or slots configuration. A channel holds one requirement with up to 64 cards; separate seats hold one to eight cards each, up to twelve seats. |
profile-locator-v1 | Calibrated constant-cross-section profile facts, quantities and piece identities, plus named profile_options with complete profile_locator configuration; up to nine explicitly assigned pieces in one to three rows and columns. |
BGI does not infer dice geometry from a bulk volume, individual card thickness from a measured total, or a body’s cross sections from a single silhouette. A permitted family can be excluded when its facts or construction cannot pass the checks; the report explains why.
A complete starter
Section titled “A complete starter”Save the following as game.bgi.yaml. Its dice dimensions and token space are synthetic planning inputs, not measurements of your game. Replace them with your own facts before fabrication.
schema_version: 1readme: Synthetic 16 mm dice and a declared token space compare ordinary divided trays, individual D6 seats and double-wall trays. The bounded gallery keeps every selected choice; its first recommendation also has a directly reconstructed bundle. Access counts are digital checks, not measured comfort, laser fit or transport retention.project: {id: storage-designs, name: Synthetic dice and token designs}box: {inner_mm: [200, 200, 100]}material: {profile: de-mdf-3mm, overrides: {thickness_mm: 3, fit_clearance_mm: 0, kerf_mm: 0.16}}components: - {id: dice, kind: d6, count: 2, cube_mm: 16, measurement_basis: synthetic} - {id: tokens, kind: explicit, clear_min_mm: [30, 30, 30], orientations: [xy]}storage_search: schema_version: 1 budget: 64 top_k: 3 assemblies: - id: dice-tray members: [dice] families: [ordinary-tray-v1, d6-locator-v1] side_clearance_mm: [1, 1, 1, 1] d6_locator: columns: [2] seat_pitch_mm: [32, 32] opening_clearance_mm: 0.4 deck_top_above_support_mm: 8 minimum_exposed_mm: 6 finger_clearance_mm: [10, 10, 6] lift_clearance_mm: 20 access_state: on_table - id: token-tray members: [tokens] families: [ordinary-tray-v1, double-wall-v1] side_clearance_mm: [1, 1, 1, 1] double_wall: {border_mm: [20], floor_raise_mm: [0]}bgi design game.bgi.yaml --output designs --budget 64 --top-k 3Open designs/README.md for the comparison and designs/report.json for its structured details. Every retained candidate has a saved choice and a complete bundle. Running bgi game.bgi.yaml with this active source creates the same kind of gallery under build/storage-designs.
Rows and permitted dimension changes
Section titled “Rows and permitted dimension changes”By default, holders are compared in single X or Y rows. To also permit two rows, add this field inside the starter’s existing storage_search section:
layout_recipes: [storage-rows-v1, storage-shelves-v1]This is an addition to the complete source above. Two-row layouts require two to four holders, keep both rows nonempty and remain on the box floor. Despite the shelves name, they do not create shelves or stacked levels. The gallery records the row count, axis, holder order and split between rows. Omitting the field, or permitting only [storage-rows-v1], keeps the default row behavior. Compact placement must still pass neighboring-holder access checks.
For explicitly permitted size changes, change the complete starter’s storage_search.schema_version to 2 and add this separate section at the project root. Keep the root project schema_version: 1:
dimensioning: schema_version: 1 max_variants: 8 parameters: - id: token-left-border group: token-tray role: border_x_min range_mm: {min: 20, preferred: 24, max: 30}This addition lets the double-wall token holder’s left border vary from 20 to 30 mm, with 24 mm preferred. Its usable token compartment and the other unbound dimensions stay fixed. The ordinary token-holder alternative has no double-wall border, so this parameter excludes that family combination rather than silently disappearing. max_variants limits the finite measure-offer list; the search budget still limits the shared work.
This is a complete V2 change to the starter, not a standalone project. Only supported compartment/split and double-wall border/floor-raise roles can vary; functional dice, card and profile geometry stays fixed. After adding the version pair and valid parameter, inspect the generated selectors with:
bgi config game.bgi.yaml --resolved --jsonFor other parameter forms, the complete project schema describes the syntax. Use the actual IDs and roles shown by config; selector fields identify a generated compartment or split, while the border parameter above identifies its holder directly.
Compare two ordinary trays as a stack
Section titled “Compare two ordinary trays as a stack”For exactly two holders, permit tray-pairs-v1 to compare both orders in X and Y and both stack orders. The permitted recipe set can contain one to four distinct names, including rows and two rows together with the pair recipes. Both chosen constructions must be ordinary-tray-v1; specialized holders retain their supported row layouts.
This complete synthetic starter stores one 16 mm D6 in each tray:
schema_version: 1project: {id: pairs, name: Pairs}box: {inner_mm: [26, 26, 70]}material: {profile: de-mdf-3mm, overrides: {thickness_mm: 3, fit_clearance_mm: 0, kerf_mm: 0.16}}components: - {id: part-a, kind: d6, count: 1, cube_mm: 16, measurement_basis: synthetic} - {id: part-b, kind: d6, count: 1, cube_mm: 16, measurement_basis: synthetic}storage_search: schema_version: 1 layout_recipes: [tray-pairs-v1] assemblies: - {id: tray-a, members: [part-a], families: [ordinary-tray-v1], side_clearance_mm: [1, 1, 1, 1]} - id: tray-b members: [part-b] families: [ordinary-tray-v1] side_clearance_mm: [1, 1, 1, 1]Run bgi design game.bgi.yaml --output designs to inspect its checked choices. A stack needs matching outside footprints, a supported wall ring, enough box height and a clear removal sequence. The upper tray is removed first; the gallery and saved choice record the order. Geometry checks do not establish physical strength, fit or comfortable handling.
Pair recipes also support version 2 with explicitly bound ordinary compartment dimensions. Other unbound facts stay fixed; the search does not silently enlarge compartments to make a stack. Changed permitted recipes require a new saved choice.
Automatically assign contents to two trays
Section titled “Automatically assign contents to two trays”Versions 1 and 2 can distribute two to four independently assignable needs or explicit storage groups between two ordinary trays. Name the primary tray explicitly; its declared members stay pinned there, while the other template starts empty. Both selected trays remain nonempty. An explicit group stays indivisible. Each normalized source must have one need; explicit component instances with their own source IDs are supported, sources expanding into several separate needs are outside this bounded mode.
This complete starter declares four synthetic 16-mm D6 dice and assumed box/material values. It pins part-a to tray-a and compares supported stacks with different assignments of the remaining dice. Replace the assumptions with your project’s facts before fabrication.
schema_version: 1project: {id: memberships, name: Four synthetic dice in two trays}box: {inner_mm: [48, 26, 70]}material: {profile: de-mdf-3mm, overrides: {thickness_mm: 3, fit_clearance_mm: 0, kerf_mm: 0.16}}components: - {id: part-a, kind: d6, count: 1, cube_mm: 16, measurement_basis: synthetic} - {id: part-b, kind: d6, count: 1, cube_mm: 16, measurement_basis: synthetic} - {id: part-c, kind: d6, count: 1, cube_mm: 16, measurement_basis: synthetic} - {id: part-d, kind: d6, count: 1, cube_mm: 16, measurement_basis: synthetic}storage_search: schema_version: 1 member_partition: {mode: two_trays, primary: tray-a} layout_recipes: [tray-pairs-v1] budget: 1000 top_k: 3 assemblies: - {id: tray-a, members: [part-a], families: [ordinary-tray-v1], side_clearance_mm: [1, 1, 1, 1]} - {id: tray-b, members: [], families: [ordinary-tray-v1], side_clearance_mm: [1, 1, 1, 1]}Run bgi design game.bgi.yaml --output designs and use the same saved-choice/recipe commands described above. Each assignment shares the global work budget and ranking; partition_preparations counts the preparation before its template and placement attempts. Original label panels and contents stay bound; an assignment violating a label is rejected. Saved choices rebuild the selected assignment without another search.
The mode requires two ordinary-tray-v1 policies. This two_trays mode keeps both trays active. The variable-count modes below also compare fewer or more trays; specialized families and fixed extra objects remain outside automatic assignment. Rows and two-row recipes may also be permitted; stack support remains a checked property of the complete candidate. Without opt-in, the declared fixed membership is unchanged.
Combine automatic assignment with permitted size changes
Section titled “Combine automatic assignment with permitted size changes”The four synthetic dice above can also be compared with equal 18-mm cavity widths.
Change storage_search.schema_version to 2 and add the following section at the
project root. Keep root project schema_version: 1. Each larger cavity and each
parent width has its own explicit permission; enlarging a child alone cannot
change a fixed parent. These prototype values are assumptions, not measurements.
dimensioning: schema_version: 1 max_variants: 16 parameters: - {id: tray-a-width, group: tray-a, node: tray-a-node-1, role: interior_x, range_mm: {min: 16, preferred: 35, max: 39}} - {id: tray-a-leaf-2, group: tray-a, compartment: tray-a-node-2, role: cavity_x, range_mm: {min: 16, preferred: 16, max: 20}} - {id: tray-a-leaf-3, group: tray-a, compartment: tray-a-node-3, role: cavity_x, range_mm: {min: 16, preferred: 16, max: 20}} - {id: tray-b-width, group: tray-b, node: tray-b-node-1, role: interior_x, range_mm: {min: 16, preferred: 35, max: 39}} - {id: tray-b-leaf-2, group: tray-b, compartment: tray-b-node-2, role: cavity_x, range_mm: {min: 16, preferred: 16, max: 20}} - {id: tray-b-leaf-3, group: tray-b, compartment: tray-b-node-3, role: cavity_x, range_mm: {min: 16, preferred: 16, max: 20}} alignments: - id: equal-cavities members: - {group: tray-a, compartment: tray-a-node-2} - {group: tray-a, compartment: tray-a-node-3} - {group: tray-b, compartment: tray-b-node-2} - {group: tray-b, compartment: tray-b-node-3} measure: cavity_x target_mm: 18 strength: required allocation: equal_by_priorityThe named slots describe the compartment structure of each candidate. Their contents can differ between assignments while original component dimensions and pinned contents remain fixed. Assignments without all declared slots are rejected before template attempts; a target supported by no assignment is an input error. The report counts prepared and rejected assignments separately and retains the separate search and measure limits. Saved choices reconstruct the selected assignment and sizes directly. These digital stacks do not establish laser fit, physical strength or comfortable handling.
Read the search limits
Section titled “Read the search limits”The shared budget counts template attempts, rejected work, duplicate work and complete placement checks. The membership mode also counts partition preparation; the dimensioned path also counts measure preparation and allocation attempts. budget_exhausted means another attempt was needed after the work allowance ran out. measure_limit reports a bounded measure-list cutoff; finite_exhausted means the permitted finite offers were exhausted. None proves that your game has no possible insert or that the result is globally optimal.
Continue with Choose and build a layout to compare the checked targets, save a choice and rebuild it without searching again.
Compare one, two or three trays
Section titled “Compare one, two or three trays”Use one_or_two_trays with two ordinary templates to compare the primary alone
with both trays. With three templates, three_trays requires all three and
one_to_three_trays keeps the primary while either, neither or both other
options may be omitted. Optional templates start empty. Each whole source has
one need; use two to four sources for two templates, three to four for three.
Primary pins stay fixed; a mandatory three-tray assignment needs at least two
unpinned sources. Components remain in separate compartments unless explicitly grouped.
Permit recipes fitting some possible active count: rows for all counts, shelves
from two, tray-pairs-v1 for two and tray-triples-v1 for three ordinary trays.
The latter reuses 42 existing arrangements: rows, paired stacks beside a single
tray and full three-tray stacks. The gallery describes support and removal order.
With enough recommendation slots, variable modes retain the best observed design of each active count and sort the final selection by the normal ranking. Reports name the active count, original memberships and omitted template IDs. A count missing when the budget ends is still unknown. Saved choices and recipes rebuild the selected activity directly and bind every original option, including omitted ones. Version 2 checks all declared size targets for each assignment; a target in an omitted tray excludes that assignment. Physical fit and strength remain unmeasured.