Method and system for editing skill attribute formula

By introducing skill attribute formula editing methods and systems into the game skill system, the existing system has been solved, and higher flexibility and scalability are achieved, reducing maintenance costs and improving user experience.

CN119857271APending Publication Date: 2025-04-22FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411903102.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-25
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing game skill system has poor flexibility, poor scalability, high maintenance costs and poor user experience, making it difficult to adapt to the frequent skill updates and balance adjustments in the game.

Method used

A method and system for editing skill attribute formulas is adopted to define skill attribute types and event entities, and a graphical interface of the formula editor is constructed, allowing users to input mathematical formulas and functions, the parser parses and generates calculation logic, and dynamically calculates the value of skill attributes.

Benefits of technology

It improves the flexibility and scalability of the game skill system, reduces maintenance costs, improves user experience, and realizes real-time updates and balanced adjustments of skills.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119857271A_ABST
    Figure CN119857271A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a skill attribute formula editing method and system, and the method comprises the steps: defining a skill attribute type; defining an event entity; a formula editor graphical interface is constructed, a user is allowed to input a mathematical operation formula and a function in a graphical or textualized mode so as to define a calculation formula of skill attributes, and an analyzer is provided and used for analyzing the formula input by the user and generating corresponding calculation logic; in the game development process, corresponding formulas and attributes are configured for different skills according to skill design and balance adjustment requirements; the calculation result is fed back to a user or a developer, adjustment and optimization are carried out according to needs, and the user or the developer is allowed to adjust and optimize the calculation result according to needs; the invention aims to provide the skill attribute formula editing method and system, so that the flexibility of a game skill system is improved, the expandability is high, the maintenance cost is low, and the user experience feeling is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for editing a skill attribute formula. Background Art

[0002] Common game skill systems usually use hard-coding to define skill attributes and their calculation formulas. For example, skill damage, cooldown time and other attributes are usually set directly in the code, and the calculation formula is also embedded in the game logic through hard coding. Although this method is intuitive and easy to implement, it lacks flexibility and scalability, and is difficult to adapt to frequent skill updates and balance adjustments in the game.

[0003] The shortcomings of the prior art are mainly the following aspects:

[0004] (1) Poor flexibility: The hard-coding method makes it difficult to modify and add skill attributes, and each update requires recompiling and deploying the game code.

[0005] (2) Poor scalability: As the game develops, new skill attributes and calculation formulas may need to be introduced, but the existing hard-coding method is difficult to quickly adapt to such changes.

[0006] (3) High maintenance cost: Due to the complexity of the skill system, hard-coding can easily lead to code confusion, increasing the difficulty and cost of maintenance.

[0007] (4) Poor user experience: Players cannot customize or modify skill attributes, which reduces the playability and personalized experience of the game. Summary of the invention

[0008] In order to overcome the problems of poor flexibility, poor scalability, high maintenance cost and poor user experience of the existing game skill system, the purpose of the present invention is to provide a method and system for editing skill attribute formulas, which improves the flexibility of the game skill system, has strong scalability, low maintenance cost and good user experience.

[0009] The present invention is implemented by the following scheme:

[0010] A method for editing a skill attribute formula, the method steps are as follows:

[0011] Step 1: Define the skill attribute type;

[0012] Step 2: Define event entity;

[0013] Step 3: Build a formula editor graphical interface to allow users to enter mathematical expressions and functions in a graphical or textual manner to define the calculation formula of skill attributes, and provide a parser to parse the formula entered by the user and generate the corresponding calculation logic;

[0014] Step 4: During the game development process, according to the skill design and balance adjustment requirements, configure corresponding formulas and attributes for different skills;

[0015] Step 5: Feedback the calculation results to the user or developer, and adjust and optimize as needed, and allow the user or developer to adjust and optimize the calculation results as needed.

[0016] Furthermore, step 1 is specifically as follows: in the early stage of game development, according to game requirements and character design, create an attribute class to define different types of skill attributes, create subclasses for each skill attribute type, and specify the corresponding data type and value range for each skill attribute.

