Game debugging method, game debugging device, program product and electronic equipment
By adding visual breakpoint markers and generating corresponding code in the game editor, game debugging is simplified, the complexity of debugging user-generated content is solved, and debugging efficiency is improved.
Patent Information
- Application Number
- CN202511020835.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-07-09
- Filing Date
- 2025-07-23
- Publication Date
- 2025-11-07
AI Technical Summary
In existing technologies, user-generated content game editors involve complex and abstract information during debugging, which increases the difficulty of inspection and debugging. Furthermore, log operations are complicated and prone to errors.
A game debugging method is provided, which simplifies the debugging process by adding breakpoint markers to a visual programming graph, generating corresponding code, running the game map in debug mode, pausing code execution, and displaying debugging information.
It reduces the difficulty for users in editing and debugging game content, reduces the time and effort spent viewing redundant information, simplifies the interaction process, and reduces operational errors.
Smart Images

Figure CN120909907A_ABST
Abstract
Description
[0001] This application claims priority to the Chinese Patent Application No. 202510947869.5, filed on July 9, 2025, and entitled "Game Debugging Method, Game Debugging Device, Program Product and Electronic Device". The entire contents of the Chinese Patent Application are incorporated herein by reference. TECHNICAL FIELD
[0002] The present disclosure relates to the technical field of games, and in particular, to a game debugging method, a game debugging device, a program product and an electronic device. BACKGROUND
[0003] Some UGC (User Generated Content) editors of games provide visual programming functions, and users can use graphical editing methods to achieve the required game logic.
[0004] If the visual content edited by the user has a problem, the actual running result may not match the expected logic when the game is running, or even an error may occur. In the related art, the user needs to check and analyze the reasons in the program running log, and then debug the edited content. However, the information in the log is usually complex and abstract, which increases the difficulty of checking and debugging. SUMMARY
[0005] The present disclosure provides a game debugging method, a game debugging device, a program product and an electronic device to at least reduce the difficulty of checking and debugging the edited content of the game.
[0006] According to a first aspect of the present disclosure, a game debugging method is provided, the method comprising: adding a breakpoint identifier in a first programming graph in response to a first editing instruction; wherein the programming graph is a visual object corresponding to the code for implementing the game logic, and the first programming graph is a programming graph associated with a first game map; adding a breakpoint in a first code corresponding to the first programming graph according to the breakpoint identifier to generate a second code; running the first game map in a debugging running mode and executing the second code in response to a game test instruction for the first game map; pausing the execution of the second code in response to the execution reaching the breakpoint in the second code; and displaying debugging information of the first programming graph according to the current execution state of the second code.
[0007] According to a second aspect of the present disclosure, a game debugging device is provided, the device comprising: a breakpoint editing module configured to add a breakpoint identifier in a first programming graph in response to a first editing instruction; wherein the programming graph is a visualized object corresponding to a code for implementing game logic, and the first programming graph is a programming graph associated with a first game map; a code processing module configured to add a breakpoint in a first code corresponding to the first programming graph according to the breakpoint identifier, and generate a second code; a debugging running module configured to run the first game map in a debugging running mode and execute the second code in response to a game testing instruction for the first game map; a code interruption module configured to pause execution of the second code in response to execution reaching a breakpoint in the second code; and a debugging information display module configured to display debugging information of the first programming graph according to a current execution state of the second code.
[0008] According to a third aspect of the present disclosure, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the method of the first aspect and possible implementation manners thereof.
[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method of the first aspect and possible implementation manners thereof by executing the executable instructions.
[0010] The technical solution of the present disclosure has the following beneficial effects:
[0011] The user can add a breakpoint identifier in the first programming graph in a visualized manner, the program side synchronously adds a breakpoint in the first code, generates a second code, runs the first game map in a debugging running mode in response to a game testing instruction, executes the second code, pauses execution of the second code based on a breakpoint in the second code, and displays debugging information. On the one hand, the user can interrupt and debug during code execution according to requirements, which facilitates intuitive viewing of the state during game running, and there is no need to check running logs after the game is run, thereby reducing the difficulty of checking and debugging game editing content. On the other hand, by displaying the debugging information of the first programming graph in the paused state, the user can quickly obtain information directly related to the breakpoint, thereby saving time and effort spent on viewing redundant information. On the other hand, the editing method of visualized addition of breakpoints is implemented, which simplifies the interaction process compared to the operation of inserting and deleting log output nodes, and is conducive to reducing operation errors. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 a schematic diagram showing a system architecture in an embodiment of the present disclosure;
[0013] Figure 2 A flow chart showing a game debugging method in an embodiment of the present disclosure;
[0014] Figure 3 A schematic diagram showing a graphical programming interface in an embodiment of the present disclosure;
[0015] Figure 4 A schematic diagram showing adding a breakpoint identifier in an embodiment of the present disclosure;
[0016] Figure 5 A schematic diagram showing a breakpoint identifier in an embodiment of the present disclosure;
[0017] Figure 6 A schematic diagram showing another adding a breakpoint identifier in an embodiment of the present disclosure;
[0018] Figure 7 A schematic diagram showing code node execution logic in an embodiment of the present disclosure;
[0019] Figure 8 A schematic diagram showing a call stack change in an embodiment of the present disclosure;
[0020] Figure 9 A flow chart showing executing a current to-be-executed node in an embodiment of the present disclosure;
[0021] Figure 10 A structural schematic diagram showing a game debugging apparatus in an embodiment of the present disclosure;
[0022] Figure 11 A structural schematic diagram showing an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] Example embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.
[0024] The accompanying drawings are illustrative of the present disclosure and are not necessarily drawn to scale. Some of the blocks in the drawings can be functional blocks that can not necessarily correspond to a physical or logical entity. These functional blocks can be implemented in software, hardware, or a combination thereof. The embodiments can be implemented in a variety of ways, and should not be limited to the examples set forth herein. The features, structures, or characteristics of the disclosure described herein can be combined in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the various details herein can be implemented in one or more alternative embodiments, or implemented with other methods, components, materials, and the like.
[0025] In the visual programming function of the game UGC editor, if the content edited by the user has a problem, the actual running result of the game deviates from the expected logic, and an error can occur. In the related art, the user needs to check and analyze the cause in the program running log, and then debug the edited content. This method has the following disadvantages:
[0026] The debugging process is complex. The information in the log is usually complex and abstract, and the user needs to have certain professional knowledge to accurately understand its meaning, and spend a lot of time and effort to find the information related to the problem. In addition, sometimes new log output nodes need to be inserted at the place where the problem may exist, and when there are many objects to be viewed, a large number of log output nodes need to be inserted accordingly, which increases the redundant log. After the problem is fixed, the log output nodes corresponding to the redundant log need to be deleted. Thus, the complexity of the debugging process is increased, and other problems can be caused by the operation errors of inserting and deleting log output nodes.
[0027] The program running log can generally only be viewed after the game is run, so the state of the game running cannot be directly observed, which increases the difficulty of checking and debugging.
[0028] In view of one or more of the above problems, the embodiments of the present disclosure provide a game debugging method, which aims to reduce the difficulty of the user in checking and debugging the edited content.
[0029] Figure 1A system architecture diagram showing an operating environment of an embodiment of the present disclosure is shown. The system architecture can include a terminal device 110, a server 120. The terminal device 110 can be a mobile phone, a tablet computer, a personal computer, a smart wearable device, a game console, etc., which has a display function and can display a graphical user interface, which can include an interface of an operating system or an interface of an application program, etc. The terminal device 110 is installed with a game program, such as a client program of an online game. When the terminal device 110 runs the game program, a game interface, such as an interface of a game editing scene or a game testing scene, is displayed through the graphical user interface. The server 120 generally refers to a background system providing a game service in an embodiment of the present disclosure, which can be a server or a cluster of multiple servers. The server 120 is deployed with a game server program for performing game data processing on the server side. The terminal device 110 can be connected with the server 120 through a wired or wireless communication link to perform data transmission. The game debugging method in an embodiment of the present disclosure can be performed by any one or more of the terminal device 110 and the server 120.
[0030] In an embodiment, the above method can be implemented and executed based on a cloud interaction system. The cloud interaction system can be the above system architecture. Various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the running mode of cloud games, the running subject of a game program and the presentation subject of a game picture are separated, and the storage and running of a control and interaction method in a game are completed on a cloud game server (which can be the above server 120). The role of a cloud game client (which can be the above terminal device 110) includes receiving and sending data and presenting a game picture. For example, the cloud game client can be a display device close to a user side with a data transmission function, such as a mobile terminal, a television, a computer, a palmtop computer, etc., and the cloud game server performs information processing. When playing a game or editing a game, a player operates the cloud game client to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, encodes and compresses game picture data, returns the data to the cloud game client through a network, and finally, the cloud game client decodes and outputs the game picture.
[0031] In an embodiment, the above method can be implemented by the terminal device 110 alone. For example, without deploying the server 120, the terminal device 110 can run a game program in a single machine environment and execute the above method.
[0032] Figure 2 An exemplary flow of the method is shown, which can include the following steps S210 to S250:
[0033] In step S210, a breakpoint identifier is added in the first programming graph in response to a first editing instruction; the programming graph is a visualized object corresponding to a code for implementing game logic, and the first programming graph is a programming graph associated with the first game map.
[0034] In step S220, a breakpoint is added in the first code corresponding to the first programming graph according to the breakpoint identifier, to generate a second code.
[0035] In step S230, the first game map is run in a debugging running mode and the second code is executed in response to a game testing instruction for the first game map.
[0036] In step S240, the execution of the second code is paused in response to reaching the breakpoint in the second code.
[0037] In step S250, debugging information of the first programming graph is displayed according to a current execution state of the second code.
[0038] Based on the method, Figure 2 the user can add a breakpoint identifier in the first programming graph in a visualized manner, the program side synchronously adds a breakpoint in the first code to generate a second code, the first game map is run in a debugging running mode and the second code is executed in response to a game testing instruction, the execution of the second code is paused based on a breakpoint in the second code, and debugging information is displayed. On the one hand, the user can interrupt and debug during code execution according to requirements, which facilitates intuitive viewing of the state during game running, and there is no need to check running logs after the game is run, thereby reducing the difficulty of checking and debugging game editing content. On the other hand, the debugging information of the first programming graph is displayed in the paused state, so that the user can quickly obtain information directly related to the breakpoint, saving time and effort spent on viewing redundant information. On the other hand, the editing method of visualized addition of a breakpoint is realized, which simplifies the interaction process compared to the operation of inserting and deleting a log output node, and is conducive to reducing operation errors.
[0039] Each step in the method will be described below. Figure 2
[0040] Referring to Figure 2 In step S210, a breakpoint identifier is added in the first programming graph in response to a first editing instruction; the programming graph is a visualized object corresponding to a code for implementing game logic, and the first programming graph is a programming graph associated with the first game map.
[0041] The present disclosure provides an editor via an application. The application can be a game application with an editing function, in which a user can select a specific option to enter the editor interface while running the game application. In another embodiment, the application can be an editing application, which is not a game application, and provides the editing function but cannot play the game. For example, the editing application can be a game application-attached editing application, which can be run independently of the game application, or a general editing application independent of the game, such as a DCC (Digital Content Creation) software, a game engine, etc. A user can use the editor while running the editing application.
[0042] The editor provides a graphical programming function to support a user to edit a programming graph to implement game logic. For example, the editor provides a graphical programming interface. The graphical programming interface provides a programming graph control configured to generate a corresponding programming graph in the graphical programming interface in response to a trigger instruction. Figure 3 A schematic diagram of the graphical programming interface is shown. Referring to Figure 3 As shown, the graphical programming interface can provide corresponding programming graph controls 301 according to different categories such as events, actions, controls, conditions, values, variables, etc., and each category can provide more subdivided programming graph controls 301, such as the programming graph controls 301 of different events such as “game initialization”, “game end”, “timer expiration”, “receive custom event”, “specified component is clicked”, etc. under the event category. A user can drag a programming graph control 301 to the graphical programming interface, which generates a trigger instruction to generate a programming graph corresponding to the programming graph control 301 in the graphical programming interface, such as dragging the programming graph control 301 of “game initialization” to the graphical programming interface to trigger the generation of the programming graph of “game initialization”. Of course, other operation modes can also be used to generate the trigger instruction, such as clicking the programming graph control 301 and then clicking a certain position in the graphical programming interface to trigger the generation of the corresponding programming graph at the position.
[0043] The developer can pre-configure the corresponding code for the programming graphical control, such as an event category programming graphical control, the code of which can be a statement describing an event, an action category programming graphical control, the code of which can be an instruction function, a condition category programming graphical control, the code of which can be a conditional statement, and the like. Moreover, the programming graphical control can be pre-configured with visual information, including the shape, color, and the like of the programming graph, as well as text, symbols, and the like information used to describe the code logic. In this case, the programming graph generated by the programming graphical control has the visual information of the programming graphical control and corresponds to the code configured by the programming graphical control, facilitating user editing.
[0044] For example, the programming graphical control and the programming graph can be in the form of a building block. A building block is a tangible object that can be assembled. Representing the programming graphical control and the programming graph in the form of a building block facilitates user understanding, and different programming graphs can be assembled to form a logical relationship. For example, a user can assemble a condition programming graph and an action programming graph to form a condition logical relationship, indicating that when the condition in the condition programming graph is met in the game, the action in the action programming graph is triggered to be executed.
[0045] Different categories of programming graphs can have different shapes or colors. The user can combine the programming graphs in the graphical programming interface. Programming graphs with matching shapes can be assembled, thereby ensuring the rationality of the code order, and the visual information such as text in the programming graph facilitates user understanding of the logic after the combination of the programming graphs. The program combines the codes corresponding to the programming graphs in the programming graph combination to form a code that can implement the game logic. As can be seen, the graphical programming interface provides a graphical programming method. The user edits the game logic through the visual graphical combination method, without the need for the user to master professional computer programming knowledge, greatly reducing the threshold and difficulty of programming.
[0046] In the above manner, the user can edit and generate one or more programming graphs in the graphical programming interface to implement the game logic.
[0047] In an implementation, in a game editing stage, a game editing scene corresponding to a first game map can be displayed in a graphical user interface; in response to a programming trigger instruction in the game editing scene, a graphical programming interface is displayed. The first game map is a game map currently edited by the user, which can be any game map, such as a newly created game map, a game map preset in the program, or a game map previously edited by the user or edited by another user. The game editing scene is a scene formed by loading the first game map in an editing mode, in which the user can edit scene components, scene environment, virtual characters, and the like. In the game editing scene, the user can enter the graphical programming interface through the programming trigger instruction, such as providing a graphical programming option in a related setting interface of the game editing scene, and triggering the display of the graphical programming interface when the user clicks the option. The programming graph edited in the graphical programming interface is a programming graph associated with the first game map, referred to herein as the first programming graph. The game logic corresponding to the first programming graph can take effect for the first game map, that is, the code corresponding to the first programming graph is executed when the first game map is run to implement the game logic. Of course, these game logics can also be reused in other game maps through sharing or the like.
[0048] The breakpoint identifier is a visual marker of the breakpoint added in the programming graph. The first editing instruction is an instruction for adding the breakpoint identifier. The user can add the breakpoint identifier in the first programming graph through the first editing instruction, and correspondingly, the program can add the breakpoint in the code node corresponding to the position of the breakpoint identifier (for details, please refer to step S220).
[0049] In an implementation, the first editing instruction includes a first breakpoint adding instruction. The above adding the breakpoint identifier in the first programming graph in response to the first editing instruction includes the following steps:
[0050] In the case where the second target programming graph in the first programming graph is selected, the first breakpoint adding instruction is used to add the breakpoint identifier for the second target programming graph.
[0051] The user can select any one or more programming graphs in the first programming graph as the second target programming graph through point selection, box selection, or the like. The first breakpoint adding instruction is an instruction for adding the breakpoint identifier for the selected programming graph. For example, as shown in FIG. 2, in the case where the second target programming graph (i.e., the second programming graph in the left second row in FIG. 2) is selected, the first breakpoint adding control, i.e., the “Add breakpoint” control in FIG. 2, is provided, and the first breakpoint adding instruction is generated when the user clicks the control, triggering the addition of the breakpoint identifier for the second target programming graph. Figure 4 Figure 4 Figure 4
[0052] In an implementation, the breakpoint identifier can be displayed at an associated position of the second target programming graph, which can include a left side of the second target programming graph, a right side of the second target programming graph, etc. Referring to Figure 5 As shown, in response to the first breakpoint adding instruction in the case that the second target programming graph is selected, the breakpoint identifier 501 is displayed at the left side of the second target programming graph, so that the user can directly see which positions in the first programming graph have added the breakpoint identifier.
[0053] In an implementation, the first editing instruction includes a second breakpoint adding instruction and an adding trigger instruction. The above-mentioned adding the breakpoint identifier in the first programming graph in response to the first editing instruction includes the following steps:
[0054] In response to the second breakpoint adding instruction, the second breakpoint adding control is provided for the candidate programming graph in the first programming graph that supports adding the breakpoint;
[0055] In response to the adding trigger instruction for the second breakpoint adding control, the breakpoint identifier is added for the third target programming graph specified by the adding trigger instruction.
[0056] The second breakpoint adding instruction is an instruction for triggering batch adding of the breakpoint identifier. For example, the control for quickly adding the breakpoint is provided in the running log of the first game map, and the trigger operation (such as the operation of opening the control) of the user for the control generates the second breakpoint adding instruction, which triggers the second breakpoint adding control to be provided for the candidate programming graph in the first programming graph that supports adding the breakpoint.
[0057] The candidate programming graph is a programming graph that supports adding a breakpoint, in other words, other programming graphs in the first programming graph do not support adding a breakpoint. For example, the candidate programming graph includes at least one of the following: an action programming graph, a control programming graph, and a first row of programming graphs in a conditional programming graph having a multi-row structure. The action programming graph represents a specific action performed by a virtual object (such as a game character controlled by a player), which can be a separate game logic and thus supports adding a breakpoint identifier. The control programming graph represents a specific control logic in the game, and each control logic can be a separate game logic and thus supports adding a breakpoint identifier. Of course, a part of the control programming graph can be set to support adding a breakpoint identifier, and another part of the control programming graph can not support adding a breakpoint identifier. The conditional programming graph can have a multi-row structure, such as two branches including a condition that is met and a condition that is not met. One conditional programming graph represents a separate conditional logic, including a logic that is met and a logic that is not met. Therefore, the embodiments of the present disclosure support adding a breakpoint identifier to the first row of programming graphs in the conditional programming graph, which actually represents adding a breakpoint identifier to the entire conditional programming graph, and do not support adding a breakpoint identifier to other rows (such as the branch row of the condition that is not met), which means that a program interrupt cannot be performed on a certain branch logic in the conditional logic, but a program interrupt can be performed on the entire conditional logic. Of course, the specific type of the candidate programming graph is not particularly limited in the present disclosure, and can be set according to specific business needs and game scene characteristics.
[0058] The second breakpoint adding control and the candidate programming graph can be in a one-to-one correspondence. Figure 6 As shown in FIG. 6, when the shortcut breakpoint adding is activated by the second breakpoint adding instruction, the corresponding second breakpoint adding control 601 can be displayed on the left side of each candidate programming graph. The user can implement an adding trigger instruction for the second breakpoint adding control 601 by clicking or the like. The third target programming graph is the programming graph corresponding to the second breakpoint adding control 601 triggered by the adding trigger instruction. For example, when the user clicks the second breakpoint adding control 601 on the left side of the second row of programming graphs on the left side in FIG. 6, the second row of programming graphs is taken as the third target programming graph, and the breakpoint identifier is added. Figure 6
[0059] Continuing to refer to FIG. 6, in step S220, a breakpoint is added in the first code corresponding to the first programming graph according to the breakpoint identifier, and a second code is generated. Figure 2
[0060] The first code can be a code without a breakpoint. Alternatively, before the breakpoint identifier is added this time, the breakpoint identifier already exists in the first programming graph, such as a breakpoint identifier added in a previous editing process. Therefore, the first code can include the previously added breakpoint.
[0061] The code node can be a code segment. According to the position of the breakpoint identifier added in step S210, a breakpoint is added at the corresponding code node in the first code, for example, if the breakpoint identifier is added at the second target programming graph or the third target programming graph, a breakpoint is added at the corresponding code node of the second target programming graph or the third target programming graph in the first code. The code in which the breakpoint is added in the first code, or the original part of the code is modified to realize the breakpoint function.
[0062] In an embodiment, the above-mentioned adding a breakpoint in the first code corresponding to the first programming graph according to the breakpoint identifier, generating the second code, comprises the following steps:
[0063] According to the position of the breakpoint identifier in the first programming graph, determining the first target code in which the breakpoint is to be added in the first code, and determining the preset type code node in the first target code;
[0064] Adding a state management class in the first code, and modifying the preset type code node to a generator-controlled code node to form the second code.
[0065] The first target code can be the code corresponding to the specific programming graph (such as the above-mentioned second target programming graph or the third target programming graph) in which the breakpoint is added in step S210. The preset type code node is a code node suitable for adding a breakpoint logic. For example, the first programming graph can include one or more lines, and each line of programming graph is a statement. The adding of the breakpoint identifier can be set to be accurate to the line, that is, the breakpoint identifier can be added to one or more lines in the first programming graph, but not to a specific programming graph in a line, for example, the breakpoint identifier cannot be set for the programming graph representing a variable in a line. In the case of adding a breakpoint identifier to a line of programming graph, since the code corresponding to a line of programming graph can include multiple code nodes, it is not necessary to modify each code node, but to modify the preset type code node, which reduces the modification degree from the first code to the second code and simplifies the process.
[0066] The preset type code node can be determined according to experience or specific business requirements, game scene characteristics, etc., which are not limited in the present disclosure. For example, the preset type code node can include a traversal node and a condition node.
[0067] The state management class is a class for managing the execution state of an object. By adding the state management class in the first code, the execution state of the code node can be obtained. In addition, by modifying the preset type code node and introducing the generator, the program can be controlled to be interrupted, realizing the breakpoint function.
[0068] For example, the following is part of the first code before adding the breakpoint:
[0069]
[0070]
[0071] It can be seen that the main difference between the second code and the first code is that the state management class EAState is added, and the execution method of the condition node is modified to the code controlled by the yield generator. The EAState can encapsulate the current code node and the parameters required for its running, and pause the execution of the subsequent logic of the current code node when executing to yield until the external attempts to continue execution.
[0072] With reference to Figure 2 In step S230, in response to the game test instruction for the first game map, the first game map is run in a debugging running mode, and the second code is executed.
[0073] The debugging running mode is a test mode containing a debugging function, and the debugging function can be implemented by a breakpoint. For example, in the case where a breakpoint identifier is added in the first programming graph, in response to the game test instruction, the first game map is run in the debugging running mode, and the second code is executed. In addition, in the case where no breakpoint identifier is added in the first programming graph, in response to the game test instruction, the first game map is run in a normal test mode, and the first code without a breakpoint can be executed. The difference between the debugging running mode and the normal running mode is that the debugging running mode supports code running interruption and can trigger the first game map to be paused, and the normal running mode does not support code running interruption.
[0074] With reference to Figure 2 In step S240, in response to the execution to the breakpoint in the second code, the execution of the second code is paused.
[0075] The breakpoint can trigger a running interruption, that is, the execution of the second code is paused. In addition, the first game map can also be paused. For example, in the paused state, the logic after the breakpoint in the second code is not continued to run, and the time of the first game map, objects with dynamic effects, and the like are also paused.
[0076] In an embodiment, the execution of the second code includes the following steps:
[0077] Each code node in the second code is sequentially added to the call stack, and it is determined whether the current to-be-executed node in the call stack is configured with a breakpoint.
[0078] Correspondingly, the pause of the execution of the second code in response to the execution to the breakpoint in the second code includes the following steps:
[0079] If the current to-be-executed node is configured with a breakpoint, the execution of the second code is paused.
[0080] For example, based on the first programming graph shown in Figure 4 , Figure 5 or Figure 6 , the execution logic of each code node when executing the second code is as shown in Figure 7 . Figure 7 The execution order of different code nodes is shown, according to which the code nodes are sequentially added to the call stack, and the node at the top of the stack is taken as the current to-be-executed node. The change of the call stack can be referred to Figure 8 . If the current to-be-executed node is configured with a breakpoint, the execution of the second code is paused, and the reverse order (e.g., from top to bottom) of the code nodes in the call stack at this time represents the current call order.
[0081] In an embodiment, a state management class and a generator are provided in the second code, and the state management class is used to encapsulate the current to-be-executed node. The above-mentioned judgment of whether the current to-be-executed node in the call stack is configured with a breakpoint includes the following steps:
[0082] The state information of the current to-be-executed node returned by the state management class is called by the generator;
[0083] According to the state information, it is judged whether the current to-be-executed node is configured with a breakpoint.
[0084] For example, based on the above part of the second code, the execution logic of the yield generator includes: calling the state information returned by the state management class, which can include whether the current to-be-executed node is configured with a breakpoint; pausing the execution of the second code; and waiting for the response of an external executor. The external executor can obtain the state information returned by the generator, and judge whether the current to-be-executed node is configured with a breakpoint according to the state information. Thus, breakpoint detection is realized.
[0085] In an embodiment, the above-mentioned sequential addition of each code node in the second code to the call stack includes the following steps:
[0086] The current to-be-executed node is encapsulated by the state management class, a state object corresponding to the current to-be-executed node is generated, and the state object is added to the call stack.
[0087] For example, the state management class EAState can encapsulate the information of the current to-be-executed node, such as the parameters required for running, generate a state object (such as an EAState object), and add the state object to the call stack during the execution process. In this way, the snapshot information of the parameters of the current to-be-executed node during the execution process can be obtained, which facilitates the realization of the debugging function.
[0088] In an implementation, the determining whether the current node to be executed in the call stack is configured with a breakpoint comprises the following steps:
[0089] According to the identifier of the current node to be executed, the breakpoint information corresponding to the current node to be executed is searched in the breakpoint information of the first game map; wherein the breakpoint information of the first game map comprises the breakpoint information corresponding to each breakpoint identifier added in the first programming graph;
[0090] If the breakpoint information corresponding to the current node to be executed is found, it is determined that the current node to be executed is configured with a breakpoint;
[0091] If the breakpoint information corresponding to the current node to be executed is not found, it is determined that the current node to be executed is not configured with a breakpoint.
[0092] Wherein, a data management center for storing breakpoint information can be set in the map data of the first game map, and the breakpoint information corresponding to all breakpoint identifiers in the first programming graph can be stored, which can include the identifier (such as the number) of the programming graph where the breakpoint identifier is located or the identifier of the code node where the breakpoint is located, the breakpoint type (such as normal breakpoint, conditional breakpoint), breakpoint condition, breakpoint activation state, etc. Moreover, the user can access and modify the data management center when editing or debugging the first programming graph, and realize real-time updating of the breakpoint information.
[0093] According to the identifier of the current node to be executed, whether the breakpoint information corresponding to the current node to be executed exists in the above-mentioned data management center is searched, if the corresponding breakpoint information is found, it means that the current node to be executed is configured with a breakpoint, if the corresponding breakpoint information is not found, it means that the current node to be executed is not configured with a breakpoint. In this way, it can be quickly and conveniently determined whether the current node to be executed is configured with a breakpoint.
[0094] In an implementation, if the current node to be executed is not configured with a breakpoint, the current node to be executed is executed, and the current node to be executed is removed from the call stack after the execution of the current node to be executed is completed. Subsequently, the code nodes after the current node to be executed can be continuously executed. In addition, if the current node to be executed is configured with a breakpoint, the execution of the second code can be paused before the execution of the current node to be executed, or the execution of the second code can be paused after the execution of the current node to be executed. This depends on the specific setting of the breakpoint code, which can be determined according to specific needs. For example, if it is desired to view the debugging information before the current node to be executed, and it is possible to skip the current node to be executed, the execution of the second code is paused before the execution of the current node to be executed.
[0095] Figure 9 The execution process of the current node to be executed is shown, which comprises:
[0096] In step S910, the current node to be executed is added to the top of the call stack;
[0097] In step S920, it is judged whether the current node to be executed is configured with a breakpoint; if yes, step S930 is executed, and if no, step S940 is executed.
[0098] In step S930, an interruption is entered, and the execution of the second code is paused.
[0099] In step S940, the current node to be executed is executed.
[0100] In step S950, the current node to be executed is removed from the top of the call stack.
[0101] With reference to the above description Figure 2 In step S250, the debugging information of the first programming graph is displayed according to the current execution state of the second code.
[0102] The debugging information is used to show the execution of the second code or the running of the first game map, so as to facilitate the user to analyze the problems in the first programming graph or the second code, and realize the debugging function.
[0103] In an embodiment, the debugging information includes current pause information, and the current pause information can represent the position of the current pause. The above-mentioned displaying the debugging information of the first programming graph according to the current execution state of the second code includes the following steps:
[0104] According to the current execution state of the second code, a target breakpoint triggering the current pause of the execution of the second code is determined, and a first target programming graph in the first programming graph is determined; the target breakpoint is a breakpoint in the second code, and the first target programming graph is added with a target breakpoint identifier corresponding to the target breakpoint;
[0105] The current pause information is displayed according to the first target programming graph.
[0106] The target breakpoint is a breakpoint in which the current pause position of the second code is located, and according to the target breakpoint, it is determined which programming graph in the first programming graph triggers the breakpoint, which is called the first target programming graph. The current pause information is displayed according to the first target programming graph, so that the user can directly see which programming graph the current pause is in.
[0107] In an embodiment, the above-mentioned displaying the current pause information according to the first target programming graph includes at least one of the following steps:
[0108] In the game test scene corresponding to the first game map, the current pause information containing the text information of the first target programming graph is displayed; the game test scene is a scene formed by loading the first game map in a debugging running mode. For example, the current pause information in the form of text can be displayed as “paused at xxx” (xxx is the text information of the first target programming graph).
[0109] In the programming graph preview interface, the first target programming graph is highlighted, and the current pause information includes the programming graph preview interface in which the first target programming graph is highlighted. The programming graph preview interface can be displayed in the form of a window in the game test scene, so that the user can see the corresponding information in the first programming graph when testing the first game map. For example, in response to the pause of the execution of the second code, the programming graph preview interface is displayed in the game test scene, and the first target programming graph is highlighted, for example, the first target programming graph is displayed in the central position of the programming graph preview interface, or the first target programming graph is highlighted, bolded, or displayed in other ways, so that the user can directly see the current pause position.
[0110] In an embodiment, the debugging information includes current state information of one or more program objects in the first programming graph, and the program object can be a variable, etc. The current state information can be the current value of the variable. The above-mentioned displaying of the debugging information of the first programming graph according to the current execution state of the second code includes the following steps:
[0111] In response to the first display instruction, the current state information of one or more program objects is displayed according to the current execution state of the second code.
[0112] For example, the first display instruction triggers a jump from the game test scene to the graphical programming interface, and the current state information of one or more program objects is displayed in the graphical programming interface. In this way, the user can directly see the current state information of the variable, which is beneficial to analyze the problems in the first programming graph.
[0113] In an embodiment, the above-mentioned displaying of the current state information of one or more program objects includes at least one of the following steps:
[0114] The current state information of the program object in the currently selected programming graph is displayed. For example, the graphical programming interface displays the first programming graph, and the user can select one or more programming graphs therefrom, triggering the display of the current state information of the program object in these programming graphs.
[0115] The current state information of the searched program object is displayed. The searched program object is a program object determined according to the user search information. For example, the user can input search information in the search bar, determine the matched program objects according to the search information, and display the current state information of these program objects.
[0116] Display the current state information of the monitored program object in the first programming graph. Wherein, the user can set the monitored program object in the first programming graph in advance, such as adding a monitoring mark on one or more program objects in the first programming graph, indicating that it is set as a monitored program object. In the case of interrupt triggered by breakpoint, the current state information of the monitored program object can be displayed.
[0117] Display the expression associated with the program object. Such as displaying the expression executed by the current to-be-executed node to show the change process of the program object.
[0118] In an embodiment, the debugging information includes breakpoint information, such as breakpoint position, breakpoint condition, etc. The above-mentioned display of the debugging information of the first programming graph according to the current execution state of the second code includes the following steps:
[0119] In response to the second display instruction, display the running log of the first game map, and display the breakpoint information of the target breakpoint that triggers the current pause of the execution of the second code in the running log according to the current execution state of the second code.
[0120] For example, the first display instruction triggers a jump from the game test scene to the running log of the first game map, and displays the breakpoint information of the target breakpoint in the running log. Such as locating the breakpoint information of the target breakpoint in the running log, displaying the breakpoint information of the target breakpoint in the central position of the running log interface, or highlighting the breakpoint information of the target breakpoint in the form of bold, bright, etc.
[0121] In an embodiment, in the case of pausing the execution of the second code, the game debugging method further includes at least one of the following steps:
[0122] In response to the re-run instruction, re-run the first game map in the debugging running mode;
[0123] In response to the single-step debugging instruction, continue to execute the second code, and pause the execution of the second code when executing to the next code node;
[0124] In response to the continue running instruction, continue to execute the second code, and pause the execution of the second code when executing to the next breakpoint. If there is no next breakpoint in the second code, execute to the end of the second code.
[0125] The specific functions of the debugging running mode are described above. In an embodiment, the first code is code without added breakpoints. In response to a game running instruction for the first game map, the first game map is run in the normal running mode, and the first code is executed. Here, the game running instruction is an instruction to run the first game map in a non-editing state (such as a playing state), at which time no debugging is needed, and the first game map can be run in the normal running mode and the first code without breakpoints can be executed. As can be seen, the embodiment of the disclosure maintains at least two sets of code for the first programming graph, including the first code without breakpoints and the second code with breakpoints, and can switch between the two sets of code according to different running modes, to achieve flexible running of the first game map in different modes.
[0126] The embodiment of the disclosure also provides a game debugging device. Referring to Figure 10 As shown in the figure, the game debugging device 1000 includes the following modules:
[0127] The breakpoint editing module 1010 is configured to add a breakpoint identifier in the first programming graph in response to a first editing instruction; wherein the programming graph is a visual object corresponding to code for implementing game logic, and the first programming graph is a programming graph associated with the first game map;
[0128] The code processing module 1020 is configured to add a breakpoint in the first code corresponding to the first programming graph according to the breakpoint identifier, to generate a second code;
[0129] The debugging running module 1030 is configured to run the first game map in a debugging running mode and execute the second code in response to a game testing instruction for the first game map;
[0130] The code interruption module 1040 is configured to pause execution of the second code in response to execution to a breakpoint in the second code;
[0131] The debugging information display module 1050 is configured to display debugging information of the first programming graph according to a current execution state of the second code.
[0132] In an embodiment, the execution of the second code includes:
[0133] Each code node in the second code is sequentially added to a call stack, and it is determined whether a current to-be-executed node in the call stack is configured with a breakpoint;
[0134] The pause of the execution of the second code in response to the execution to the breakpoint in the second code includes:
[0135] If the current to-be-executed node is configured with a breakpoint, the execution of the second code is paused.
[0136] In an implementation, the second code is provided with a state management class and a generator, the state management class is used to encapsulate the current node to be executed; and the determination of whether the current node to be executed in the call stack is configured with a breakpoint comprises:
[0137] the state information of the current node to be executed returned by the state management class is called by the generator;
[0138] the determination of whether the current node to be executed is configured with a breakpoint according to the state information.
[0139] In an implementation, the second code is provided with a state management class and a generator, the state management class is used to encapsulate the current node to be executed; and the determination of whether the current node to be executed in the call stack is configured with a breakpoint comprises:
[0140] the current node to be executed is encapsulated by the state management class, a state object corresponding to the current node to be executed is generated, and the state object is added to the call stack.
[0141] In an implementation, the determination of whether the current node to be executed in the call stack is configured with a breakpoint comprises:
[0142] the breakpoint information corresponding to the current node to be executed is found in the breakpoint information of the first game map according to the identifier of the current node to be executed; wherein the breakpoint information of the first game map comprises the breakpoint information corresponding to each breakpoint identifier added in the first programming graph;
[0143] if the breakpoint information corresponding to the current node to be executed is found, it is determined that the current node to be executed is configured with a breakpoint;
[0144] if the breakpoint information corresponding to the current node to be executed is not found, it is determined that the current node to be executed is not configured with a breakpoint.
[0145] In an implementation, the execution of the second code further comprises:
[0146] if the current node to be executed is not configured with a breakpoint, the current node to be executed is executed, and the current node to be executed is removed from the call stack after the execution of the current node to be executed is ended.
[0147] In an implementation, the generation of the second code according to the breakpoint identifier in the first code corresponding to the first programming graph comprises:
[0148] the first target code to be added with a breakpoint is determined in the first code according to the position of the breakpoint identifier in the first programming graph, and a preset type code node in the first target code is determined;
[0149] adding a state management class in the first code, and modifying the preset type code node into a generator control-based code node to form the second code.
[0150] In an implementation, the first code is a code without added breakpoints; the apparatus is further configured to:
[0151] In response to a game running instruction for the first game map, running the first game map in a normal running mode and executing the first code.
[0152] In an implementation, the debugging information includes current pause information; the displaying of the debugging information of the first programming graph according to the current execution state of the second code includes:
[0153] determining a target breakpoint triggering a current pause execution of the second code according to the current execution state of the second code, and determining a first target programming graph in the first programming graph; the target breakpoint is a breakpoint in the second code, and the first target programming graph is added with a target breakpoint identifier corresponding to the target breakpoint;
[0154] displaying the current pause information according to the first target programming graph.
[0155] In an implementation, the displaying of the current pause information according to the first target programming graph includes at least one of the following steps:
[0156] displaying the current pause information containing text information of the first target programming graph in a game test scene corresponding to the first game map; the game test scene is a scene formed by loading the first game map in a debugging running mode;
[0157] highlighting the first target programming graph in a programming graph preview interface, and the current pause information includes the programming graph preview interface in which the first target programming graph is highlighted.
[0158] In an implementation, the debugging information includes current state information of one or more program objects in the first programming graph; the displaying of the debugging information of the first programming graph according to the current execution state of the second code includes:
[0159] In response to a first display instruction, displaying the current state information of the one or more program objects according to the current execution state of the second code.
[0160] In an implementation, the displaying of the current state information of the one or more program objects includes at least one of the following steps:
[0161] display current state information of a program object in a currently selected programming graph;
[0162] display current state information of a searched program object, the searched program object being determined according to user search information;
[0163] display current state information of a monitored program object in the first programming graph;
[0164] display an expression associated with the program object.
[0165] In an implementation, the debugging information includes breakpoint information; and the displaying the debugging information of the first programming graph according to the current execution state of the second code comprises:
[0166] In response to a second display instruction, display a running log of the first game map, and display, in the running log, breakpoint information of a target breakpoint that triggers a current pause of execution of the second code according to the current execution state of the second code.
[0167] In an implementation, the apparatus is further configured to, in the case of a pause of execution of the second code, perform at least one of the following steps:
[0168] In response to a re-run instruction, re-run the first game map in a debugging running mode;
[0169] In response to a single-step debugging instruction, continue to execute the second code, and pause execution of the second code when execution reaches a next code node;
[0170] In response to a continue running instruction, continue to execute the second code, and pause execution of the second code when execution reaches a next breakpoint.
[0171] In an implementation, the first editing instruction includes a first breakpoint adding instruction; and the adding, in response to the first editing instruction, of a breakpoint identifier in the first programming graph comprises:
[0172] In the case of selection of a second target programming graph in the first programming graph, add, in response to the first breakpoint adding instruction, a breakpoint identifier for the second target programming graph.
[0173] In an implementation, the first editing instruction includes a second breakpoint adding instruction and an adding triggering instruction; and the adding, in response to the first editing instruction, of a breakpoint identifier in the first programming graph comprises:
[0174] In response to the second breakpoint adding instruction, provide a second breakpoint adding control for a candidate programming graph in the first programming graph that supports adding of a breakpoint;
[0175] In response to the adding trigger instruction for adding the control to the second breakpoint, a third target programming graph specified for the adding trigger instruction is added with a breakpoint identification.
[0176] In an embodiment, the candidate programming graph comprises at least one of: an action programming graph, a control programming graph, a first row programming graph in a condition programming graph having a multi-row structure.
[0177] The specific details of the parts of the apparatus described above have been described in detail in the embodiments of the method part, and the undisclosed details can be referred to the embodiment content of the method part, and thus will not be described again.
[0178] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, such division is not mandatory. In fact, according to the example embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into embodied by multiple modules or units.
[0179] The example embodiments of the present disclosure also provide a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the above method.
[0180] In an embodiment, the computer program product can be a tangible product, such as a computer readable storage medium storing the computer program. The readable storage medium can be based on electrical, magnetic, optical, electromagnetic, infrared, etc. signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid state disk (SSD), etc. For example, the computer program product can be a non-volatile storage medium storing the computer program, such as read-only memory, Nand flash memory, etc.
[0181] In an embodiment, the computer program product can be an intangible product. For example, the computer program product can be a virtual digital product, such as an executable file or installation package containing the computer program.
[0182] The code of the computer program can be written in one or more programming languages. Programming languages such as C, Java, C++, and the like. Program code can be executed entirely on a user computing device, or partially on a user computing device, or as a standalone software package, or partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, such as a local area network (LAN), a wide area network (WAN), and the like, or can be connected to an external computing device (for example, through an Internet connection provided by an operator).
[0183] The computer program can be carried or transmitted by electrical, magnetic, optical, electromagnetic, infrared, and the like signals. The electronic device can convert the signal carrying the computer program into a digital signal, and then run the computer program. When the computer program is running on the electronic device, its code is used to make the electronic device execute (more specifically, can make the processor of the electronic device execute) the method steps of various embodiments of the present disclosure, for example: step S210, in response to a first editing instruction, adding a breakpoint identifier in a first programming graph; wherein the programming graph is a visual object corresponding to the code for implementing the game logic, and the first programming graph is the programming graph associated with the first game map; step S220, adding a breakpoint in the first code corresponding to the first programming graph according to the breakpoint identifier, to generate a second code; step S230, in response to a game test instruction for the first game map, running the first game map in a debugging running mode, and executing the second code; step S240, in response to execution to the breakpoint in the second code, pausing the execution of the second code. Step S250, displaying debugging information of the first programming graph according to the current execution state of the second code.
[0184] The above method steps are implemented by the computer program, which supports the user to add a breakpoint identifier in the first programming graph in a visual manner, and the program side synchronously adds a breakpoint in the first code to generate a second code, in response to a game test instruction, runs the first game map in a debugging running mode, and executes the second code, based on the breakpoint in the second code to trigger pausing the execution of the second code, and displays debugging information. On the one hand, the user can interrupt and debug during code execution according to needs, which is convenient for intuitive viewing of the state during game running, without the need to check the running log after the game is run, thereby reducing the difficulty of checking and debugging the game editing content. On the other hand, by displaying the debugging information of the first programming graph in the paused state, the user can quickly obtain information directly related to the breakpoint, saving the time and effort spent on viewing redundant information. On the other hand, the editing method of visual adding of breakpoints is realized, which simplifies the interaction process compared to the operation of inserting and deleting log output nodes, and is conducive to reducing operation errors.
[0185] An exemplary embodiment of the present disclosure also provides an electronic device. The electronic device can include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor performs the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions.
[0186] The following description refers to the accompanying drawings, which illustrate examples of the present disclosure in the form of electronic devices. It is to be understood that Figure 11 The electronic device is exemplarily illustrated in the form of a general computing device. It should be understood that Figure 11 The electronic device 1100 shown is merely an example and should not limit the functions and use range of the embodiments of the present disclosure.
[0187] As Figure 11 shown, the electronic device 1100 can include a processor 1110, a memory 1120, a bus 1130, an I / O (Input / Output) interface 1140, and a network adapter 1150.
[0188] The memory 1120 can include a volatile memory, such as a RAM 1121, a cache unit 1122, and a non-volatile memory, such as a ROM 1123. The memory 1120 can also include one or more program modules 1124, which include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which can include implementation of a network environment. For example, the program modules 1124 can include the modules in the above-described apparatus.
[0189] The processor 1110 can include one or more processing units, such as: an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or a NPU (Neural-Network Processing Unit), etc.
[0190] The processor 1110 can be configured to execute executable instructions stored in the memory 1120 to perform the method steps of various embodiments of the present disclosure, for example: step S210, in response to a first editing instruction, adding a breakpoint identifier in a first programming graph; wherein the programming graph is a visualized object corresponding to code for implementing game logic, and the first programming graph is a programming graph associated with a first game map; step S220, adding a breakpoint in first code corresponding to the first programming graph according to the breakpoint identifier, to generate second code; step S230, in response to a game testing instruction for the first game map, running the first game map in a debugging running mode, and executing the second code; step S240, in response to execution to the breakpoint in the second code, pausing execution of the second code. Step S250, displaying debugging information of the first programming graph according to the current execution state of the second code.
[0191] By executing the above method steps through the processor 1110, the user can add a breakpoint identifier in the first programming graph in a visualized manner, the program side synchronously adds a breakpoint in the first code, generates second code, in response to a game testing instruction, runs the first game map in a debugging running mode, and executes the second code, based on the breakpoint in the second code, triggers pausing execution of the second code, and displays debugging information. In one aspect, the user can interrupt and debug during code execution according to needs, facilitating intuitive viewing of the state during game running, without the need to review running logs after the game runs, reducing the difficulty of checking and debugging game editing content. In another aspect, by displaying the debugging information of the first programming graph in the paused state, the user can quickly obtain information directly related to the breakpoint, saving time and effort spent on viewing redundant information. In still another aspect, the editing method of visualized adding of breakpoints is implemented, simplifying the interaction process compared to the operation of inserting and deleting log output nodes, and being conducive to reducing operation errors.
[0192] The bus 1130 is configured to implement the connection between different components of the electronic device 1100, and can include a data bus, an address bus, and a control bus.
[0193] The electronic device 1100 can communicate with one or more external devices 1200 (such as a keyboard, a mouse, an external controller, etc.) through the I / O interface 1140.
[0194] The electronic device 1100 can communicate with one or more networks through the network adapter 1150, for example, the network adapter 1150 can provide a mobile communication solution such as 3G / 4G / 5G, or provide a wireless communication solution such as a wireless local area network, Bluetooth, near field communication, etc. The network adapter 1150 can communicate with other modules of the electronic device 1100 through the bus 1130.
[0195] AlthoughFigure 11 Other hardware and / or software modules can also be included in electronic device 1100, as desired, including but not limited to displays, microcode, device drivers, redundant processors, external disk drive arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, data backup storage systems, etc.
[0196] As can be seen, the technical solutions of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented as follows: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be referred to as "circuitry", "module" or "system", respectively.
[0197] It should be understood that the present disclosure is not limited to the specific methods steps or structural components described above and shown in the drawings, and various modifications and changes can be made without departing from the scope of the present disclosure. Based on the specific embodiments provided by the present disclosure, those skilled in the art will easily think of other embodiments. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and should cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure, and include common knowledge or conventional technical means in the technical field that are not disclosed by the present disclosure.
Claims
1. A game debugging method characterized by comprising: The method comprises: adding a breakpoint identifier in the first programming graph in response to a first editing instruction; wherein the programming graph is a visualized object corresponding to code for implementing game logic, and the first programming graph is a programming graph associated with a first game map; adding a breakpoint in first code corresponding to the first programming graph according to the breakpoint identifier to generate second code; running the first game map in a debugging running mode and executing the second code in response to a game testing instruction for the first game map; pausing execution of the second code in response to execution reaching a breakpoint in the second code; displaying debugging information of the first programming graph according to a current execution state of the second code.
2. The method of claim 1, wherein, The execution of the second code comprises: adding each code node in the second code into a call stack in turn and judging whether a current to-be-executed node in the call stack is configured with a breakpoint; The pausing of the execution of the second code in response to execution reaching the breakpoint in the second code comprises: if the current to-be-executed node is configured with a breakpoint, pausing the execution of the second code.
3. The method of claim 2, wherein, The second code is provided with a state management class and a generator, the state management class is used for encapsulating the current to-be-executed node; the judging of whether the current to-be-executed node in the call stack is configured with a breakpoint comprises: calling state information of the current to-be-executed node returned by the state management class through the generator; judging whether the current to-be-executed node is configured with a breakpoint according to the state information.
4. The method of claim 3, wherein, The adding of each code node in the second code into the call stack in turn comprises: encapsulating the current to-be-executed node through the state management class, generating a state object corresponding to the current to-be-executed node, and adding the state object into the call stack.
5. The method of claim 2, wherein, The judging of whether the current to-be-executed node in the call stack is configured with a breakpoint comprises: finding breakpoint information corresponding to the current to-be-executed node in breakpoint information of the first game map according to an identifier of the current to-be-executed node; wherein the breakpoint information of the first game map comprises breakpoint information corresponding to each breakpoint identifier added in the first programming graph; if the breakpoint information corresponding to the current to-be-executed node is found, it is determined that the current to-be-executed node is configured with a breakpoint; if the breakpoint information corresponding to the current to-be-executed node is not found, it is determined that the current to-be-executed node is not configured with a breakpoint.
6. The method of claim 2, wherein, The execution of the second code further comprises: if the current to-be-executed node is not configured with a breakpoint, executing the current to-be-executed node and removing the current to-be-executed node from the call stack after the execution of the current to-be-executed node ends.
7. The method of claim 1, wherein, The adding of a breakpoint in first code corresponding to the first programming graph according to the breakpoint identifier to generate second code comprises: determining first target code to which a breakpoint is to be added in the first code and determining a preset type code node in the first target code according to a position of the breakpoint identifier in the first programming graph. Add a state management class in the first code, and modify the preset type code node to a generator control-based code node to form the second code.
8. The method of claim 1, wherein, The first code is a code without added breakpoints; and the method further comprises: In response to a game running instruction for the first game map, running the first game map in a normal running mode and executing the first code.
9. The method according to any one of claims 1 to 8, characterized in that, The debugging information comprises current pause information; and displaying the debugging information of the first programming graph according to the current execution state of the second code comprises: Determining a target breakpoint triggering a current pause of executing the second code according to the current execution state of the second code, and determining a first target programming graph in the first programming graph; the target breakpoint is a breakpoint in the second code, and the first target programming graph is added with a target breakpoint identifier corresponding to the target breakpoint; Displaying the current pause information according to the first target programming graph.
10. The method of claim 9, wherein, The displaying of the current pause information according to the first target programming graph comprises at least one of the following steps: Displaying the current pause information containing text information of the first target programming graph in a game test scene corresponding to the first game map; the game test scene is a scene formed by loading the first game map in a debugging running mode; Highlighting the first target programming graph in a programming graph preview interface, and the current pause information comprises the programming graph preview interface in which the first target programming graph is highlighted.
11. The method according to any one of claims 1 to 8, characterized in that, The debugging information comprises current state information of one or more program objects in the first programming graph; The displaying of the debugging information of the first programming graph according to the current execution state of the second code comprises: In response to a first display instruction, displaying the current state information of the one or more program objects according to the current execution state of the second code.
12. The method of claim 11, wherein, The displaying of the current state information of the one or more program objects comprises at least one of the following steps: Displaying the current state information of a program object in a currently selected programming graph; Displaying the current state information of a searched program object, which is a program object determined according to user search information; Displaying the current state information of a monitored program object in the first programming graph; Displaying an expression associated with the program object.
13. The method according to any one of claims 1 to 8, characterized in that, The debugging information comprises breakpoint information; and the displaying of the debugging information of the first programming graph according to the current execution state of the second code comprises: In response to a second display instruction, displaying a running log of the first game map, and displaying, in the running log, breakpoint information of a target breakpoint triggering a current pause of executing the second code according to the current execution state of the second code.
14. The method according to any one of claims 1 to 8, characterized in that, In the case of pausing the execution of the second code, the method further comprises at least one of the following steps: In response to a re-running instruction, re-running the first game map in a debugging running mode; In response to a single-step debugging instruction, continuing to execute the second code, and pausing the execution of the second code when a next code node is executed; In response to the continue running instruction, the second code is continuously executed and execution of the second code is paused at a next breakpoint.
15. The method according to any one of claims 1 to 8, characterized in that, The first editing instruction comprises a first breakpoint adding instruction; and the adding of the breakpoint identifier in the first programming graph in response to the first editing instruction comprises: In a case where a second target programming graph in the first programming graph is selected, a breakpoint identifier is added for the second target programming graph in response to the first breakpoint adding instruction.
16. The method according to any one of claims 1 to 8, characterized in that, The first editing instruction comprises a second breakpoint adding instruction and an adding trigger instruction; The adding of the breakpoint identifier in the first programming graph in response to the first editing instruction comprises: In response to the second breakpoint adding instruction, a second breakpoint adding control is provided for a candidate programming graph in the first programming graph that supports adding of a breakpoint; In response to the adding trigger instruction for the second breakpoint adding control, a breakpoint identifier is added for a third target programming graph specified by the adding trigger instruction.
17. The method of claim 16, wherein, The candidate programming graph comprises at least one of the following: an action programming graph, a control programming graph, and a first row programming graph in a first row of a condition programming graph having a multi-row structure.
18. A game debugging apparatus characterized by comprising: The apparatus comprises: A breakpoint editing module configured to add a breakpoint identifier in a first programming graph in response to a first editing instruction; wherein the programming graph is a visualized object corresponding to code for implementing game logic, and the first programming graph is a programming graph associated with a first game map; A code processing module configured to add a breakpoint in a first code corresponding to the first programming graph according to the breakpoint identifier, and generate a second code; A debugging running module configured to run the first game map in a debugging running mode and execute the second code in response to a game testing instruction for the first game map; A code interruption module configured to pause execution of the second code in response to execution reaching a breakpoint in the second code; A debugging information display module configured to display debugging information of the first programming graph according to a current execution state of the second code.
19. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method of any one of claims 1 to 17.
20. An electronic device, comprising: Comprise: A processor; A memory for storing executable instructions of the processor; The processor is configured to implement the method of any one of claims 1 to 17 by executing the executable instructions.