Virtual character control method and device, electronic equipment and storage medium

By defining target areas and defensive roles in the football game, the problem of inflexible NPC defense was solved, and the flexibility of virtual character control and the realism of team cooperation were improved.

CN116421968BActive Publication Date: 2025-12-30GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310385804.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-11
Publication Date
2025-12-30
Estimated Expiration
2043-04-11

AI Technical Summary

Technical Problem

In existing football games, non-player characters (NPCs) are simple to control when defending, resulting in insufficient flexibility in virtual character control and a lack of realism in team cooperation.

Method used

By obtaining the target position of the ball-carrying character in the virtual court, the target area is determined using the target position and preset positions. Based on the positional relationship between the target area and the characters of the opposing and friendly factions, the supporting and target characters are determined, and the supporting characters are controlled to perform supporting actions.

Benefits of technology

It enhances the flexibility of virtual character control and the realism of teamwork in football games, enabling more flexible and strategic defensive cooperation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116421968B_ABST
    Figure CN116421968B_ABST
Patent Text Reader

Abstract

Embodiments of the application disclose a virtual character control method and device, electronic equipment and a storage medium; the method comprises: obtaining a target position of a ball-holding character in a virtual football field; determining a target area in the virtual football field according to the target position and a preset position in the virtual football field; determining a cooperative defense character and a target character according to a positional relationship between the target area and a plurality of characters of an opponent team and a positional relationship between the target area and a plurality of characters of a self team; and controlling the cooperative defense character to perform a cooperative defense action on the target character. The target area is determined according to the position of the ball-holding character, the positional relationship between the virtual character and the target area is fully considered, the cooperative defense character and the target character are determined, and the flexibility of virtual character control and the realism of team cooperation in a football game are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and specifically to virtual character control methods, devices, electronic devices, and storage media. Background Technology

[0002] Sports games are games that allow players to simulate participating in professional sports. Players can control virtual characters within the game to participate in the sport. For example, in a football game, players can control virtual characters to simulate football players.

[0003] In existing football games, virtual characters can include player characters and non-player characters. When player characters are defending, the game system can automatically control non-player characters to provide support. However, the current control of non-player characters in football games is too simple, resulting in a lack of flexibility in controlling virtual characters and a lack of realism in team cooperation. Summary of the Invention

[0004] This application provides a virtual character control method, device, electronic device, and storage medium, which can improve the flexibility of virtual character control and the realism of team cooperation in football games.

[0005] This application provides a virtual character control method, which provides a graphical user interface through a terminal. The content displayed by the graphical user interface at least partially includes a virtual sports field. The method includes:

[0006] Obtain the target position of the ball-holding character in the virtual court, where the ball-holding character is on the opposing team's side;

[0007] Based on the target location and the preset location in the virtual court, a target area is determined in the virtual court;

[0008] Based on the positional relationship between the target area and multiple characters of the opposing faction, and the positional relationship between the target area and multiple characters of our faction, the supporting characters and target characters are determined, wherein the supporting characters are non-player characters of our faction, and the target characters are characters of the opposing faction.

[0009] Control the auxiliary defense role to perform auxiliary defense actions against the target role.

[0010] This application embodiment also provides a virtual character control device, which provides a graphical user interface via a terminal. The content displayed by the graphical user interface at least partially includes a virtual sports field. The device includes:

[0011] The acquisition module is used to acquire the target position of the ball-holding character in the virtual court, wherein the ball-holding character is in the opposing team's camp;

[0012] The area determination module is used to determine a target area in the virtual court based on the target location and a preset location in the virtual court;

[0013] The role determination module is used to determine the supporting role and the target role based on the positional relationship between the target area and multiple roles of the opposing faction, as well as the positional relationship between the target area and multiple roles of our faction. The supporting role is a non-player role of our faction, and the target role is a role of the opposing faction.

[0014] The control module is used to control the auxiliary defense role to perform auxiliary defense actions against the target role.

[0015] This application also provides an electronic device, including a memory storing multiple instructions; the processor loads instructions from the memory to execute any of the virtual character control methods provided in this application.

[0016] This application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the virtual character control methods provided in this application.

[0017] This application embodiment can obtain the target position of the opposing team's ball-carrying character in a virtual stadium; using this target position and preset positions in the virtual stadium, a target area is determined; then, based on the positional relationships between the target area and multiple characters in the opposing team, and the positional relationships between the target area and multiple characters in the opposing team, a supporting defensive character and a target character are determined, so as to control the supporting defensive character to perform a supporting defensive action against the target character. Determining the target area based on the position of the ball-carrying character, and fully considering the positional relationships between the virtual character and the target area, to determine the supporting defensive character and the target character, improves the flexibility of virtual character control and the realism of team cooperation in football games. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the virtual character control method provided in an embodiment of this application;

[0020] Figure 2 This is a schematic diagram of the various areas and lines on the virtual court provided in the embodiments of this application;

[0021] Figure 3 This is a schematic diagram of the first candidate region provided in the embodiments of this application;

[0022] Figure 4 This is another schematic diagram of the first candidate region provided in the embodiments of this application;

[0023] Figure 5 This is a schematic diagram of the second candidate region provided in the embodiments of this application;

[0024] Figure 6 This is a schematic diagram of the target area provided in the embodiments of this application;

[0025] Figure 7 This is a schematic diagram illustrating the determination of the defense role and the target role provided in an embodiment of this application;

[0026] Figure 8 This is another schematic diagram illustrating the determination of the defense role and the target role provided in an embodiment of this application;

[0027] Figure 9 This is yet another schematic diagram illustrating the determination of the defense role and the target role provided in the embodiments of this application;

[0028] Figure 10 This is another schematic diagram illustrating the determination of the defense role and the target role provided in the embodiments of this application;

[0029] Figure 11 This is a flowchart illustrating a virtual character control method provided in another embodiment of this application;

[0030] Figure 12 This is a schematic diagram of the structure of the virtual character control device provided in the embodiments of this application;

[0031] Figure 13 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] This application provides a virtual character control method, apparatus, electronic device, and storage medium.

[0034] Specifically, the virtual character control device can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet, smart Bluetooth device, laptop, or personal computer (PC); the server can be a single server or a server cluster consisting of multiple servers.

[0035] In some embodiments, the virtual character control device can also be integrated into multiple electronic devices. For example, the virtual character control device can be integrated into multiple servers, and the virtual character control method of this application can be implemented by multiple servers.

[0036] In some embodiments, the server may also be implemented as a terminal.

[0037] For example, in some embodiments, the electronic device can be a mobile terminal running a game client. The game client provides a graphical user interface (GUI) through the terminal, and the GUI displays content that at least partially includes a virtual court. This embodiment can obtain the target position of a ball-carrying character in the virtual court, the ball-carrying character being in the opposing team's camp; determine a target area in the virtual court based on the target position and preset positions in the virtual court; determine a supporting role and a target role based on the positional relationships between the target area and multiple characters in the opposing team's camp, and the positional relationships between the target area and multiple characters in our team's camp, wherein the supporting role is a non-player character in our team, and the target role is a character in the opposing team's camp; and control the supporting role to perform a supporting action against the target role.

