baba-is-auto
C++17 Baba Is You simulator
Loading...
Searching...
No Matches
Rule-language capability matrix

Rule-language capability matrix

This page records the rule language implemented by the current simulator. The comparison baseline is Baba Is You version 481d, but the matrix is bounded to tokens exported by the simulator's shared .def files. Official words absent from those files, including BECOME, FACEDBY, HOLD, HAPPY, and ANGRY, cannot be tokenized and are unsupported as a class. An ObjectType enum value is not, by itself, a supported semantic. Statuses mean:

  • Implemented: current behavior has focused executable evidence.
  • Partial: a documented subset works, but the named boundaries remain.
  • Unsupported: the token is inert or its special meaning is deliberately not claimed.

Map links point to repository-authored fixtures. The rule_language_examples.txt rule gallery records original, representative layouts for slices whose focused tests construct executable scenarios in code.

Rule references

External references are comparison aids; repository code, focused tests, and maps define the simulator's behavior.

Grammar

Surface Status Current behavior Executable evidence Representative map
Ordinary noun subjects and predicates Implemented Ordinary noun subjects form IS property rules and IS noun transformations. The narrower HAS behavior and inert MAKE token are listed separately below. Game - Basic, Game - Transformations use one snapshot baba_is_you.txt, transformations.txt
AND subject and predicate chains Implemented Subjects and predicates expand into independent rule combinations. Condition targets and consecutive conditions may also be joined with AND. Verb chaining is not supported. Game - Arbitrary AND Chains, Game - Conditional MOVE rules and_chains.txt, move_conditions.txt
NOT Partial NOT LONELY and NOT before ON, NEAR, or FACING are parsed. Negated subjects, predicates, condition targets, repeated NOT, and nested forms are unsupported. Game - Conditional MOVE rules, Game - NOT NEAR condition moves a distant object, Game - NOT FACING condition moves an object facing away move_conditions.txt, NOT NEAR and NOT FACING examples
Malformed or trailing tokens Partial Missing or malformed required fields create no rule from that starting position. Once a valid predicate prefix is complete, later tokens that do not continue an AND predicate chain are ignored. Scanning continues at later positions. Game - Rule after leading AND, Game - Valid rule prefix ignores trailing token and_chains.txt, BABA IS YOU NOT

The noun vocabulary is the set in NounType.def, with EMPTY, TEXT, ALL, GROUP, LEVEL, CURSOR, and IMAGE described separately below. Every other exported noun uses ordinary noun behavior.

Verbs

Verb Status Current behavior Executable evidence Representative map
IS Implemented Applies supported properties and directions, or performs snapshot-based noun transformations. Multiple noun predicates may produce multiple objects; an identity result protects the source. Game - Conditional YOU applies per instance, Game - Transformations use one snapshot conditional_you.txt, transformations.txt
HAS Partial Noun predicates are produced only when an OPEN/SHUT interaction destroys the subject. Other destruction paths do not run HAS, and property predicates do not grant properties. Game - OPEN and SHUT destruction spawns HAS before movement, Game - HAS does not grant properties BABA HAS ROCK, has_property.txt
MAKE Unsupported The parser recognizes MAKE as a verb, but no runtime phase consumes it. No positive executable evidence. No conformance map yet.

Conditions

Conditions restrict individual subject instances. RuleManager::FindPlayer and RuleManager::HasProperty intentionally query unconditional rules only; Game performs position-aware condition evaluation.

