Game spirit treasure control method and device, electronic equipment and storage medium
By implementing the logic for switching the status of spirit treasures on the client side and optimizing energy value management on the server side, the latency and lag issues caused by the numerous functional systems in MMORPG games have been resolved, improving the smoothness and fluidity of the game.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING PIXEL SOFTWARE TECH
- Filing Date
- 2022-12-12
- Publication Date
- 2026-04-17
AI Technical Summary
As MMORPG games introduce more and more features and systems, the amount of server logic processing becomes large, causing game lag and stuttering, which affects the player experience.
Implement the logic for switching the state of the spirit treasure on the client side to reduce interaction with the server. Control the state actions of the bound spirit treasure through a state machine and store the linked list on the server to optimize energy value management.
It reduces the server's workload, lowers game latency and lag, and improves the smoothness and fluidity of game animations.
Smart Images

Figure CN116077931B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer network technology, and more specifically, to a method, device, electronic device, and storage medium for controlling game spirit treasures. Background Technology
[0002] Massive Multiplayer Online Role-Playing Game (MMORPG) is a type of online game. In role-playing games, players take on the role of a fictional character and control many of that character's activities.
[0003] With improvements in graphics, content, and AI, MMORPGs have developed increasingly complex systems, each with its own gameplay elements, such as magical artifacts, multiplayer battles, one-on-one duels, costumes, and mounts. During gameplay, the client constantly interacts with the server to obtain various game data to support player activities. However, this proliferation of systems leads to excessive computational demands on the server's logic, slowing down CPU usage and causing lag and stuttering, resulting in a poor gaming experience for players. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a game spirit treasure control method, device, electronic device and storage medium, which can reduce the computing load of game servers and improve the current problems of high latency and lag in games.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:
[0006] In a first aspect, embodiments of the present invention provide a game spirit treasure control method applied to a client, wherein the client runs a state machine, the state machine including the switching order between the various sub-states of each main state and the duration of each sub-state, the method comprising:
[0007] When a player character is detected switching character states, the player character's state after the switch is obtained;
[0008] The switched character state is taken as the current main state of the player character's bound spirit treasure, and the current state action of the bound spirit treasure is terminated.
[0009] Based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, the state actions of the bound spirit treasure are controlled according to the current main state of the bound spirit treasure.
[0010] Further, the step of controlling the state actions of the bound spirit treasure based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, according to the current main state of the bound spirit treasure, includes:
[0011] Take the first sub-state in the main state as the target state, control the bound spirit treasure to perform the state action corresponding to the target state, and start the timer;
[0012] When the timeout period reaches the duration of the target state, the sub-state that is ordered after the target state in each sub-state of the main state is taken as the next target state to control the next state action of the bound spirit treasure.
[0013] Furthermore, the client communicates with the server, and the server stores multiple linked lists in its running memory;
[0014] When the main state is combat state, and the sub-state is combat skill, the step of controlling the bound spirit treasure to perform the state action corresponding to the target state includes:
[0015] Control the bound magical artifact to perform the skill release action corresponding to the target state;
[0016] The method further includes:
[0017] When the bound spirit treasure performs a skill release action, the energy value of the bound spirit treasure is detected. When the energy value is lower than the charging threshold and the charging conditions are met, the energy value of the bound spirit treasure is replenished based on the spirit treasure data in the linked list corresponding to the bound spirit treasure.
[0018] Furthermore, the spirit treasure data includes the maximum energy value corresponding to the current level of the bound spirit treasure, the number of charging items, and the charging value of each charging item;
[0019] The step of supplementing the energy value of the bound spirit treasure based on the spirit treasure data in the linked list corresponding to the bound spirit treasure includes:
[0020] Send a charging query command to the server; wherein, the charging query command is used to prompt the server to query the linked list corresponding to the bound spirit treasure, and calculate the required number of charging items and the total charging value;
[0021] Receive the charging instruction returned by the server, deduct the number of charging items in the player character's inventory according to the required number, and update the energy value of the bound spirit treasure according to the total charging value.
[0022] Furthermore, the method also includes:
[0023] Check if the player character's inventory contains a charging item corresponding to the energy value. If so, the charging condition is met.
[0024] Furthermore, the method also includes:
[0025] When the energy value is lower than the warning threshold, the color of the energy bar of the bound spirit treasure is switched to a set color to warn the player; wherein, the warning threshold is greater than the charging threshold.
[0026] Furthermore, when the main state is a resting state, the step of controlling the bound magical artifact to perform the state action corresponding to the target state includes:
[0027] Control the bound magical artifact to perform the expressions and / or actions corresponding to the target state.
[0028] Secondly, embodiments of the present invention provide a game spirit treasure control device applied to a client, wherein the client runs a state machine, the state machine includes the switching order between the sub-states of each main state and the duration of each sub-state, and the device includes a state detection module, a state update module and an action control module.
[0029] The state detection module is used to detect when a player character switches between character states and obtain the character state after the switch.
[0030] The state update module is used to set the switched character state as the current main state of the player character's bound spirit treasure, and to terminate the current state action of the bound spirit treasure.
[0031] The action control module is used to control the state actions of the bound spirit treasure based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, according to the current main state of the bound spirit treasure.
[0032] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the game spirit treasure control method as described in the first aspect.
[0033] Fourthly, embodiments of the present invention provide a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the game spirit treasure control method as described in the first aspect.
[0034] The game spirit treasure control method, device, electronic device, and storage medium provided in this invention allow the client to detect when a player character switches character states. The client then uses the switched character state as the current main state of the player character's bound spirit treasure, terminating the previous state actions of the bound spirit treasure. Based on the switching order and duration of each sub-state of the main state recorded by the state machine on the client, the client controls the state actions of the bound spirit treasure. This allows the client to implement the logic for switching the bound spirit treasure's state without needing to interact with the server, reducing server computation and thus minimizing game latency and stuttering, resulting in smoother game animations.
[0035] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0036] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A block diagram of the game spirit treasure control system provided in an embodiment of the present invention is shown.
[0038] Figure 2 This is a schematic flowchart of one of the game spirit treasure control methods provided in an embodiment of the present invention.
[0039] Figure 3 It shows Figure 2 A flowchart illustrating some sub-steps of step S15.
[0040] Figure 4 The second schematic diagram of the game spirit treasure control method provided in the embodiment of the present invention is shown.
[0041] Figure 5 It shows Figure 4 One of the flowcharts for some sub-steps in step S22.
[0042] Figure 6 It shows Figure 4 The second flowchart of some sub-steps in step S22.
[0043] Figure 7 The third schematic diagram of the game spirit treasure control method provided in the embodiment of the present invention is shown.
[0044] Figure 8 A block diagram of the game spirit treasure control device provided in an embodiment of the present invention is shown.
[0045] Figure 9 A block diagram of an electronic device provided in an embodiment of the present invention is shown.
[0046] Reference numerals: 100-Game Spirit Treasure Control System; 110-Server; 120-Client; 130-Game Spirit Treasure Control Device; 140-Status Detection Module; 150-Status Update Module; 160-Action Control Module; 170-Electronic Equipment. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0048] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0049] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0050] With improvements in graphics, content, and intelligence, MMORPGs are developing more and more feature systems, and each feature system offers a wider variety of gameplay options, such as spirit treasures, multiplayer battles, one-on-one duels, costumes, and mounts.
[0051] During gameplay, the client needs to constantly interact with the server to obtain various game data to support player activities. However, as the game's functional systems become increasingly complex, the server's logic requires a large amount of computation, slowing down CPU processing and causing lag and stuttering, resulting in a poor gaming experience for players.
[0052] Based on the above considerations, embodiments of the present invention provide a game spirit treasure control method, which can reduce the computational load on game servers and improve the high latency and lag issues currently existing in games. The following is a description of this game spirit treasure control method.
[0053] The game spirit treasure control method provided in this embodiment of the invention can be applied to, for example... Figure 1 The game spirit treasure control system 100 shown includes a server 110 and multiple clients 120, each of which can communicate with the server 110 via a network.
[0054] Server 110 can be a cluster of servers 110 or a standalone server 110.
[0055] Each client 120 runs (or has a state machine added to it). The state machine includes the switching order between the various sub-states of each main state and the duration of each sub-state. The main states include, but are not limited to: combat state and rest state.
[0056] For Lingbao, the sub-states of combat state include multiple combat skills and / or multiple actions, such as cheering actions and auxiliary combat skills. The resting state includes multiple expressions and / or multiple actions, such as dancing, resting still, and expressions of joy, anger, sorrow, and happiness.
[0057] In one implementation, reference is made to Figure 2 A method for controlling a game's magical artifact is provided, which may include the following steps. In this embodiment, the game magical artifact control method is applied to... Figure 1 Let's take any one of the clients, 120, as an example.
[0058] S11, when the player character is switching character states, the player character state after the switch is obtained.
[0059] S13 sets the switched character state as the current main state of the player character's bound spirit treasure and terminates the current state action of the bound spirit treasure.
[0060] S15, based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, control the state actions of the bound spirit treasure according to the current main state of the bound spirit treasure.
[0061] Spiritual treasures are generally bound to player characters; that is, each spiritual treasure has a corresponding player character, and the state of the spiritual treasure is closely related to the state of the bound player character. For example, when a player character activates a spiritual treasure, if the player character is in combat, the bound spiritual treasure is generally also in combat, releasing skills to assist the player character in battle. If the player character is not in combat (resting), the bound spiritual treasure is also in a resting state.
[0062] When a player character's bound spirit treasure is in the enabled state, if the client 120 detects that the player character on the client 120 has switched character states, for example, from rest state to combat state, then the client obtains the player character's new character state and uses the new character state as the current main state of the player character's bound spirit treasure.
[0063] Client 120 controls the state actions of the bound spirit treasure based on its current main state, combined with the switching order between the sub-states of the main state recorded on the state machine and the duration of each sub-state. For example, when the main state is combat state and the switching order of the sub-states is skill 1—skill 2—skill 3—skill 4—skill 1, then the order of the state actions is: skill 1 release action—skill 2 release action—skill 3 release action—skill 1 release action—skill 1 release action.
[0064] The existing method for controlling game spirit treasures is as follows: the server processes the state switching logic of the spirit treasure animation, and then synchronously sends the animation data to the client to control the state actions of the bound spirit treasure on the client.
[0065] Compared with existing game spirit treasure control methods, the game spirit treasure control method provided in this embodiment of the invention implements the logic processing of the binding spirit treasure state switching on the client side, without the need for client-server interaction. This reduces the server's computational load, thereby reducing game latency and lag on the client side and making game animations smoother.
[0066] To make the animation of binding spirit treasures smoother and reduce the workload on the program, in one possible implementation, refer to Figure 3 Step S15 above may include the following steps.
[0067] S151, take the first substate in the main state as the target state.
[0068] S153, control the bound spirit treasure to perform the state action corresponding to the target state, and start the timer.
[0069] S155, when the timer reaches the duration of the target state, the sub-state that follows the target state in the main state's sub-states is taken as the next target state. Then, return to step S153 to control the next state action of the bound spirit treasure.
[0070] Furthermore, in one implementation, in order to facilitate the addition, deletion, modification, and query of vehicle main states and sub-states, each main state and sub-state of the main state included in the state machine is controlled by an action table.
[0071] Through the above steps S151-S155, various states are controlled by action tables, and sub-states are switched by timing. The state switching process of the bound spirit treasure does not require server participation, and the server or client does not need to detect the state of the bound spirit treasure in real time, which greatly reduces the server's logical operations, reduces latency and lag, and makes the spirit treasure animation smoother.
[0072] In one possible implementation, when the main state of the bound spirit treasure is combat state, the sub-state of the main state is combat skill. In this case, the control of the bound spirit treasure to perform the state action corresponding to the target state in step S153 is achieved by controlling the bound spirit treasure to perform the skill release action corresponding to the target state.
[0073] When a Spirit Treasure unleashes a combat skill, it consumes the Spirit Treasure's energy, such as spiritual power or health. Replenishing the energy requires charging items, which are provided by the player character bound to the Spirit Treasure. The consumption of charging items involves changes to the player character's data, which requires interaction with the server.
[0074] In typical game controls, if a spirit treasure's energy level isn't full, it automatically consumes the player character's charging items to replenish it, leading to excessive energy consumption for the player. During this process, the server updates the player character's data every time a charging item is consumed. Furthermore, every frame tick requires checking if a combat skill can be released. When automatic charging is enabled, the spirit treasure's own conditions need to be checked, and the relevant conditions for the combat skill need to be retrieved from a server table. This table-reading logic is quite complex, and the frequent data updates and interactions consume server resources, causing game lag and stuttering.
[0075] Based on the above considerations, to further improve game latency and lag, charging thresholds and conditions are introduced during the control of the bound spirit treasure's state actions. Multiple linked lists are stored in the server's running memory to reduce the server's logical computation load. Specifically, refer to... Figure 4 The game spirit treasure control method provided in this embodiment of the invention also includes the following steps.
[0076] S21: When a bound spirit treasure is used to perform a skill release action, the energy value of the bound spirit treasure is detected.
[0077] It should be understood that step S152 can be performed before step S21.
[0078] S22, when the energy value is lower than the charging threshold and the charging conditions are met, the energy value of the bound spirit treasure is replenished based on the spirit treasure data in the linked list corresponding to the bound spirit treasure.
[0079] The charging threshold can be flexibly set; for example, it can be 30% or 50% of the energy value. In practice, players can set the charging threshold according to their own needs, or they can use the default value set by the game system.
[0080] When a player character's bound spirit treasure performs a skill release action, the client checks the bound spirit treasure's energy value. When the energy value is lower than the charging threshold and the charging conditions are met, the client replenishes the bound spirit treasure's energy value based on the spirit treasure data recorded in the linked list stored on the server.
[0081] Furthermore, the linked list stored in the server's temporary memory is encapsulated in a hash_multimap container. The hash_multimap container supports bidirectional iteration, meaning it can search in ascending or descending order of sorting, which improves the speed of data retrieval, thereby enhancing query efficiency and server performance.
[0082] In one possible implementation, the data of the spirit treasure recorded in the linked list includes, but is not limited to: the maximum energy value corresponding to the current level of the bound spirit treasure, the number of charging items, and the charging value of each charging item.
[0083] The method for replenishing the energy value of the bound spirit treasure in step S22 can be flexibly chosen. For example, the calculation can be completed on the client and then the data can be synchronized to the server, or the calculation can be completed on the server and then the data can be synchronized to the client.
[0084] In one possible implementation, refer to Figure 5 You can replenish the energy value of the bound spirit treasure by following these steps.
[0085] S222, send a power query command to the server.
[0086] S224: Receives the charging instruction returned by the server, deducts the number of charging items in the player's inventory according to the required number, and updates the energy value of the bound spirit treasure according to the total charging value.
[0087] In this embodiment, the charging query command is used to prompt the server to query the linked list corresponding to the bound spirit treasure, and calculate the required number of charging items and the total charging value.
[0088] The charging query command can include the identifier ID of the bound spirit item and its current energy value. After receiving the charging query command, server 110 retrieves the linked list corresponding to the identifier ID in its temporary memory, obtains the maximum energy value of the bound spirit item from the linked list, and calculates the difference between the maximum energy value and the current energy value to get the total charging value. Then, based on the charging value of the charging items, it calculates the required number of charging items to meet the total charging value.
[0089] If the total number of charging items exceeds the required number, the required number is deducted directly, the quantity of charging items in the linked list is updated, and the charging command is returned to client 120. Client 120 deducts the quantity of charging items from the player character's inventory based on the required number and updates the energy value of the bound spirit treasure.
[0090] If the total number of charging items is less than the required number, all charging items are deducted, the quantity of charging items in the linked list is updated, and a charging command is returned to client 120. Client 120 deducts all charging items, calculates the energy value that all charging items can replenish, and updates the energy value of the bound spirit treasure based on this energy value. In other implementations, server 110 may calculate the energy value that all charging items can replenish, update the energy value of the bound spirit treasure, and then synchronize the data to client 120.
[0091] It should be noted that when a player obtains a charging item, server 110 will simultaneously update the number of charging items recorded in the linked list.
[0092] Based on steps S21-S22 and S22's sub-steps, during Spirit Treasure battles, the server's computational load can be reduced, server performance can be improved, and stuttering and latency during Spirit Treasure battles can be reduced, resulting in smoother Spirit Treasure animations.
[0093] For step S22, refer to Figure 6 You can determine whether the charging conditions are met by following these steps.
[0094] S221: Check if the player character's inventory contains a charging item corresponding to the energy value. If so, the charging condition is met. Step S222 is executed after step S221.
[0095] When a player character has an energy-boosting item in their inventory, it means the character can automatically recharge and meet the charging requirements.
[0096] To allow players to intuitively understand the energy value of their bound spirit treasures, in one possible implementation, refer to... Figure 7 The game pet control method provided in this embodiment of the invention may further include the following steps.
[0097] S23: When the energy value is lower than the warning threshold, the color of the energy bar of the bound spirit item will be switched to the set color to warn the player. The warning threshold is greater than the charging threshold.
[0098] When the energy value of the bound spirit treasure is lower than the charging threshold, the client can also switch the color of the bound spirit treasure's energy bar to another set color.
[0099] For example, when the energy value is greater than the warning threshold, the energy bar can be green; when the energy value is less than or equal to the warning threshold but greater than the charging threshold, the energy bar can be yellow; and when the energy value is less than or equal to the charging threshold, the energy bar can be red.
[0100] In one possible implementation, when the current main state of the bound spirit treasure is the resting state, the bound spirit treasure can be controlled to perform the state action corresponding to the target state in the following way: control the bound spirit treasure to perform the expression and / or action corresponding to the target state.
[0101] The game spirit treasure control method provided in this invention migrates the spirit treasure animation mechanism to the client side. This reduces unnecessary server logic overhead, optimizes server processing logic, and improves server performance based on actual game conditions. Consequently, under normal gaming conditions, it reduces latency caused by logical operations, increases server load, and alleviates game lag and stuttering caused by heavy server computation. Simultaneously, it makes the spirit treasure animation on the client side smoother, enhancing the player's gaming experience.
[0102] Based on the inventive concept of the game spirit treasure control method provided above, in one embodiment, a game spirit treasure control device 130 is provided, which can be applied to... Figure 1 For any client 120 in the process, refer to Figure 8 The game's spirit treasure control device 130 may include a status detection module 140, a status update module 150, and an action control module 160.
[0103] The status detection module 140 is used to detect when a player character switches between character states and to obtain the character state after the switch.
[0104] The status update module 150 is used to set the switched character status as the current main status of the player character's bound spirit treasure, and to terminate the current status action of the bound spirit treasure.
[0105] The action control module 160 is used to control the state actions of the bound spirit treasure based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, according to the current main state of the bound spirit treasure.
[0106] In the aforementioned game spirit treasure control device 130, the logic processing of the state switching of the bound spirit treasure is realized on the client through the coordinated action of the state detection module, state update module and action control module. This can be completed without the client interacting with the server, thereby reducing the amount of computation on the server, reducing game latency and lag on the client, and making the game animation smoother.
[0107] Specific limitations regarding the game spirit treasure control device 130 can be found in the limitations of the game spirit treasure control method described above, and will not be repeated here. Each module in the aforementioned game spirit treasure control device 130 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the electronic device in hardware form, or stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0108] In one embodiment, an electronic device 170 is provided, which may be a client device 120, and its internal structure diagram may be as follows: Figure 9 As shown, the electronic device 170 includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor of the electronic device 170 provides computing and control capabilities. The memory of the electronic device 170 includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device 170 is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, near-field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements the game control method for the magical artifacts provided in the above embodiment.
[0109] Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device 170 to which the present invention is applied. The specific electronic device 170 may include, but is not limited to, the following: Figure 9 The diagram shows more or fewer components, or combinations of certain components, or different component arrangements.
[0110] In one embodiment, the game magic weapon control device 130 provided by the present invention can be implemented as a computer program, and the computer program can be implemented in the form of, for example, Figure 9 The electronic device 170 shown operates on this device. The memory of the electronic device 170 can store the various program modules that make up the game's magical artifact control device 130, for example, Figure 8The diagram shows a status detection module 140, a status update module 150, and an action control module 160. The computer program comprised of these modules causes the processor to execute the steps in the game control method described in this specification.
[0111] For example, Figure 9 The electronic device 170 shown can be used as follows Figure 8 The status detection module 140 in the game control device 130 shown executes step S11. The electronic device 170 can execute step S13 through the status update module 150. The electronic device 170 can execute step S15 through the motion control module 160.
[0112] In one embodiment, an electronic device 170 is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: when a player character switches character states, the processor obtains the character state after the switch; the player character's switched character state is used as the current main state of the player character's bound spirit treasure, and the current state action of the bound spirit treasure is terminated; based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, the processor controls the state action of the bound spirit treasure according to the current main state of the bound spirit treasure.
[0113] In one embodiment, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: when a player character switches character states, the player character's state after the switch is detected; the player character's state after the switch is taken as the current main state of the player character's bound spirit treasure, and the current state action of the bound spirit treasure is terminated; based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, the bound spirit treasure's state action is controlled according to the current main state of the bound spirit treasure.
[0114] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0115] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0116] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. 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.
[0117] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for controlling a game's magical artifact, characterized in that, Applied to a client running a state machine, the state machine including the transition order between the sub-states of each main state and the duration of each sub-state, the method includes: When the player character's bound spirit treasure is in the activated state, if the player character is detected to be switching character states, then the player character's state after the switch is obtained; The switched character state is taken as the current main state of the player character's bound spirit treasure, and the current state action of the bound spirit treasure is terminated. Based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, the state actions of the bound spirit treasure are controlled according to the current main state of the bound spirit treasure.
2. The game spirit treasure control method according to claim 1, characterized in that, The step of controlling the state actions of the bound spirit treasure based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, according to the current main state of the bound spirit treasure, includes: Take the first sub-state in the main state as the target state, control the bound spirit treasure to perform the state action corresponding to the target state, and start the timer; When the timeout period reaches the duration of the target state, the sub-state that is ordered after the target state in each sub-state of the main state is taken as the next target state to control the next state action of the bound spirit treasure.
3. The game spirit treasure control method according to claim 2, characterized in that, The client communicates with the server, and the server stores multiple linked lists in its running memory; When the main state is combat state, and the sub-state is combat skill, the step of controlling the bound spirit treasure to perform the state action corresponding to the target state includes: Control the bound magical artifact to perform the skill release action corresponding to the target state; The method further includes: When the bound spirit treasure performs a skill release action, the energy value of the bound spirit treasure is detected. When the energy value is lower than the charging threshold and the charging conditions are met, the energy value of the bound spirit treasure is replenished based on the spirit treasure data in the linked list corresponding to the bound spirit treasure.
4. The game spirit treasure control method according to claim 3, characterized in that, The data of the spirit treasure includes the maximum energy value corresponding to the current level of the bound spirit treasure, the number of charging items, and the charging value of each charging item; The step of supplementing the energy value of the bound spirit treasure based on the spirit treasure data in the linked list corresponding to the bound spirit treasure includes: Send a charging query command to the server; wherein, the charging query command is used to prompt the server to query the linked list corresponding to the bound spirit treasure, and calculate the required number of charging items and the total charging value; Receive the charging instruction returned by the server, deduct the number of charging items in the player character's backpack according to the required number, and update the energy value of the bound spirit treasure according to the total charging value.
5. The game spirit treasure control method according to claim 3, characterized in that, The method further includes: Check if the player character's inventory contains a charging item corresponding to the energy value. If so, the charging condition is met.
6. The game spirit treasure control method according to claim 3, characterized in that, The method further includes: When the energy value is lower than the warning threshold, the color of the energy bar of the bound spirit treasure is switched to a set color to warn the player; wherein, the warning threshold is greater than the charging threshold.
7. The game spirit treasure control method according to claim 2, characterized in that, When the main state is a resting state, the step of controlling the bound magical artifact to perform the state action corresponding to the target state includes: Control the bound magical artifact to perform the expressions and / or actions corresponding to the target state.
8. A game spirit treasure control device, characterized in that, Applied to a client, the client runs a state machine, the state machine includes the switching order between the sub-states of each main state and the duration of each sub-state, the device includes a state detection module, a state update module and an action control module; The status detection module is used to obtain the player character's status after switching if it detects that the player character is switching status when the player character's bound spirit treasure is in the enabled state. The state update module is used to set the switched character state as the current main state of the player character's bound spirit treasure, and to terminate the current state action of the bound spirit treasure. The action control module is used to control the state actions of the bound spirit treasure based on the switching order between the sub-states of the main state recorded in the state machine and the duration of each sub-state, according to the current main state of the bound spirit treasure.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program that can be executed by the processor to implement the game spirit treasure control method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the game spirit treasure control method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Game role and equipment control method and device, touch device and storage medium
CN107694085A
State machine implementation method and device, terminal equipment and readable storage medium
CN114416216A