[0038] A virtual object control method disclosed in one embodiment of this application can run on a local terminal device or a server. When the virtual object 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.

[0039] In some implementations, various cloud applications, such as cloud gaming, can run under a cloud-interactive 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 virtual object 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 terminal, television, computer, or PDA; however, the virtual object control is performed by the cloud gaming server in the cloud. When playing the game, the target client device sends operation instructions, such as touch operation instructions, to the cloud gaming server. The cloud gaming server runs the game according to the operation instructions, encodes and compresses game screen data, and returns it to the client device via the network. Finally, the client device decodes and outputs the game screen.

[0040] In some implementations, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the user through a graphical user interface (GUI), that is, conventionally downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the user in various ways, such as rendering it on the terminal's display screen or providing it to the user through holographic projection. For example, the local terminal device may include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.

[0041] A virtual sports field is a virtual stadium displayed when an application runs on a terminal or server. In this embodiment, the virtual stadium can be a simulation of a real-world sports field.

[0042] A game interface refers to the interface of an application provided or displayed through a graphical user interface. This interface includes a graphical user interface for user interaction and game screens, which are images of a virtual stadium and virtual characters within it.

[0043] In some implementations, the UI may include various game elements (e.g., status bar, character avatar, etc.), indicators (e.g., direction indicators, character indicators, etc.), information display areas (e.g., number of kills, match time, etc.), or game settings controls (e.g., system settings, shop, coins, etc.).

[0044] In optional implementations, the game screen is the display screen corresponding to the virtual court shown on the terminal device. The game screen may include virtual characters such as game objects, NPC characters, and AI characters that execute game logic in the virtual court. For example, in some embodiments, the content displayed in the graphical user interface at least partially includes the virtual court.

[0045] Virtual objects refer to objects within a virtual arena, including game characters (also known as virtual roles). Game characters are controllable, dynamic objects, i.e., dynamic virtual objects. Optionally, these dynamic objects can be virtual characters, virtual animals, anime characters, etc. These virtual roles are characters controlled by the user through input devices, or artificial intelligence (AI) trained and set up for battles in a virtual environment, or non-player characters (NPCs) set up for battles in a virtual arena.

[0046] Optionally, the virtual character is a virtual person competing in a virtual stadium. Optionally, the number of virtual characters in the virtual stadium battle is preset or dynamically determined according to the number of clients joining the battle; this embodiment of the application does not limit this.

[0047] In one possible implementation, the user can control virtual objects to perform game behaviors in the virtual arena. Game behaviors can include moving, casting skills, using items, and talking. For example, the user can control the virtual objects to run, jump, crawl, etc., and can also control the virtual objects to use skills and virtual items provided by the application to fight against other virtual objects.

[0048] Virtual cameras are an essential component of game scene visuals, used to present game scene visuals. Each game scene corresponds to at least one virtual camera, and depending on actual needs, there can be two or more. As a game rendering window, they capture and present the game world visuals for the user. By setting the parameters of the virtual camera, the user's viewing angle of the game world can be adjusted, such as first-person perspective or third-person perspective.

[0049] In one optional implementation, this invention provides a virtual object control method that provides a graphical user interface through a terminal device, wherein the terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.

[0050] In sports games, such as football, two teams typically compete against each other, with the team scoring more goals within a set time winning. Currently, in most football games, when a player controls a virtual character to defend against an opposing player, they can call upon AI-controlled teammates (NPCs) for assistance. However, in existing football games, the movement control of NPCs during defensive maneuvers is relatively simple; they usually run directly towards the ball to intercept, resulting in a rigid and inflexible defensive coordination between players. Therefore, this application provides the following method to address the problem of rigid and inflexible NPC player defense.

[0051] In this embodiment, a virtual object control method is provided, such as... Figure 1 As shown, the specific flow of this virtual object control method can be as follows:

[0052] S110. Obtain the target position of the ball-holding character in the virtual court, wherein the ball-holding character is in the opposing team's camp.

[0053] The "ball-carrying character" refers to a virtual character who has control over a virtual ball, which in a football game is the virtual soccer ball. The ball-carrying character belongs to the opposing team. In a football game, when a virtual character from the opposing team gains control of the virtual soccer ball, a player on their team can trigger a defensive support action to call upon teammates for assistance. In other words, the virtual character controlled by the player triggering the defensive support action is on a different team than the ball-carrying character.

[0054] In a football game, a defensive support trigger operation refers to an action performed by a player to call upon teammates for defensive support. These operations can include touch, swipe, tap, long press, short press, double tap, tap, and ending the swipe. For example, in some embodiments, a defensive support trigger operation may be a short press; in others, a long press; and in still others, a swipe. In some implementations, the defensive support trigger operation can also be a combination of operations, such as a long press combined with a swipe, or a tap combined with a tap, etc. The specific configuration of the defensive support trigger operation is not limited here.

[0055] As one implementation method, when a virtual character in the opposing team has control of the virtual soccer ball, that is, if the character with the ball is in the opposing team's camp, a defense control can be displayed on the graphical user interface. Players on their own team can click on the defense control to trigger the defense, or they can long-press the defense control to trigger the defense.

[0056] As one implementation method, it can also involve acquiring the voice of one's own players. When the voice of one's own players contains a keyword, it can be considered that a defensive support trigger operation has been detected. In response to the defensive support trigger operation, the target position of the ball-carrying character in the virtual court can be obtained. For example, if the keyword is "defense support," and the ball-carrying character is on the opposing team's side, the voice input of one's own players can be acquired. Then, speech-to-text technology can be used to convert the acquired voice of one's own players into text, and then it can be determined whether the text contains "defense support." If it does, it is considered that a defensive support trigger operation has been detected.

[0057] In one method, when acquiring the voice input of a player on your own side, if the character holding the ball is on the opposing team, the terminal can perform real-time voice detection to acquire the voice input from your own player. Alternatively, if the character holding the ball is on the opposing team, a voice input icon can be displayed on the graphical user interface, which your own player can click to instruct the terminal to perform real-time voice detection and acquire the voice input from your own player.

[0058] After receiving a defense assistance trigger, the electronic device can obtain the position of the ball-carrying character in the virtual court, i.e., the target position, so as to use the target position for subsequent calculations.

[0059] S120. Based on the target location and the preset location in the virtual court, determine the target area in the virtual court.

[0060] After obtaining the target location, the target area can be determined within the virtual court using the target location and preset locations within the virtual court. The preset locations can refer to fixed positions on the virtual court, such as the four corners of the virtual court, or the two corners of the penalty area.

