A game development method and device based on a packaged function library
By encapsulating the layered architecture of the function library and using a lightweight script engine, the problem of low development efficiency in rehabilitation medical equipment games has been solved, cross-platform adaptation and security management have been achieved, and development efficiency and system performance have been improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-31
AI Technical Summary
The development of games related to rehabilitation medical equipment faces challenges such as limited hardware resources, high development complexity, and high costs for cross-platform adaptation and maintenance, resulting in low development efficiency.
It adopts a layered architecture based on encapsulated function libraries, including a game base layer, agent layer, tool component layer and control protocol layer. It integrates a lightweight script engine, develops game logic through preset interfaces, and dynamically loads and updates game behavior at runtime.
It improves game development efficiency, reduces system resource requirements, simplifies hardware resource management, supports cross-platform adaptation, and ensures security and performance optimization.
Smart Images

Figure CN121255151B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game development for embedded systems in rehabilitation medicine, and more specifically, to a game development method and apparatus based on an encapsulated function library. Background Technology
[0002] Currently, in the field of rehabilitation medical equipment, users often need to perform thousands of repetitive rehabilitation medical movements on the equipment to achieve training goals. For example, the recovery of grip strength in the arm requires repeated "grip-relax" movements; the recovery of arm muscles requires repeated raising and lowering of the arm, etc. The process is extremely tedious and boring, and patients (especially children or the elderly) are prone to developing resistance, resulting in poor training effects.
[0003] Currently, there are several initiatives to develop mini-games to aid patients in their rehabilitation training. For example, for arm muscle recovery training, a "racing" game could be developed, where users can control the direction of the "race car" by pushing the robotic arm of the medical device. For wrist rotation rehabilitation training, a "screw-tightening" game could be developed. Some rehabilitation medical devices also allow users to control robotic arms to complete tasks such as "cooking in a virtual kitchen" or "flying an airplane through a circle." Alternatively, soft robotic gloves could be used to design games that focus on fine motor skills training of the fingers, such as "grabbing building blocks" or "sorting beans." For more details, please refer to the patent application with application number 202510544230.2.
[0004] These types of mini-games are typically installed as embedded modules in rehabilitation medical equipment systems. Specifically, the game logic, rendering, and interactive functions need to be integrated into the existing control motherboard of the rehabilitation medical equipment. In this case, the control motherboard must simultaneously run the mini-game and handle core training functions such as motor control, sensor data acquisition, and safety monitoring. This leads to challenges for developers, including limited hardware resources, high development complexity, and high costs associated with cross-platform adaptation and maintenance. Common pain points include:
[0005] Insufficient hardware abstraction layer: Device interfaces such as screen, audio, and execution components are scattered, and game logic is coupled with specific hardware.
[0006] Basic functionalities are scattered: Commonly used capabilities such as timing, screen caching, and graphics rendering lack unified encapsulation. Cross-platform compatibility is difficult: Build configurations are scattered across different target platforms, resulting in high costs for unified build and adaptation.
[0007] Inconsistent lifecycle management: Management of initialization, operation, pause, termination, etc. is not standardized.
[0008] The aforementioned problems ultimately lead to low efficiency in game development for rehabilitation medical equipment, and there is currently no good solution. Summary of the Invention
[0009] This invention provides a game development method and apparatus based on an encapsulated function library, which at least solves the problem of low game development efficiency in related technologies.
[0010] According to an embodiment of the present invention, a game development method based on an encapsulated function library is provided, comprising:
[0011] Obtain the target functions required for game development, wherein the target functions are obtained by filtering and selecting historical development data;
[0012] The target functions are organized through a pre-defined layered architecture to form an encapsulated function library. The layered architecture includes a game base layer, a game agent layer, a tool component layer, and a control protocol layer. A lightweight script engine is integrated into the encapsulated function library, and the game logic is defined as an external script file. During game runtime, the script engine parses and executes the external script file to achieve dynamic loading and updating of game behavior.
[0013] Game logic is developed based on the interfaces provided by the encapsulated function library.
[0014] In one exemplary embodiment, organizing the target functionality through the game base layer includes:
[0015] Obtain a standard game base class, and define the target interface in a standardized manner based on the standard game base class, wherein the target interface includes at least one of initialization, main loop execution, pause and resume, and end cleanup;
[0016] The game information is organized through the first structural tool of the game base layer, wherein the game information includes at least one of the following: game name, version, configuration parameters, and running status.
[0017] The first information is defined and mapped using the second structural tool of the game's base layer to adapt to the basic requirements of different display interfaces. The first information includes at least color information.
[0018] In one exemplary embodiment, organizing the target functionality through the game proxy layer includes:
[0019] The target device is encapsulated with a unified interface through a third-party architecture tool, and device availability checks, initialization / release processes, and error path logging are provided.
[0020] In one exemplary embodiment, organizing the target functionality through the tool component layer includes:
[0021] Timer encapsulation is performed using the fourth structure tool;
[0022] Screen caching and update optimization strategies are encapsulated using the fifth-structure tool;
[0023] The sixth structure tool is used for graphical drawing interface processing to provide a multi-level log output interface.
[0024] In one exemplary embodiment, organizing the target function through the control protocol layer includes:
[0025] Define the basic control protocol and command data structure in the first path.
[0026] In one exemplary embodiment, after developing the game logic based on the interface provided by the encapsulated function library, the method further includes:
[0027] In the first mode, obtain the resource budget and the actual performance metrics of the system during runtime;
[0028] When the actual performance indicators exceed the resource budget, performance profiling is performed to obtain performance analysis information.
[0029] In the second mode, resource optimization operations are performed based on the performance analysis information, wherein the performance analysis information includes the estimated amount of performance resources saved, the optimization level, and the weight corresponding to the optimization level.
[0030] In one exemplary embodiment, the method further includes:
[0031] The game proxy layer performs real-time verification of the hardware control commands issued by the game logic to the execution component based on an independently configured security policy file.
[0032] If the hardware control command exceeds the scope defined in the security policy file, the game proxy layer intercepts the hardware control command.
[0033] According to another embodiment of the present invention, a game development apparatus based on a packaged function library is provided, comprising:
[0034] The function acquisition module is used to acquire the target functions required for game development, wherein the target functions are obtained by filtering and screening historical development data;
[0035] An encapsulation module is used to organize the target functions through a preset layered architecture and form an encapsulated function library. The layered architecture includes a game base layer, a game agent layer, a tool component layer, and a control protocol layer. A lightweight script engine is integrated into the encapsulated function library, and the game logic is defined as an external script file. During game runtime, the script engine parses and executes the external script file to achieve dynamic loading and updating of game behavior.
[0036] The development module is used to develop game logic based on the interfaces provided by the encapsulated function library.
[0037] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0038] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0039] This invention organizes and encapsulates the target functions to be implemented through a pre-defined layered architecture, which can greatly improve game development efficiency. Therefore, it can solve the problem of low game development efficiency and achieve the effect of improving game development efficiency. Attached Figure Description
[0040] Figure 1 This is a flowchart of a game development method based on an encapsulated function library according to an embodiment of the present invention;
[0041] Figure 2 This is a structural block diagram of a game development device based on an encapsulated function library according to an embodiment of the present invention. Detailed Implementation
[0042] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0043] In the following description, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0044] Furthermore, in this application, directional terms such as "upper," "lower," "left," and "right" may be defined relative to the orientation of the components shown in the accompanying drawings. It should be understood that these directional terms can be relative concepts, used for relative description and clarification, and may change accordingly depending on the orientation of the components in the accompanying drawings.
[0045] In this application, unless otherwise expressly specified and limited, the term "connection" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral part; it can be a direct connection or an indirect connection through an intermediate medium. Furthermore, the term "coupled" can refer to an electrical connection that enables signal transmission.
[0046] As used herein, “about,” “approximately,” or “approximately” includes the stated value and the average value within an acceptable range of deviation from the given value, wherein the acceptable range of deviation is determined by a person skilled in the art taking into account the measurement under discussion and the error associated with the measurement of the given quantity (i.e., the limitations of the measurement system).
[0047] Example 1
[0048] This embodiment provides a game development method based on a packaged function library. Figure 1 This is a flowchart of a game development method based on an encapsulated function library according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0049] Step S11: Obtain the target functions required for game development, wherein the target functions are obtained by filtering and selecting historical development data;
[0050] In this embodiment, developers or users first select or input the functions to be implemented through the interactive interface, or filter the functions based on historical data using a filtering tool to obtain the best and simplest functions, and then carry out subsequent development based on these functional requirements.
[0051] Step S12: The target functions are organized through a preset layered architecture to form an encapsulated function library. The layered architecture includes a game base layer, a game agent layer, a tool component layer, and a control protocol layer. A lightweight script engine is integrated into the encapsulated function library, and the game logic is defined as an external script file. During game runtime, the script engine parses and executes the external script file to achieve dynamic loading and updating of game behavior.
[0052] In this embodiment, the required functions are compiled and organized through the game base layer, game agent layer, tool component layer and control protocol layer, respectively, so as to quickly realize game development; and in order to improve the subsequent game running efficiency, a lightweight script engine can also be encapsulated into the function library.
[0053] The game's foundation layer provides the game lifecycle and basic interfaces; the game agent layer abstracts and encapsulates devices such as screen, audio, and execution components; the tool component layer provides general capabilities such as timers, screen caching, and graphics rendering; and the control protocol layer provides control protocol definitions and interface entry points. Specifically, the game foundation layer first obtains and defines a standardized game base class to cover interfaces such as initialization, main loop execution, pause and resume, and end cleanup, thereby standardizing the basic process of the game project and achieving lifecycle management. Then, it organizes game information such as game name, version, configuration parameters, and running status through structures like `GameInfo` (the first structure tool), which can be tailored or extended according to project needs. Finally, it provides commonly used color definitions and mappings through utility classes like `GameColor` (the second structure tool) to adapt to the basic requirements of different display interfaces, thus building a color system. Similarly, the game agent layer first abstracts the device, that is, it encapsulates the screen, audio, and execution components (such as motors / vibrations) through `GameAgent` (the third structure tool), with typical capabilities including:
[0054] Screen (`agent / Screen). `: Combining basic drawing and display buffering (with `utils / ScreenCache). (To be compatible with) Adaptation to different resolutions / color depths is extended by the project side according to the device.
[0055] Audio (`agent / Audio.hpp`): Placeholder for playback and basic control interface; specific encoding / decoding / streaming processing is integrated by the project depending on the hardware and system capabilities provided.
[0056] Execution components (such as `agent / Motor.hpp` and `agent / Vibrator.hpp`): provide motion control interfaces; specific control strategies and safety limits are implemented by the project according to the equipment specifications.
[0057] GIF(`agent / Gif). `: Provides a simple GIF parsing / playback interface (depending on the repository's implementation capabilities).
[0058] Then, device status and resource management are performed to provide necessary device availability checks, initialization / release processes, and error path logging (in conjunction with `utils / Trace). Complex condition monitoring, automatic calibration, and fault diagnosis can be extended and implemented in the project if needed.
[0059] For the utility component layer, this is achieved through a timer (`utils / GameTimer). `, i.e., the fourth structure tool) provides a high-precision timer encapsulation (based on the existing implementation in the repository) for game timing control, periodic task scheduling, and asynchronous callback triggering; cross-platform adaptation is achieved through internal conditional compilation of the function library or platform-layer implementation provided by the project side; then, it is achieved through screen caching (`utils / ScreenCache). The fifth structural tool provides screen caching and basic update optimization methods (such as dirty areas / incremental updates, provided within the existing implementation scope) to reduce redundant drawing and invalid refreshes, and improve display performance and stability; subsequently, it provides graphics drawing (utils / Trace). The sixth structural tool provides a multi-level log output interface, supporting development debugging and runtime problem localization. Log levels and output backends (console / file / remote) are configured according to the actual project. The control protocol layer defines the basic control protocol and command / data structures in the following path as the interface agreement between the game and external control terminals / devices, thus implementing the protocol definition: `src / controlport / generalctrl / protocol / GameCtrlProtocol.h`. Specific transmission media (such as UDP, serial port, USB, etc.) and encoding / decoding details are implemented by the project side according to the target platform / driver conditions. Additionally, JSON / binary parameter passing, version compatibility strategies, etc., are optional extensions. When the project introduces the corresponding libraries and implementations, unified encoding / decoding and compatibility processing can be added at this layer to achieve protocol integration and expansion.
[0060] It should be noted that when building and deploying across platforms, CMake can be used to manage project builds to support common compilers / toolchains; platform differences can be handled through conditional compilation or toolchain file configuration; and for embedded target platforms, cross-compilation can be configured through toolchain files; specific optimizations (such as real-time kernel options, debugging symbols, and performance analysis integration) are selected by the project according to the target platform and deployment environment.
[0061] Furthermore, the function library incorporates a lightweight scripting engine (such as Lua, mPython, or a self-developed DSL interpreter) and provides two-way binding between C++ and scripting languages. This allows the core game flow, object behavior, and event responses to be written as external script files (such as level1.lua) instead of being hard-coded in C++. When the C++ GameBase executes the run method, it calls the scripting engine to execute these scripts. Meanwhile, the game's required resources, such as images, audio, and configuration files, are preprocessed into a resource package (assets.pak) using a packaging tool. The function library provides a resource manager, allowing resources to be loaded / unloaded from the resource package on demand at runtime. After the device boots up, the C++ framework runs. When a game scene is entered, the framework loads and executes the corresponding logic script. When game logic needs to be updated, developers only need to update the script files and resource packages via the network or external storage and restart the application for the changes to take effect. There is no need to recompile and flash the entire firmware, greatly reducing system resource requirements.
[0062] Additionally, a security boundary supervisor can be integrated into the game proxy layer. This supervisor sits between the game logic's calls to the proxy interface and the actual physical hardware driver, and its workflow is as follows:
[0063] Loading the safety policy: During system initialization, the supervisor loads a separate safety policy file (e.g., safety_profile.json) from non-volatile storage. This file defines the safe operating boundaries of all critical actuators (such as the rehabilitation robot arm, motors, vibration motors, etc.), for example: { "motor_A": { "max_speed": 100, "max_force": 50, "valid_range": [-90, 90]}}.
[0064] Command interception and verification: When the game logic application calls a command such as GameAgent.motor_A.setSpeed, the call is not directly passed to the driver, but is first intercepted by the security boundary supervisor.
[0065] Decision-making and execution: The supervisor compares the command parameters with the loaded security policy. If the request exceeds the limit, the supervisor will execute a pre-defined corrective action, such as clamping the command parameters to a safe value or directly rejecting the command and logging a serious error. Only commands that pass the verification are allowed to proceed. This mechanism ensures that even if there are serious errors in the game logic, the hardware cannot perform dangerous actions, which is crucial for high-safety scenarios such as medical rehabilitation equipment.
[0066] Step S13: Develop game logic based on the interfaces provided by the encapsulated function library.
[0067] In this embodiment, after the functions are organized, modular development can be carried out based on the organized functions, which greatly improves development efficiency.
[0068] Example 2
[0069] The difference from Example 1 is that, based on the encapsulated function library of the game base layer, game proxy layer, and tool component layer, the following steps are further included:
[0070] Development Mode (First Mode): In this mode, a lightweight resource manager is integrated during system build. Developers can define a resource budget for key functional modules or game scenarios. When the application runs on the target hardware, the resource manager will monitor resource consumption in real time, intervene in behaviors that exceed the budget, and generate a detailed performance analysis report.
[0071] Deployment Mode (Second Mode): When preparing to compile the final release version, the build process calls a profiling-guided optimization tool, which reads the performance profiling report and creatively employs an adaptive resource degradation algorithm based on a cost-benefit model to guide automated optimization.
[0072] The core of this algorithm lies in calculating an Optimization Efficiency Index (OEI) for each potential resource degradation operation (e.g., reducing the resolution of an image from 1024x1024 to 512x512). The formula for calculating this index is as follows:
[0073]
[0074] in, Represents normalized performance benefits. This indicates the estimated amount of performance resources that can be saved after performing the downgrade operation (e.g., the number of KB of memory or the number of milliseconds of CPU saved). This value is calculated based on the actual data in the performance profiling report, combined with resource characteristics (such as the relationship between image format and size). This represents the total budget value corresponding to the performance metric; normalization by dividing by the budget value makes the performance gains of different types (memory, CPU) comparable, thus determining what percentage of the optimization objective can be achieved in a given operation; the denominator This represents the weighted user experience cost, where This indicates the degree of degradation (e.g., mild degradation = 1, moderate = 2, severe = 3). The higher the level, the greater the damage to the picture or sound quality. This indicates the weight of the resource type. Degrading different types of resources has different impacts on user experience; for example, a decrease in the sound quality of background music. It may be lower resolution than the core interactive UI. These weights are less likely to be noticed because they are pre-configured by developers based on application characteristics. It is a global experience sensitivity coefficient (e.g., 0.1 to 1.0) used to adjust the aggressiveness of the overall optimization strategy. The higher the value, the more the system tends to optimize conservatively to protect the user experience.
[0075] In practical applications, the tool calculates the OEI value of all available degradation options and starts executing the operation with the highest OEI. The option with the highest OEI means that it is the best choice to obtain the maximum relative performance return with the least user experience cost. The tool will then execute this process in a loop until the system's various performance indicators have met the budget requirements according to the analysis report.
[0076] This implementation replaces the traditional one-size-fits-all degradation strategy and can intelligently weigh multiple optimization options to achieve refined and optimized resource allocation. By quantifying user experience costs, it ensures that the optimization process always prioritizes sacrificing details that are least important to users, thereby preserving the core quality of the application to the greatest extent while meeting performance constraints. Moreover, the entire optimization process is executed automatically by the tool, and developers can flexibly customize optimization strategies by adjusting weights and sensitivity coefficients to adapt to the needs of different projects or different release channels. It also transforms performance issues from post-event discovery to real-time alerts and interventions during development, greatly shortening the debugging cycle.
[0077] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0078] This embodiment also provides a game development apparatus based on a packaged function library, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0079] Figure 2This is a structural block diagram of a game development apparatus based on a packaged function library according to an embodiment of the present invention, such as... Figure 2 As shown, the device includes:
[0080] The function acquisition module 21 is used to acquire the target functions required for game development, wherein the target functions are obtained by filtering and screening historical development data;
[0081] The encapsulation module 22 is used to organize the target functions through a preset layered architecture and form an encapsulated function library. The layered architecture includes a game base layer, a game agent layer, a tool component layer, and a control protocol layer. A lightweight script engine is integrated into the encapsulated function library, and game logic is defined as external script files. During game runtime, the script engine parses and executes the external script files to achieve dynamic loading and updating of game behavior.
[0082] Development module 23 is used to develop game logic based on the interfaces provided by the encapsulated function library.
[0083] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0084] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0085] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0086] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0087] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0088] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0090] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0091] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A game development method based on a packaged function library, characterized by, The method comprises the following steps: acquiring target functions required for game development, wherein the target functions are obtained by filtering and screening historical development data; organizing the target functions through a preset hierarchical architecture, and forming an encapsulated function library, wherein the hierarchical architecture comprises a game base layer, a game agent layer, a tool component layer, and a control protocol layer, the game agent layer is integrated with a security boundary supervisor, the security boundary supervisor is configured to compare instructions of a game logic application call with a preloaded security policy, and the instructions are released only after passing the verification; the encapsulated function library is integrated with a lightweight script engine, and game logic is defined as an external script file; and during game running, the external script file is parsed and executed through the script engine to realize dynamic loading and updating of game behavior; developing game logic based on an interface provided by the encapsulated function library; after developing game logic based on the interface provided by the encapsulated function library, the method further comprises the following steps: in a first mode, acquiring a resource budget and an actual performance index during system running; when the actual performance index exceeds the resource budget, performing performance profiling processing to obtain performance analysis information; In the second mode, a resource optimization operation is performed according to the performance analysis information, wherein the performance analysis information comprises an estimated amount of saved performance resources, an optimization level, and a weight corresponding to the optimization level; the resource optimization operation comprises cyclically calculating an optimization benefit index corresponding to each potential resource degradation operation by using an adaptive resource degradation algorithm until each performance index meets a budget requirement, and the optimization benefit index is calculated according to the following formula: wherein, represents a normalized performance benefit, represents an estimated amount of performance resources that can be saved after the degradation operation is performed; represents a total budget value corresponding to the performance index; represents a weighted user experience cost, wherein represents a degree level of degradation; represents a weight of a resource type; is a global experience sensitivity coefficient, which is used to globally adjust the aggressiveness of the optimization strategy.
2. The method of claim 1, wherein, organizing the target functions through the game base layer comprises the following steps: acquiring a standard game base class, and defining a target interface based on the standard game base class, wherein the target interface comprises at least any one of initialization, main loop running, pause and recovery, and end cleaning; organizing game information through a first structure tool of the game base layer, wherein the game information comprises at least any one of a game name, a version, configuration parameters, and a running state; defining and mapping the first information through a second structure tool of the game base layer to adapt to basic requirements of different display interfaces, wherein the first information comprises at least color information.
3. The method of claim 1, wherein, organizing the target functions through the game agent layer comprises the following steps: unifying an interface of a target device through a third structure tool, and providing device availability checking, initialization / release flow, and error path log recording.
4. The method of claim 1, wherein, organizing the target functions through the tool component layer comprises the following steps: performing timer encapsulation through a fourth structure tool; performing screen caching and updating optimization strategy encapsulation through a fifth structure tool; performing graphic drawing interface processing through a sixth structure tool to provide a multi-level log output interface.
5. The method of claim 1, wherein, organizing the target functions through the control protocol layer comprises the following steps: defining a basic control protocol and a command data structure in a first path.
6. The method of claim 1, wherein, The method further comprises the following steps: The game agent layer performs real-time verification on a hardware control instruction issued by the game logic to an execution component according to an independently configured security policy file; if the hardware control instruction exceeds a range defined by the security policy file, the game agent layer intercepts the hardware control instruction.
7. A game development apparatus based on a package function library, characterized by comprising: The method comprises the following steps: a function acquisition module is configured to acquire target functions required for game development, wherein the target functions are obtained by filtering and screening historical development data; The encapsulation module is configured to organize the target function through a preset layered architecture, and form an encapsulation function library, wherein the layered architecture comprises a game base layer, a game agent layer, a tool component layer and a control protocol layer, the game agent layer is integrated with a security boundary supervisor, the security boundary supervisor is configured to compare instructions of a game logic application call with a preloaded security policy, and release the instructions only when the instructions pass the verification; a lightweight script engine is integrated in the encapsulation function library, and game logic is defined as an external script file; and during game running, the external script file is parsed and executed through the script engine, so as to realize dynamic loading and updating of game behavior. The development module is configured to develop game logic based on an interface provided by the encapsulation function library. After the game logic is developed based on the interface provided by the encapsulation function library, the method further comprises: In the first mode, an actual performance index of system running and a resource budget are obtained; When the actual performance index exceeds the resource budget, performance profiling processing is performed to obtain performance analysis information; In the second mode, a resource optimization operation is performed according to the performance analysis information, wherein the performance analysis information comprises an estimated amount of saved performance resources, an optimization level, and a weight corresponding to the optimization level; the resource optimization operation comprises cyclically calculating an optimization benefit index corresponding to each potential resource degradation operation by using an adaptive resource degradation algorithm until each performance index meets a budget requirement; and the optimization benefit index calculation formula is: wherein, represents a normalized performance benefit, represents an estimated amount of performance resources that can be saved after the degradation operation is performed; represents a total budget value corresponding to the performance index; represents a weighted user experience cost, wherein represents a degradation level; represents a weight of a resource type; is a global experience sensitivity coefficient, which is used to globally adjust the aggressiveness of the optimization strategy.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is configured to execute the method in any one of claims 1 to 6 when running. 9.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to execute the computer program to execute the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Scene interactive limb active and passive rehabilitation training system based on virtual three-dimensional game
CN120260821A
Game engine system for developing 3D game
CN105005473A
Resource dynamic scheduling technology of distributed cloud computing system
CN117762644A
Cross-platform game architecture, cross-platform game development method and electronic equipment
CN118349217A