Condition Status Current behavior Executable evidence Representative map
LONELY Implemented Matches a cell containing only the subject instance. NOT LONELY inverts that result. Game - Conditional MOVE rules move_conditions.txt
ON Implemented Matches other instances on the subject's cell. Repeated targets require distinct matching instances. Game - Conditional transformations apply per instance conditional_transformation.txt
NEAR Implemented Searches the surrounding 3-by-3 area, including other instances on the subject's cell and excluding the subject instance itself. Game - Conditional MOVE rules move_conditions.txt
FACING Implemented Matches a noun in the cell ahead or the subject's current UP, DOWN, LEFT, or RIGHT direction. Directionless EMPTY does not match until a direction rule assigns it one. Game - Directionless EMPTY does not satisfy FACING, Game - Later direction rules set EMPTY FACING direction conditional_empty_facing.txt, conditional_empty_assigned_facing.txt
NOT ON, NOT NEAR, NOT FACING Partial Negation is implemented for each listed condition. Nested and target negation remain unsupported. Game - Conditional MOVE rules, Game - NOT NEAR condition moves a distant object, Game - NOT FACING condition moves an object facing away move_conditions.txt, NOT NEAR and NOT FACING examples
TEXT, EMPTY, and ALL targets Implemented TEXT matches text instances, EMPTY matches blank cells where applicable, and ALL expands to the simulator's remembered ordinary-noun set with the special-noun exclusions below. Game - MOVE special noun conditions, Game - MOVE ALL conditions exclude special nouns move_special_conditions.txt, move_all_condition.txt

Special nouns

Noun Status Current behavior Executable evidence Representative map
EMPTY Partial Blank cells are evaluated as synthetic instances for supported properties, conditions, MOVE, and IS transformations without persistent empty objects. Directionless MOVE selects a random direction unless a direction rule supplies one. Full production and all-layer semantics are not defined. Game - Conditional EMPTY transformations apply per position, Game - EMPTY properties are evaluated at their position, Game - directionless EMPTY MOVE uses a random direction conditional_empty_transformation.txt, EMPTY IS STOP, EMPTY IS MOVE
TEXT Partial As a subject it selects text instances, and all text is pushable without an explicit rule. In noun-producing contexts, an icon source becomes its matching noun text while a text source remains itself; the runtime never produces ICON_TEXT. Other official TEXT combinations are not claimed. Game - Special noun TEXT subject transforms every text, Game - Special noun TEXT predicate writes the source noun, Game - Text is push without an explicit rule TEXT IS ROCK, BABA IS TEXT, baba_is_you.txt
ALL Partial As a subject it selects noun icons except TEXT, EMPTY, and LEVEL. As an IS predicate it expands to ordinary nouns accumulated from the map at load or reset and before each transformation phase, excluding ALL and GROUP, without duplicating a type already on the cell. Membership grows when a new noun appears and persists after removal. Game - Special noun ALL subject transforms every member, Game - Special noun ALL membership persists after removal, Game - Special noun ALL learns nouns added after load ALL IS LOVE, BABA IS ALL
GROUP Unsupported The parser accepts the noun token, but transformation subjects and predicates explicitly skip its special meaning. Game - Unsupported GROUP predicate does not create an icon No conformance map; the negative rule is constructed by the test.
LEVEL Unsupported No single-map meaning is defined. Incidental enum conversion or internal ALL exclusions are not a supported rule surface. No focused executable evidence. No conformance map yet.
CURSOR Unsupported Its map-selection and base-rule meaning are not implemented. Incidental generic noun conversion is not claimed as special-noun support. No focused special-meaning evidence. No conformance map yet.
IMAGE Unsupported Its Gallery-specific meaning is not implemented. Incidental generic noun conversion is not claimed as special-noun support. No focused special-meaning evidence. No conformance map yet.

Property predicates

These properties are effective only through IS. Conditions may restrict the subject instances receiving any implemented property.