[0017] Furthermore, step 2 is specifically as follows: creating an entity class, defining different types of event entities, and specifying corresponding properties and methods for each event entity.

[0018] Furthermore, the parser parses the formula input by the user, as follows:

[0019] Input validation: First, string checking and syntax validation are performed to ensure that the user input is valid and that there are no illegal characters or format errors in the input content.

[0020] Define tags: Identify all the basic elements included in the formula and define a unique tag for each element;

[0021] Write regular expressions: Write regular expressions for each tag to match and extract elements from the input string;

[0022] Generate a token stream: Scan the input string, match and generate a token stream according to the defined regular expression, each token usually contains a type;

[0023] Define grammar rules: Define how tokens are combined into correct expressions or statements according to the rules of mathematical grammar;

[0024] Perform type checking: ensure that each token and expression conforms to the expected type;

[0025] Perform scope and variable checks: If the formula contains variables, make sure the variables are defined before use and that the scope of the variables is correct;

[0026] Execute calculation logic: Get all necessary input values, execute calculation logic according to grammar rules, and return the result.

[0027] Furthermore, step 4 is specifically as follows:

[0028] Step 4.1: At runtime, parse the user-defined formula and dynamically calculate the value of the skill attribute based on the actual variable value;

[0029] Step 4.2: Trigger the calculation process based on game events;

[0030] Step 4.3: Find the corresponding formula according to the event type and the attributes of the related event entity, and execute the calculation logic;

[0031] Step 4.4: The calculation results will be updated in real time and stored in the corresponding attributes, and an error handling mechanism is provided to capture and handle errors in the formula parsing or calculation process;

[0032] The error handling mechanism is as follows:

[0033] Define error types: define a series of possible error types; the error types include: syntax errors, semantic errors, calculation errors, resource errors, and errors caused by resource limitations during parsing or calculation;

[0034] And define a unique error code and description information for each error type;

[0035] Capture errors: Use exception handling mechanisms to capture errors that may occur when using the parser for parsing and calculations;

[0036] Error handling: When an error is captured, take action based on the error type. Actions include recording error information, reporting the error to the user, attempting to automatically correct the error or providing suggested corrections, terminating the current operation, and notifying the user.

[0037] Real-time update and error feedback: If the calculation results need to be updated in real time and stored in the corresponding attributes, when an error is caught during the calculation process, the calculation should be stopped immediately, the corresponding error status attribute should be updated, and the error should be reported to the user.

[0038] A system for editing skill attribute formulas, the system comprising: an attribute definition module, an entity definition module, a formula editor module, a dynamic calculation module, and an error processing and feedback module;

[0039] The attribute definition module is used to define the skill attribute type;

[0040] The entity definition module is used to define event entities;

[0041] The formula editor module is used to construct a formula editor graphical interface, allowing users to input mathematical expressions and functions in a graphical or textual manner to define the calculation formula of skill attributes, and provides a parser for parsing the formula input by the user and generating corresponding calculation logic;

[0042] The dynamic calculation module is used to configure corresponding formulas and attributes for different skills according to skill design and balance adjustment requirements during the game development process;

[0043] The error handling and feedback module is used to feed back the calculation results to the user or developer, and to adjust and optimize as needed, and to allow the user or developer to adjust and optimize the calculation results as needed.

[0044] Furthermore, the attribute definition module is specifically as follows: in the early stage of game development, according to game requirements and character design, an attribute class is created to define different types of skill attributes, subclasses are created for each skill attribute type, and corresponding data types and value ranges are specified for each skill attribute.

[0045] Furthermore, the entity definition module specifically creates an entity class, defines different types of event entities, and specifies corresponding properties and methods for each event entity.

[0046] Furthermore, the parser parses the formula input by the user, as follows:

[0047] Input validation: First, string checking and syntax validation are performed to ensure that the user input is valid and that there are no illegal characters or format errors in the input content.

[0048] Define tags: Identify all the basic elements included in the formula and define a unique tag for each element;