[0061] In some implementations, the preset location may include a first preset location, a second preset location, and a designated location, wherein the designated location is a fixed location related to the goal. When determining the target area based on the target location and the preset location, the location to be used may be determined at the intersection of the center line and the sideline based on a first distance and a second distance, where the first distance is the distance between the target location and the first preset location, and the second distance is the distance between the target location and the second preset location; connecting the first preset location, the second preset location, the location to be used, and the target location yields a first candidate area; based on the target location and the distance between the target location and the designated location, a second candidate area is determined; the overlapping area of ​​the first candidate area and the second candidate area is determined as the target area.

[0062] The first and second preset positions can refer to the location of the intersection of the goal line and the touchline on the half of the field where the target position is located. For example, see [reference needed]. Figure 2 The diagram shows the various areas and lines on the virtual court. Assuming the target position is point O, the first preset position and the second preset position are points A and E.

[0063] Wherein, the first distance refers to the distance between the target position and the first preset position, and the second distance refers to the distance between the target position and the second preset position. Based on the first and second distances, the position to be used can be determined at the intersection of the centerline and the edge line. In some embodiments, when determining the position to be used, if the first distance is less than the second distance, the intersection point that is on the same edge line as the second preset position is determined as the position to be used; if the first distance is greater than the second distance, the intersection point that is on the same edge line as the first preset position is determined as the position to be used.

[0064] If the first distance is less than the second distance, it means the target location is closer to the first preset location, and the intersection of the first and second preset locations on the same sideline can be used as the location to be used; if the first distance is greater than the second distance, it means the target location is closer to the second preset location, and the intersection of the first and second preset locations on the same sideline can be used as the location to be used. For example, see [reference needed]. Figure 3 A schematic diagram of the first candidate region is shown. Figure 3 In the diagram, the length of OA is less than the length of OE, indicating that point O is closer to point A. Therefore, the intersection point on the same sideline as point E can be used as the position to be used, namely point D.

[0065] After determining the location to be used, the first preset location, the second preset location, the target location, and the location to be used can be connected to obtain the first candidate region. That is, the first candidate region is the closed region obtained by sequentially connecting the above four location points. For example, please refer to [further details omitted]. Figure 3 The gray area AODE in the figure is the first candidate region.

[0066] Understandably, the first candidate region varies depending on the target location; for example, see [reference needed]. Figure 4 This diagram illustrates another possible first candidate region. Similarly, since point O is closer to point A, point D is located at the intersection of the edge line and the center line where point E is located. The gray area AODE in the diagram represents the first candidate region.

[0067] A second candidate area can be determined based on the distance between the target location and the designated location. The designated location is a fixed position related to the goal, such as the two corners of the goal area or the two corners of the penalty area. In some implementations, the designated location may also be divided into a first designated location and a second designated location. In this embodiment, the designated location is defined as the two corners of the penalty area. Figure 4 Points B and C in the diagram.

[0068] In some implementations, when determining the second candidate region, a first sub-region may be generated with the target location as the center and the distance between the target location and the first designated location as the radius; a second sub-region may be generated with the target location as the center and the distance between the target location and the second designated location as the radius; and the second candidate region may be determined based on the first sub-region and the second sub-region.

[0069] Since the specified location includes both a first specified location and a second specified location, we can use the target location as the center and the distance between the first specified location and the target location as the radius to generate a first sub-region, which is a circular region. Continuing, using the target location as the center and the distance between the second specified location and the target location as the radius, we generate a second sub-region, which is also a circular region with the same center as the first sub-region. For example, see [reference needed]. Figure 5 This shows a schematic diagram of the second candidate region. Figure 5 In the diagram, the circle OB with radius OB and center O can be denoted as the first subregion, and the circle OC with radius OC and center O can be denoted as the second subregion.

[0070] Based on the first and second sub-regions, a second candidate region can be determined. In some embodiments, the second candidate region may consist of two parts; for example, the second candidate region may include a first region and a second region. The overlapping area between the first and second sub-regions can be used as the first region, and the non-overlapping area between the first and second sub-regions can be used as the second region. See further details. Figure 5 Since the area of ​​circle OB is smaller than that of circle OC, the overlapping area of ​​circles OB and OC is the entire circle OB. Figure 5 The light gray area, and the non-overlapping area, represents the annulus formed by removing circle OB from circle OC. Figure 5 Medium-dark gray area.

[0071] After identifying the first and second candidate regions, the overlapping area between them can be defined as the target region. It should be noted that since the second candidate region contains two regions, the corresponding target region can also contain two regions: a first sub-target region and a second sub-target region. For example, see [reference needed]. Figure 6 The diagram shows the target area, where the first sub-target area and the second sub-target area are adjacent, and the target position is located on the first sub-target area. Figure 6 The light gray area is the first sub-target area, and the target location point O is located in the first sub-target area. The dark gray area is the second sub-target area.

[0072] S130. Based on the positional relationship between the target area and multiple characters of the opposing camp, and the positional relationship between the target area and multiple characters of our camp, determine the supporting role and the target role.

[0073] The "multiple roles" in the opposing team refer to all roles within that team, including the ball carrier and opposing teammates. The "multiple roles" in our team refer to all roles within our team, including both player-controlled and non-player-controlled characters. Player-controlled characters are virtual characters within our team that are controlled by the player, while non-player-controlled characters are virtual characters within our team that are either automatically controlled by the game program or controlled by AI. The opposing and opposing teams are adversaries; in the football game, characters from both teams must engage in offensive and defensive battles on the virtual field.

[0074] Once the target area is determined, the supporting roles and target roles can be identified based on the positional relationships between multiple characters from the opposing faction and the target area, as well as the positional relationships between multiple characters from our faction and the target area.

[0075] In this system, the supporting defender is a non-player character within our faction, while the target character is a character within the opposing faction; the target character is the object of the supporting defender's defense. The positional relationship between the character and the target area can be divided into two cases: the first is that the character is within the target area, and the second is that the character is not within the target area.

[0076] When determining the positional relationship between a character and a target area, a target coordinate system can be established to obtain the character's coordinate information in the target coordinate system, as well as the coordinate range of the target area in the target coordinate system. When the coordinate information falls within the coordinate range of the target area, the character can be considered to be within the target area.

[0077] For example, the target coordinate system includes a first coordinate axis and a second coordinate axis, assuming they are the X-axis and the Y-axis. The maximum range of the target area on the X-axis can be determined, for example, [1,4], and the maximum range of the target area on the Y-axis can be determined, for example, [0,6]. The coordinate information of the character can be represented as (x1, y1). When 1≤x1≤4 and 0≤y1≤6, it can be determined that the character is within the target area; otherwise, it is determined that the character is not within the target area.

[0078] Since the target area can include a first sub-target area and a second sub-target area, by obtaining the coordinate information of all characters in our camp, the coordinate information of all characters in the enemy camp, the coordinate range of the first sub-target area, and the coordinate range of the second sub-target area, we can determine the positional relationship between each character and the first sub-target area, as well as the positional relationship between each character and the second sub-target area.

