Skip to main content

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:

  1. Easy to edit data;
  2. Viewing data is more intuitive;

Source Code Mode:

  1. View the content of Script more completely;
  2. 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:

image-20220427092926724

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:

image-20220427093140953

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)
tip

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:

image-20220427094301203

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:

image-20220427095012039

Click Add Attribute to add data. We can choose two ways to add data: Client Request, Player Data, as shown below:

image-20220427120052748

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:

image-20220427101750328

Click Add Team to add data, as shown below:

image-20220427120211855

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:

image-20220427103208840

Click Add Rule to add data, as shown below:

image-20220427120556224

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:

image-20220427103822063

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:

image-20220427104934298

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:

image-20220427105314354

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:

image-20220427111528472

Click Add Expansion to add data, as shown below:

image-20220427121149230

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:

image-20220427112244975

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:

image-20220427113447037

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:

image-20220427115232748

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;
tip
  1. After saving the Ruleset as a draft, the Ruleset will not be associated with MatchConfiguration;
  2. Ruleset Name cannot be repeated in the current Title Region;