[0049] Write regular expressions: Write regular expressions for each tag to match and extract elements from the input string;

[0050] Generate a token stream: Scan the input string, match and generate a token stream according to the defined regular expression, each token usually contains a type;

[0051] Define grammar rules: Define how tokens are combined into correct expressions or statements according to the rules of mathematical grammar;

[0052] Perform type checking: ensure that each token and expression conforms to the expected type;

[0053] Perform scope and variable checks: If the formula contains variables, make sure the variables are defined before use and that the scope of the variables is correct;

[0054] Execute calculation logic: Get all necessary input values, execute calculation logic according to grammar rules, and return the result.

[0055] Furthermore, the dynamic calculation module specifically: parses the user-defined formula at runtime and dynamically calculates the value of the skill attribute according to the actual variable value;

[0056] Triggering calculations based on game events;

[0057] Find the corresponding formula based on the event type and the attributes of the related event entity, and execute the calculation logic;

[0058] The calculation results will be updated in real time and stored in the corresponding attributes, and an error handling mechanism is provided to capture and handle errors in formula parsing or calculation process;

[0059] The error handling mechanism is as follows:

[0060] Define error types: define a series of possible error types; the error types include: syntax errors, semantic errors, calculation errors, resource errors, and errors caused by resource limitations during parsing or calculation;

[0061] And define a unique error code and description information for each error type;

[0062] Capture errors: Use exception handling mechanisms to capture errors that may occur when using the parser for parsing and calculations;

[0063] Error handling: When an error is captured, take action based on the error type. Actions include recording error information, reporting the error to the user, attempting to automatically correct the error or providing suggested corrections, terminating the current operation, and notifying the user.

[0064] Real-time update and error feedback: If the calculation results need to be updated in real time and stored in the corresponding attributes, when an error is caught during the calculation process, the calculation should be stopped immediately, the corresponding error status attribute should be updated, and the error should be reported to the user.

[0065] The beneficial effects of the present invention are:

[0066] The overall idea of ​​this solution is to adopt a skill attribute system based on formula editing, by defining different types of skill attributes (such as fixed attributes, custom attributes, skill variables, etc.) and event entities (such as skill casters, scene entities, etc.), combined with mathematical expressions and functions to dynamically calculate the value of skill attributes. The key technical ideas of this method are:

[0067] (1) Separation of attributes and entities: Skill attributes are separated from event entities so that attributes can be defined and modified independently. Entities, as carriers of attributes, enable flexible combination of attributes and entities.

[0068] (2) Formula editing: By defining mathematical expressions and functions, users (or developers) can define the calculation formula of skill attributes in the form of formulas, which improves the flexibility and scalability of the system.

[0069] (3) Dynamic calculation: The value of skill attributes is dynamically calculated based on the actual variable values ​​at runtime, achieving real-time updating and balance adjustment of skills.

[0070] The present invention can provide a flexible, scalable and easy-to-maintain skill attribute formula editing system, which provides more creative space for game developers and also improves the game experience of players. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 is a flow chart of the method of the present invention;

[0072] Figure 2 It is a structural block diagram of the system of the present invention;

[0073] Figure 3 A diagram of the graphical interface of the formula editor. DETAILED DESCRIPTION

[0074] The present invention will be further described below in conjunction with the accompanying drawings.

[0075] See also Figure 1 , a method for editing a skill attribute formula, the method steps are as follows:

[0076] Step 1: Define the skill attribute type;

[0077] Step 2: Define event entity;

[0078] Step 3: Build a formula editor graphical interface to allow users to enter mathematical expressions and functions in a graphical or textual manner to define the calculation formula of skill attributes, and provide a parser to parse the formula entered by the user and generate the corresponding calculation logic;

[0079] Step 4: During the game development process, according to the skill design and balance adjustment requirements, configure corresponding formulas and attributes for different skills;

[0080] Step 5: Feedback the calculation results to the user or developer, and adjust and optimize as needed, and allow the user or developer to adjust and optimize the calculation results as needed.