Properties Status Current behavior Executable evidence Representative map
YOU Implemented Selects player-controlled instances and participates in win/defeat state. Game - Conditional YOU applies per instance conditional_you.txt
STOP, PUSH Implemented Block and push during movement; PUSH overrides STOP on the same instance. Game - PUSH overrides STOP on the same instance conditional_push_stop.txt
MOVE Implemented Moves matching persistent objects in deterministic rounds using their facing direction. A directionless synthetic EMPTY selects a random direction unless a direction rule supplies one. Game - MOVE uses phase snapshots and stacked counts, Game - directionless EMPTY MOVE uses a random direction move_conditions.txt, move_rules.txt, EMPTY IS MOVE
WIN Implemented Wins when a YOU instance shares a cell with a WIN instance. Game - Won off_limits_bug.txt
DEFEAT Implemented Removes overlapping YOU instances during the effect phase. Game - DEFEAT conditions use one effect-phase snapshot conditional_defeat_snapshot.txt
SINK Implemented Removes all instances from an occupied sink cell during the effect phase. Game - Conditional overlap effects apply per instance conditional_sink.txt
HOT, MELT Implemented A cell containing a matching HOT instance removes matching MELT instances. Game - HOT and MELT conditions use one effect-phase snapshot conditional_hot_melt_snapshot.txt
OPEN, SHUT Implemented Matching instances destroy each other during movement and existing-overlap resolution; destruction is the implemented HAS trigger. Game - OPEN and SHUT destroy each other during movement, Game - existing OPEN and SHUT overlaps use opener priority, Game - OPEN and SHUT destruction spawns HAS before movement BABA IS OPEN, DOOR IS SHUT
WEAK Implemented Removes a matching object on a blocked move or an existing overlap, subject to the documented turn timing. Game - STOP WEAK allows entry and is destroyed ROCK IS WEAK
UP, DOWN, LEFT, RIGHT Partial Persistent instances use stacked-rule counts and deterministic clockwise tie breaking to set facing direction. Synthetic EMPTY direction rules are resolved separately. No broader directional-property semantics are claimed. Game - direction properties use their stacked counts, Game - tied direction properties choose clockwise from facing Tied KEKE direction rules
LOCKED_UP, LOCKED_DOWN, LOCKED_LEFT, LOCKED_RIGHT Partial Synthetic enum-only properties block movement in one direction. They are not text tokens in PropertyType.def. Game - Conditional PUSH observes directional lock, Game - YOU cannot move through a directional lock conditional_push_scope.txt, locked_you.txt
FLOAT Partial Separates OPEN/SHUT interactions by float layer. It is not applied to the other overlap/effect properties. Game - OPEN and SHUT require matching FLOAT layers KEY IS OPEN, WALL IS SHUT/FLOAT
SAFE Partial Protects participants in implemented OPEN/SHUT interactions. General destruction immunity is not implemented. Game - SAFE OPEN and SHUT objects survive movement interactions TILE IS OPEN/SAFE, DOOR IS SHUT
PULL, SWAP, TELE, FALL, SHIFT, MORE, WORD, BEST, SLEEP, RED, BLUE, HIDE, BONUS, END, DONE Unsupported These names are exported enum values with no runtime behavior hook. No positive executable evidence. No conformance maps yet.

Python-visible surface

  • Python exposes the C++ ObjectType names from the shared .def files plus the synthetic LOCKED_* values. Export does not upgrade an unsupported token to supported behavior.
  • pyBaba.Game runs the same core implementation. Focused parity examples cover AND chains, HAS not granting properties, special condition targets, EMPTY facing, and TEXT/ALL transformations.
  • RuleCondition exposes op, targets, and negated; its binding does not validate that op is one of the supported condition tokens. The API is covered by test_rule_conditions_are_visible_in_python.
  • RuleManager::FindPlayer and RuleManager::HasProperty report only unconditional IS rules. Conditional behavior must be observed through Game with a concrete position.
  • Some C++ behavior rows have no focused Python parity test yet. They remain C++-implemented behavior, not a promise of Python test coverage.

Next semantic gaps

The open follow-ups define the next boundaries without requiring a parser redesign:

  1. IS NOT properties, IS NOT nouns, and NOT precedence
  2. MAKE and WORD
  3. GROUP and complete EMPTY
  4. complete TEXT and ALL
  5. bounded single-map LEVEL