Experiments
This API is used to read the experiments the local player is currently enrolled in.
For more information about Experiments, visit the Experiments Guide.
Enrollment happens automatically: loading a configuration evaluates active experiments for the local player, and the values from the Configs service already include the assigned group's changes. This service is read-only, for display, analytics segmentation, and debugging.
Types
GamebeastExperimentAssignment
class_name GamebeastExperimentAssignment
var experiment_id: int
var experiment_name: String # Empty until the experiment catalog has loaded.
var group_id: int
var group_label: String # Empty until the experiment catalog has loaded.
var configuration_alias: String # The configuration whose evaluation reported it.
var source: String # "weightedHash", "roundRobin" or "manual".get_assignments()
Array[GamebeastExperimentAssignment]return type
The player's assignments across every configuration loaded so far.
Usage
for assignment in Gamebeast.experiments.get_assignments():
print("%s: %s" % [assignment.experiment_name, assignment.group_label])get_assignment(experiment_id)
GamebeastExperimentAssignmentreturn type
The player's assignment in one experiment, or null when they aren't in it.
assignments_changed
Signal, with the full list whenever it changes: when a configuration reports new assignments, when names arrive, and after identify.
Gamebeast.experiments.assignments_changed.connect(_on_assignments_changed)Targeting
To target players by something your game knows, set it in GamebeastOptions.user_properties or with set_user_property: strings, numbers, booleans, or arrays of one of those. They're targeted as custom properties.