[0081] The present invention will be further described below in conjunction with a specific embodiment:

[0082] A method for editing a skill attribute formula, the method comprising the following steps:

[0083] Step 1: Define the skill attribute type

[0084] In the early stages of game development, different types of skill attributes and event entities are defined based on game requirements and character design. These attributes and entities will serve as the basis for subsequent formula editing and calculations. First, different types of skill attributes are defined, including fixed attributes, custom attributes, skill variables, temporary variables, and status progress, and the corresponding data type and value range are specified for each attribute.

[0085] Create an attribute class to define the basic structure of skill attributes, including attribute name, type, value range, etc.

[0086] Create subclasses for different types of attributes, such as fixed attribute class, custom attribute class, etc., and define corresponding properties and methods.

[0087] For example:

[0088] Skill attributes mainly include fixed attributes, custom attributes, skill variables, temporary variables and status progress.

[0089] Fixed attributes include current health, basic health, current mana, basic mana, movement speed, attack speed, basic health regeneration, basic mana regeneration, basic physical attack, basic magic attack, basic physical defense, basic magic defense, etc.

[0090] Custom attributes include points, time, unit level on the map, monster group, character group, AI group, etc.

[0091] Skill variables include skill id, level, skill level learning limit, casting radius, basic damage value, cooling time value, duration value, range value, range distance value, etc.

[0092] Temporary variables include temporary variable A, temporary variable B, temporary variable C and other user-defined temporary variables;

[0093] The status progress shows the current status progress. This variable increases according to the number of frames remaining in the current state, and the range is [0.0,1.0].

[0094] Step 2: Define the event entity:

[0095] By creating an entity class, define different types of event entities, including skill casters, node executors, scene entities, owners, and parent nodes, and specify corresponding properties and methods for each entity.

[0096] For example:

[0097] Skill attributes need to be combined with an event entity to become a complete event variable.

[0098] The event entity has the node executor (EventEntity), skill caster (AttackEntity), scene entity (GlobalEntity), owner (OwnerEntity) and parent node (ParentEntity).

[0099] A variable is formed by attributes and event entities. For example, if the event entity is a skill caster and the fixed attribute is the current health value, then the formed variable is the current health value of the skill caster.

[0100] Attribute example: "X-value of X-entity";

[0101] Fixed attributes are marked with Role, custom attributes are marked with Custom, and skill variables are marked with SkillData variables.

[0102] For example, the current health value of the skill caster in the fixed attributes is $role:AttackEntity:role_HP.

[0103] Step 3: Build the formula editor:

[0104] Build a formula editor graphical interface that allows users to enter mathematical expressions and functions in a graphical or textual manner to define the calculation formula for skill attributes, and provide a parser to parse the formula entered by the user and generate the corresponding calculation logic.

[0105] The parser works as follows:

[0106] Input validation: First, ensure that the user input is valid and contains no illegal characters or format errors through string checking and syntax validation.

[0107] Define tags: Identify all the basic elements that may be included in the formula, such as numbers, operators, brackets, function names, etc., and define a unique tag for each element.

[0108] Write regular expressions: For each token, write regular expressions that match and extract those elements from the input string.

[0109] Generate a token stream: Scan the input string, match and generate a token stream according to the defined regular expression. Each token usually contains a type (such as a number (1, 2), a variable, an operation (addition, subtraction, multiplication and division functions), etc.) and a value (such as the specific value of a number).

[0110] Define grammar rules: Define how to combine tokens into correct expressions or statements according to the rules of mathematical grammar. These rules are usually given in the form of grammar rules, each of which specifies one or more possible input patterns and how they are combined into output. For example, C=A+B is an addition formula, where A and B are variables or numbers entered by the user.

[0111] Do type checking: Make sure each token and expression conforms to the expected type. For example, in the context of a binary operator such as addition, both operands should be numbers or expressions that can be converted to numbers.

[0112] Perform scope and variable checks: If your formula contains variables, you need to make sure they are defined before use and that they are scoped correctly.