[0079] The larger the area of ​​the second sub-target region, the greater the probability that there are enemy teammates in the second sub-target region. Therefore, based on the specific area where our player character is located, as well as the specific areas where other virtual characters are located, we can determine the movement path and defensive actions of our non-player characters in different areas.

[0080] When determining the supporting and target roles based on positional relationships, the following methods may be used: If the friendly player character is not within the first sub-target area, the supporting and target roles are determined based on the distance between the friendly non-player character within the first sub-target area and the target location; if the friendly player character is within the first sub-target area, the supporting and target roles are determined based on the location of the opposing teammate within the target area; if the friendly player character is within the first sub-target area and the opposing teammate does not exist within the target area, the supporting and target roles are determined based on the distance between the friendly non-player character within the first sub-target area and the target location.

[0081] according to Figure 6 The first and second sub-target areas shown in the diagram indicate that the first sub-target area is closer to the target location. If our player character is not within the first sub-target area, it means that our player character is far from the player with the ball. In order to prevent the player with the ball from shooting or passing, our players need to defend the player with the ball. Therefore, the supporting players and the target player can be determined based on the distance between our non-player characters within the first sub-target area and the target location.

[0082] In some implementations, to achieve a more flexible defense, when determining the support role and the target role based on the distance between the friendly non-player character and the target position within the first sub-target area, the distance between each of the friendly non-player characters and the target position within the first sub-target area can be calculated to obtain candidate distances corresponding to the friendly non-player characters; the friendly non-player character corresponding to the minimum value among the candidate distances is determined as the support role, and the ball-handling character is determined as the target role.

[0083] When calculating distances, the position information of each non-player character within the first sub-target area can be obtained first. The straight-line distance between the position information within the first sub-target area and the target position can then be calculated to obtain candidate distances for each non-player character. The player character corresponding to the minimum candidate distance is then selected as the support / defense role, and the ball-handler is selected as the target character. In other words, the non-player character within the first sub-target area closest to the target position can be directly selected as the support / defense role. Since this support / defense role is closest to the ball-handler at the target position, it can defend against the ball-handler more quickly.

[0084] For example, see Figure 7 This diagram illustrates how to determine the roles of support and target. Figure 7 In the game, a white pentagram indicates our player character 101, a black pentagram indicates our non-player character 102, and a black triangle indicates the opposing teammate character 103. If the ball-holding character is at point O, and our player character is not in the first sub-target area, we can directly identify our non-player character 102, who is closest to point O, as the support character, and the ball-holding character at point O as the target character.

[0085] In some implementations, if there are no friendly non-player characters in the first sub-target area, the friendly non-player character closest to the target location in the second target sub-target area can be selected as the auxiliary defense character. If there are still no friendly non-player characters in the second target sub-target area, the friendly non-player character closest to the target location can be directly selected as the auxiliary defense character.

[0086] If our player character is within the first sub-target area and there are no opposing teammates within that area, it indicates that the player with the ball at the target location is unlikely to pass the ball to their teammate. Therefore, the supporting and target roles can be determined based on the distance between our non-player characters within the first sub-target area and the target location. In this case, if there are no opposing teammates within either the first or second sub-target areas, our players need to defend the player with the ball to prevent them from shooting or passing. We can directly designate the non-player character within the first sub-target area closest to the target location as the supporting role and the player with the ball as the target role.

[0087] For example, see Figure 8 This illustrates another schematic diagram for determining the defensive and target roles. Figure 8In the game, a white pentagram indicates our player character 101, a black pentagram indicates our non-player character 102, and a black triangle indicates the opposing teammate character 103. If the ball-holding character is at point O, and our player character is in the first sub-target area, and there are no opposing teammate characters in the target area, our non-player character 102, who is closest to point O, can be directly identified as the support character, and the ball-holding character at point O can be identified as the target character.

[0088] If our player character is within the first sub-target area, we can determine the supporting and target characters based on the positions of the opposing team's teammates within the target area. Since the target area can include both the first and second sub-target areas, we can determine the supporting and target characters based on whether the opposing team's teammates are specifically located within the first or second sub-target area.

[0089] For example, if both the player character and the opposing teammate character are within the first sub-target area, the supporting role and the target role can be determined based on the distance between the player character and the opposing teammate character within the first sub-target area, and the distance between the opposing teammate character and the target location. If the player character is within the first sub-target area, and the opposing teammate character is within the second sub-target area, and there is no opposing teammate character within the first sub-target area, the supporting role and the target role can be determined based on the distance between the player character and the opposing teammate character within the second sub-target area, and the distance between the opposing teammate character and the target location.

[0090] As one implementation method, if both our player character and the opposing team's teammate character are within the first sub-target area, the target character can be determined from among the opposing teammate characters within the first sub-target area based on the distance between each opposing teammate character within the first sub-target area and the target position. Similarly, a supporting defender can be determined from among our non-player characters based on the distance between our non-player characters and the target position. It should be noted that the presence of opposing teammate characters within the first sub-target area indicates that the player with the ball at the target position might pass the ball to an opposing teammate character for a shot. Therefore, a target character can be determined from among the opposing teammate characters within the first sub-target area for defense. For example, the opposing teammate character furthest from the target position within the first sub-target area can be designated as the target character.

[0091] After locking onto the target character, the non-player character closest to the target character within the first sub-target area can be designated as the support character, so that the support character can defend against the target character.

[0092] For example, see Figure 9This illustrates yet another diagram for determining the roles of support and target, in Figure 9 In the game, a white pentagram indicates our player character 101, a black pentagram indicates our non-player character 102, and a black triangle indicates the opposing teammate character 103. The player with the ball is positioned at point O. When both our player character and the opposing teammate character are within the first sub-target area, the opposing teammate character 103, who is furthest from point O within the first sub-target area, is designated as the target character, and our non-player character 102, who is closest to the target character, is designated as the support character.

[0093] As one implementation method, if our player character is in the first sub-target area and the opposing teammate character is in the second sub-target area, and there is no opposing teammate character in the first sub-target area, the target character can be determined from the opposing teammate characters in the second sub-target area based on the distance between each opposing teammate character in the second sub-target area and the target position, and the supporting role can be determined from our non-player characters based on the distance between our non-player characters and the target character.

[0094] Similarly, if there is an opposing teammate in the second sub-target area, in order to prevent the ball-carrying character from passing the ball to the opposing teammate, the opposing teammate farthest from the target position in the second sub-target area can be identified as the target character, and the friendly non-player character closest to the target character in the second sub-target area can be identified as the support character.

