Probably - Display probability distributions

Probably is a plugin for Studio for displaying the probability distributions of Luau functions.

Showcase

Installation

Probably is available for installation from within Studio via the Toolbox:

  1. Open the Toolbox.
  2. Select the Plugins category.
  3. Search for “Probably”.
  4. Select Probably by Anaminus.
  5. Click the Install button.

It can also be installed from the website.

Installing free copies of Probably should be avoided, as they will have been authored by untrusted providers. Instead, it is recommended that you compile the plugin yourself from source.

Usage

Probably adds the Probably button to the toolbar. Clicking it will toggle the Probably window.

Window

The window has several panels:

  • Top bar: Across the top. Contains various buttons.
  • Graph: On the left. Displays probability distributions. Has X and Y axes.
  • Editor: On the right. Contains the editable source of the distribution function.
  • Options: On the lower right, below the Editor. Contains options for configuring the plugin.
  • Errors: On the bottom right, below the Options. Displays errors with the source.

Top bar

In the Top bar are three buttons:

  • Play/Pause: Toggles sampling. While running, the distribution function is continuously called, and the results are displayed on the Graph.
  • Reset: Removes all results.
  • About: Displays a panel containing information about the plugin.

Graph

The Graph displays the results of sampling as a bar graph. Results are added to buckets, and the height of each bar is the size of the bucket relative to the largest bucket.

The X axis displays the minimum and maximum values that have been observed. The Y axis displays the probability of the largest bucket.

Hovering over a bar will display the probability for the bar, and the range of values the bar represents.

Editor

The Editor displays the Luau source of the distribution function. While running, the Graph will be updated live as the source is edited.

The source is expected to return a function. This function will be called continuously while the plugin is running. The function receives a Random value, and must return a number. Non-number types, infinities, and NaN values are discarded. The function should avoid having side-effects.

The source is executed only whenever it changes. If the source or function contains an error, then the previous function will continue to be used until there is no longer an error. Any errors will be displayed in the bottom right corner.

Options

There are several options for configuring the plugin:

  • Resolution: The number of buckets (or bars) into which results will be distributed.
  • Budget: Amount of time, per frame, that should be dedicated to sampling, in microseconds.
  • Updates: The number of times the graph should be updated, per second.

Permissions

Probably requires no permissions to operate.

Source code

The source for Probably is available on GitHub under the MIT license.

If you have an issue or feature request, you may post it in this topic, or as an issue on the repository.

Note that, while Probably is not free to install from the website, the source code will always be available for users to compile themselves.

12 Likes