Virtual character control method and device, electronic equipment and readable storage medium
By dynamically adjusting the orientation of non-player characters based on the weight of virtual areas in the game scene, the problem of fixed and rigid behavior of non-player characters is solved, thereby enhancing the immersion and experience of the game.
Patent Information
- Application Number
- CN202511625300.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2025-12-12
AI Technical Summary
In existing technologies, the way non-player characters are presented on terminal devices is fixed and rigid, which affects the player's game immersion and experience.
By dynamically determining the target orientation of non-player characters based on the regional weights of virtual areas in the game scene and controlling their turning, the richness of non-player character performance is enhanced.
It enhances the player's immersion and experience, and increases the game's challenge and interactivity by dynamically adjusting the behavior of non-player characters.
Smart Images

Figure CN121102893A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of human-computer interaction technology, and in particular to methods, devices, electronic devices, and readable storage media for controlling virtual characters. Background Technology
[0002] During gameplay, players can control virtual characters or virtual teams consisting of at least one virtual character to move within the game environment and complete corresponding virtual tasks. For example, in current strategy games (SLGs, simulation games), players typically control a virtual team containing at least one virtual character to move and interact on a grid-based map, triggering battles against hostile non-player characters.
[0003] In recent years, an increasing number of strategy games (SLGs) have introduced large-scale boss battles. These battles feature non-player characters with extremely high health on the map, requiring multiple players to control a virtual army of these characters to launch continuous attacks and defeat them. This type of gameplay increases player cooperation while also enhancing the overall challenge and immersion of the game.
[0004] In related technologies, the presentation of non-player characters on terminal devices is generally done in a fixed manner. This fixed and rigid presentation of non-player character behavior affects the player's immersion and gaming experience. Summary of the Invention
[0005] In view of this, the purpose of this disclosure is to provide a method, device, electronic device and readable storage medium for controlling virtual characters, which can dynamically determine the target orientation of non-player characters according to the regional weight of virtual areas in the game scene, enhance the richness of the performance of non-player characters, and thus enhance the player's game immersion and game experience.
[0006] In a first aspect, embodiments of this disclosure provide a method for controlling a virtual character, applied to a terminal device; the terminal device provides a graphical user interface; the graphical user interface displays at least a portion of a game scene; the game scene includes a target virtual character controlled by the terminal device and at least one other virtual character controlled by another terminal device; the control method includes: In response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character, control the target virtual character and at least one of the other virtual characters to fight against the non-player character; During the battle, the target orientation of the non-player character is determined based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located; Control the non-player character to turn from the current direction toward the target orientation.
[0007] Secondly, embodiments of this disclosure also provide a control device for a virtual character, applied to a terminal device; the terminal device provides a graphical user interface; the graphical user interface displays at least a portion of a game scene; the game scene includes a target virtual character controlled by the terminal device and at least one other virtual character controlled by another terminal device; the control device includes: A character control module is used to control the target virtual character and / or at least one of the other virtual characters to fight against the non-player character in response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character. The orientation determination module is used to determine the target orientation of the non-player character during the battle, based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located. A rotation control module is used to control the non-player character to turn from the current orientation to the target orientation.
[0008] Thirdly, embodiments of this disclosure also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the virtual character control method as described in the first aspect.
[0009] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the virtual character control method as described in the first aspect.
[0010] The virtual character control method, apparatus, electronic device, and readable storage medium provided in this disclosure, in response to a target virtual character and / or at least one other virtual character moving to the location of a non-player character, control the target virtual character and at least one other virtual character to engage in combat with the non-player character. During the combat, based on the set area weights of the virtual areas where the target virtual character and each other virtual character are located, the target orientation of the non-player character is determined; the non-player character is then controlled to turn from its current direction to the target orientation. In this way, the target orientation of the non-player character can be dynamically determined according to the area weights of the virtual areas in the game scene, enhancing the richness of the presentation of the non-player character's behavior, thereby improving the player's game immersion and experience.
[0011] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this disclosure and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for controlling a virtual character provided in an embodiment of this disclosure; Figure 2 This is one of the schematic diagrams of a first graphical user interface of a first terminal provided in an embodiment of this disclosure; Figure 3 This is a second schematic diagram of the first graphical user interface of the first terminal provided in the embodiments of this disclosure; Figure 4 This is a schematic diagram of the second graphical user interface of the second terminal provided in an embodiment of the present disclosure; Figure 5 This is the third schematic diagram of the first graphical user interface of the first terminal provided in the embodiments of this disclosure; Figure 6 This is the fourth schematic diagram of the first graphical user interface of the first terminal provided in the embodiments of this disclosure; Figure 7 This is a flowchart of the state animation playback control provided in the embodiments of this disclosure; Figure 8 This is a schematic diagram of the structure of a virtual character control device provided in an embodiment of the present disclosure; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. Based on the embodiments of this disclosure, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this disclosure.
[0015] First, let me introduce the terms used in this disclosure: (1) Terminal equipment The terminal device involved in this disclosure mainly refers to a terminal used to provide a graphical user interface and to control virtual characters. The terminal device can be a local terminal device as mentioned below, or a client device in a cloud interaction system. This terminal device can include, but is not limited to, any of the following devices: smartphones, tablets, game consoles, MP4 (Moving Picture Experts Group Audio Layer IV) players, personal digital assistants (PDAs), e-book readers, etc. This terminal device has a game-supporting application installed and running, such as an application supporting 3D or 2D games. In this disclosure, the application is described as a game application; optionally, this application can be a standalone application, such as a standalone 3D game program, or a network-connected application.
[0016] (2) Graphical User Interface A graphical user interface (GUI) is a human-computer interaction display format that allows users to manipulate icons, icons, or menu options on the screen using input devices such as a mouse or keyboard. It also allows users to manipulate icons or menu options on the touch screen of a touch terminal by performing touch operations to select commands, launch programs, or perform other tasks.
[0017] (3) Game Scene A game scene is a game environment displayed (or provided) by an application while it is running on a terminal or server; that is, the scene used during normal gameplay. In other words, a game scene refers to the virtual game controls that carry virtual characters during gameplay. These virtual characters can move, release skills, and perform other actions within the game scene under the control of user (i.e., player) commands issued to the terminal device. Optionally, a game scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. A game scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional game scene. The virtual environment can be sky, land, ocean, etc., where land includes environmental elements such as deserts and cities. The game scene is the scene where the user controls the complete game logic of the virtual character. Optionally, a game scene can also be used for game scene battles between at least two virtual characters, and the game scene has virtual resources available for use by at least two virtual characters. For example, a game scene can include any one or more of the following elements: game background elements, game object elements, game item elements, and game resource elements.
[0018] Secondly, the technical background of this disclosure will be introduced: During gameplay, players can control virtual characters or virtual teams consisting of at least one virtual character to move within the game environment and complete corresponding virtual tasks. For example, in current strategy games (SLGs, simulation games), players typically control a virtual team containing at least one virtual character to move and interact on a grid-based map, triggering battles against hostile non-player characters.
[0019] In recent years, an increasing number of strategy games (SLGs) have introduced large-scale boss battles. These battles feature non-player characters with extremely high health on the map, requiring multiple players to control a virtual army of these characters to launch continuous attacks and defeat them. This type of gameplay increases player cooperation while also enhancing the overall challenge and immersion of the game.
[0020] In related technologies, the presentation of non-player characters on terminal devices is generally done in a fixed manner. This fixed and rigid presentation of non-player character behavior affects the player's immersion and gaming experience.
[0021] In related technologies, the presentation of non-player characters on terminal devices is generally done in a fixed manner. This fixed and rigid presentation of non-player character behavior affects the player's immersion and gaming experience.
[0022] Based on this, the present disclosure provides a method for controlling virtual characters to enhance the richness of the presentation of non-player characters, thereby improving the player's game immersion and game experience.
[0023] In one embodiment of the application, the virtual character control method can run on a local mobile terminal or a server. When the virtual character control method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0024] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program's execution and the game screen presentation are separated. The storage and execution of the virtual character's control methods are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0025] In an alternative implementation, taking a game as an example, the local mobile terminal stores the game program and is used to display the game screen. The local mobile terminal is used to interact with the player through a graphical user interface, that is, conventionally downloading, installing, and running the game program via an electronic device. The local mobile terminal can provide the graphical user interface to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player through holographic projection. For example, the local mobile terminal can include a display screen for displaying the graphical user interface, which includes game screens, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
[0026] In one optional implementation, this invention provides a method for controlling a virtual character, which provides a graphical user interface via a mobile terminal. The mobile terminal can be a local mobile terminal (such as a local touchscreen terminal) or a client device in the aforementioned cloud interaction system. The following description uses the example of the virtual character control method running on a local mobile terminal (hereinafter referred to as the mobile terminal).
[0027] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for controlling a virtual character as provided in an embodiment of this disclosure. Figure 1 As shown in the embodiments of this disclosure, the method for controlling a virtual character includes: S101. In response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character, control the target virtual character and at least one of the other virtual characters to fight against the non-player character.
[0028] S102. During the battle, the target orientation of the non-player character is determined based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located.
[0029] S103, Control the non-player character to turn from the current direction to the target direction.
[0030] The virtual character control method provided in this disclosure can dynamically determine the target orientation of non-player characters based on the regional weight of virtual areas in the game scene, thereby enhancing the richness of the performance of non-player characters and improving the player's game immersion and experience.
[0031] The exemplary steps of the embodiments of this disclosure are described below: S101. In response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character, control the target virtual character and at least one of the other virtual characters to fight against the non-player character.
[0032] In one possible implementation, players can control a target virtual character to perform virtual game tasks in the game through a terminal device. Here, the target virtual character can be a single virtual character or a virtual team composed of multiple target virtual characters. Players can simultaneously control a virtual team containing multiple target virtual characters to perform virtual game tasks in the game scene.
[0033] During gameplay, players can control at least one target virtual character located within the game scene to move around the scene and complete corresponding virtual tasks. For example, in current strategy games (SLGs, simulation games), players typically control a team containing at least one target virtual character to move and interact on a grid-based map, thereby triggering battles against enemy virtual characters.
[0034] In recent years, an increasing number of strategy games (SLGs) have introduced large-scale boss battles, where non-player characters with extremely high health are placed on the map, requiring multiple virtual troops from multiple players to attack them repeatedly before they can be defeated. This type of gameplay increases cooperation between players and also enhances the overall challenge and immersion of the game.
[0035] In related technologies, the presentation of non-player characters on terminal devices is generally done in a fixed manner. This fixed and rigid presentation of non-player character behavior affects the player's immersion and gaming experience.
[0036] Based on this, in the technical solution disclosed herein, the target orientation of non-player characters can be dynamically determined according to the regional weight of virtual areas in the game scene, thereby enhancing the richness of the presentation of non-player characters' performance and improving the player's game immersion and experience.
[0037] In one alternative implementation, players can control a virtual team consisting of multiple target virtual characters to move within the game scene via a terminal device, while other players can control a virtual team consisting of at least one other virtual character to move within the game scene via other terminal devices.
[0038] Furthermore, different non-player characters are set up in different locations on the large map in the game scene. When the target virtual character and / or at least one other virtual character moves to the corresponding scene location, the non-player character corresponding to that scene location will be automatically presented in the game scene, so that the player can control a virtual team composed of at least one target virtual character to interact with the non-player character, defeat the non-player character, and complete the game task.
[0039] Here, the character type and level of non-player characters may differ depending on the location in the scene.
[0040] Furthermore, during the process of determining the target virtual character and / or at least one other virtual character engaging in combat with a non-player character, the non-player character may move or turn in the game scene to interact with the target virtual character and / or at least one other virtual character. The target orientation of the non-player character can be determined based on the set area weight.
[0041] S102. During the battle, the target orientation of the non-player character is determined based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located.
[0042] In one alternative implementation, the virtual area where the target virtual character and each other virtual character are located can be the virtual grid where the target virtual character and each other virtual character are located in the game scene map. For each virtual area, the terminal device can set different area weights for different virtual areas.
[0043] Here, the region weight of the virtual region where the target virtual character is located, controlled by the terminal device, is higher than the region weight of the virtual region where other virtual characters are located, controlled by other terminal devices.
[0044] In this way, when determining the target orientation of a non-player character based on regional weights, it is highly likely that the non-player character will be facing the target virtual character controlled by the player on the terminal device, so that the player can have the feeling of directly confronting the non-player character, further enhancing the player's game immersion and game experience.
[0045] In one alternative implementation, the orientation of the non-player character displayed on different terminal devices is different, all facing the corresponding virtual character controlled by the player, so that each player can have the feeling of directly confronting the non-player character, further enhancing the player's game immersion and game experience.
[0046] For example, player A controls a virtual team A, consisting of at least one virtual character, to interact with non-player characters in the game scene via terminal device A; player B controls a virtual team B, consisting of at least one virtual character, to interact with non-player characters in the game scene via terminal device B. At this time, virtual team A is located in the lower left corner of the non-player characters; virtual team B is located in the upper right corner of the non-player characters; the view displayed on terminal device A is the non-player characters facing the lower left corner of the virtual team; the view displayed on terminal device B is the non-player characters facing the upper right corner of the virtual team.
[0047] In one alternative implementation, the orientation of a non-player character is determined based on the set target virtual character and the regional weight of the virtual region where each other virtual character is located. This can be determined based on the size of the regional weight of each virtual region, with the target orientation of the non-player character determined based on the virtual region with the largest regional weight.
[0048] Specifically, the step "determine the target orientation of the non-player character based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located" includes: a1: Based on the set target virtual character and the regional weight of the virtual region where each other virtual character is located, determine the target region whose regional weight is greater than the regional weight of other virtual regions.
[0049] a2: The direction of the target area relative to the location of the non-player character is determined as the target orientation.
[0050] In related technologies, in SLG games, the way non-player characters (Bosses) engage in combat typically relies on backend-synchronized combat status, with the frontend driving Boss animations based on the synchronized data. For example, when the backend determines that there is combat on a certain grid, the client will play the corresponding attack or hit animation. To reduce implementation complexity, existing solutions generally adopt simplified processing, resulting in relatively fixed and monotonous Boss performance, which affects the player's gaming experience.
[0051] In this embodiment, the backend server only provides the corresponding battle information, while the performance of the non-player character is determined by the frontend terminal device. This decouples the data layer from the presentation layer, reduces the backend computing pressure, improves the flexibility and scalability of the frontend, and enriches the performance of the non-player character on the terminal device, which helps to enhance the player's immersion and gaming experience.
[0052] Specifically, the step "During the battle, based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located, determine the target orientation of the non-player character" includes: b1: During the battle, receive battle information for each virtual area sent by the server.
[0053] b2: Based on the battle information of each virtual area, determine the target virtual character and the area weight of the virtual area where each other virtual character is located, and determine the target orientation of the non-player character.
[0054] In this embodiment of the disclosure, the battle information for each virtual area may include the virtual area where the battle takes place, and the control information of the target virtual character or other virtual characters in each virtual area where the battle takes place.
[0055] For example, the area surrounding the non-player character includes virtual regions 1, 2, 3, and 4. The battle information provided by the server for these virtual regions may include: virtual teams consisting of at least one virtual character exist in virtual regions 1, 2, and 3; the virtual team consisting of at least one target virtual character controlled by the current terminal device is located in virtual region 3; and no virtual team exists in virtual region 4. In this case, the terminal device can set corresponding regional weights for virtual regions 1, 2, 3, and 4.
[0056] In one alternative implementation, in order to ensure that the terminal device displays non-player characters facing the player's virtual team, the virtual area where the target virtual character's virtual team is located needs to be given a larger area weight, while the virtual area where other virtual character's virtual team is located needs to be given a smaller area weight.
[0057] For example, in the above example, there are virtual teams in virtual region 1, virtual region 2 and virtual region 3. The virtual team controlled by the current terminal device is located in virtual region 3, and there is no virtual team in virtual region 4. In this case, the regional weights of virtual region 1 and virtual region 2 can be uniformly set to 1, the regional weight of virtual region 3 can be set to 100, and the regional weight of virtual region 4 can be set to 0.
[0058] In another alternative implementation, the virtual region containing the virtual team consisting of at least one target virtual character can still be assigned a larger region weight. For other virtual regions, the region weight can be set according to information such as the number of other virtual characters contained in the virtual teams in each virtual region. For example, the more other virtual characters contained in the virtual teams in a virtual region, the higher the region weight of the virtual region.
[0059] Furthermore, based on the regional weight of each virtual region, a target region with a regional weight greater than that of other virtual regions can be determined, and then the direction of the target region relative to the location of the non-player character can be determined as the target orientation.
[0060] For example, in the above example, the weight of virtual region 1 and virtual region 2 is 1, the weight of virtual region 3 is 100, and the weight of virtual region 4 is 0. At this time, the weight of virtual region 3 is the largest among the four virtual regions. It is determined that virtual region 3 is located in the lower left corner of the non-player character. Therefore, the target orientation of the non-player character is determined to be towards the lower left corner.
[0061] Furthermore, after determining the target orientation of the non-player character, the player can control the non-player character to face the target orientation.
[0062] S103, Control the non-player character to turn from the current direction to the target direction.
[0063] In one alternative implementation, during the process of controlling the non-player character to turn from the current orientation to the target orientation, in order to avoid the non-player character's turn being too abrupt, multiple corresponding turning animations can be played to present the process of the non-player character gradually turning to the target orientation, reducing the abruptness of the non-player character's turn and further enhancing the player's immersion.
[0064] Specifically, the control method further includes: c1: Determine the target turning angle of the current orientation towards the target orientation.
[0065] c2: Based on the target turning angle and the preset angle range, determine at least one target animation corresponding to the non-player character's rotation process.
[0066] c3: During the process of the non-player character turning towards the target, at least one target animation is played sequentially according to the corresponding target angle range.
[0067] In one alternative implementation, multiple preset angle ranges can be pre-set. Based on the target turning angle of the current orientation towards the target orientation, at least one target angle range is determined when the non-player character turns towards the target orientation, thereby determining at least one target animation.
[0068] Specifically, the step "based on the target turning angle and the preset angle range, determine at least one target animation corresponding to the non-player character's rotation process" includes: d1: Based on the target steering angle and the preset angle range, determine at least one target angle range included in the target steering angle.
[0069] d2: The rotation animation corresponding to each preset target angle range is determined as the target animation.
[0070] In one optional implementation, the preset angle range may include (0°, 45°), (45°, 90°), (90°, 135°), and (135°, 180°); each different preset angle range corresponds to a corresponding rotation animation, and at least one rotation animation corresponding to at least one target angle region included in the target turning angle is determined as the target animation.
[0071] For example, the target turning angle is 120°, and the target angle region includes (0°, 45°) and (45°, 90°). In this case, the rotation animations corresponding to 45° and 90° can be determined as the target animations.
[0072] Furthermore, after identifying at least one target animation, at least one target animation will be played sequentially according to the corresponding target angle range.
[0073] For example, in the above example, (0°, 45°) corresponds to rotation animation A; (45°, 90°) corresponds to rotation animation B. During the process of controlling the non-player character to turn towards the target direction, rotation animation A and rotation animation B will be played in sequence.
[0074] In one alternative implementation, in a scenario where a non-player character is controlled to rotate 180°, the turning direction is further determined based on the regional weights of the adjacent virtual areas on the left and right to avoid abrupt changes and further enhance the player's immersion and gaming experience.
[0075] Furthermore, as the battle progresses, if a non-player character is attacked by at least one virtual team, the non-player character's status will change. Different status animations will be played for different non-player character statuses, increasing the richness of the animation presentation and further enhancing the player's immersion in the game.
[0076] Specifically, the control method further includes: e1: During the battle, based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, as well as the animation state of the completed historical animation, determine the state animation corresponding to the target character state corresponding to the non-player character.
[0077] e2: Play the state animation.
[0078] In one alternative implementation, the non-player character's status may be related to the degree of attack by the virtual team on the non-player character or the impact on the non-player character's target health value, or it may be related to the non-player character's attack method.
[0079] For example, the character status of a non-player character may include standby, attacking in front, attacking not in front, minor victory, major victory, and death.
[0080] In one alternative implementation, it is necessary to determine the state animation to be played that corresponds to the current target character state of the non-player character, based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, as well as the animation state of the completed historical animation.
[0081] Specifically, the state animation is determined through the following steps: f1: Based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, determine whether the target virtual character is fighting against the non-player character.
[0082] f2: If the target virtual character is fighting against the non-player character, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
[0083] In one optional implementation, based on the battle information determined by the server for each virtual area, it is determined whether the target virtual character controlled by the current terminal device or the virtual team composed of at least one target virtual character is currently participating in a battle against a non-player character. If it is determined that the virtual team composed of the current target virtual character is currently participating in a battle against a non-player character, it is necessary to further determine the status animation based on the animation status of the historical animation and the battle settings of the non-player character.
[0084] Specifically, it can be determined whether the current non-player character is in a turning attack state based on the animation state of the historical animation. If it is determined that the current non-player character is not in a turning attack state, then the process of determining the target orientation of the non-player character is entered, and the non-player character is controlled to turn. The specific method of determining the target orientation of the non-player character is the same as the determination method described above, and will not be repeated here.
[0085] Furthermore, if it is determined that the current non-player character is in a turning attack state, it is necessary to determine whether the non-player character has activated a non-forward attack state and whether there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, based on the non-player character's battle settings and the battle information synchronized with the server. If it is determined that the non-player character has activated a non-forward attack state and there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, the state animation that can be played is the non-forward attack animation when the animation state trigger conditions are met.
[0086] Here, enabling the non-player character to enter a non-forward attack state can be selected through settings before entering the game; the non-forward preset area range can be determined based on the non-player character's attack range, attack ability, and the attack abilities of the target virtual character and other virtual characters participating in the battle. For example, the non-forward preset area range can be set to the three non-forward virtual areas of the non-player character; satisfying the animation state trigger condition can be that the battle time with the non-player character meets a preset time threshold.
[0087] Furthermore, if it is determined that the non-player character has not activated a non-forward attack state or that there are no other virtual characters participating in the battle within the non-forward preset area of the non-player character, the status animation that can be played is a small victory animation.
[0088] In another alternative implementation, if the target virtual character is not fighting against a non-player character, the status animation needs to be determined based on the battle information between at least one other virtual character fighting against a non-player character.
[0089] Specifically, after the step of "determining whether the target virtual character is fighting against the non-player character", the control method further includes: g1: If the target virtual character is not fighting against the non-player character, based on the battle information between at least one of the other virtual characters and the non-player character, determine whether there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing.
[0090] g2: If there is no other virtual character fighting against the non-player character in the direction the non-player character is currently facing, determine whether there is at least one other virtual character fighting against the non-player character in other directions based on the battle information between at least one other virtual character and the non-player character.
[0091] g3: If there is at least one other virtual character fighting against the non-player character in other directions, determine the state animation based on the animation state of the historical animation and the battle settings of the non-player character.
[0092] g4: If there is no other virtual character fighting against the non-player character in other directions, determine the state animation based on the animation state of the historical animation.
[0093] In one alternative implementation, if it is determined that the current target virtual character or a virtual team composed of at least one target virtual character is not currently participating in a battle against a non-player character, then it is necessary to determine, based on the battle information between at least one other virtual character and the non-player character, that there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing. If it is determined that there is no other virtual character fighting against the non-player character in the direction the non-player character is currently facing, then it is further determined whether there is at least one virtual character fighting against the non-player character in other directions of the non-player character. If there is at least one other virtual character fighting against the non-player character in other directions, it is necessary to further determine the status animation based on the animation status of the historical animation and the battle settings of the non-player character.
[0094] Specifically, it can be determined whether the current non-player character is in a turning attack state based on the animation state of the historical animation. If it is determined that the current non-player character is not in a turning attack state, then the process of determining the target orientation of the non-player character is entered, and the non-player character is controlled to turn. The specific method of determining the target orientation of the non-player character is the same as the determination method described above, and will not be repeated here.
[0095] Furthermore, if it is determined that the current non-player character is in a turning attack state, it is necessary to determine whether the non-player character has activated a non-forward attack state and whether there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, based on the non-player character's battle settings and the battle information synchronized with the server. If it is determined that the non-player character has activated a non-forward attack state and there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, the state animation that can be played is the non-forward attack animation when the animation state trigger conditions are met.
[0096] In another alternative implementation, if there is no other virtual character fighting against a non-player character in other directions, the state animation needs to be determined based on the animation state of the historical animation.
[0097] Specifically, it can be determined whether a historical animation is the target state animation based on the animation state of the historical animation.
[0098] Here, the target state animation can be a grand victory animation, which indicates that the final victory animation has already been played. If the historical animation is a grand victory animation, then the current state animation to be played is determined to be an idle animation; if the historical animation is not a grand victory animation, then the current state animation to be played is determined to be a grand victory animation.
[0099] Furthermore, if it is determined that there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, then the status animation needs to be determined based on the animation status of the historical animation and the non-player character's battle settings.
[0100] Specifically, after the step of "determining whether there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing", the control method further includes: h1: If there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, determine the state animation based on the animation state of the historical animation and the battle settings of the non-player character.
[0101] In one optional implementation, if there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, it can be determined whether the non-player character is in a non-forward attack state based on the animation state of the historical animation. If it is determined that the non-player character is in a non-forward attack state, it is necessary to determine whether the non-player character has activated the non-forward attack state and whether there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, based on the non-player character's battle settings and the battle information synchronized with the server. If it is determined that the non-player character has activated the non-forward attack state and there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, the state animation that can be played is the non-forward attack animation when it is determined that the animation state triggering condition is met.
[0102] In another optional implementation, if it is determined that the non-player character has not activated a non-forward attack state or there are no other virtual characters participating in the battle within the non-forward preset area of the non-player character, the status animation that can be played is a forward attack animation.
[0103] In one alternative implementation, different state animation resources can be set for each character state, and the corresponding animation resources can be determined based on the character level and character state of the non-player character.
[0104] Specifically, the control method further includes: i1: Based on the character level and character state of the non-player character, determine at least one state animation corresponding to each character state of the non-player character.
[0105] The higher the character level of the non-player character, the more state animations are generated for each character state of the non-player character.
[0106] Here, non-player characters of different levels or types can be configured with different performance options, such as whether to enable non-frontal attacks or add special victory actions. These can be set automatically by the system based on the character level or type, or they can be set by the player through the settings interface before entering the game scene. This can achieve a rich variety of visual performances while minimizing the production cost of animation assets, saving device resources and improving presentation efficiency, while ensuring the player's immersion and experience.
[0107] Furthermore, at least one different state animation can be set for each character state of a non-player character. These state animations can be stored in an animation library. After determining that the non-player character is the current target character state, a state animation can be selected from the target character states and played.
[0108] Specifically, the step "play the state animation" includes: j1: Select one state animation from at least one state animation corresponding to the target character's state and play it.
[0109] For example, it is determined that the current non-player character is in target character state 1, and it is determined that target character state 1 corresponds to state animation A, state animation B and state animation C; a state animation can be randomly selected from state animation A, state animation B and state animation C for playback.
[0110] In one alternative implementation, in addition to playing the corresponding status animations during the battle, the current non-player character's status information (health points, HP, etc.) and the attack animations and attack information of each virtual team (the attack route of the virtual team, the attack time of the virtual team, and the attack result, etc.) can be displayed in the graphical user interface. This ensures that players can understand the battle situation in a timely manner, make corresponding battle decisions, increase the player's probability of winning, and further enhance the player's gaming experience.
[0111] The control process of the virtual character in this embodiment will be illustrated below with specific examples. For example, the virtual team composed of the target virtual character and other virtual characters will fight against non-player characters.
[0112] Please see Figure 2 , Figure 2 This is one of the schematic diagrams of the first graphical user interface of the first terminal provided in the embodiments of this disclosure, such as... Figure 2 As shown, the first graphical user interface 200 includes a non-player character 210 and at least one virtual team 220, with the non-player character 210 facing upwards when it appears.
[0113] For further details, please refer to Figure 3 , Figure 3 This is a second schematic diagram of the first graphical user interface of the first terminal provided in the embodiments of this disclosure, as shown below. Figure 3 As shown, the first virtual team 221 controlled by the first terminal is located below the non-player character 210. At this time, the non-player character 210 is controlled to turn to the first virtual team 221 below in the first graphical user interface 200.
[0114] For further details, please refer to Figure 4 , Figure 4 This is a schematic diagram of the second graphical user interface of the second terminal provided in the embodiments of this disclosure, such as... Figure 4As shown, the second graphical user interface 400 includes a non-player character 210 and at least one virtual team, wherein the second virtual team 222 controlled by the second terminal is located to the left of the non-player character 210. At this time, in the second graphical user interface 400, the non-player character 210 turns to the left of the second virtual team 222.
[0115] For further details, please refer to Figure 5 , Figure 5 This is a third schematic diagram of the first graphical user interface of the first terminal provided in the embodiments of this disclosure, as shown below. Figure 5 As shown, the first virtual team 221 attacks the non-player character 210. The attack route 230 of the first virtual team 221 is displayed in the first graphical user interface 200, and the attack information 240 for the non-player character 210 is displayed.
[0116] For further details, please refer to Figure 6 , Figure 6 This is a fourth schematic diagram of the first graphical user interface of the first terminal provided in the embodiments of this disclosure, as shown below. Figure 6 As shown, the non-player character 210 is defeated by multiple virtual teams 220, and the non-player character 210 is in a state of great victory after being defeated. An animation of the non-player character 210 being knocked down is played in the first graphical user interface 200.
[0117] For further details, please refer to Figure 7 , Figure 7 This is a flowchart of the state animation playback control provided in the embodiments of this disclosure, such as... Figure 7As shown, the process retrieves the current orientation of the non-player character, determines whether the target virtual character is fighting against the non-player character, and if so, confirms that the virtual team composed of the target virtual character is currently participating in the battle against the non-player character; it then determines whether the non-player character is in a turning attack state. If the non-player character is not in a turning attack state, the process proceeds to determine the target orientation of the non-player character, controlling the non-player character to turn; if the non-player character is in a turning attack state, it determines whether the non-player character has activated a non-forward attack state, whether there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, and whether the animation trigger conditions are met. If the non-player character has activated a non-forward attack state... If the player character is in a forward attack state and there are other virtual characters participating in the battle within a non-forward preset area, the state animation that can be played is a non-forward attack animation, provided the animation state triggering conditions are met. If it is determined that the non-player character has not activated a non-forward attack state, or there are no other virtual characters participating in the battle within the non-forward preset area of the non-player character, or the animation triggering conditions are not met, the state animation that can be played is a small victory animation. If it is determined that the virtual team composed of the current target virtual characters is not currently participating in the battle against the non-player character, and it is determined that there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing; if it is determined that the non-player character is currently facing... If there is no other virtual character fighting against a non-player character in the direction of the non-player character; if there is at least one other virtual character fighting against a non-player character in other directions; determine if the current non-player character is in a turning attack state. If it is determined that the current non-player character is not in a turning attack state, proceed to determine the target orientation of the non-player character and control the non-player character to turn; if it is determined that the current non-player character is in a turning attack state, determine if the non-player character has activated a non-forward attack state, whether there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, and whether the animation trigger conditions are met. If it is determined that the non-player character has activated a non-forward attack state and there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, determine if the animation trigger conditions are met. If other virtual characters are involved in the battle within the non-frontal preset area of the character, and the animation state triggering conditions are met, the state animation that can be played is the non-frontal attack animation; if it is determined that the non-player character has not activated the non-frontal attack state, or there are no other virtual characters involved in the battle within the non-player character's non-frontal preset area, or the animation triggering conditions are not met, the state animation that can be played is the minor victory animation; if there are no other virtual characters fighting against the non-player character in other directions, and if the historical animation is a major victory animation, then the state animation that needs to be played now is the idle animation; if the historical animation is not a major victory animation, then the state animation that needs to be played now is the major victory animation.If it is determined that there is at least one other virtual character fighting in the direction the non-player character is currently facing, then it is determined whether the non-player character is in a non-forward attack state. If it is determined that the non-player character is in a non-forward attack state, then it is determined whether the non-player character has activated the non-forward attack state, whether there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, and whether the animation trigger conditions are met. If it is determined that the non-player character has activated the non-forward attack state and there are other virtual characters participating in the battle within the non-forward preset area of the non-player character, then the non-forward attack animation can be played if the animation trigger conditions are met. If it is determined that the non-player character has not activated the non-forward attack state, or there are no other virtual characters participating in the battle within the non-forward preset area of the non-player character, or the animation trigger conditions are not met, then the forward attack animation can be played.
[0118] The virtual character control method provided in this disclosure, in response to a target virtual character and / or at least one other virtual character moving to the location of a non-player character, controls the target virtual character and at least one other virtual character to engage in combat with the non-player character. During the combat, based on the set area weights of the virtual areas where the target virtual character and each other virtual character are located, the target orientation of the non-player character is determined; the non-player character is then controlled to turn from its current orientation to the target orientation. In this way, the target orientation of the non-player character can be dynamically determined according to the area weights of the virtual areas in the game scene, enhancing the richness of the non-player character's performance and thus improving the player's game immersion and experience.
[0119] Based on the same inventive concept, this disclosure also provides a virtual character control device corresponding to the virtual character control method. Since the principle of the device in this disclosure for solving the problem is similar to the virtual character control method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0120] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a control device for a virtual character provided in an embodiment of this disclosure. Figure 8 As shown, the control device 800 includes: The character control module 810 is configured to control the target virtual character and / or at least one of the other virtual characters to fight against the non-player character in response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character. Orientation determination module 820 is used to determine the target orientation of the non-player character during the battle, based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located. The rotation control module 830 is used to control the non-player character to turn from the current direction to the target orientation.
[0121] In one alternative implementation, the region weight of the virtual region where the target virtual character controlled by the terminal device is located is higher than the region weight of the virtual region where other virtual characters controlled by other terminal devices are located.
[0122] In an optional implementation, when determining the target orientation of the non-player character based on the set target virtual character and the regional weights of the virtual regions where each other virtual character is located, the orientation determination module 820 is used to: Based on the target virtual character and the region weight of the virtual region where each other virtual character is located, determine the target region whose region weight is greater than the region weight of other virtual regions; The target orientation is determined based on the direction of the target area relative to the location of the non-player character.
[0123] In an optional embodiment, the control device 800 further includes an animation playback control module (not shown in the figure), which is used for: Determine the target turning angle from the current orientation to the target orientation; Based on the target turning angle and the preset angle range, at least one target animation is determined corresponding to the non-player character's rotation process; During the process of the non-player character turning towards the target, at least one target animation is played sequentially according to the corresponding target angle range.
[0124] In one optional implementation, when the animation playback control module is used to determine at least one target animation corresponding to the rotation of the non-player character based on the target turning angle and a preset angle range, the animation playback control module is used to: Based on the target steering angle and the preset angle range, at least one target angle range including the target steering angle is determined; The rotation animation corresponding to each preset target angle range is determined as the target animation.
[0125] In an optional embodiment, the control device 800 further includes a state animation determination module (not shown in the figure), the state animation determination module being used for: During the battle, based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, as well as the animation state of the completed historical animation, the state animation corresponding to the target character state corresponding to the non-player character is determined. Play the aforementioned state animation.
[0126] In one optional implementation, the state animation determination module is used to determine the state animation through the following steps: Based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, determine whether the target virtual character is fighting against the non-player character; If the target virtual character is fighting against the non-player character, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
[0127] In an optional implementation, the state animation determination module is further configured to: If the target virtual character is not fighting against the non-player character, based on the battle information between at least one of the other virtual characters and the non-player character, determine whether there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing. If there is no other virtual character fighting against the non-player character in the direction the non-player character is currently facing, determine whether there is at least one other virtual character fighting against the non-player character in other directions based on the battle information between at least one other virtual character and the non-player character. If there is at least one other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character. If there is no other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation.
[0128] In an optional implementation, the state animation determination module is further configured to: If there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
[0129] In an optional embodiment, the control device 800 further includes a state animation setting module (not shown in the figure), the state animation setting module being used for: Based on the character level and character status of the non-player character, determine at least one state animation corresponding to each character status of the non-player character; The higher the character level of the non-player character, the more state animations are corresponding to each character state of the non-player character.
[0130] In one optional implementation, when the state animation determination module is used to play the state animation, the state animation determination module is used to: Select one state animation from at least one state animation corresponding to the target character's state and play it.
[0131] In an optional implementation, when the orientation determination module 820 determines the target orientation of the non-player character during a battle, based on the set target virtual character and the regional weights of the virtual areas where each other virtual character is located, the orientation determination module 820 is used to: During the battle, receive battle information for each virtual area sent by the server; Based on the battle information of each virtual region, the target virtual character and the regional weight of each other virtual character's virtual region are determined, and the target orientation of the non-player character is determined.
[0132] The virtual character control device provided in this disclosure, in response to a target virtual character and / or at least one other virtual character moving to the location of a non-player character, controls the target virtual character and at least one other virtual character to engage in combat with the non-player character. During the combat, based on the set area weights of the virtual areas where the target virtual character and each other virtual character are located, the target orientation of the non-player character is determined; the non-player character is then controlled to turn from its current direction to the target orientation. In this way, the target orientation of the non-player character can be dynamically determined according to the area weights of the virtual areas in the game scene, enhancing the richness of the presentation of the non-player character's behavior, thereby improving the player's game immersion and overall game experience.
[0133] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Figure 9 As shown, the electronic device 900 includes a processor 910, a memory 920, and a bus 930.
[0134] The memory 920 stores machine-readable instructions executable by the processor 910. When the electronic device 900 is running, the processor 910 communicates with the memory 920 via the bus 930, causing the processor 910 to execute the following instructions during operation: In response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character, control the target virtual character and at least one of the other virtual characters to fight against the non-player character; During the battle, the target orientation of the non-player character is determined based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located; Control the non-player character to turn from the current direction toward the target orientation.
[0135] In one optional implementation, the region weight of the virtual region where the target virtual character controlled by the terminal device is located is higher than the region weight of the virtual region where other virtual characters controlled by other terminal devices are located.
[0136] In one optional implementation, the instructions executed by the processor 910, which include determining the target orientation of the non-player character based on the set target virtual character and the regional weights of the virtual regions where each other virtual character is located, include: Based on the target virtual character and the region weight of the virtual region where each other virtual character is located, determine the target region whose region weight is greater than the region weight of other virtual regions; The target orientation is determined based on the direction of the target area relative to the location of the non-player character.
[0137] In one optional implementation, the instructions executed by the processor 910 further include: Determine the target turning angle from the current orientation to the target orientation; Based on the target turning angle and the preset angle range, at least one target animation is determined corresponding to the non-player character's rotation process; During the process of the non-player character turning towards the target, at least one target animation is played sequentially according to the corresponding target angle range.
[0138] In one optional implementation, the instructions executed by the processor 910, including determining at least one target animation corresponding to the non-player character's rotation process based on the target turning angle and a preset angle range, include: Based on the target steering angle and the preset angle range, at least one target angle range including the target steering angle is determined; The rotation animation corresponding to each preset target angle range is determined as the target animation.
[0139] In one optional implementation, the instructions executed by the processor 910 further include: During the battle, based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, as well as the animation state of the completed historical animation, the state animation corresponding to the target character state corresponding to the non-player character is determined. Play the aforementioned state animation.
[0140] In one optional implementation, the state animation is determined by the following steps in the instructions executed by the processor 910: Based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, determine whether the target virtual character is fighting against the non-player character; If the target virtual character is fighting against the non-player character, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
[0141] In one optional implementation, the instructions executed by the processor 910 further include: If the target virtual character is not fighting against the non-player character, based on the battle information between at least one of the other virtual characters and the non-player character, determine whether there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing. If there is no other virtual character fighting against the non-player character in the direction the non-player character is currently facing, determine whether there is at least one other virtual character fighting against the non-player character in other directions based on the battle information between at least one other virtual character and the non-player character. If there is at least one other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character. If there is no other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation.
[0142] In one optional implementation, the instructions executed by the processor 910 further include: If there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
[0143] In one optional implementation, the instructions executed by the processor 910 further include: Based on the character level and character status of the non-player character, determine at least one state animation corresponding to each character status of the non-player character; The higher the character level of the non-player character, the more state animations are corresponding to each character state of the non-player character.
[0144] In one optional implementation, the instructions executed by the processor 910, including playing the state animation, include: Select one state animation from at least one state animation corresponding to the target character's state and play it.
[0145] In one optional implementation, the instructions executed by the processor 910, wherein determining the target orientation of the non-player character during the battle, based on the set target virtual character and the regional weights of the virtual regions where each other virtual character is located, includes: During the battle, receive battle information for each virtual area sent by the server; Based on the battle information of each virtual region, the target virtual character and the regional weight of each other virtual character's virtual region are determined, and the target orientation of the non-player character is determined.
[0146] By employing the above method, the target orientation of non-player characters can be dynamically determined based on the regional weights of virtual areas within the game scene. This enhances the richness of the non-player character's presentation, thereby improving player immersion and overall gaming experience. Furthermore, the regional weight of the virtual area containing the target virtual character controlled by a terminal device is higher than that of the virtual areas containing other virtual characters controlled by other terminal devices. Therefore, when determining the target orientation of non-player characters based on regional weights, there is a high probability that the non-player characters will face the virtual team composed of the target virtual characters controlled by the player on the terminal device. This allows players to experience the feeling of directly confronting non-player characters, further enhancing the gaming experience. This enhances player immersion and overall gaming experience. Furthermore, the orientation of non-player characters differs across different devices, always facing the virtual team of player-controlled characters. This creates a sense of direct confrontation between players and non-player characters, further boosting immersion and gaming experience. The backend server only provides battle information; the behavior of non-player characters is determined by the frontend device. This decoupling of the data and presentation layers reduces backend computational load, improves frontend flexibility and scalability, and enriches the visual presentation of non-player characters on different devices, ultimately enhancing player experience. To enhance player immersion and gaming experience; simultaneously, during the process of controlling a non-player character to turn from the current direction to the target direction, to avoid overly abrupt turns, multiple corresponding turning animations can be played to present the gradual process of the non-player character turning to the target direction, reducing the abruptness of the turn and further enhancing player immersion; furthermore, in scenarios where the non-player character rotates 180°, the turning direction is further determined based on the regional weights of the adjacent virtual areas on the left and right to avoid abruptness, further enhancing player immersion and gaming experience; additionally, when the non-player character is attacked by at least one virtual team, the non-player character's status will change. The system features dynamic animations for different non-player character states, enhancing the richness of the animation presentation and further improving player immersion. Simultaneously, non-player characters of different levels or types can be configured with different performance options, such as enabling non-frontal attacks or adding special victory animations. These can be automatically set by the system based on character level or type, or players can customize them through the settings interface before entering the game. This allows for a rich and diverse visual experience while minimizing animation asset production costs, saving device resources and improving presentation efficiency while ensuring player immersion and overall experience.In addition to playing corresponding status animations during battles, the system can also display the current non-player character's status information (health points, HP, etc.) and the attack animations and information of each virtual team (attack route, attack time, and attack results, etc.) in the graphical user interface. This ensures players can understand the battle situation in a timely manner, make appropriate battle decisions, increase their chances of winning, and further enhance their gaming experience.
[0147] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the following instructions: In response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character, control the target virtual character and at least one of the other virtual characters to fight against the non-player character; During the battle, the target orientation of the non-player character is determined based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located; Control the non-player character to turn from the current direction toward the target orientation.
[0148] In one optional implementation, the region weight of the virtual region where the target virtual character controlled by the terminal device is located is higher than the region weight of the virtual region where other virtual characters controlled by other terminal devices are located.
[0149] In one optional implementation, the instructions executed by the computer-readable storage medium, which specify determining the target orientation of the non-player character based on a set target virtual character and the regional weights of the virtual regions where each other virtual character is located, include: Based on the target virtual character and the region weight of the virtual region where each other virtual character is located, determine the target region whose region weight is greater than the region weight of other virtual regions; The target orientation is determined based on the direction of the target area relative to the location of the non-player character.
[0150] In one optional implementation, the instructions executed by the computer-readable storage medium further include: Determine the target turning angle from the current orientation to the target orientation; Based on the target turning angle and the preset angle range, at least one target animation is determined corresponding to the non-player character's rotation process; During the process of the non-player character turning towards the target, at least one target animation is played sequentially according to the corresponding target angle range.
[0151] In one optional implementation, the instructions executed by the computer-readable storage medium, wherein determining at least one target animation corresponding to the rotation of the non-player character based on the target turning angle and a preset angle range, includes: Based on the target steering angle and the preset angle range, at least one target angle range including the target steering angle is determined; The rotation animation corresponding to each preset target angle range is determined as the target animation.
[0152] In one optional implementation, the instructions executed by the computer-readable storage medium further include: During the battle, based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, as well as the animation state of the completed historical animation, the state animation corresponding to the target character state corresponding to the non-player character is determined. Play the aforementioned state animation.
[0153] In one optional implementation, the state animation is determined in the instructions executable by the computer-readable storage medium through the following steps: Based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, determine whether the target virtual character is fighting against the non-player character; If the target virtual character is fighting against the non-player character, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
[0154] In one optional implementation, the instructions executed by the computer-readable storage medium further include: If the target virtual character is not fighting against the non-player character, based on the battle information between at least one of the other virtual characters and the non-player character, determine whether there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing. If there is no other virtual character fighting against the non-player character in the direction the non-player character is currently facing, determine whether there is at least one other virtual character fighting against the non-player character in other directions based on the battle information between at least one other virtual character and the non-player character. If there is at least one other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character. If there is no other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation.
[0155] In one optional implementation, the instructions executed by the computer-readable storage medium further include: If there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
[0156] In one optional implementation, the instructions executed by the computer-readable storage medium further include: Based on the character level and character status of the non-player character, determine at least one state animation corresponding to each character status of the non-player character; The higher the character level of the non-player character, the more state animations are corresponding to each character state of the non-player character.
[0157] In one optional implementation, the instructions executed by the computer-readable storage medium, wherein playing the state animation includes: Select one state animation from at least one state animation corresponding to the target character's state and play it.
[0158] In one optional implementation, the instructions executed by the computer-readable storage medium, wherein determining the target orientation of the non-player character during a battle, based on the set target virtual character and the regional weights of the virtual areas where each other virtual character is located, includes: During the battle, receive battle information for each virtual area sent by the server; Based on the battle information of each virtual region, the target virtual character and the regional weight of each other virtual character's virtual region are determined, and the target orientation of the non-player character is determined.
[0159] By employing the above method, the target orientation of non-player characters can be dynamically determined based on the regional weights of virtual areas within the game scene. This enhances the richness of the non-player character's presentation, thereby improving player immersion and overall gaming experience. Furthermore, the regional weight of the virtual area containing the target virtual character controlled by a terminal device is higher than that of the virtual areas containing other virtual characters controlled by other terminal devices. Therefore, when determining the target orientation of non-player characters based on regional weights, there is a high probability that the non-player characters will face the virtual team composed of the target virtual characters controlled by the player on the terminal device. This allows players to experience the feeling of directly confronting non-player characters, further enhancing the gaming experience. This enhances player immersion and overall gaming experience. Furthermore, the orientation of non-player characters differs across different devices, always facing the virtual team of player-controlled characters. This creates a sense of direct confrontation between players and non-player characters, further boosting immersion and gaming experience. The backend server only provides battle information; the behavior of non-player characters is determined by the frontend device. This decoupling of the data and presentation layers reduces backend computational load, improves frontend flexibility and scalability, and enriches the visual presentation of non-player characters on different devices, ultimately enhancing player experience. To enhance player immersion and gaming experience; simultaneously, during the process of controlling a non-player character to turn from the current direction to the target direction, to avoid overly abrupt turns, multiple corresponding turning animations can be played to present the gradual process of the non-player character turning to the target direction, reducing the abruptness of the turn and further enhancing player immersion; furthermore, in scenarios where the non-player character rotates 180°, the turning direction is further determined based on the regional weights of the adjacent virtual areas on the left and right to avoid abruptness, further enhancing player immersion and gaming experience; additionally, when the non-player character is attacked by at least one virtual team, the non-player character's status will change. The system features dynamic animations for different non-player character states, enhancing the richness of the animation presentation and further improving player immersion. Simultaneously, non-player characters of different levels or types can be configured with different performance options, such as enabling non-frontal attacks or adding special victory animations. These can be automatically set by the system based on character level or type, or players can customize them through the settings interface before entering the game. This allows for a rich and diverse visual experience while minimizing animation asset production costs, saving device resources and improving presentation efficiency while ensuring player immersion and overall experience.In addition to playing corresponding status animations during battles, the system can also display the current non-player character's status information (health points, HP, etc.) and the attack animations and information of each virtual team (attack route, attack time, and attack results, etc.) in the graphical user interface. This ensures players can understand the battle situation in a timely manner, make appropriate battle decisions, increase their chances of winning, and further enhance their gaming experience.
[0160] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0161] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0162] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0163] In addition, the functional units in the various embodiments of this disclosure 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.
[0164] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, 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 disclosure. 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.
[0165] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A method for controlling a virtual character, characterized in that, Applied to a terminal device; providing a graphical user interface through the terminal device; the graphical user interface displays at least a portion of the game scene; The game scene includes a target virtual character controlled by the terminal device and at least one other virtual character controlled by another terminal device. The control method includes: In response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character, control the target virtual character and at least one of the other virtual characters to fight against the non-player character; During the battle, the target orientation of the non-player character is determined based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located; Control the non-player character to turn from the current direction toward the target orientation.
2. The control method according to claim 1, characterized in that, The region weight of the virtual region where the target virtual character is located, controlled by the terminal device, is higher than the region weight of the virtual region where other virtual characters are located, controlled by other terminal devices.
3. The control method according to claim 1, characterized in that, The determination of the non-player character's target orientation based on the set target virtual character and the regional weights of the virtual regions where each other virtual character is located includes: Based on the target virtual character and the region weight of the virtual region where each other virtual character is located, determine the target region whose region weight is greater than the region weight of other virtual regions; The target orientation is determined based on the direction of the target area relative to the location of the non-player character.
4. The control method according to claim 1, characterized in that, The control method further includes: Determine the target turning angle from the current orientation to the target orientation; Based on the target turning angle and the preset angle range, at least one target animation is determined corresponding to the non-player character's rotation process; During the process of the non-player character turning towards the target, at least one target animation is played sequentially according to the corresponding target angle range.
5. The control method according to claim 4, characterized in that, The step of determining at least one target animation corresponding to the non-player character's rotation process based on the target turning angle and a preset angle range includes: Based on the target steering angle and the preset angle range, at least one target angle range including the target steering angle is determined; The rotation animation corresponding to each preset target angle range is determined as the target animation.
6. The control method according to claim 1, characterized in that, The control method further includes: During the battle, based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, as well as the animation state of the completed historical animation, the state animation corresponding to the target character state corresponding to the non-player character is determined. Play the aforementioned state animation.
7. The control method according to claim 6, characterized in that, The state animation is determined through the following steps: Based on the battle information between the target virtual character and at least one of the other virtual characters and the non-player character, determine whether the target virtual character is fighting against the non-player character; If the target virtual character is fighting against the non-player character, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
8. The control method according to claim 7, characterized in that, After determining whether the target virtual character is fighting against the non-player character, the control method further includes: If the target virtual character is not fighting against the non-player character, based on the battle information between at least one of the other virtual characters and the non-player character, determine whether there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing. If there is no other virtual character fighting against the non-player character in the direction the non-player character is currently facing, determine whether there is at least one other virtual character fighting against the non-player character in other directions based on the battle information between at least one other virtual character and the non-player character. If there is at least one other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character. If there is no other virtual character fighting against the non-player character in other directions, the state animation is determined based on the animation state of the historical animation.
9. The control method according to claim 8, characterized in that, After determining whether there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, the control method further includes: If there is at least one other virtual character fighting against the non-player character in the direction the non-player character is currently facing, the state animation is determined based on the animation state of the historical animation and the battle settings of the non-player character.
10. The control method according to claim 6, characterized in that, The control method further includes: Based on the character level and character status of the non-player character, determine at least one state animation corresponding to each character status of the non-player character; The higher the character level of the non-player character, the more state animations are corresponding to each character state of the non-player character.
11. The control method according to claim 10, characterized in that, Playing the state animation includes: Select one state animation from at least one state animation corresponding to the target character's state and play it.
12. The control method according to claim 1, characterized in that, During the battle, determining the target orientation of the non-player character based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located includes: During the battle, receive battle information for each virtual area sent by the server; Based on the battle information of each virtual region, the target virtual character and the regional weight of each other virtual character's virtual region are determined, and the target orientation of the non-player character is determined.
13. A control device for a virtual character, characterized in that, Applied to a terminal device; providing a graphical user interface through the terminal device; the graphical user interface displays at least a portion of the game scene; The game scene includes a target virtual character controlled by the terminal device and at least one other virtual character controlled by another terminal device. The control device includes: A character control module is used to control the target virtual character and / or at least one of the other virtual characters to fight against the non-player character in response to the target virtual character and / or at least one of the other virtual characters moving to the location of the non-player character. The orientation determination module is used to determine the target orientation of the non-player character during the battle, based on the set target virtual character and the regional weight of the virtual area where each other virtual character is located. A rotation control module is used to control the non-player character to turn from the current orientation to the target orientation.
14. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the virtual character control method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the virtual character control method according to any one of claims 1 to 12.