[0113] Execute calculation logic: Get all necessary input values ​​(such as the value of variables), execute the calculation logic according to the grammar rules, and return the result.

[0114] Step 4: Parsing and calculating formulas

[0115] During the game development process, according to the skill design and balance adjustment requirements, the corresponding formulas and attributes are configured for different skills. These formulas and attributes will be stored in the system for subsequent use. At runtime, the user-defined formula is parsed, and the value of the skill attribute is dynamically calculated based on the actual variable value. The calculation process is triggered according to game events (such as character upgrades, skill releases, etc.). The corresponding formula is found according to the event type and related entity attributes, and the calculation logic is executed. The calculation results will be updated in real time and stored in the corresponding attributes, and an error handling mechanism is provided to capture and handle errors in formula parsing or calculation.

[0116] The error handling mechanism is as follows:

[0117] 1. Define error types

[0118] First, define a series of possible error types. These error types are mainly:

[0119] Syntax Error: The formula does not conform to the expected syntax rules.

[0120] Semantic Error: The formula is semantically incorrect, such as using an undefined variable or function.

[0121] Computational error: An exception occurred during the computation, such as division by zero or mathematical overflow.

[0122] Resource Error: An error caused by resource limitations (such as insufficient memory) during parsing or calculation.

[0123] Define a unique error code and description for each error type so that you can accurately identify and handle the error when it is caught.

[0124] 2. Capture Errors

[0125] In each key step of parsing and calculation, use exception handling mechanism to capture possible errors.

[0126] 3. Handling Errors

[0127] When an error is caught, take appropriate action based on the error type. The main action is:

[0128] (1) Record error information: Record error information (including error code, description information and possible context information) in a log file.

[0129] (2) Report errors to users: Display error messages to users through the user interface and provide sufficient context to help users understand the cause of the error and how to correct it.

[0130] (3) Attempt recovery: In some cases, you can try to automatically correct the error or provide suggested correction solutions.

[0131] (4) Terminate the operation: If the error is so serious that the operation cannot continue, the current operation can be terminated and the user can be notified.

[0132] 4. Real-time updates and error feedback

[0133] If the calculation results need to be updated in real time and stored in the corresponding attributes, then when an error is caught during the calculation process, the calculation should be stopped immediately, the corresponding error status attribute should be updated, and the error should be reported to the user.

[0134] In this way, you can ensure that any errors that occur when parsing and calculating formulas are caught and handled in a timely manner, providing a robust user experience.

[0135] For example:

[0136] Calculate variable values ​​through mathematical expressions and mathematical functions, and combine variables to perform calculations

[0137] Combine variables with mathematical addition, subtraction, multiplication, division or function values ​​to form a complete formula. For example, $skilldata:id+2*$skilldata:level-$role:EventEntity:role_HP

[0138] Or $custom:AttackEntity*exp(2*$role:EventEntity:role_HP)-$skilldata:CD calculates the combined formula to form the final attribute value.

[0139] When calculating the final formula value, it is necessary to obtain the actual value of each variable. For example, if the health value of a character with a fixed attribute is 500, the original variables are involved in the calculation and the final formula value is dynamically calculated.

[0140] For example, $skilldata:id+2*$skilldata:level-$role:EventEntity:role_HP, where the value of $skilldata:id is 80, the value of $skilldata:level is 60, and the value of $role:EventEntity:role_HP is 100.

[0141] Then the final attribute value is 80+2*60-100=100

[0142] Step 5: Result feedback and adjustment:

[0143] Add error handling logic during formula parsing and calculation, such as exception capture, error code return, etc. At the same time, provide a feedback interface or interface to display error information and solutions. Users or developers can obtain error details and handle them accordingly through this interface or interface.

[0144] See also Figure 2 , a system for editing skill attribute formulas, the system comprising: an attribute definition module, an entity definition module, a formula editor module, a dynamic calculation module and an error handling and feedback module;

[0145] The attribute definition module is used to define the skill attribute type;

[0146] The entity definition module is used to define event entities;

[0147] The formula editor module is used to construct a formula editor graphical interface, allowing users to input mathematical expressions and functions in a graphical or textual manner to define the calculation formula of skill attributes, and provides a parser for parsing the formula input by the user and generating corresponding calculation logic;

[0148] The dynamic calculation module is used to configure corresponding formulas and attributes for different skills according to skill design and balance adjustment requirements during the game development process;

[0149] The error handling and feedback module is used to feed back the calculation results to the user or developer, and to adjust and optimize as needed, and to allow the user or developer to adjust and optimize the calculation results as needed.

[0150] In one embodiment of the present invention, the attribute definition module is specifically as follows: in the early stage of game development, according to game requirements and character design, an attribute class is created to define different types of skill attributes, subclasses are created for each skill attribute type, and corresponding data types and value ranges are specified for each skill attribute.

[0151] Function: Define different types of skill attributes, including fixed attributes (such as current health, basic mana, etc.), custom attributes (such as points, time, etc.), skill variables (such as skill ID, level, cooldown time, etc.), etc.

[0152] In one embodiment of the present invention, the entity definition module specifically creates an entity class, defines different types of event entities, and specifies corresponding properties and methods for each event entity.

[0153] The entity definition module is used to define different types of event entities, including skill casters, node executors, scene entities, owners, and parent nodes. These entities, as carriers of skill attributes, can participate in the calculation and triggering of skill attributes.

[0154] In one embodiment of the present invention, the parser parses the formula input by the user as follows:

[0155] Input validation: First, string checking and syntax validation are performed to ensure that the user input is valid and that there are no illegal characters or format errors in the input content.

[0156] Define tags: Identify all the basic elements included in the formula and define a unique tag for each element;

[0157] Write regular expressions: Write regular expressions for each tag to match and extract elements from the input string;

[0158] Generate a token stream: Scan the input string, match and generate a token stream according to the defined regular expression, each token usually contains a type;

[0159] Define grammar rules: Define how tokens are combined into correct expressions or statements according to the rules of mathematical grammar;

[0160] Perform type checking: ensure that each token and expression conforms to the expected type;

[0161] Perform scope and variable checks: If the formula contains variables, make sure the variables are defined before use and that the scope of the variables is correct;

[0162] Execute calculation logic: Get all necessary input values, execute calculation logic according to grammar rules, and return the result.

[0163] See also Figure 3 In one embodiment of the present invention, the formula editor module provides a graphical interface or a text input box, allowing the user to define the calculation formula of the skill attribute in the form of a formula. The formula may include mathematical expressions, functions, variables, etc.

[0164] Specifically, a graphical interface or text editor is used as an input tool, combined with parser technology to parse the formula entered by the user. The parser converts the formula into executable calculation logic and stores it in the system for subsequent use.

[0165] In order to configure corresponding formulas and attributes for different skills according to skill design and balance adjustment requirements during the game development process, in one embodiment of the present invention, the dynamic calculation module specifically: parses the user-defined formula at runtime and dynamically calculates the value of the skill attribute according to the actual variable value;

[0166] Trigger the calculation process based on game events (such as character upgrades, skill releases, etc.);

[0167] The system will look up the corresponding formula based on the event type and the attributes of the related event entity, and execute the calculation logic;

[0168] The calculation results will be updated in real time and stored in the corresponding attributes, and an error handling mechanism is provided to capture and handle errors in formula parsing or calculation process;

[0169] The error handling mechanism is as follows:

[0170] Define error types: define a series of possible error types; the error types include: syntax errors, semantic errors, calculation errors, resource errors, and errors caused by resource limitations during parsing or calculation;

[0171] And define a unique error code and description information for each error type;

[0172] Capture errors: Use exception handling mechanisms to capture errors that may occur when using the parser for parsing and calculations;

[0173] Error handling: When an error is captured, take action based on the error type. Actions include recording error information, reporting the error to the user, attempting to automatically correct the error or providing suggested corrections, terminating the current operation, and notifying the user.