[0095] For example, see Figure 10 This illustrates yet another diagram for determining the roles of support and target, in Figure 10 In the game, a white pentagram indicates our player character 101, a black pentagram indicates our non-player character 102, and a black triangle indicates the opposing teammate character 103. The player with the ball is positioned at point O. If our player character is within the first sub-target area, and the opposing teammate character is not within the first sub-target area but is within the second sub-target area, then the opposing teammate character 103, who is furthest from point O within the second sub-target area, is designated as the target character, and our non-player character 102, who is closest to the target character, is designated as the support character.

[0096] S140. Control the defense role to perform defense actions against the target role.

[0097] After identifying the supporting and target roles, the supporting action to be performed by the supporting role can be determined based on the target role. In some implementations, the supporting action may include a steal and a follow-up action. When controlling the supporting role to perform the supporting action against the target role, if the target role is the ball-handler, the supporting role may perform a steal; if the target role is an opposing teammate, the supporting role may perform a follow-up action.

[0098] If the target player is the ball carrier, to prevent them from passing or shooting, the supporting defender can be directly controlled to intercept the ball. If the target player is an opposing teammate, to prevent them from receiving the ball, the supporting defender can be directly controlled to mark the target player to intercept the pass. In some implementations, when controlling the supporting defender to perform a defensive action, the supporting defender can first move to the vicinity of the target player before performing the corresponding defensive action.

[0099] The virtual character control scheme provided in this application can be applied to various virtual ball games. For example, in a football game, when an opponent's character has the ball, they can call on their own players for defensive support. During this support, the defensive character can flexibly determine the appropriate defensive action based on the positional relationship between their own character and the target area, as well as the positional relationship between the opponent's character and the target area. This makes the entire support process more focused on teamwork, more flexible, and more strategic, thereby enhancing the player's gaming experience.

[0100] As can be seen from the above, the embodiments of this application can obtain the target position of the opposing team's ball-carrying character in the virtual stadium; using this target position and preset positions in the virtual stadium, a target area is determined; then, based on the positional relationships between the target area and multiple characters in the opposing team, and the positional relationships between the target area and multiple characters in the opposing team, a supporting defensive character and a target character are determined, so as to control the supporting defensive character to perform a supporting defensive action against the target character. Determining the target area based on the position of the ball-carrying character, and fully considering the positional relationships between the virtual character and the target area, to determine the supporting defensive character and the target character, improves the flexibility of virtual character control and the realism of team cooperation in football games.

[0101] The method described in the above embodiments will be further described in detail below.

[0102] In this embodiment, a football game will be used as an example to describe the method of this application embodiment in detail. It is assumed that the football game includes two camps, namely the opposing camp and our camp. Each camp has a virtual character that can be controlled by the player. The player can switch between the controlled virtual characters at will. For example, our camp has virtual characters A, B, and C. The player can choose to control virtual character A, while virtual characters B and C can be automatically controlled by the game. During the game, the player can switch to control virtual character B, while virtual characters A and C can be automatically controlled by the game.

[0103] like Figure 11 As shown, the specific process of a virtual object control method in a football game is as follows:

[0104] S210, In response to the defense-triggered operation, obtain the target position of the ball-carrying character in the opposing team in the virtual stadium.

[0105] S220. Based on the target location and the preset location in the virtual court, determine the target area in the virtual court, wherein the target area includes a first sub-target area and a second sub-target area.

[0106] When the opposing team's character is playing virtual soccer, a support control can be displayed on the terminal of the player controlling the player character in our team. The player can click the support control to trigger a support action, so that other virtual characters in our team can assist the player character in defense. After our player triggers the support action, they can obtain the target position of the character with the ball in the virtual field.

[0107] In this embodiment, the preset position may include a first preset position, a second preset position, and a designated position. The first and second preset positions are the two intersections of the sideline and the goal line in the half of the field where the ball-handling player is located. The designated position may include a first and a second designated position, which can refer to the locations of the two corners of the penalty area. The specific details of determining the target area can be found in the corresponding parts of the foregoing embodiments and will not be repeated here.

[0108] S230. Determine if our player character is within the first sub-target area; if yes, execute S240; if no, execute S280.

[0109] S240. Determine if there is an enemy teammate within the first sub-target area; if yes, execute S250; if no, execute S260.

[0110] S250. Within the first sub-target area, the enemy teammate character furthest from the target location is identified as the target character, and the friendly non-player character closest to the target character is identified as the support character. The support character is then controlled to perform a follow-up action against the target character.

[0111] S260. Determine if there is an enemy teammate within the second sub-target area; if yes, execute S270; if no, execute S280.

[0112] S270. Within the second sub-target area, identify the enemy teammate character furthest from the target location as the target character, and designate the friendly non-player character closest to the target character as the support character, and control the support character to perform a follow-up action on the target character.

[0113] S280. Within the first sub-target area, the ball-handling character is identified as the target character, the closest non-player character of our side is identified as the defensive support character, and the defensive support character is controlled to perform a steal action against the target character.

[0114] After determining the target area, it can be determined whether our player character is in the first sub-target area; if our player character is not in the first sub-target area, the player with the ball can be identified as the target character in the first sub-target area, and the non-player character closest to the target character can be identified as the defensive role, and the defensive role can be controlled to perform a steal action against the target character.

[0115] If our player character is within the first sub-target area, we can continue to determine whether there are any enemy teammate characters within the first sub-target area. If there are enemy teammate characters within the first sub-target area, we can identify the enemy teammate character furthest from the target position as the target character and the our non-player character closest to the target character as the support character; and control the support character to perform a follow-up defense action against the target character.

[0116] If there are no enemy teammates in the first sub-target area, the system can continue to determine if there are enemy teammates in the second sub-target area. If there are enemy teammates in the second sub-target area, the enemy teammate farthest from the target location is identified as the target character, and the friendly non-player character closest to the target character is identified as the support character. The support character is then controlled to perform a follow-up action on the target character.

[0117] If there are still no opposing teammates in the second target area, the player with the ball can be designated as the target player in the first target area, and the closest non-player player on our side can be designated as the defensive player. The defensive player can then be controlled to intercept the target player.

[0118] As can be seen from the above, the virtual character control method provided in this application embodiment can determine the target area based on the target position of the ball-holding character and the preset position in the virtual field when a non-player character needs to assist the player character in defense in a football game. Based on the different positions of our player character, our non-player character, and the opposing team's teammate character in the target area, the assisting character, the target character, and the corresponding defensive actions can be determined, so as to improve the flexibility of virtual character control and the realism of team cooperation in the football game.

[0119] To better implement the above methods, this application also provides a virtual character control device, which can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, or personal computer; the server can be a single server or a server cluster composed of multiple servers.

[0120] For example, in this embodiment, the method of this application embodiment will be described in detail by taking the virtual character control device specifically integrated into the server as an example.

[0121] For example, such as Figure 12 As shown, the virtual character control device may include an acquisition module 310, an area determination module 320, a character determination module 330, and a control module 340.

[0122] The acquisition module 310 is used to acquire the target position of the ball-holding character in the virtual court, wherein the ball-holding character is in the opposing team's camp;

