Ruleset Debugger
1. Overview
With the rules debugger, developers can evaluate expressions used in rules and observe the execution output of rules based on pre-configured fake player dataset. With these evalutions, writing expressions and rules that match your expectations will be more convenient and quick.
Rules debugger could be accessed from Ruleset Editor, whether or not in source code mode:
Main content of this article:
- Fake Matched Players for Debugging
- Evaluate Expression
- Execute Ruleset
2. Fake Matched Players for Debugging
Both execution of rules and evaluation of expressions rely on a set of players data with team information. In order to perform real-time expressions evaluation and rules execution, it is necessary to construct a set of player data called Fake Matched Players
which meet the constraints of the team section in the ruleset script.
There are two methods to build these players:
- Import players from fake player dataset: This is the recommended way to quickly build your fake matched players. Read this documentation to learn how to configure a fake player dataset.
- Populate player data manually: Manually filling is supported, which can also be used as a supplement if the automatically generated data imported from fake players dataset does not meet your needs.
Fake matched players is only temporarily stored within the ruleset editor.
2.1 Populate Player Data Manually
We provide fully manual editing of fake matched players includes adding player items, removing player items in batches and modifying player items.
Field Description:
- Team: Select team for the player. Team selections are parsed from ruleset script in the editor.
- Player ID: Custom player ID, unique in fake matched players.
- Attrbutes: Player attributes filled in ruleset script. This field will be automatically split into multiple fileds based on the number of player attributes in the ruleset script.
The team name will end with a string of numbers if the maxQuantity
in the team's definition is greater than 1. Such as red_001, red_002, red_003.
2.2 Import Players from Fake Player Dataset
You could also specify a fake player dataset. PGOS will quickly select a set of players from the data set. And the number of players is up to the maximum number that satisfies the constraints of ruleset.teams
.
Only those player datasets whose attribute parameters are compatible with current ruleset can be used as the data source of fake matched players.
3. Execute Rules
Once the fake matched players are populated, the rules
defined in the ruleset script will be applied on it. Here you can observe whether the given fake matched players pass the constraints defined in the rules, and the reason.
4. Evaluate Expressions
PGOS supports evaluating multiple expressions.