[0174] Real-time update and error feedback: If the calculation results need to be updated in real time and stored in the corresponding attributes, when an error is caught during the calculation process, the calculation should be stopped immediately, the corresponding error status attribute should be updated, and the error should be reported to the user.

[0175] The formulas and properties are stored in the system for subsequent use.

[0176] In one embodiment of the present invention, the error handling and feedback module specifically includes: adding error handling logic during formula parsing and calculation, and providing a feedback interface or interface for displaying error information and solutions.

[0177] The specific application scenarios of the present invention are as follows (taking a role-playing game as an example):

[0178] In the game, players can choose different characters and learn various skills. Each skill has its own unique attributes, such as damage value, cooldown time, range of action, etc. Traditional skill systems may define these attributes and calculation formulas in a hard-coded way. However, after adopting this solution, skill attributes can be defined and modified more flexibly.

[0179] For example, for a character's skill "Fireball", its damage value can be calculated by the following formula:

[0180] Damage value = basic damage value + level coefficient × level + mana bonus

[0181] Among them, "basic damage value", "level coefficient" and "mana bonus" are all skill attributes, which can be defined and modified through the formula editor in the game. When the player upgrades or increases the mana, the system will automatically update the skill damage value to achieve real-time balance adjustment of the skill.

[0182] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A method for editing a skill attribute formula, characterized in that: The method steps are as follows: Step 1: Define the skill attribute type; Step 2: Define event entity; Step 3: Build a formula editor graphical interface to allow users to enter mathematical expressions and functions in a graphical or textual manner to define the calculation formula of skill attributes, and provide a parser to parse the formula entered by the user and generate the corresponding calculation logic; Step 4: During the game development process, according to the skill design and balance adjustment requirements, configure corresponding formulas and attributes for different skills; Step 5: Feedback the calculation results to the user or developer, and adjust and optimize as needed, and allow the user or developer to adjust and optimize the calculation results as needed.

2. A method for editing a skill attribute formula according to claim 1, characterized in that: Step 1 is as follows: In the early stage of game development, according to game requirements and character design, create an attribute class to define different types of skill attributes, create subclasses for each skill attribute type, and specify the corresponding data type and value range for each skill attribute.

3. A method for editing a skill attribute formula according to claim 1, characterized in that: Step 2 is as follows: create an entity class, define different types of event entities, and specify corresponding properties and methods for each event entity.

4. A method for editing a skill attribute formula according to claim 1, characterized in that: The parser parses the formula input by the user, as follows: Input validation: First, string checking and syntax validation are performed to ensure that the user input is valid and that there are no illegal characters or format errors in the input content. Define tags: Identify all the basic elements included in the formula and define a unique tag for each element; Write regular expressions: Write regular expressions for each tag to match and extract elements from the input string; Generate a token stream: Scan the input string, match and generate a token stream according to the defined regular expression, each token usually contains a type; Define grammar rules: Define how tokens are combined into correct expressions or statements according to the rules of mathematical grammar; Perform type checking: ensure that each token and expression conforms to the expected type; Perform scope and variable checks: If the formula contains variables, make sure the variables are defined before use and that the scope of the variables is correct; Execute calculation logic: Get all necessary input values, execute calculation logic according to grammar rules, and return the result.

5. A method for editing a skill attribute formula according to claim 1, characterized in that: Step 4 is as follows: Step 4.1: At runtime, use the parser to parse the user-defined formula, obtain the variables according to the grammar rules in the parser, and dynamically calculate the value of the skill attribute according to the actual variable value; Step 4.2: Trigger the calculation process based on game events; Step 4.3: Find the corresponding formula according to the event type and the attributes of the related event entity, and execute the calculation logic; Step 4.4: The calculation results will be updated in real time and stored in the corresponding attributes, and an error handling mechanism is provided to capture and handle errors in the formula parsing or calculation process; The error handling mechanism is as follows: Define error types: define a series of possible error types; the error types include: syntax errors, semantic errors, calculation errors, resource errors, and errors caused by resource limitations during parsing or calculation; And define a unique error code and description information for each error type; Capture errors: Use exception handling mechanisms to capture errors that may occur when using the parser for parsing and calculations; Error handling: When an error is captured, take action based on the error type. Actions include recording error information, reporting the error to the user, attempting to automatically correct the error or providing suggested corrections, terminating the current operation, and notifying the user. Real-time update and error feedback: If the calculation results need to be updated in real time and stored in the corresponding attributes, when an error is caught during the calculation process, the calculation should be stopped immediately, the corresponding error status attribute should be updated, and the error should be reported to the user.