[0123] The area determination module 320 is used to determine a target area in the virtual court based on the target location and a preset location in the virtual court;

[0124] The role determination module 330 is used to determine the supporting role and the target role based on the positional relationship between the target area and multiple roles of the opposing faction, and the positional relationship between the target area and multiple roles of our faction, wherein the supporting role is a non-player role of our faction, and the target role is a role of the opposing faction.

[0125] The control module 340 is used to control the auxiliary defense role to perform auxiliary defense actions against the target role.

[0126] In some embodiments, the preset position includes a first preset position, a second preset position, and a specified position, wherein the specified position is a fixed position related to the goal, and the area determination module 320 further includes:

[0127] A position determination unit is used to determine a position to be used at the intersection of a centerline and a sideline based on a first distance and a second distance, wherein the first distance is the distance between the target position and a first preset position, and the second distance is the distance between the target position and the second preset position;

[0128] The first candidate unit is used to connect the first preset position, the second preset position, the position to be used, and the target position to obtain a first candidate region;

[0129] The second candidate unit is used to determine a second candidate region based on the target location and the distance between the target location and the specified location;

[0130] The target determination unit is used to determine the overlapping area of ​​the first candidate region and the second candidate region as the target region.

[0131] In some embodiments, the position determination unit is further configured to:

[0132] If the first distance is less than the second distance, the intersection point that is on the same sideline as the second preset position will be determined as the position to be used;

[0133] If the first distance is greater than the second distance, the intersection point that is on the same sideline as the first preset position is determined as the position to be used.

[0134] In some embodiments, the designated location includes a first designated location and a second designated location, and the second candidate unit is further configured to:

[0135] A first sub-region is generated with the target location as the center and the distance between the target location and the first specified location as the radius.

[0136] A second sub-region is generated with the target location as the center and the distance between the target location and the second specified location as the radius.

[0137] Based on the first sub-region and the second sub-region, a second candidate region is determined.

[0138] In some embodiments, the target area includes a first sub-target area and a second sub-target area adjacent to the first sub-target area, the target location is located in the first sub-target area, the multiple characters of our faction include our player characters and our non-player characters, the multiple characters of the opposing faction also include opposing teammate characters, and the character determination module 330 further includes:

[0139] The first determining unit is used to determine the supporting role and the target role based on the distance between the friendly non-player character in the first sub-target area and the target location if the friendly player character is not in the first sub-target area.

[0140] The second determining unit is used to determine the supporting role and the target role based on the position of the opposing teammate role in the target area if the friendly player character is in the first sub-target area;

[0141] The third determining unit is used to determine the supporting role and the target role based on the distance between the friendly non-player character in the first sub-target area and the target location if the friendly player character is in the first sub-target area and there is no opposing teammate character in the target area.

[0142] In some embodiments, the first determining unit and the third determining unit are further configured to:

[0143] Calculate the distance between each of the friendly non-player characters within the first sub-target area and the target location to obtain the candidate distances corresponding to the friendly non-player characters;

[0144] The non-player character corresponding to the minimum value among the candidate distances is identified as the defensive support character, and the ball-handling character is identified as the target character.

[0145] In some embodiments, the second determining unit is further configured to:

[0146] If both the player character and the opposing teammate character are within the first sub-target area, the supporting character and the target character are determined based on the distance between the player character and the opposing teammate character within the first sub-target area, and the distance between the opposing teammate character and the target location.

[0147] If the player character is in the first sub-target area, and the opposing teammate character is in the second sub-target area, and there is no opposing teammate character in the first sub-target area, the supporting character and the target character are determined based on the distance between the player character and the opposing teammate character in the second sub-target area, and the distance between the opposing teammate character and the target location.

[0148] In some embodiments, the defensive action includes a steal and a follow-up action, and the control module 340 further includes:

[0149] The first control unit is configured to, if the target character is the ball-handling character, control the defensive support character to perform a steal action against the ball-handling character.

[0150] The second control unit is used to control the supporting character to perform a follow-up action on the opposing teammate if the target character is the opposing teammate character.

[0151] In some embodiments, the acquisition module 310 further includes:

[0152] The display unit is used to display defensive controls in the graphical user interface if the player with the ball is on the opposing team's side;

[0153] The acquisition unit is used to acquire the target position of the ball-holding character in the virtual court in response to the cooperative defense trigger operation of the cooperative defense control.

[0154] In practice, each of the above modules or units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above modules or units, please refer to the previous method embodiments, which will not be repeated here.

[0155] As can be seen from the above, the virtual character control device in this embodiment can obtain the target position of the opposing team's ball-carrying character in the virtual field; using this target position and preset positions in the virtual field, a target area is determined; then, based on the positional relationship between the target area and multiple characters in the opposing team, and the positional relationship between the target area and multiple characters in the opposing team, the supporting defensive character and the target character are determined, so as to control the supporting defensive character to perform supporting defensive actions against the target character. Determining the target area based on the position of the ball-carrying character, and fully considering the positional relationship between the virtual character and the target area, to determine the supporting defensive character and the target character, improves the flexibility of virtual character control and the realism of team cooperation in the football game.

[0156] Accordingly, this application also provides an electronic device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer, personal digital assistant (PDA) and other terminal devices.

[0157] like Figure 13 As shown, Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 400 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored in the memory 402 and executable on the processor. The processor 401 and the memory 402 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0158] The processor 401 is the control center of the electronic device 400. It connects various parts of the electronic device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the electronic device 400 and processes data, thereby monitoring the electronic device 400 as a whole.

[0159] In this embodiment, the processor 401 in the electronic device 400 loads the instructions corresponding to the processes of one or more applications into the memory 402 according to the following steps, and the processor 401 runs the applications stored in the memory 402 to realize various functions:

[0160] The system obtains the target position of a ball-carrying character in the virtual court, the ball-carrying character being in the opposing team's camp; based on the target position and preset positions in the virtual court, a target area is determined in the virtual court; based on the positional relationships between the target area and multiple characters in the opposing team's camp, and the positional relationships between the target area and multiple characters in our team's camp, a support character and a target character are determined, wherein the support character is a non-player character in our team, and the target character is a character in the opposing team's camp; the system controls the support character to perform a support action against the target character.

[0161] The target area is determined based on the position of the player with the ball, and the positional relationship between the virtual character and the target area is fully considered to determine the supporting and target roles, thereby improving the flexibility of virtual character control and the realism of team cooperation in the football game.

[0162] Based on a first distance and a second distance, a position to be used is determined at the intersection of the centerline and the edge line. The first distance is the distance between the target position and the first preset position, and the second distance is the distance between the target position and the second preset position. Connecting the first preset position, the second preset position, the position to be used, and the target position yields a first candidate region. Based on the target position and the distance between the target position and the designated position, a second candidate region is determined. The overlapping area of ​​the first candidate region and the second candidate region is determined as the target region.

