Experiment Scenario
Events, Layers and Flow Routes
In this article:
Designing an experiment in EventIDE is similar to building a slide presentation—each stage is represented visually. However, EventIDE offers significantly more control over the flow, timing, and logical branching of these stages through its flexible use of events, layers, and flow routes.
This section will guide you through the core structure of an EventIDE experiment.
Events: Building Blocks of an Experiment
An event in EventIDE represents a distinct phase of the experiment, such as showing instructions, presenting stimuli, or collecting responses. You can think of events as interactive slides, each with its own content, logic, and duration.
Events can contain any number of elements, such as text, images, videos, audio, or input handlers.
Non-visual events are also possible (e.g. delivering a sound without visual output).
Only one event per layer can be active at a time.

Events are displayed as blocks in the Event Bar under the Events Ribbon Tab. Each event shows:
Event Title (editable by double-clicking the title)
Event Number (top-left corner)
Minimum Duration (shown at the bottom, editable via double-click; replaced with “?” if duration is conditional)
Creating and Managing Events
To add a new event, go to Events Ribbon Tab > Add Event, or right-click in the Event Bar and select Add New Event.
Events can be reordered by dragging.
You can cut, copy, paste, or delete events via right-click.
Flow Routes: Controlling the Experimental Flow
Events do not run strictly in the order shown in the Event Bar. Instead, their execution is governed by flow routes, which define how and when the experiment transitions from one event to another.
Flow routes are created and managed using the Layers & Flow Editor, accessible by clicking Layers & Flow (right of the Event Bar).

How to Create Flow Routes
Open Layers & Flow Editor
In the Flow Routes Panel (right side), click and drag from one event’s circle to another to create a connection.
Hovering over an event circle shows its title.
To create a recurrent route (i.e. loop), drag from an event back to itself.

Types of Flow Routes
Each route is color-coded according to its condition:
Type | Color | Description |
Event Duration | Blue | Route opens when the event reaches its set duration. (Default) |
Code Condition | Green | Opens when a user-defined logical expression becomes true. |
Duration OR Condition | Teal | Opens when either the duration expires or the condition becomes true. |
Duration AND Condition | Purple | Opens only when the duration expires and the condition is true. |
Last Sub-event Duration | Red | Triggered by the duration of the last sub-event in a sub-layer. |

Managing Flow Routes
To change the route type: Right-click on the route and choose a type.
To add a condition: Right-click the route > Edit Route Condition. This opens the code snippet editor, where you can view and prioritize multiple conditions.
Note: If multiple outgoing routes become open simultaneously, the one created first takes precedence.

Key Flow Route Behaviors
Routes are directional—to make a two-way loop, two opposing routes are required.
Events with no incoming routes (except the first event) will never activate.
An event can be reactivated repeatedly if flow logic requires it.
Flow routes enable branching, looping, and conditional paths—ideal for adaptive trials, repeated sequences, or feedback mechanisms.
The presentation will always start with the first event.
Event Layers: Organizing Complex Experimental Structures
Events are grouped into layers, which define what can be presented in parallel or in sequence. The default layer is the Root Layer, but you can create sub-layers inside any event to structure your experiment hierarchically.
Why Use Layers?
Overlapping visual content – Sub-layer events appear on top of parent event surfaces (e.g. subtitles over a video).
Independent timing – Sub-events can have different durations and start conditions from the parent.
Logical grouping – Blocks like Block 1 and Block 2 can each contain their own trial sequences.
Example: A visual stimulus rotates while a separate sub-layer controls a flashing marker—both processes run in parallel but remain independent.
Creating a Sub-layer
Click Layers & Flow on the Events Ribbon.
In the Event Layers Panel (left side), hover over an event to reveal a + icon—click to create a sub-event.
Navigate between layers using the Navigation Bar to add and edit events as needed.

Managing Flow in Sub-layers
Flow routes for sub-layer events are created just like those in the Root Layer. You can define sequence, loops, and conditions independently for each layer.
Layer Behavior Rules
Sub-layers obey the parent layer’s timing. If a parent event lasts 1 second, all its sub-events are confined to that duration.
Some elements (e.g. response buttons) defined in the parent layer are also active in sub-layers.
Transparency matters. If sub-events have transparent backgrounds, content from the parent layer will be visible underneath.
Tip: Use layers strategically to simplify coding, increase modularity, and maintain clarity in complex experimental designs.