6. A system for editing skill attribute formulas, characterized in that: The system comprises: an attribute definition module, an entity definition module, a formula editor module, a dynamic calculation module and an error processing and feedback module; The attribute definition module is used to define the skill attribute type; The entity definition module is used to define event entities; The formula editor module is used to build a formula editor graphical interface, allowing users to enter mathematical expressions and functions in a graphical or textual manner to define the calculation formula of skill attributes, and provides a parser. Used to parse the formula entered by the user and generate the corresponding calculation logic; The dynamic calculation module is used to configure corresponding formulas and attributes for different skills according to skill design and balance adjustment requirements during the game development process; The error handling and feedback module is used to feed back the calculation results to the user or developer, and to adjust and optimize as needed, and to allow the user or developer to adjust and optimize the calculation results as needed.

7. A system for editing skill attribute formulas according to claim 6, characterized in that: The attribute definition module is specifically as follows: in the early stage of game development, according to game requirements and character design, an attribute class is created to define different types of skill attributes, a subclass is created for each skill attribute type, and a corresponding data type and value range are specified for each skill attribute.

8. A system for editing skill attribute formulas according to claim 6, characterized in that: The entity definition module specifically creates an entity class, defines different types of event entities, and specifies corresponding properties and methods for each event entity.

9. A system for editing skill attribute formulas according to claim 6, characterized in that: The parser parses the formula input by the user, as follows: Input validation: First, string checking and syntax validation are performed to ensure that the user input is valid and that there are no illegal characters or format errors in the input content. Define tags: Identify all the basic elements included in the formula and define a unique tag for each element; Write regular expressions: Write regular expressions for each tag to match and extract elements from the input string; Generate a token stream: Scan the input string, match and generate a token stream according to the defined regular expression, each token usually contains a type; Define grammar rules: Define how tokens are combined into correct expressions or statements according to the rules of mathematical grammar; Perform type checking: ensure that each token and expression conforms to the expected type; Perform scope and variable checks: If the formula contains variables, make sure that the variables are defined before use and that the scope of the variables is correct; Execute calculation logic: Get all necessary input values, execute calculation logic according to grammar rules, and return the result.

10. A system for editing skill attribute formulas according to claim 6, characterized in that: The dynamic calculation module specifically comprises: when running, using a parser to parse a user-defined formula, obtaining variables according to grammatical rules in the parser, and dynamically calculating the value of the skill attribute according to the actual variable value; Triggering calculations based on game events; Find the corresponding formula based on the event type and the attributes of the related event entity, and execute the calculation logic; The calculation results will be updated in real time and stored in the corresponding attributes, and an error handling mechanism is provided to capture and handle errors in formula parsing or calculation process; The error handling mechanism is as follows: Define error types: define a series of possible error types; the error types include: syntax errors, semantic errors, calculation errors, resource errors, and errors caused by resource limitations during parsing or calculation; And define a unique error code and description information for each error type; Capture errors: Use exception handling mechanisms to capture errors that may occur when using the parser for parsing and calculations; Error handling: When an error is captured, take action based on the error type. Actions include recording error information, reporting the error to the user, attempting to automatically correct the error or providing suggested corrections, terminating the current operation, and notifying the user. Real-time update and error feedback: If the calculation results need to be updated in real time and stored in the corresponding attributes, when an error is caught during the calculation process, the calculation should be stopped immediately, the corresponding error status attribute should be updated, and the error should be reported to the user.