Ruleset Editor
1. Overview
On the edit page of Ruleset, PGOS provides both Form mode and Source Code Mode, and we can flexibly switch between the two modes.
Form Mode:
- Easy to edit data;
- Viewing data is more intuitive;
Source Code Mode:
- View the content of Script more completely;
- Editing data is more flexible;
2. Ruleset Edit Page
When we enter the new (or edit) Ruleset page, PGOS will provide a Form Mode editing interface by default, as shown in the following figure:
We can divide the page content into two parts: Base Info, Script Info.
3. Base Info
Base Info includes the Ruleset Name and Description of the Ruleset, as follows:
Field Description:
- Ruleset Name:the name of the ruleset, must be unique within each title region. (max 128 characters, follow regexp [a-zA-Z0-9-.]*)
- Description:the description of the ruleset. (maximum number is 1024 characters)
The Ruleset Name must remain unique within the Current Title Region.
4. Script Info
PGOS provides two editing capabilities for Script Editor, Form Mode and Source Code Mode. We can click Enter Source Code Mode , Exit Source Code Mode button to switch, PGOS will ensure the data consistency between the two modes, you can operate with confidence.
4.1 Form Mode
When the button shows Enter Source Code Mode, we enter the form mode, as shown below:
Through the form mode, we can easily edit the data. As we can see from the above figure, Ruleset is divided into four modules: Player Attributes, Teams, Rules, and Expansions. Below we describe each module in detail:
4.1.1 Player Attributes
The Player Attribute form looks like this:
Click Add Attribute to add data. We can choose two ways to add data: Client Request, Player Data, as shown below:
Field Description
- Data Source:
Optional
, PGOS provides two ways to choose, Client Request, Player Data; - Key:
Required
, it will appear only when the Data Source is selected as Player Data, and the selected content is the Player Data defined by the current Title Region; - Name:
Required
, the name of the Player Attribute, the maximum length is 32 characters; - Type:
Required
, the data type of Player Attribute, you can choose String, Number; - Default Value:
Optional
, the default value of the Player Attribute data must meet the currently defined data type;
4.1.2 Teams
The Teams form looks like this:
Click Add Team to add data, as shown below:
Field Description
- Name:
Required
, the name of the Team, the maximum length is 32 characters; - Min Players:
Required
, the data must be between 1 and 40; - Max Players:
Required
, the data must be between 1 and 40, and Max Players must be greater than or equal to Min Players; - Min Quantity:
Optional
, the data must be between 1 and 999; - Max Quantity:
Optional
, the data must be between 1 and 999, and the Max Quantity must be greater than or equal to the Min Quantity;
4.1.3 Rules
PGOS currently supports three types of Rule configurations: Distance Rule, Comparison Rule, and Latency Rule. Each type contains inconsistent fields, and the Rules form looks like this:
Click Add Rule to add data, as shown below:
Base Info
- Name:
Required
, the name of the Rule, the maximum length is 32 characters; - Type:
Required
, the type of Rule, PGOS is currently available: Distance Rule, Comparison Rule, Latency Rule; - Description:
Required
, the description of the Rule, the maximum length is 32 characters;
Distance Rule Info
When we select the Rule Type as Distance Rule, we will switch the form to the Distance Rule field information, as shown in the following figure:
The field information included in the Distance Rule is as follows:
- Measurements:
Required
, measurements of Distance Rule, we can fill in multiple Expression information, for example: flatten(teams[*].players.playerAttributes[mmr]); - Reference Value:
Required
, the reference value of the Distance Rule, for example: avg(flatten(teams[*].players.playerAttributes[mmr])); - Max Distance:
Required
, max distance of Distance Rule, type: Number; - Min Distance:
Optional
, min distance of Distance Rule, type: Number; - Party Aggregation:
Optional
, party aggregation of Distance Rule, optional values are: Each, Avg, Min, Max, Any;
Comparison Rule
When we select the Rule Type as Comparison Rule, we will switch the form to the Comparison Rule field information, as shown in the following figure:
The field information included in the Comparison Rule is as follows:
Measurements:
Required
, measurements of Distance Rule, we can fill in multiple Expression information, for example: flatten(teams[*].players.playerAttributes[mmr]);Reference Value:
Required
, the reference value of the Distance Rule, for example: avg(flatten(teams[*].players.playerAttributes[mmr]));Operation:
Required
, operation of Comparison Rule, optional values are: =, !=, <, <=, >, >=;
Latency Rule
When we select Rule Type as Latency Rule, we will switch the form to Latency Rule field information, as shown in the following figure:
The field information included in the Latency Rule is as follows:
Max Latency:
Required
, max latency of Latency Rule, type Number;Party Aggregation:
Optional
, party aggregation of Latency Rule, optional values are: Each, Avg, Min, Max, Any;
4.1.4 Expansions
The Expansions form looks like this:
Click Add Expansion to add data, as shown below:
Field Description
- Target Expression:
Required
, the target expression of Expansion, for example: rules[mmr_calc].maxDistance; - Steps:
Required
, steps of Expansion, can be filled with multiple pieces of data;
4.2 Source Code Mode
When the button is displayed as Exit Source Code Mode, we enter the source code editing mode, as shown in the following figure:
Through the source code mode, we can see the Ruleset Script data information more completely. The source code is a legal Json string. When the data you enter is illegal, the page will give the corresponding prompt information:
5. Submit Your Ruleset
After editing the Ruleset, you can click the operation button in the lower left corner of the editing page to perform related operations. The operation area is as shown in the figure:
Operation:
- Back:Return to the previous page, the content edited on the current page will be cleared;
- Validate Ruleset:Verify the validity of the Ruleset, which is convenient for verifying the data;
- Save as Draft:Save as a draft, this operation will not verify the validity of the Ruleset Script when saving;
- Submit:Save the Ruleset, this operation will verify the validity of the Ruleset Script and can be associated with MatchConfiguration;
- After saving the Ruleset as a draft, the Ruleset will not be associated with MatchConfiguration;
- Ruleset Name cannot be repeated in the current Title Region;