[0163] If the first distance is less than the second distance, the intersection point that is on the same sideline as the second preset position is determined as the position to be used; if the first distance is greater than the second distance, the intersection point that is on the same sideline as the first preset position is determined as the position to be used.

[0164] A first sub-region is generated with the target location as the center and the distance between the target location and the first designated location as the radius; a second sub-region is generated with the target location as the center and the distance between the target location and the second designated location as the radius; a second candidate region is determined based on the first sub-region and the second sub-region.

[0165] Using the target location to determine the first and second candidate regions, and using their overlapping area as the target region, the corresponding region can be divided more accurately based on the target location, so as to more flexibly determine the auxiliary defense role and the target role, making the control more rational.

[0166] If the player character is not within the first sub-target area, the supporting role and the target role are determined based on the distance between the player character and the target location within the first sub-target area; if the player character is within the first sub-target area, the supporting role and the target role are determined based on the location of the opposing teammate within the target area; if the player character is within the first sub-target area and the opposing teammate is not within the target area, the supporting role and the target role are determined based on the distance between the player character and the target location within the first sub-target area.

[0167] Calculate the distance between each of the friendly non-player characters within the first sub-target area and the target location to obtain the candidate distances corresponding to the friendly non-player characters; determine the friendly non-player character corresponding to the minimum value among the candidate distances as the defensive role, and determine the ball-handling character as the target character.

[0168] If both the player character and the opposing teammate are within the first sub-target area, the supporting role and the target role are determined based on the distance between the player character and the opposing teammate within the first sub-target area, and the distance between the opposing teammate and the target location. If the player character is within the first sub-target area, and the opposing teammate is within the second sub-target area, and there is no opposing teammate within the first sub-target area, the supporting role and the target role are determined based on the distance between the player character and the opposing teammate within the second sub-target area, and the distance between the opposing teammate and the target location.

[0169] By considering the areas where our player characters, our non-player characters, and the enemy's teammates are located, we can select support and target characters to enhance the realism of teamwork.

[0170] If the target character is the ball-handler, control the assisting defender to perform a steal action against the ball-handler; if the target character is the opposing teammate, control the assisting defender to perform a follow-up action against the opposing teammate.

[0171] Based on the different target roles, the defensive roles can be reasonably controlled to perform different defensive actions against the target roles. This not only allows for flexible control of virtual roles but also enhances the realism of team cooperation.

[0172] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0173] Optional, such as Figure 13 As shown, the electronic device 400 also includes: a touch display screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch display screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407. Those skilled in the art will understand that... Figure 13 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0174] The touch display screen 403 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 403 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 401. It can also receive and execute commands from the processor 401. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 401 to determine the type of touch event. Subsequently, the processor 401 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 403 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 403 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 403 can also be used as part of the input unit 406 to achieve input functions.

[0175] In this embodiment, a game application is executed by processor 401 to generate a graphical user interface (GUI) on touch display screen 403, which can display a virtual sports field. The touch display screen 403 is used to present the GUI and receive user commands generated by the GUI.

[0176] The radio frequency circuit 404 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.

[0177] Audio circuit 405 can be used to provide an audio interface between a user and an electronic device via a speaker and a microphone. Audio circuit 405 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuit 405, converted back into audio data, and then processed by processor 401 before being transmitted via radio frequency circuit 404 to, for example, another electronic device, or output to memory 402 for further processing. Audio circuit 405 may also include an earphone jack to provide communication between peripheral headphones and electronic devices.

[0178] The input unit 406 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0179] Power supply 407 is used to supply power to various components of electronic device 400. Optionally, power supply 407 can be logically connected to processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 407 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0180] although Figure 13 As not shown in the diagram, the electronic device 400 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0181] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0182] As can be seen from the above, the electronic device provided in this embodiment can obtain the target position of the opposing team's ball-carrying character in the virtual stadium; using this target position and preset positions in the virtual stadium, a target area is determined; then, based on the positional relationship between the target area and multiple characters in the opposing team, and the positional relationship between the target area and multiple characters in the opposing team, the supporting defensive character and the target character are determined, so as to control the supporting defensive character to perform supporting defensive actions against the target character. Determining the target area based on the position of the ball-carrying character, and fully considering the positional relationship between the virtual character and the target area, to determine the supporting defensive character and the target character, improves the flexibility of virtual character control and the realism of team cooperation in the football game.

[0183] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0184] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the virtual character control methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0185] The system obtains the target position of a ball-carrying character in the virtual court, the ball-carrying character being in the opposing team's camp; based on the target position and preset positions in the virtual court, a target area is determined in the virtual court; based on the positional relationships between the target area and multiple characters in the opposing team's camp, and the positional relationships between the target area and multiple characters in our team's camp, a support character and a target character are determined, wherein the support character is a non-player character in our team, and the target character is a character in the opposing team's camp; the system controls the support character to perform a support action against the target character.

[0186] The target area is determined based on the position of the player with the ball, and the positional relationship between the virtual character and the target area is fully considered to determine the supporting and target roles, thereby improving the flexibility of virtual character control and the realism of team cooperation in the football game.

[0187] Based on a first distance and a second distance, a position to be used is determined at the intersection of the centerline and the edge line. The first distance is the distance between the target position and the first preset position, and the second distance is the distance between the target position and the second preset position. Connecting the first preset position, the second preset position, the position to be used, and the target position yields a first candidate region. Based on the target position and the distance between the target position and the designated position, a second candidate region is determined. The overlapping area of ​​the first candidate region and the second candidate region is determined as the target region.

[0188] If the first distance is less than the second distance, the intersection point that is on the same sideline as the second preset position is determined as the position to be used; if the first distance is greater than the second distance, the intersection point that is on the same sideline as the first preset position is determined as the position to be used.

[0189] A first sub-region is generated with the target location as the center and the distance between the target location and the first designated location as the radius; a second sub-region is generated with the target location as the center and the distance between the target location and the second designated location as the radius; a second candidate region is determined based on the first sub-region and the second sub-region.

[0190] Using the target location to determine the first and second candidate regions, and using their overlapping area as the target region, the corresponding region can be divided more accurately based on the target location, so as to more flexibly determine the auxiliary defense role and the target role, making the control more rational.

[0191] If the player character is not within the first sub-target area, the supporting role and the target role are determined based on the distance between the player character and the target location within the first sub-target area; if the player character is within the first sub-target area, the supporting role and the target role are determined based on the location of the opposing teammate within the target area; if the player character is within the first sub-target area and the opposing teammate is not within the target area, the supporting role and the target role are determined based on the distance between the player character and the target location within the first sub-target area.

[0192] Calculate the distance between each of the friendly non-player characters within the first sub-target area and the target location to obtain the candidate distances corresponding to the friendly non-player characters; determine the friendly non-player character corresponding to the minimum value among the candidate distances as the defensive role, and determine the ball-handling character as the target character.

