Skip to content

Design and Implement the Condition Builder #780

Description

@AerunDev

As a game developer
I want to visually build logical conditions through a dedicated Condition Builder
So that I can express gameplay logic without writing Ruby code while keeping my events readable, maintainable and scalable

The Condition Builder is the modern replacement for RPG Maker XP's Conditional Branch command.

Rather than exposing a fixed command with hardcoded inputs, Pokémon Studio provides a reusable visual component capable of composing logical expressions from conditions exposed by the Condition Registry (see #781).

The builder itself is completely generic: it knows how to build conditions, but not which conditions exist.

This separation ensures that new gameplay systems (Quests, Day Care, Pokédex, Plugins, etc.) can extend the available conditions without requiring modifications to the builder itself.

Objectives

The Condition Builder should:

  • replace RPG Maker XP's Conditional Branch editor
  • provide a modern and discoverable UX
  • remain completely independent from gameplay logic
  • support progressively richer gameplay systems through the Condition Registry
  • become a reusable component across Pokémon Studio

Acceptance Criteria

General Component

  • A reusable Condition Builder component is available.
  • The component can be embedded anywhere a logical condition is required (for yet, with the Event Builder).
  • The component follows the Pokémon Studio design system.
  • The component is independent from any specific gameplay system.
  • The component retrieves available conditions from the Condition Registry.

Condition Editing

Users can create one or more conditions.

For each condition, the builder allows selecting:

  • a condition category
  • a condition
  • a comparison operator
  • one or more values

The builder automatically adapts its UI according to the selected condition definition.

Examples include:

  • Boolean toggle
  • Numeric input
  • Text input
  • Enum selector
  • Multi-select
  • Database selector
  • Duration picker

The user never manually chooses an editor type.

Dynamic Behaviour

  • Available categories are provided by the Condition Registry.
  • Available conditions depend on the selected category.
  • Available operators depend on the selected condition.
  • Value editors adapt automatically to the selected operator.
  • Invalid combinations cannot be created.
  • The interface updates immediately after every change.

Logical Groups

The builder supports logical expressions.

Users can:

  • add conditions
  • group conditions
  • combine groups using AND
  • combine groups using OR (not for the first level which will require two different nodes)
  • nest groups
  • reorder conditions and groups
  • remove conditions and groups.

The visual hierarchy clearly represents the logical evaluation order.

User Experience

The builder should prioritize:

  • readability
  • discoverability
  • progressive disclosure
  • minimal number of clicks
  • consistency with the rest of Pokémon Studio.

Only relevant information should be displayed at each step.
The interface should guide users toward valid conditions rather than relying on validation errors.

Serialization

  • The complete logical tree can be serialized
  • Serialized conditions reference stable identifiers provided by the Condition Registry
  • The logical tree can be deserialized without information loss
  • Unknown condition identifiers are handled gracefully

Accessibility

  • The builder is fully keyboard accessible.
  • All interactive controls expose visible focus states.
  • No interaction relies exclusively on mouse hover.
  • Controls follow Pokémon Studio accessibility guidelines.

Documentation

  • User documentation explains:

    • creating conditions
    • grouping conditions
    • combining AND / OR expressions
    • editing existing conditions.
  • Developer documentation explains:

    • how the Condition Builder interacts with the Condition Registry
    • how to embed the component in another feature.

Design Guidelines

The component should draw inspiration from modern rule builders (Power Automate, Airtable, Miro, Notion, etc.) while remaining consistent with Pokémon Studio's visual scripting philosophy.

The objective is not to reproduce RPG Maker XP's Conditional Branch interface, but to provide a significantly better editing experience.

The UI should remain compact enough to support complex expressions without overwhelming the user.

References

Image Image Image Image

Out of Scope

This story does not include:

  • implementation of gameplay conditions
  • runtime evaluation
  • compilation to PSDK instructions
  • migration from RPG Maker XP
  • plugin-defined conditions.

These concerns are handled by dedicated stories.

Product Notes

The Condition Builder is intended to become one of Pokémon Studio's core UI components.

Future systems should reuse it whenever users need to express logical rules.

For this reason, the builder should never contain hardcoded knowledge about Pokémon-specific concepts. It is solely responsible for building and editing logical expressions based on condition definitions exposed by the Condition Registry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DesignIssues related to UX/UI designUser storyIssues related to a new feature or request

    Type

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions