Game debugging method, device and equipment and computer readable medium
By executing and monitoring the updates of the project code in the development environment on a real device, and updating the game executable file in real time, the problem of repeated compilation during game development and debugging is solved, and an efficient debugging process is achieved.
Patent Information
- Application Number
- CN202111644316.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2041-12-29
AI Technical Summary
During game development and debugging, repeatedly compiling the complete game code and generating executable files wastes a significant amount of time, resulting in low debugging efficiency.
The executable file of the target game is executed in a real device environment, and the project code is monitored for updates in the connected development environment. The updated project code is obtained in real time and parsed into associated data. The associated data is then used to update the target executable file to display the updated content of the game.
No need to recompile and install on a real device; code changes in the development environment are synchronized directly on the real device in real time, improving debugging efficiency and reducing developer waiting time.
Smart Images

Figure CN114328237B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of game development, and particularly relates to a game debugging method and device, equipment and a computer readable medium. BACKGROUND
[0002] In order to make the game consistent in the development environment and the real machine environment, and avoid the problems in the development environment appearing in the real machine environment, the developer needs to repeatedly debug in the game development stage. Before debugging, the game engineering code needs to be compiled in the development environment to generate an executable file that can be executed outside the development environment (i.e. on the real machine), and the executable file needs to be installed on the real machine to debug the game in development. Even if the developer only wants to see the actual effect of changing a parameter, the game code needs to be recompiled completely, a complete new executable file needs to be generated, and the game program needs to be reinstalled on the real machine. After a long process, the developer can see the changes brought by changing a parameter on the real machine. However, for a large game project, it often takes tens of minutes or even hours to compile the game code completely once. This undoubtedly wastes a lot of time on repeatedly compiling the complete game code and exporting the executable file for the debugging requirement of high frequency of code modification in game development.
[0003] At present, there is no effective solution to the problem of serious waste of time in the game development debugging process. SUMMARY
[0004] The present application provides a game debugging method, device, equipment and computer readable medium to solve the technical problem of serious waste of time in the game development debugging process.
[0005] According to one aspect of the embodiments of the present application, the present application provides a game debugging method, comprising:
[0006] executing a target executable file of a target game on a first device, and monitoring engineering code of the target game on a second device connected to the first device, wherein the first device is used to provide a real machine environment of the target game, the second device is used to provide a development environment and the engineering code of the target game, and the target executable file is obtained by parsing the engineering code;
[0007] In the case where it is monitored that the engineering code is updated, the updated engineering code is obtained; and
[0008] The updated engineering code is parsed into associated data of the executable file, and the associated data is used to update the target executable file according to an update strategy corresponding to the updated engineering code, so that the first device continues to execute the updated target executable file to display the updated content of the target game.
[0009] Optionally, the second device is deployed with a game engineering server, and the game engineering server is configured to monitor and store the engineering code of the target game.
[0010] Optionally, before executing the target executable file of the target game on the first device, the method further comprises:
[0011] connecting to the game engineering server and obtaining the engineering code list and the engineering build script of the target game from the game engineering server;
[0012] downloading the corresponding engineering code according to the engineering code list and inputting the engineering build script into the target compilation engine; and
[0013] parsing the engineering code according to the engineering build script by using the target compilation engine to obtain the target executable file.
[0014] Optionally, in the case where the engineering code is updated, the updated engineering code is obtained, comprising:
[0015] receiving the update notification sent by the game engineering server when the engineering code is updated, and obtaining the updated engineering code from the game engineering server according to the update notification.
[0016] Optionally, parsing the updated engineering code into the associated data of the executable file and updating the target executable file according to the update strategy corresponding to the updated engineering code comprises:
[0017] determining the memory space on the first device where the target executable file is located, wherein the memory space is a storage space on the running memory of the first device;
[0018] reading the data of the target executable file in the memory space and inputting the updated engineering code into the target compilation engine to parse the updated engineering code into the associated data of the executable file; and
[0019] in the case where the update strategy is to replace the engineering code, replacing the corresponding original associated data in the memory space with the associated data parsed from the updated engineering code;
[0020] in the case where the update strategy is to add the engineering code, determining an insertion position in the memory space and storing the associated data parsed from the updated engineering code to the insertion position.
[0021] Optionally, the method further comprises:
[0022] in the case where the debugging instruction is received, extracting the debugging code from the debugging instruction and determining the injection position of the debugging code in the running memory where the target executable file is located;
[0023] Debug code is injected into the target executable file of the target game via injection location; and...
[0024] When the debug code is executed by the first device, receive the debug data returned by the debug code.
[0025] Optionally, after receiving the debug data returned by the debug code, the method further includes:
[0026] When debugging data results in an exception thrown by the debugging code, collect the running parameters of the target game on the first device.
[0027] Send the runtime parameters to the game engineering server;
[0028] After updating the target executable file based on the updated project code on the game's project server, the updated target executable file continues to be executed with the same runtime parameters, and the runtime parameters continue to be monitored; and,
[0029] Once the running parameters meet the target expected values, return a debugging completion message to the game engineering server.
[0030] Optionally, the updated project code is converted to Javascript code, parsed into executable file association data, and the target executable file is updated using the association data according to the update strategy corresponding to the updated project code, including:
[0031] The API interface of the V8 engine is called to parse the updated project code into the associated data of the executable file, and the target executable file is updated according to the update strategy corresponding to the updated project code using the associated data.
[0032] According to another aspect of the embodiments of this application, this application provides a game debugging device, including:
[0033] The startup module is used to execute the target executable file of the target game on the first device and monitor the project code of the target game on the second device connected to the first device. The first device is used to provide the real machine environment of the target game, and the second device is used to provide the development environment and project code of the target game. The target executable file is obtained by parsing the project code.
[0034] The synchronization module is used to retrieve updated project code when updates are detected; and,
[0035] The debugging module is used to parse the updated project code into associated data of the executable file, and use the associated data to update the target executable file according to the update strategy corresponding to the updated project code, so that the updated content of the target game can be displayed when the first device continues to execute the updated target executable file.
[0036] According to another aspect of the embodiments of the present application, the present application provides an electronic device, comprising a memory, a processor, a communication interface and a communication bus, the memory stores a computer program executable on the processor, the memory, the processor and the communication interface communicate through the communication bus, and the processor executes the computer program to implement the steps of the above method.
[0037] According to another aspect of the embodiments of the present application, the present application further provides a computer readable medium having a non-volatile program code executable by a processor, the program code causes the processor to execute the above method.
[0038] The above technical solutions provided by the embodiments of the present application have the following advantages compared with related art:
[0039] The technical solutions of the present application execute the target executable file of the target game on the first device, and monitor the engineering code of the target game on the second device connected to the first device, wherein the first device is used to provide a real machine environment of the target game, the second device is used to provide a development environment and engineering code of the target game, and the target executable file is obtained based on the analysis of the engineering code; in the case that the monitoring of the engineering code is updated, the updated engineering code is obtained; and the associated data of the updated engineering code is parsed into an executable file, and the target executable file is updated according to the update strategy corresponding to the updated engineering code by using the associated data, so that the first device continues to execute the updated target executable file to display the updated content of the target game. The present application directly runs the program code in the development environment on the real machine, and synchronizes the code changes in the development environment on the real machine in real time, without the need for the developer to compile and publish, and without the need to restart the program. The game content changes caused by the code changes in the development environment can be displayed on the real machine in real time, which solves the technical problem of serious waste of time in the game development and debugging process. BRIEF DESCRIPTION OF DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and serve to explain the principles of the present application together with the specification.
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the related art, the accompanying drawings needed to be used in the embodiments or related art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0042] Figure 1 An optional game debugging method hardware environment schematic diagram is provided according to the embodiments of the present application;
[0043] Figure 2This is a schematic diagram of an optional game debugging method provided according to an embodiment of this application;
[0044] Figure 3 This is a block diagram of an optional game debugging device according to an embodiment of this application;
[0045] Figure 4 This is a schematic diagram of an optional electronic device structure provided in an embodiment of this application. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustration and has no specific meaning in itself. Therefore, "module" and "part" may be used interchangeably.
[0048] In related technologies, to ensure consistent game performance between the development environment and the actual device environment, and to prevent issues not present in the development environment from appearing on the actual device, developers need to perform repeated debugging during the game development phase. Before debugging, the game project code needs to be compiled in the development environment to generate an executable file that can be run outside the development environment (i.e., on the actual device). This executable file must then be installed on the actual device for debugging. Even if developers simply want to see the actual effect of modifying a single parameter, they need to completely recompile the game code, generate a new executable file, and reinstall the game program on the actual device. This lengthy process is required before the changes from modifying a single parameter can be observed on the actual device. However, for large-scale game projects, a complete compilation of the game code often takes tens of minutes or even hours. For the frequent code modifications and debugging needs in game development, this undoubtedly wastes a significant amount of time on repeatedly compiling the complete game code and exporting executable files.
[0049] To address the problems mentioned in the background art, according to one aspect of the embodiments of this application, an embodiment of a game debugging method is provided.
[0050] Optionally, in the embodiments of this application, the above-described game debugging method can be applied to, for example, Figure 1 The hardware environment shown consists of terminal 101 and server 103.Figure 1 As shown, the server 103 is connected with the terminal 101 through a network, which can be used to provide services (such as synchronization services, debugging services, etc.) for the terminal or the client installed on the terminal, and a database 105 can be set on the server or independently of the server, which is used to provide data storage services for the server 103. The network includes but is not limited to a wide area network, a metropolitan area network or a local area network, and the terminal 101 includes but is not limited to a PC, a mobile phone, a tablet computer, etc.
[0051] The game debugging method in the embodiment of the application can be executed by the server 103, and can also be executed by the server 103 and the terminal 101 together, for example, Figure 2 As shown, the method can include the following steps:
[0052] In step S202, a target executable file of a target game is executed on a first device, and engineering code of the target game is monitored on a second device connected with the first device, wherein the first device is used to provide a real machine environment of the target game, the second device is used to provide a development environment and the engineering code of the target game, and the target executable file is obtained by parsing the engineering code;
[0053] In step S204, when it is monitored that the engineering code is updated, the updated engineering code is obtained; and
[0054] In step S206, the updated engineering code is parsed into associated data of the executable file, and the target executable file is updated according to an update strategy corresponding to the updated engineering code by using the associated data, so that the first device continues to execute the updated target executable file to display the updated content of the target game.
[0055] Through steps S202 to S206, the program code in the development environment is directly run on the real machine, and the code changes in the development environment are synchronized in real time on the real machine, without the need for the developer to compile and publish, and without the need to restart the program. The game content changes caused by the code changes in the development environment can be displayed in real time on the real machine, which solves the technical problem of serious waste of time in the game development and debugging process.
[0056] In step S202, the target game is a game under development, and the first device is one of the running devices of the target game, i.e. a real machine (such as a mobile phone, a computer, etc.), which is used to provide a real machine environment of the target game. The developer can collect typical machines on the market as real machines to debug the target game, so as to test the running effect of the target game on the real machine. The second device is a development machine of the target game, i.e. a machine installed with game development software and configured with a corresponding game development environment.
[0057] Optionally, the second device is deployed with a game engineering server, which is configured to monitor and store the engineering code of the target game. The game engineering server is connected with the real machine (the first device) and the development machine (the second device) respectively, and is configured to manage and schedule the project engineering of the target game, such as building a project framework of the target game and collecting the codes submitted by multiple developers. The target executable file of the target game on the real machine is obtained by pre-analyzing the engineering code of the target game. In the embodiments of the present application, the engineering code can be Typescript code, Javascript code, etc. The development machine, the real machine and the game engineering server can compile the Typescript code into Javascript code through the V8 engine, and the target executable file can be obtained by analyzing the Javascript code.
[0058] In step S204, optionally, in the case that the monitoring of the engineering code indicates that the engineering code is updated, the updated engineering code is obtained, including:
[0059] The updated notification sent by the game engineering server when the monitoring of the engineering code indicates that the engineering code is updated is received, and the updated engineering code is obtained from the game engineering server according to the updated notification.
[0060] By monitoring the engineering code of the target game on the game engineering server in real time, the code changes can be perceived in real time, and the code changes can be synchronized to the real machine at the first time. The above-mentioned update strategy can include adding, deleting and modifying the engineering code, etc. The update strategy can be determined according to the update information carried by the updated engineering code when the updated engineering code is downloaded. The update information can be the code modification trace embedded by the developer, the update instruction, etc. The update information can also be determined by comparing the changes of the new and old engineering codes after the updated engineering code is downloaded and analyzed. When the code changes are synchronized, the file directory on the game engineering server and the file directory on the real machine can be compared, and the code files of each path can be hash checked. If the check is consistent, it means that the code has not changed, and if the check is inconsistent, it means that the code has changed.
[0061] In step S206, the engineering code on the real machine does not need to be compiled for the entire game project, only the updated part needs to be analyzed as the associated data of the executable file, only the data before the code changes needs to be replaced, and the data of the newly added code needs to be loaded, so that the modified target game can be run on the real machine.
[0062] Optionally, the application can also directly connect the real machine and the development machine, without setting up a game engineering server, so as to directly run the program code in the development environment on the real machine, and synchronize the code changes in the development environment on the real machine in real time, without the need for the developer to compile and publish, and without the need for restarting the program. The game content changes caused by the code changes in the development environment can be displayed on the real machine in real time, thereby solving the technical problem of serious waste of time in the game development and debugging process.
[0063] Optionally, before executing the target executable file of the target game on the first device, the method further comprises:
[0064] Step 1, connecting to the game engineering server and obtaining the engineering code list and engineering build script of the target game from the game engineering server;
[0065] Step 2, downloading the corresponding engineering code according to the engineering code list, and inputting the engineering build script into the target compilation engine; and,
[0066] Step 3, parsing the engineering code according to the engineering build script by using the target compilation engine to obtain the target executable file.
[0067] In the embodiment of the application, before starting the debugging, the real machine needs to be connected to the game engineering server, and the user settings, such as the running mode of the target game, whether it is in the debugging mode or the normal running mode, etc., are read. Finally, the engineering code of the target game is obtained from the game engineering server. If the engineering code is Typescript code, the Typescript code needs to be parsed into Javascript code by using the Typescript compiler (tsc). If the engineering code is Javascript code, the Javascript code can be directly parsed into the target executable file according to the engineering build script. The engineering build script records the modular relationship and the game control flow of the entire project of the target game, and multiple developers jointly maintain these modules. When the Javascript code is parsed according to the engineering build script, the Javascript code of each module is extracted in sequence according to the game control flow, and the target executable file is obtained.
[0068] Optionally, parsing the updated engineering code into the associated data of the executable file, and updating the target executable file according to the update strategy corresponding to the updated engineering code by using the associated data comprises:
[0069] Step 1, determining the memory space on the first device where the target executable file is located, wherein the memory space is a storage space on the running memory of the first device;
[0070] Step 2, reading data of the target executable file in the memory space, and inputting the update engineering code into the target compiling engine to make the target compiling engine parse the update engineering code into associated data of the executable file; and
[0071] Step 3, in the case that the update strategy is replacing the engineering code, replacing the corresponding original associated data in the memory space with the associated data parsed from the update engineering code; in the case that the update strategy is adding the engineering code, determining an insertion position in the memory space, and storing the associated data parsed from the update engineering code to the insertion position.
[0072] In the embodiment of the application, the update code is not stored in the disk of the real machine, but directly stored in the memory of the real machine, to directly modify the running program data, and to realize the modification of the program code and the execution in the running process of the real machine.
[0073] Optionally, the method further comprises:
[0074] Step 1, in the case that the debugging instruction is received, extracting the debugging code from the debugging instruction, and determining an injection position of the debugging code in the running memory where the target executable file is located;
[0075] Step 2, injecting the debugging code into the target executable file of the target game through the injection position; and
[0076] Step 3, receiving the debugging data returned by the debugging code when the debugging code is executed by the first device.
[0077] In the embodiment of the application, the developer can directly inject the debugging code into the game program of the target game in the code update manner, and the debugging program can return the debugging data to the developer at the running time.
[0078] Optionally, after receiving the debugging data returned by the debugging code, the method further comprises:
[0079] Step 1, in the case that the debugging data is an exception thrown by the debugging code, collecting the running parameter of the first device when the target game is running on the first device;
[0080] Step 2, sending the running parameter to the game engineering server;
[0081] Step 3, after updating the target executable file according to the update engineering code on the game engineering server, continuing to execute the updated target executable file based on the same running parameter, and continuing to monitor the running parameter; and
[0082] Step 4, in the case that the running parameter reaches a target expected value, returning the debugging end information to the game engineering server.
[0083] In the related art, a game program is modified and then deployed to a real machine to enable the real machine to run the latest game content. Once a problem occurs during game running, the program needs to be modified and redeployed, which will lose the running environment where the problem occurs. In the embodiments of the present application, the game program can be modified and debugged in real time without exiting the running environment, and the process of modifying the code to change the real machine running parameters is recorded, which greatly improves the game debugging efficiency.
[0084] Optionally, the update engineering code is a Javascript code, the update engineering code is parsed into associated data of the executable file, and the target executable file is updated according to the update strategy corresponding to the update engineering code by using the associated data, including:
[0085] The API interface of the V8 engine is called, the update engineering code is parsed into associated data of the executable file, and the target executable file is updated according to the update strategy corresponding to the update engineering code by using the associated data.
[0086] In the embodiments of the present application, the development machine, the real machine and the game engineering server can parse the Javascript code by the V8 engine to obtain the above target executable file.
[0087] According to another aspect of the embodiments of the present application, as Figure 3 shown, a game debugging apparatus is provided, including:
[0088] The starting module 301 is configured to execute a target executable file of a target game on a first device, and monitor engineering code of the target game on a second device connected to the first device, wherein the first device is configured to provide a real machine environment of the target game, the second device is configured to provide a development environment and the engineering code of the target game, and the target executable file is obtained by parsing the engineering code;
[0089] The synchronization module 303 is configured to acquire updated engineering code when it is monitored that the engineering code is updated; and
[0090] The debugging module 305 is configured to parse the updated engineering code into associated data of the executable file, and update the target executable file according to the update strategy corresponding to the updated engineering code by using the associated data, so that the first device continues to execute the updated target executable file to display the updated content of the target game.
[0091] It should be noted that the starting module 301 in this embodiment can be configured to execute step S202 in the embodiments of the present application, the synchronization module 303 in this embodiment can be configured to execute step S204 in the embodiments of the present application, and the debugging module 305 in this embodiment can be configured to execute step S206 in the embodiments of the present application.
[0092] It should be noted that the above modules and the examples and application scenarios implemented by the corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules can be run in the hardware environment as shown in the device as a part of the device, and can be implemented by software or hardware. Figure 1 The above modules can be implemented by software or hardware.
[0093] Optionally, the second device is deployed with a game engineering server, and the game engineering server is configured to monitor and store the engineering code of the target game.
[0094] Optionally, the game debugging apparatus further comprises a program loading module configured to:
[0095] connect to the game engineering server and obtain the engineering code list and the engineering build script of the target game from the game engineering server;
[0096] download the corresponding engineering code according to the engineering code list and input the engineering build script into the target compilation engine; and
[0097] parse the engineering code according to the engineering build script by using the target compilation engine to obtain the target executable file.
[0098] Optionally, the synchronization module is specifically configured to:
[0099] receive an update notification sent by the game engineering server when the game engineering server monitors that the engineering code is updated, and obtain the updated engineering code from the game engineering server according to the update notification.
[0100] Optionally, the debugging module is specifically configured to:
[0101] determine a memory space in which the target executable file is located on the first device, wherein the memory space is a storage space on a running memory of the first device;
[0102] read the data of the target executable file in the memory space, and input the updated engineering code into the target compilation engine to enable the target compilation engine to parse the updated engineering code into associated data of the executable file; and
[0103] in a case where the update strategy is to replace the engineering code, replace the corresponding original associated data in the memory space with the associated data parsed from the updated engineering code;
[0104] in a case where the update strategy is to add the engineering code, determine an insertion position in the memory space, and store the associated data parsed from the updated engineering code to the insertion position.
[0105] Optionally, the debugging module is further configured to:
[0106] In a case of receiving the debugging instruction, extracting the debugging code from the debugging instruction, and determining an injection position of the debugging code in a running memory where the target executable file is located;
[0107] injecting the debugging code into the target executable file of the target game through the injection position; and
[0108] receiving debugging data returned by the debugging code when the debugging code is executed by the first device.
[0109] Optionally, the debugging module is further configured to:
[0110] collecting a running parameter of the first device when the target game is running on the first device in a case that the debugging data is an exception thrown by the debugging code;
[0111] sending the running parameter to the game engineering server;
[0112] continuing to execute the updated target executable file based on the same running parameter and continuing to monitor the running parameter after the target executable file is updated according to the updated engineering code on the game engineering server; and
[0113] returning debugging end information to the game engineering server in a case that the running parameter reaches a target expected value.
[0114] Optionally, the updated engineering code is a Javascript code, and the debugging module is further configured to:
[0115] calling an API interface of a V8 engine, parsing the updated engineering code into associated data of the executable file, and updating the target executable file according to an update strategy corresponding to the updated engineering code by using the associated data.
[0116] The application directly runs program codes in a development environment on a real machine, and synchronizes code changes in the development environment on the real machine in real time, without the need of developers to compile and publish or restart the program, so that game content changes caused by code changes in the development environment can be displayed on the real machine in real time, thereby solving the technical problem of serious waste of time in a game development and debugging process.
[0117] According to another aspect of the embodiments of the application, the application provides an electronic device, such as Figure 4 As shown in the figure, the electronic device includes a memory 401, a processor 403, a communication interface 405, and a communication bus 407, the memory 401 stores a computer program that can run on the processor 403, the memory 401 and the processor 403 communicate through the communication interface 405 and the communication bus 407, and the processor 403 executes the computer program to implement the steps of the above method.
[0118] The memory, the processor in the electronic device above communicate through a communication bus and a communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0119] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the processor mentioned above.
[0120] The processor mentioned above can be a general-purpose processor including a Central Processing Unit (CPU), a Network Processor (NP), etc. and can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0121] According to another aspect of the embodiments of the present application, a computer program product or a computer program is also provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the steps of any of the embodiments described above.
[0122] Optionally, in the embodiments of the present application, the computer readable medium is configured to store program codes for the processor to perform the following steps:
[0123] The target executable file of the target game is executed on the first device, and the engineering code of the target game is monitored on a second device connected to the first device, wherein the first device is configured to provide a real machine environment of the target game, the second device is configured to provide a development environment and the engineering code of the target game, and the target executable file is obtained based on the engineering code;
[0124] In a case where it is monitored that the engineering code is updated, the updated engineering code is acquired; and
[0125] The updated engineering code is parsed into associated data of an executable file, and the target executable file is updated according to an update strategy corresponding to the updated engineering code by using the associated data, so that the first device continues to execute the updated target executable file to display the update content of the target game.
[0126] Optionally, specific examples in the embodiments can refer to the examples described in the above embodiments, and the embodiments will not be described here again.
[0127] The embodiments of the present application can refer to the above embodiments in the specific implementation, and have corresponding technical effects.
[0128] It can be understood that the embodiments described herein can be realized in hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0129] For software implementation, the units described herein can be implemented by executing the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0130] Those skilled in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0131] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.
[0132] In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the described apparatus embodiments are merely schematic, and the division of the modules is merely a logical function division, and there can be another division manner in actual implementation. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0133] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0134] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can be a physically independent unit, or two or more units can be integrated in one unit.
[0135] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various program codes that can be stored in the medium. It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or action from another entity or action, and do not necessarily require or imply that there is any such actual relationship or order between these entities or actions. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0136] The above description is only a specific implementation of the present application, which enables those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A game debugging method characterized by comprising: The method comprises the following steps: executing a target executable file of a target game on a first device and monitoring engineering code of the target game on a second device connected to the first device, wherein the first device is configured to provide a real machine environment of the target game, the second device is configured to provide a development environment of the target game and the engineering code, the target executable file is obtained by compiling Typescript code into Javascript code by a V8 engine and parsing the Javascript code, and the engineering code comprises the Typescript code; in the case that the engineering code is updated, obtaining updated engineering code; and parsing the updated engineering code into associated data of an executable file and updating the target executable file according to an update strategy corresponding to the updated engineering code by using the associated data, so that the first device continues to execute the updated target executable file to display updated content of the target game, comprising the following steps: determining a memory space of the target executable file on the first device, wherein the memory space is a storage space on a running memory of the first device; reading data of the target executable file in the memory space and inputting the updated engineering code into a target compilation engine to parse the updated engineering code into the associated data of the executable file; and in the case that the update strategy is to replace engineering code, replacing corresponding original associated data in the memory space with the associated data obtained by parsing the updated engineering code; in the case that the update strategy is to add engineering code, determining an insertion position in the memory space and storing the associated data obtained by parsing the updated engineering code into the insertion position.
2. The method of claim 1, wherein, The second device is provided with a game engineering server, and the game engineering server is configured to monitor and store the engineering code of the target game.
3. The method of claim 2, wherein, Before executing the target executable file of the target game on the first device, the method further comprises the following steps: connecting to the game engineering server and obtaining an engineering code list and an engineering build script of the target game from the game engineering server; downloading corresponding engineering code according to the engineering code list and inputting the engineering build script into a target compilation engine; and parsing the engineering code according to the engineering build script by using the target compilation engine to obtain the target executable file.
4. The method of claim 2, wherein, In the case that the engineering code is updated, obtaining updated engineering code, comprising the following steps: receiving an update notification sent by the game engineering server when the engineering code is updated, and obtaining the updated engineering code from the game engineering server according to the update notification.
5. The method of claim 1, wherein, The method further comprises the following steps: in the case that a debugging instruction is received, extracting a debugging code from the debugging instruction and determining an injection position of the debugging code in a running memory where the target executable file is located. injecting the debugging code into a target executable file of the target game through the injection position; and receiving debugging data returned by the debugging code when the debugging code is executed by the first device.
6. The method of claim 5, wherein, After the receiving the debugging data returned by the debugging code, the method further comprises: when the debugging data is an exception thrown by the debugging code, collecting a running parameter of the first device when the target game runs on the first device; sending the running parameter to a game engineering server; after the target executable file is updated according to the updated engineering code on the game engineering server, continuing to execute the updated target executable file based on the same running parameter and continuing to monitor the running parameter; and when the running parameter reaches a target expected value, returning debugging end information to the game engineering server.
7. The method of claim 1, wherein, The updated engineering code is a Javascript code, the parsing the updated engineering code into associated data of an executable file, and updating the target executable file according to an update strategy corresponding to the updated engineering code by using the associated data, comprises: calling an API interface of a V8 engine to parse the updated engineering code into associated data of an executable file, and updating the target executable file according to an update strategy corresponding to the updated engineering code by using the associated data.
8. A game debugging apparatus, comprising: a starting module configured to execute a target executable file of a target game on a first device and monitor an engineering code of the target game on a second device connected to the first device, wherein the first device is configured to provide a real machine environment of the target game, the second device is configured to provide a development environment of the target game and the engineering code, the target executable file is obtained by compiling Typescript code into Javascript code by a V8 engine and parsing the Javascript code on the first device or the second device, and the engineering code comprises the Typescript code; a synchronizing module configured to acquire updated engineering code when it is monitored that the engineering code is updated; and The debugging module is configured to parse the update engineering code into associated data of an executable file, and update the target executable file according to an update strategy corresponding to the update engineering code by using the associated data, so that the first device continues to execute the updated target executable file to display the update content of the target game, and includes: determining a memory space on the first device where the target executable file is located, wherein the memory space is a storage space on a running memory of the first device; reading data of the target executable file in the memory space, and inputting the update engineering code into a target compilation engine, so that the target compilation engine parses the update engineering code into the associated data of the executable file; and in a case where the update strategy is a replacement engineering code, replacing corresponding original associated data in the memory space with the associated data obtained by parsing the update engineering code; in a case where the update strategy is an added engineering code, determining an insertion position in the memory space, and storing the associated data obtained by parsing the update engineering code to the insertion position.
9. An electronic device comprising a memory, a processor, a communication interface and a communication bus, the memory having stored therein a computer program executable on the processor, the memory, the processor being in communication via the communication bus and the communication interface, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.
10. A computer readable medium having non-transitory program code executable by a processor, the program code comprising instructions for: The program code causes the processor to execute the method of any one of claims 1 to 7.
Citation Information
Patent Citations
File testing method and device and computer readable storage medium
CN109634858A