[0193] If both the player character and the opposing teammate are within the first sub-target area, the supporting role and the target role are determined based on the distance between the player character and the opposing teammate within the first sub-target area, and the distance between the opposing teammate and the target location. If the player character is within the first sub-target area, and the opposing teammate is within the second sub-target area, and there is no opposing teammate within the first sub-target area, the supporting role and the target role are determined based on the distance between the player character and the opposing teammate within the second sub-target area, and the distance between the opposing teammate and the target location.

[0194] By considering the areas where our player characters, our non-player characters, and the enemy's teammates are located, we can select support and target characters to enhance the realism of teamwork.

[0195] If the target character is the ball-handler, control the assisting defender to perform a steal action against the ball-handler; if the target character is the opposing teammate, control the assisting defender to perform a follow-up action against the opposing teammate.

[0196] Based on the different target roles, the defensive roles can be reasonably controlled to perform different defensive actions against the target roles. This not only allows for flexible control of virtual roles but also enhances the realism of team cooperation.

[0197] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0198] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0199] Since the computer program stored in the storage medium can execute the steps in any of the virtual character control methods provided in the embodiments of this application, the beneficial effects that any of the virtual character control methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0200] The above provides a detailed description of a virtual character control method, device, electronic device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A virtual character control method, characterized by, The method comprises the following steps: A terminal provides a graphical user interface, and the graphical user interface displays a virtual soccer field, and the method comprises the following steps: Obtaining a target position of a ball-holding character in the virtual soccer field, wherein the ball-holding character is in an opponent team; Determining a to-be-used position in the intersection of a middle line and a side line according to a first distance and a second distance, wherein the first distance is the distance between the target position and a first preset position, and the second distance is the distance between the target position and a second preset position; Connecting the first preset position, the second preset position, the to-be-used position, and the target position to obtain a first candidate region; Determining a second candidate region based on the target position and the distance between the target position and a specified position, wherein the specified position is a fixed position related to a goal; Determining a target region from the overlapping region of the first candidate region and the second candidate region; Determining a target character and a cooperative defense character according to the positional relationship between the target region and the characters in the opponent team and the positional relationship between the target region and the characters in the self team, wherein the cooperative defense character is a non-player character in the self team, and the target character is a character in the opponent team; 2. The method of claim 1, wherein, Controlling the cooperative defense character to perform a cooperative defense action on the target character. The method comprises the following steps: If the first distance is less than the second distance, determining the intersection point on the same side line as the second preset position as the to-be-used position; 3. The method of claim 1, wherein, If the first distance is greater than the second distance, determining the intersection point on the same side line as the first preset position as the to-be-used position. The specified position comprises a first specified position and a second specified position, and the method comprises the following steps: Generating a first sub-region with the target position as the center and the distance between the target position and the first specified position as the radius; Generating a second sub-region with the target position as the center and the distance between the target position and the second specified position as the radius; 4. The method of claim 1, wherein, Determining the second candidate region according to the first sub-region and the second sub-region. The target region comprises a first sub-target region and a second sub-target region adjacent to the first sub-target region, the target position is in the first sub-target region, the characters in the self team comprise a self player character and a self non-player character, the characters in the opponent team further comprise an opponent teammate character, and the method comprises the following steps: If the self player character is not in the first sub-target region, determining the cooperative defense character and the target character according to the distance between the self non-player character in the first sub-target region and the target position. If the player character of the first party is in the first sub-target area, the defending character and the target character are determined according to the position of the teammate character of the second party in the target area; If the player character of the first party is in the first sub-target area, and there is no teammate character of the second party in the target area, the defending character and the target character are determined according to the distance between the non-player character of the first party in the first sub-target area and the target position.

5. The method of claim 4, wherein, The determining of the defending character and the target character according to the distance between the non-player character of the first party in the first sub-target area and the target position comprises: The distance between each non-player character of the first party in the first sub-target area and the target position is calculated to obtain a candidate distance corresponding to the non-player character; The non-player character corresponding to the minimum value in the candidate distance is determined as the defending character, and the ball holding character is determined as the target character.

6. The method of claim 4, wherein, The determining of the defending character and the target character according to the position of the teammate character of the second party in the target area when the player character of the first party is in the first sub-target area comprises: If the player character of the first party and the teammate character of the second party are both in the first sub-target area, the defending character and the target character are determined according to the distance between the non-player character of the first party in the first sub-target area and the teammate character of the second party, and the distance between the teammate character of the second party and the target position; If the player character of the first party is in the first sub-target area, and the teammate character of the second party is in the second sub-target area, and there is no teammate character of the second party in the first sub-target area, the defending character and the target character are determined according to the distance between the non-player character of the first party in the second sub-target area and the teammate character of the second party, and the distance between the teammate character of the second party and the target position.

7. The method of claim 4, wherein, The defending action comprises a tackle action and a follow-up action, and the controlling of the defending character to perform the defending action on the target character comprises: If the target character is the ball holding character, the defending character is controlled to perform the tackle action on the ball holding character; If the target character is the teammate character of the second party, the defending character is controlled to perform the follow-up action on the teammate character of the second party.

8. The method of claim 1, wherein, The obtaining of the target position of the ball holding character in the virtual stadium comprises: If the ball holding character is in the second team camp, a defending control is displayed in the graphical user interface; In response to a defending trigger operation on the defending control, the target position of the ball holding character in the virtual stadium is obtained.

9. A virtual character control apparatus, characterized by comprising: A terminal provides a graphical user interface, and content displayed by the graphical user interface at least partially contains a virtual stadium, and the apparatus comprises: An obtaining module is configured to obtain a target position of a ball holding character in the virtual stadium, wherein the ball holding character is in a second team camp; A position determining unit is configured to determine a to-be-used position from among intersection points of a middle line and a side line according to a first distance and a second distance, wherein the first distance is a distance between the target position and a first preset position, and the second distance is a distance between the target position and a second preset position. A first candidate unit is configured to connect the first preset position, the second preset position, the to-be-used position, and the target position to obtain a first candidate region; A second candidate unit is configured to determine a second candidate region based on the target position and a distance between the target position and a specified position, the specified position being a fixed position related to a goal; A target determination unit is configured to determine an overlapping region of the first candidate region and the second candidate region as a target region; A role determination module is configured to determine a cooperative defense role and a target role according to a positional relationship between the target region and a plurality of roles of the opponent camp and a positional relationship between the target region and a plurality of roles of the self camp, the cooperative defense role being a non-player character of the self camp and the target role being a role of the opponent camp; A control module is configured to control the cooperative defense role to perform a cooperative defense action on the target role.

10. An electronic device, comprising: A computer readable storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor to execute the virtual role control method according to any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor to execute the virtual role control method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Movement control method and device in sports game, storage medium and electronic equipment

    CN114768255A

  • Game control method and device, storage medium and electronic equipment

    CN115607957A