A game development system and method
Through the automatic code conversion, automatic connection code generation, vulnerability detection and scoring modules in the game development system, the connection error problem caused by different code writing styles and formats is solved, and high-quality game code connection and operation is achieved.
Patent Information
- Application Number
- CN202310812257.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-07-04
AI Technical Summary
In the prior art, due to the different code writing styles and code formats of each person, the format and parameters are different when the code is connected, which leads to errors in running after the code is connected.
It provides a game development system, including a code input module, a code connection code automatic generation module, a code connection module, a code vulnerability detection module, a background processing module, a code rating module and a code similarity detection module. Through these modules, the system can automatically convert different types of code into a unified type, automatically generate connection codes, and perform vulnerability detection and scoring to ensure that code connections are carried out in the same format.
In an automated way, ensuring that code connections are carried out in the same format, avoiding connection errors due to different code formats, and ensuring code quality through vulnerability detection and scoring, reducing the occurrence of game code operation errors.
Smart Images

Figure CN117032648B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to game development technology, and in particular to a game development system and method. Background Art
[0002] Electronic games, also known as video games or video games, refer to all interactive games that rely on electronic equipment platforms to run. According to different media, they are divided into five categories: console games (also known as home console games, TV games), handheld games, computer games, arcade games and mobile games (mainly mobile games).
[0003] With the rapid development of science and technology, people's requirements for game quality are getting higher and higher, which requires game development companies to pay more attention to the quality of games. In the process of game development, in order to ensure the quality of the game, many staff members will be jointly responsible for the development of a game. In this way, the development content of each staff member is different, but they are interrelated. In this way, it is necessary to ensure that each staff member not only considers the part he or she writes when writing the game code, but also needs to consider the connection relationship between the codes. However, since each person's code writing style and the code format that everyone is familiar with are different, when connecting the code, due to different code formats and different parameter meanings, the code will run incorrectly after connection. Summary of the invention
[0004] The purpose of the present invention is to provide a game development system and method to solve the problem in the prior art that each person's code writing style and the code format that each person is familiar with are different, resulting in different code formats and different parameter meanings when the code is connected, which in turn leads to running errors after the code is connected.
[0005] In order to achieve the above object, the present invention provides the following technical solution: a game development system and method, comprising:
[0006] The code input module is used by different staff members to input the codes they have written personally;
[0007] A connection code automatic generation module, used for receiving different personal codes in the code input module, and automatically generating connection codes according to the connection relationship between different personal codes;
[0008] A code connection module, used to connect different personal codes in the code input module with the code generated by the connection code automatic generation module;
[0009] A code vulnerability detection module is used to receive the code connected in the code connection module and perform code vulnerability detection on the code connected;
[0010] A background processing module is used to receive game codes with problems in each stage and analyze the causes of the code problems. The background processing module sends the analyzed problems to the corresponding person in charge;
[0011] A code scoring module is used to receive the code after code vulnerability detection sent by the code vulnerability detection module;
[0012] The code similarity detection module is used to detect the similarity between the code that has passed the scoring in the code scoring module and the existing code. The code similarity detection module includes:
[0013] A code similarity checking module, wherein the code similarity checking module is used to perform a code similarity check on the codes that are scored as qualified by the code scoring module, wherein the code similarity check includes code similarity detection and code similarity calculation;
[0014] An existing code input module, wherein the existing code input module is used to input source code of an existing game that is currently similar to the game to be developed;
[0015] A code similarity standard input module is used for a user to input a code similarity determination standard.
[0016] Furthermore, the connection code automatic generation module includes:
[0017] A code conversion module, used for receiving different personal codes in the code input module and converting them into a unified code type according to the type of the personal code;
[0018] A connection code template input module, used for inputting an existing connection code template;
[0019] The code parsing module is used to parse the personal code converted in the code conversion module and the connection code template input in the connection code template input module. The code parsing module divides the connection code template and the personal code into Sim type code, Block type code and Include type code according to the type of code. The Sim type code is in the form of cpr.sim.xxx, where xxx is replaced with the parameters required for the personal code to run. The Block type code is in the form of block.Name.xxx. The Block type code is used to give each section of the personal code a corresponding parameter state, traverse each section of the personal code one by one, and obtain the specified parameter interface according to the personal code requirements. The Include type code is in the form of<include(DocName)> , the Include type code is used to embed other connection codes in the personal code, and the Include type code includes not only the header files required for system operation, but also the dynamic files and parameter definition files generated according to the personal code status;
[0020] The connection code generation module is used to generate the connection code that is parsed in the code parsing module and is suitable for the current game code.
[0021] Furthermore, the code vulnerability detection module includes:
[0022] A code intermediate representation graph construction module, wherein the code intermediate representation graph construction module is used to analyze the source code, discard redundant code information, and extract a code attribute graph;
[0023] A data vectorization information generation module, used to embed vertex information in the graph into the form of numerical vectors, and to make the vectorized vertices still have semantic relevance expressions, and the data vectorization information generation module is also used to construct an adjacency matrix;
[0024] A graph representation learning module is used to establish a gated graph neural network model that can process edge information in the attribute graph and memorize long-term vertex propagation information;
[0025] The classification module is used to build a multi-layer perceptron as a classifier and use the graph embedding obtained in the graph representation learning module as the input of the classifier to achieve graph-level prediction of code vulnerabilities.
[0026] Furthermore, the specific working method of the code scoring module is:
[0027] Convert the error results of code performance data and code real-time running performance data into a confusion matrix:
[0028]
[0029] Among them, Aa represents the number of results in which both the code performance data and the code real-time running performance data have errors, Ba represents the number of results in which the code performance data has errors and the code real-time running performance data has no errors, Ab represents the number of results in which the code performance data has no errors and the code real-time running performance data has errors, and Bb represents the number of results in which both the code performance data and the code real-time running performance data have no errors;
[0030] Based on the above confusion matrix, the following accuracy judgment formula is constructed, including:
[0031] Code accuracy formula:
[0032]
[0033] Code accuracy formula:
[0034]
[0035] Code sensitivity formula:
[0036]
[0037] Code specificity formula:
[0038]
[0039] The corresponding code accuracy, code precision, code sensitivity and code specificity are calculated through the above formula and confusion matrix, and the accuracy of the code performance data is measured based on the calculation results.
[0040] Furthermore, the specific calculation method of the code similarity calculation performed by the code similarity checking module is:
[0041] C1, input the code snippet that needs to be tested for similarity;
[0042] C2, obtains the similarity matrix M1 in the first stage of code similarity detection through the similarity detection network;
[0043] C3, determines the target to be detected through the target detection network;
[0044] C4, calculates the similarity matrix m of each code segment of the tracking trajectory of the code to be detected through the trajectory classification network;
[0045] C5, user input similarity weight matrix n;
[0046] C6, multiplying the weight matrix n by each code similarity matrix m can obtain the code similarity matrix M2 of the scenario adjusted by the user;
[0047] C7, after obtaining the similarity matrices M1 and M2 obtained in the two stages, integrates them and outputs them as the final similarity matrix after normalization.
[0048] A game development method, the specific method of the game development is:
[0049] S1, multiple staff members upload their individually written game codes to the game development system;
[0050] S2, receives individual codes of multiple staff members and converts different types of codes into the same type of code;
[0051] S3, automatically generating a connection code according to the connection relationship between different personal codes through a connection code automatic generation module;
[0052] S4, connecting the game codes of multiple staff members through a connection code;
[0053] S5, performing vulnerability check on the code that completes the connection;
[0054] S6, if the code passes the vulnerability check in step S5, code scoring is performed; if the code fails the vulnerability check in step S5, the code is returned to the background processing module and the cause of the code problem is analyzed, and the analyzed problem is sent to the corresponding person in charge;
[0055] S7, if the code score in step S6 is qualified, then perform code similarity detection; if the code score in step S6 is unqualified, then return to the background processing module and analyze the cause of the code problem, and send the analyzed problem to the corresponding person in charge;
[0056] S8, if the code similarity test in step S7 is qualified, the game code is output; if the code similarity test in step S7 is unqualified, the process returns to the background processing module and analyzes the cause of the code problem, and sends the analyzed problem to the corresponding person in charge.
[0057] Compared with the prior art, the game development system and method provided by the present invention ensure that the code connections occur in the same format through the connection code automatic generation module, thereby avoiding code connection errors caused by different code formats, and can automatically select a suitable connection code to avoid game code running errors caused by connection code mismatch. Such a setting can also detect the similarity between the game code that has passed the score in the code scoring module and the existing code through the code similarity detection module, thereby avoiding infringement of the game code. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0059] Figure 1 A schematic diagram of the structure of a game development system provided by an embodiment of the present invention;
[0060] Figure 2 A schematic diagram of the structure of a game development method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0062] Embodiment 1:
[0063] See also Figure 1 , a game development system and method, comprising:
[0064] The code input module is used by different staff members to input the codes they have written personally;
[0065] A connection code automatic generation module, used for receiving different personal codes in the code input module, and automatically generating connection codes according to the connection relationship between different personal codes;
[0066] A code connection module, used to connect different personal codes in the code input module with the code generated by the connection code automatic generation module;
[0067] A code vulnerability detection module is used to receive the code connected in the code connection module and perform code vulnerability detection on the code connected;
[0068] The background processing module is used to receive the game codes with problems in each stage and analyze the causes of the code problems. The background processing module sends the analyzed problems to the corresponding person in charge;
[0069] A code scoring module is used to receive the code after code vulnerability detection sent by the code vulnerability detection module;
[0070] The code similarity detection module is used to detect the similarity between the code that has passed the scoring in the code scoring module and the existing code. The code similarity detection module includes:
[0071] A code similarity checking module is used to perform code similarity checking on the codes that have been scored as qualified by the code scoring module. The code similarity checking includes code similarity detection and code similarity calculation;
[0072] An existing code input module, the existing code input module is used to input source codes of existing games that are similar to the game to be developed;
[0073] The code similarity standard input module is used for users to input code similarity judgment standards.
[0074] In this way, multiple staff members are arranged to upload their personally written game codes to the game development system through the code input module respectively, the personal codes of multiple staff members are received through the code conversion module, and different types of codes are converted into the same type of code, the connection code is automatically generated according to the connection relationship between different personal codes through the connection code automatic generation module, and the game codes of multiple staff members are connected through the connection code, the connected codes are checked for vulnerabilities through the code vulnerability detection module, the codes that pass the vulnerability check are scored through the code scoring module, if the code score is qualified, the code similarity check is performed, and if the code similarity check is qualified, the game code is output.
[0075] The connection code automatic generation module includes:
[0076] A code conversion module, used for receiving different personal codes in the code input module and converting them into a unified code type according to the type of the personal code;
[0077] A connection code template input module, used for inputting an existing connection code template;
[0078] The code parsing module is used to parse the personal code converted in the code conversion module and the connection code template input in the connection code template input module. The code parsing module divides the connection code template and the personal code into Sim type code, Block type code and Include type code according to the type of code. The form of Sim type code is cpr.sim.xxx, where xxx is replaced with the parameters required for the personal code to run. The form of Block type code is block.Name.xxx. Block type code is used to give each section of the personal code a corresponding parameter state, traverse each section of the personal code one by one, and obtain the specified parameter interface according to the personal code requirements. The form of Include type code is<include(DocName)> ,Include type code is used to embed other connection codes in personal code. Include type code includes not only the header files required for system operation, but also dynamic files and parameter definition files generated according to the status of personal code;
[0079] The connection code generation module is used to generate the connection code that is parsed in the code parsing module and is suitable for the current game code.
[0080] In this setting, the personal code converted in the code conversion module and the connection code template input in the connection code template input module are respectively parsed through the code parsing module, and xxx in the Sim type code is replaced with the parameters required for the personal code to run. The corresponding parameter status of each code segment in the personal code is given through the Block type code, each code segment involved in the personal code is traversed one by one, and the specified parameter interface is obtained according to the personal code requirements. Finally, other connection codes are embedded in multiple personal codes through the Include type code. This setting can not only ensure that the code connection occurs in the same format, avoiding code connection errors due to different code formats, but also automatically select the appropriate connection code to avoid game code running errors caused by connection code mismatch.
[0081] Code vulnerability detection modules include:
[0082] The module for constructing the intermediate representation graph of the code uses the Joern tool to analyze the source code, discard redundant code information, and extract the code attribute graph, thereby obtaining a series of information such as the syntax information, control flow information, and data flow information of the complete code;
[0083] Data vectorization information generation module: In the process of constructing the code intermediate representation graph, although the code attribute graph abstracts the source code information and can be intuitively understood by people, the vertex information and edge attribute information are all presented in the form of natural language and logical reasoning, while the deep learning model can only recognize specific numerical vectors as input. Therefore, the information in the graph cannot be directly obtained by the model. In this module, the vertex information in the graph needs to be embedded in the form of numerical vectors, and the vectorized vertices still have a certain semantic relevance expression. At the same time, this module uses the edge connection information and attribute information to construct an adjacency matrix;
[0084] The graph representation learning module is used to build a gated graph neural network model. The gated graph neural network model can process the edge information in the graph and memorize the long-term vertex propagation information. It takes the vertex vectors and adjacency matrix of the code attribute graph as input, continuously trains the model and adjusts the parameters to enable it to learn the deep-level features of the graph.
[0085] The classification module is used to build a multi-layer perceptron as a classifier and use the graph embedding obtained in the graph representation learning module as the input of the classifier to achieve graph-level prediction of code vulnerabilities.
[0086] The specific working method of the code scoring module is:
[0087] Convert the error results of code performance data and code real-time running performance data into a confusion matrix:
[0088]
[0089] Among them, Aa represents the number of results in which both the code performance data and the code real-time running performance data have errors, Ba represents the number of results in which the code performance data has errors and the code real-time running performance data has no errors, Ab represents the number of results in which the code performance data has no errors and the code real-time running performance data has errors, and Bb represents the number of results in which both the code performance data and the code real-time running performance data have no errors;
[0090] Based on the above confusion matrix, the following accuracy judgment formula is constructed, including:
[0091] Code accuracy formula:
[0092]
[0093] Code accuracy formula:
[0094]
[0095] Code sensitivity formula:
[0096]
[0097] Code specificity formula:
[0098]
[0099] The corresponding code accuracy, code precision, code sensitivity and code specificity are calculated through the above formula and confusion matrix, and the accuracy of the code performance data is measured based on the calculation results.
[0100] The specific calculation method of the code similarity calculation performed by the code similarity check module is:
[0101] C1, input the code snippet that needs to be tested for similarity;
[0102] C2, obtains the similarity matrix M1 in the first stage of code similarity detection through the similarity detection network;
[0103] C3, determines the target to be detected through the target detection network;
[0104] C4, calculates the similarity matrix m of each code segment of the tracking trajectory of the code to be detected through the trajectory classification network;
[0105] C5, user input similarity weight matrix n;
[0106] C6, multiplying the weight matrix n by each code similarity matrix m can obtain the code similarity matrix M2 of the scenario adjusted by the user;
[0107] C7, after obtaining the similarity matrices M1 and M2 obtained in the two stages, integrates them and outputs them as the final similarity matrix after normalization.
[0108] The specific calculation formula is as follows:
[0109] Output=add(M1, M2)=add(M1, multiply(M1, W)),
[0110] Where add represents the corresponding matrix addition process, multiply represents the corresponding matrix multiplication process, and M1 and M2 represent the similarity matrices obtained in the first and second stages respectively under the code similarity calculation framework.
[0111] Embodiment 2:
[0112] See also Figure 2 , a game development method, the specific method of game development is:
[0113] S1, multiple staff members upload their individually written game codes to the game development system;
[0114] S2, receives individual codes of multiple staff members and converts different types of codes into the same type of code;
[0115] S3, automatically generating a connection code according to the connection relationship between different personal codes through a connection code automatic generation module;
[0116] S4, connecting the game codes of multiple staff members through a connection code;
[0117] S5, performing vulnerability check on the code that completes the connection;
[0118] S6, if the code passes the vulnerability check in step S5, code scoring is performed; if the code fails the vulnerability check in step S5, the code is returned to the background processing module and the cause of the code problem is analyzed, and the analyzed problem is sent to the corresponding person in charge;
[0119] S7, if the code score in step S6 is qualified, then perform code similarity detection; if the code score in step S6 is unqualified, then return to the background processing module and analyze the cause of the code problem, and send the analyzed problem to the corresponding person in charge;
[0120] S8, if the code similarity test in step S7 is qualified, the game code is output; if the code similarity test in step S7 is unqualified, the process returns to the background processing module and analyzes the cause of the code problem, and sends the analyzed problem to the corresponding person in charge.
[0121] Working principle: When in use, multiple staff members upload their personally written game codes to the game development system through the code input module respectively, receive the personal codes of multiple staff members through the code conversion module, and convert different types of codes into the same type of code, automatically generate connection codes according to the connection relationship between different personal codes through the connection code automatic generation module, and connect the game codes of multiple staff members through the connection code, perform vulnerability check on the connected code through the code vulnerability detection module, and score the code that passes the vulnerability check through the code scoring module. If the code score is qualified, a code similarity test is performed. If the code similarity test is qualified, the game code is output. This setting can not only ensure that the code is connected in the same format through the connection code automatic generation module to avoid code connection errors caused by different code formats, but also automatically select the appropriate connection code to avoid game code running errors caused by connection code mismatch. This setting can also detect the similarity between the game code that has passed the score in the code scoring module and the existing code through the code similarity detection module to avoid infringement of the game code.
[0122] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. A game development system, characterized in that: include: The code input module is used by different staff members to input the codes they have written personally; A connection code automatic generation module, used for receiving different personal codes in the code input module, and automatically generating connection codes according to the connection relationship between different personal codes; A code connection module, used to connect different personal codes in the code input module with the code generated by the connection code automatic generation module; A code vulnerability detection module is used to receive the code connected in the code connection module and perform code vulnerability detection on the code connected; A background processing module is used to receive game codes with problems in each stage and analyze the causes of the code problems. The background processing module sends the analyzed problems to the corresponding person in charge; A code scoring module is used to receive the code sent by the code vulnerability detection module after the code vulnerability detection is completed; The code similarity detection module is used to detect the similarity between the code that has passed the scoring in the code scoring module and the existing code. The code similarity detection module includes: A code similarity checking module, wherein the code similarity checking module is used to perform a code similarity check on the codes that are scored as qualified by the code scoring module, wherein the code similarity check includes code similarity detection and code similarity calculation; An existing code input module, wherein the existing code input module is used to input source code of an existing game that is currently similar to the game to be developed; A code similarity standard input module, wherein the code similarity standard input module is used for a user to input a code similarity determination standard; The connection code automatic generation module includes: A code conversion module, used for receiving different personal codes in the code input module and converting them into a unified code type according to the type of the personal code; A connection code template input module, used for inputting an existing connection code template; The code parsing module is used to parse the personal code converted in the code conversion module and the connection code template input in the connection code template input module. The code parsing module divides the connection code template and the personal code into Sim type code, Block type code and Include type code according to the type of code. The Sim type code is in the form of cpr.sim.xxx, where xxx is replaced with the parameters required for the personal code to run. The Block type code is in the form of block.Name.xxx. The Block type code is used to give each section of the personal code a corresponding parameter state, traverse each section of the personal code one by one, and obtain the specified parameter interface according to the personal code requirements. The Include type code is in the form of<include DocName> , the Include type code is used to embed other connection codes in the personal code, and the Include type code includes not only the header files required for system operation, but also the dynamic files and parameter definition files generated according to the personal code status; The connection code generation module is used to generate the connection code that is parsed in the code parsing module and is suitable for the current game code.
2. A game development system according to claim 1, characterized in that: The code vulnerability detection module includes: A code intermediate representation graph construction module, wherein the code intermediate representation graph construction module is used to analyze the source code, discard redundant code information, and extract a code attribute graph; A data vectorization information generation module, used to embed vertex information in the graph into the form of numerical vectors, and to make the vectorized vertices still have semantic relevance expressions, and the data vectorization information generation module is also used to construct an adjacency matrix; A graph representation learning module is used to establish a gated graph neural network model that can process edge information in the attribute graph and memorize long-term vertex propagation information; The classification module is used to build a multi-layer perceptron as a classifier and use the graph embedding obtained in the graph representation learning module as the input of the classifier to achieve graph-level prediction of code vulnerabilities.
3. A game development system according to claim 1, characterized in that: The specific working method of the code scoring module is as follows: Convert the error results of code performance data and code real-time running performance data into a confusion matrix: ; Among them, Aa represents the number of results in which both the code performance data and the code real-time running performance data have errors, Ba represents the number of results in which the code performance data has errors and the code real-time running performance data has no errors, Ab represents the number of results in which the code performance data has no errors and the code real-time running performance data has errors, and Bb represents the number of results in which both the code performance data and the code real-time running performance data have no errors; Based on the above confusion matrix, the following accuracy judgment formula is constructed, including: Code accuracy formula: ; Code accuracy formula: ; Code sensitivity formula: ; Code specificity formula: ; The corresponding code accuracy, code precision, code sensitivity and code specificity are calculated through the above formula and confusion matrix, and the accuracy of the code performance data is measured based on the calculation results.
4. A game development system according to claim 1, characterized in that: The specific calculation method of the code similarity checking module for code similarity calculation is: C1, input the code snippet that needs to be tested for similarity; C2, obtains the similarity matrix M1 in the first stage of code similarity detection through the similarity detection network; C3, determines the target to be detected through the target detection network; C4, calculates the similarity matrix m of each code segment of the tracking trajectory of the code to be detected through the trajectory classification network; C5, user input similarity weight matrix n; C6, multiplying the similarity weight matrix n by each code segment similarity matrix m can obtain the code similarity matrix M2 in the scenario adjusted by the user; C7, after obtaining the similarity matrices M1 and M2 obtained in the two stages, integrate them and output them as the final similarity matrix after normalization.
5. A game development method applicable to claim 1, characterized in that: The specific methods of game development are: S1, multiple staff members upload their individually written game codes to the game development system; S2, receives individual codes of multiple staff members and converts different types of codes into the same type of code; S3, automatically generating a connection code according to the connection relationship between different personal codes through a connection code automatic generation module; S4, connecting the game codes of multiple staff members through a connection code; S5, performing vulnerability check on the code that completes the connection; S6, if the code passes the vulnerability check in step S5, code scoring is performed; if the code fails the vulnerability check in step S5, the code is returned to the background processing module and the cause of the code problem is analyzed, and the analyzed problem is sent to the corresponding person in charge; S7, if the code score in step S6 is qualified, then perform code similarity detection; if the code score in step S6 is unqualified, then return to the background processing module and analyze the cause of the code problem, and send the analyzed problem to the corresponding person in charge; S8, if the code similarity test in step S7 is qualified, the game code is output; if the code similarity test in step S7 is unqualified, the process returns to the background processing module and analyzes the cause of the code problem, and sends the analyzed problem to the corresponding person in charge.
Citation Information
Patent Citations
Large-scale associated data division method and system based on attribute graph
CN110245271A
Automatic function coverage rate code generation method and device
CN115357494A