Game character position control method and device, electronic equipment and storage medium

By generating basic dot matrix and character dot matrix maps in ball games, and calculating the running positions of game characters in the target area, the problem of complex logic and difficult iteration in existing technologies is solved, thus improving development efficiency.

CN116139496BActive Publication Date: 2026-04-07NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, controlling team formations in ball games through behavior trees and public information boards involves complex logic and difficult iterations, resulting in low development efficiency.

Method used

By acquiring the base dot matrix map of the target area, calculating the target position base point of the game character in the target area based on the formation relationship of the attacking team, generating the character dot matrix map, and determining the running position, the overall logic and iteration process are simplified.

Benefits of technology

While maintaining the team's formation, the overall logic and iteration complexity were simplified, thus improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116139496B_ABST
    Figure CN116139496B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a game character position control method and device, electronic equipment and storage medium, and relate to the technical field of computers. Embodiments of the present application obtain a basic point array of a target area in response to a target instruction, and calculate a target position base point of each game character in the target area according to the formation relationship of each game character, calculate a character point array of each game character according to the target position base point of each game character in the target area, and calculate the running position of each game character according to the character point array and the basic point array. In this way, by digitizing the target area and the game character task, the target position of the game character is obtained according to the basic point array of the target area and the character point array of the game character, the overall logic and iteration complexity can be simplified while maintaining the team formation, and the development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a game character position control method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the popularity and development of mobile internet, network games are more and more popular among netizens. At present, in the ball game of multi-person confrontation, such as football game, water polo, sumo game, etc., in order to keep the team in attack a certain formation, each team member needs not to be too far away from his own position and also needs to take into account various other external conditions, such as the position of the ball carrier, the density of the surrounding personnel and other factors.

[0003] At present, most of the schemes are mainly through various behavior trees and public information boards sharing information within the team to keep the team in attack a certain formation. But the behavior tree will increase with the increase of various logics, and each time adding or deleting the corresponding logic will cause the behavior tree to iterate a lot, thus leading to the overall behavior tree code confusion and not easy to arrange, making the development efficiency very slow. SUMMARY

[0004] Therefore, the embodiments of the present application provide a game character position control method and device, electronic equipment and storage medium, which can simplify the complexity of the overall logic and iteration and improve the development efficiency.

[0005] The embodiments of the present application can be implemented in the following way:

[0006] In a first aspect, the embodiments of the present application provide a game character position control method, which comprises:

[0007] In response to a target instruction, a basic point array of a target area is obtained, and a target position base point of each game character in the attacking team in the target area is obtained according to the formation relationship of the attacking team; the basic point array comprises a basic score of each position point of the target area;

[0008] According to the target position base point of each game character in the target area, a character point array of each game character is obtained; the character point array comprises a task score of each position point of the game character in the target area;

[0009] According to the character point array and the basic point array, the running position of each game character is obtained.

[0010] In an optional embodiment, the step of obtaining the basic point array of the target area comprises:

[0011] Obtain an initial point map of the target region; the initial point map includes the initial score of each location point in the target region;

[0012] Based on the boundary line of the target area, a boundary line dot matrix is ​​obtained; the boundary line dot matrix includes the boundary line distance score of each location point in the target area;

[0013] An attack point map is obtained based on the positions of the defensive roles in the defensive team and the positions of the target roles in each of the game characters; the attack point map includes the attack score of each position point in the target area;

[0014] Based on the initial dot matrix, the edge dot matrix, and the attack dot matrix, the base dot matrix of the target area is obtained.

[0015] In an optional implementation, obtaining the attack point map based on the positions of the defensive characters in the defensive team and the positions of the target characters among the game characters includes:

[0016] Based on the position of the defensive character, a first distance between each location point in the target area and the position of the defensive character is calculated, and based on the position of the target character, a second distance between each location point in the target area and the position of the target character is calculated.

[0017] Based on the first distance, a value is assigned to each location point in the target area to obtain a defensive station point matrix map; based on the second distance, a value is assigned to each location point in the target area to obtain an extrapolation point matrix map.

[0018] Based on the defensive position map and the extrapolated map, the offensive map is obtained.

[0019] In an optional implementation, the step of obtaining the edge dot matrix map based on the boundary line of the target region includes:

[0020] Based on the boundary line of the target area, the distance between each location point in the target area and the boundary line is calculated;

[0021] Based on the distance between each location point in the target area and the boundary line, a value is assigned to each location point in the target area to obtain a boundary line dot matrix.

[0022] In an optional implementation, the step of obtaining the base dot map of the target area based on the initial dot map, the edge dot map, and the attack dot map includes:

[0023] Weights are assigned to the edge dot matrix and the attack dot matrix to obtain the weight values ​​of the edge dot matrix and the attack dot matrix.

[0024] Based on the weight values ​​of the edge dot matrix and the attack dot matrix, the edge dot matrix and the attack dot matrix are superimposed on the initial dot matrix to obtain the base dot matrix of the target area.

[0025] In an optional implementation, the step of obtaining the target position base point of each game character in the attacking team in the target area based on the formation relationship of the attacking team includes:

[0026] Based on the formation of the attacking team, the target position base point of the target character in the game is determined;

[0027] The target position base point of the non-target character in the game is calculated based on the target position base point of the target character and the historical position base point of the non-target character in the game.

[0028] In an optional implementation, the step of calculating the target position base point of the non-target character in the game based on the target position base point of the target character and the historical position base points of the non-target characters in the game includes:

[0029] Based on the historical position base points of the non-target characters, determine the target range and the initial position base points within the target range;

[0030] Calculate the first distance score of the initial position base point based on the distance between the target position base point of the target character and the initial position base point;

[0031] The target score of the initial position base point is calculated based on the first distance score and the position score of the initial position base point.

[0032] Based on the target score, the target position base point of the non-target role is determined.

[0033] In an optional implementation, before calculating the target score of the initial position base point based on the first distance score and the position score of the initial position base point, the method further includes:

[0034] Based on the formation of the attacking team, the standard position base point of the non-target character is determined, and the second distance score of the initial position base point is calculated based on the distance between the standard position base point and the initial position base point.

[0035] Based on the character attributes of the non-target character, the basic score and additional score of the initial position base point are obtained;

[0036] Obtain the number of characters within a set range from the initial location base point, and determine the congestion score of the initial location base point based on the number of characters.

[0037] The position score of the initial position base point is calculated based on the second distance score, the base score, the additional score, and the congestion score.

[0038] In an optional implementation, the step of determining the target location base point of the non-target character based on the target score includes:

[0039] Select the N initial target positions as base points with the highest target scores; N is a positive integer.

[0040] Add a random number to the target score of each target initial position base point to obtain a random score for each target initial position base point;

[0041] The initial position base point of the target with the highest random score is set at the target position base point of the non-target character.

[0042] In an optional implementation, the step of obtaining the character dot matrix of each game character based on the target position base point of each game character in the target area includes:

[0043] Calculate the third distance between each location point in the target area and the target location base point of each game character;

[0044] Based on the third distance, a value is assigned to each location point in the target area to obtain the character dot matrix of each game character.

[0045] In an optional implementation, the step of obtaining the running position of each game character based on the character dot matrix and the base dot matrix includes:

[0046] The character dot matrix image and the base dot matrix image are superimposed to obtain the target score for each location point in the target area;

[0047] Set the position with the highest target score as the running position of the game character.

[0048] In an optional implementation, before obtaining the running positions of each game character based on the character dot matrix and the base dot matrix, the method further includes:

[0049] Obtain the current position of the target teammates of each game character in the target area, and calculate the fourth distance between each position point in the target area and the current position;

[0050] Based on the fourth distance, a value is assigned to each location point in the target area to obtain the teammate dot matrix of each game character;

[0051] The step of obtaining the running position of each game character based on the character dot matrix and the base dot matrix includes:

[0052] The character dot matrix, the teammate dot matrix, and the base dot matrix are superimposed to obtain the target score for each position point in the target area. The position point with the highest target score is set as the running position of the game character.

[0053] Secondly, embodiments of the present invention provide a position control device for a game character, the position control device comprising:

[0054] The instruction response module is used to respond to target instructions, obtain the basic dot matrix map of the target area, and obtain the target position base points of each game character in the attacking team in the target area according to the formation relationship of the attacking team; the basic dot matrix map includes the basic score of each position point in the target area;

[0055] The character processing module is used to obtain a character dot matrix of each game character based on the target position base point of each game character in the target area; the character dot matrix includes the task score of each game character at each position point in the target area;

[0056] The position calculation module is used to obtain the running position of each game character based on the character dot matrix and the base dot matrix.

[0057] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the position control method for game characters described in any of the foregoing embodiments.

[0058] Fourthly, embodiments of the present invention provide a storage medium, the storage medium including a computer program, wherein the computer program, when running, controls the electronic device containing the storage medium to execute the game character position control method described in any of the foregoing embodiments.

[0059] The game character position control method, device, electronic device, and storage medium provided in this invention, by responding to target commands, acquires a base dot matrix map of the target area, and obtains the target position base points of each game character in the attacking team within the target area based on the formation of the attacking team. Based on the target position base points of each game character in the target area, a character dot matrix map of each game character is obtained. Based on the character dot matrix map and the base dot matrix map, the running position of each game character is calculated. Thus, by digitizing the target area and the game character tasks, and obtaining the running position of the game characters based on the base dot matrix map of the target area and the character dot matrix maps of the game characters, the overall logic and iteration complexity can be simplified while maintaining the team formation, thereby improving development efficiency. Attached Figure Description

[0060] The technical solution and other beneficial effects of the present invention will become apparent from the following detailed description of specific embodiments of the invention, in conjunction with the accompanying drawings.

[0061] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0062] Figure 2 This is a flowchart illustrating a method for controlling the position of a game character according to an embodiment of the present invention.

[0063] Figure 3 This is another flowchart illustrating the game character position control method provided in an embodiment of the present invention.

[0064] Figure 4 This is a schematic diagram of a location base point provided in an embodiment of the present invention.

[0065] Figure 5 This is a schematic diagram of a range division provided in an embodiment of the present invention.

[0066] Figure 6 This is a block diagram of a position control device provided in an embodiment of the present invention.

[0067] Icons: 100 - Electronic device; 10 - Position control device; 11 - Command response module; 12 - Role processing module; 13 - Position calculation module; 20 - Memory; 30 - Processor; 40 - Communication unit; 50 - Display unit. Detailed Implementation

[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0069] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0070] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, an electrical connection, or a connection that allows for communication; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0071] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0072] The following disclosure provides many different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. In addition, examples of various specific processes and materials are provided in this invention, but those skilled in the art will recognize the application of other processes and / or the use of other materials.

[0073] As described in the background section, most existing technical solutions use various behavior trees combined with a shared information board within the team to maintain a certain formation during offense. After receiving information from the outside world or the shared information board, team members use various conditions within the behavior tree to determine which behavior tree branches to invoke under different conditions and simultaneously update the information on the shared information board for other team members to share. This allows other team members to calculate and take corresponding actions based on the information. Thus, each player needs to perform corresponding calculations to maintain the overall team formation.

[0074] However, the inventors discovered that the behavior tree would continuously increase with the addition of various logics, and each addition or deletion of the corresponding logic would cause the behavior tree to undergo a large number of iterations, resulting in a messy and difficult-to-organize behavior tree code, making development very slow. Furthermore, the behavior tree itself could not be visualized, making it very inconvenient to adjust the logic or values.

[0075] Based on the above research, this embodiment provides a method, device, electronic device, and storage medium for controlling the position of game characters. By responding to a target command, it acquires a base map of the target area, calculates the target position base point of each game character in the target area based on the formation relationship of each game character, calculates the character's base map based on the target position base point of each game character in the target area, and calculates the running position of each game character based on the character's base map and the base map. Thus, by digitizing the target area and the game character's task, and obtaining the target position of the game character based on the base map of the target area and the character's base map, it is possible to simplify the overall logic and iteration complexity, reduce computational load, and improve development efficiency while maintaining the team formation.

[0076] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of the electronic device provided in this embodiment. Figure 1As shown, the electronic device 100 includes a position control device 10, a memory 20, a processor 30, a communication unit 40, and a display unit 50. The memory 20, processor 30, communication unit 40, and display unit 50 are electrically connected directly or indirectly to each other to achieve signal transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0077] In this embodiment, the position control device 10 includes at least one software functional module that can be stored in the memory 20 in the form of software or firmware. The processor 30 is used to execute the executable module (e.g., the software functional module or computer program included in the position control device 10) stored in the memory 20. When the electronic device 100 is running, the processor 30 communicates with the memory 20 via a bus, and the processor 30 executes the executable module or computer program to implement the position control method for the game character described in this embodiment.

[0078] The memory 20 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0079] Processor 30 is used to perform one or more functions described in this embodiment. In some embodiments, processor 30 may include one or more processing cores (e.g., a single-core processor (S) or a multi-core processor (S)). By way of example only, processor 30 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computing (RISC) computer, or a microprocessor, or any combination thereof.

[0080] For ease of explanation, only one processor is described in the electronic device 100. However, it should be noted that the electronic device 100 in this embodiment may also include multiple processors, and therefore the steps performed by one processor as described in this embodiment may also be performed jointly or individually by multiple processors. For example, if the processor of the electronic device performs steps A and B, it should be understood that steps A and B may also be performed jointly by two different processors or individually by one processor. For example, one processor performs step A, and a second processor performs step B, or the first processor and the second processor jointly perform steps A and B.

[0081] In this embodiment, the process definition method disclosed in any implementation can be applied to the processor 30, or implemented by the processor 30.

[0082] The communication unit 40 is used to establish a communication connection between the electronic device 100 and other devices via a network, and to send and receive data via the network.

[0083] In some implementations, the network can be any type of wired or wireless network, or a combination thereof. By way of example only, the network may include wired networks, wireless networks, fiber optic networks, telecommunications networks, intranets, the Internet, local area networks (LANs), wide area networks (WANs), wireless local area networks (WLANs), metropolitan area networks (MANs), public switched telephone networks (PSTNs), Bluetooth networks, ZigBee networks, or near field communication (NFC) networks, or any combination thereof.

[0084] In this embodiment, the display unit 50 provides an interactive interface (e.g., a user interface) between the electronic device 100 and the user for displaying image information. In this embodiment, the display unit 50 can be a liquid crystal display (LCD) or a touch display. If it is a touch display, it can be a capacitive touchscreen or a resistive touchscreen that supports single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations generated from one or more locations on the touch display and pass the sensed touch operations to the processor 30 for calculation and processing.

[0085] To facilitate interaction between the user and the display unit 50, in this embodiment, the electronic device 100 may further include an input / output unit. The input / output unit provides input data to the user, enabling interaction between the user and the electronic device 100. The input / output unit may be, but is not limited to, a mouse and keyboard.

[0086] In some embodiments, the electronic device 100 may include one or N display units 50, where N is a positive integer greater than 1.

[0087] In this embodiment, the electronic device can be a mobile terminal, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a physical server, etc. This embodiment does not impose any restrictions on the specific type of electronic device.

[0088] Understandably, Figure 1 The structure shown is for illustrative purposes only. Electronic devices may also have more advanced features.Figure 1 Showing more or fewer components, or having with Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.

[0089] based on Figure 1 The implementation architecture of this embodiment provides a method for controlling the position of a game character, which is based on... Figure 1 The electronic device shown executes the following detailed explanation of the steps of the game character position control method provided in this embodiment. Please refer to the reference below. Figure 2 The game character position control method provided in this embodiment includes steps S101 to S103.

[0090] Step S101: Respond to the target command, obtain the base map of the target area, and obtain the target position base points of each game character in the target area according to the formation relationship of the attacking team.

[0091] The game character position control method provided in this embodiment can be used for position control of game characters in ball games, specifically for position control of the attacking team in ball games. Each player can correspond to a game character, and each game character has a different identity, and different identities can have different tasks. For example, in football, a team includes identities such as forward, center forward, defender, and goalkeeper, and players can choose any game character to play.

[0092] In this embodiment, when a player is playing a game, the electronic device processes and renders the game data, then displays the rendering results frame by frame on the display unit, thereby displaying the game screen. Since the position of the game character is constantly changing during gameplay, to improve response speed and enhance the user experience, in this embodiment, target instructions can be obtained based on the frame rate.

[0093] Optionally, the target command is triggered when the number of rendered frames reaches a set threshold. The threshold can be set according to actual needs, and this embodiment does not impose specific restrictions. For example, the target command can be triggered when the number of frames reaches two.

[0094] Since the game character position control method provided in this embodiment can be used for position control of the attacking team in ball games, a target command can be triggered when a team gains an attacking opportunity. Specifically, when a character in one team obtains the ball and moves it towards the other team, it indicates that that team has gained an attacking opportunity.

[0095] In an optional implementation, the target command can also be issued by the player. When the player needs to obtain the next position of the game character they are controlling, they can issue a target command. The display unit can display the game screen and simultaneously set up menu controls on the screen. These menu controls include a target command control. When the player needs to issue a target command, they can do so by manipulating the target command control, for example, by clicking or touching the target command control.

[0096] In this embodiment, the target instruction refers to the instruction to update the position of the game characters. Upon receiving the target instruction, the system can respond to it, calculate the movement position of each game character in the team, and update the position of each game character in the team.

[0097] Upon responding to the target command, the base dot matrix map of the target area can be obtained. In this embodiment, the target area is the area where the game character can move around; for example, in a ball game, the target area could be the playing field. The base dot matrix map of the target area includes the base score for each point within the target area.

[0098] In ball games, the size of the area where the game character can move is fixed; that is, the size of the target area is fixed. This embodiment obtains the basic dot matrix map of the target area by dividing the target area into position points and assigning different scores to each point.

[0099] In this embodiment, the base dot matrix of the target area represents the base score of the entire team. However, for individual game characters, since their identities and game tasks differ, the required positions also differ. Therefore, for each game character, it is necessary to calculate their movement position individually.

[0100] Based on this, after responding to the target command, this embodiment also needs to calculate the target position base point of each game character in the attacking team in the target area according to the formation relationship of the attacking team.

[0101] Among them, the Home Region (HR) is the anchor point of a player's position in the formation, which is determined by each player's role in the team. For example, in football, the HR points of forwards and defenders are different, and the HR points of left-backs and right-backs are also different.

[0102] In ball games, teams compete by changing formations; that is, teams will adopt certain formations during the game. For example, in football, team formations include 4-3-3, 4-4-2, and 4-5-1.

[0103] In this embodiment, each game character has a base point for each formation. Therefore, upon receiving a target command, the system can respond to the command and, based on the current formation of the attacking team, determine the target base points of each game character within the attacking team in the target area.

[0104] Step S102: Based on the target position base point of each game character in the target area, obtain the character dot matrix of each game character.

[0105] Once the target position base point of each game character in the attacking team is calculated in the target area, the task score of each game character at each position point in the target area can be calculated based on the target position base point of each game character in the target area, thereby obtaining the character dot matrix map of each game character.

[0106] Optionally, when calculating the task score for each game character at each location point in the target area based on the target location base point of each game character, for each game character, the task score can be calculated by radiating outwards from the target location base point and obtaining the corresponding task score based on the distance from the target location base point. The farther a location point in the target area is from the target location base point of the game character, the lower the value assigned; the closer a location point in the target area is to the target location base point of the game character, the higher the value assigned. This process is used to obtain the task score for each location point of the game character in the target area, thus obtaining the character's pixel art.

[0107] Step S103: Based on the character dot matrix and the basic dot matrix, obtain the running position of each game character.

[0108] The character's dot matrix represents the character's individual task score, while the target area's base dot matrix represents the team's base score. Therefore, after obtaining both the character's and base dot matrix maps, calculating the character's positioning involves combining team and individual data to determine the individual's positioning.

[0109] In this embodiment, the running position of a game character refers to the location where the game character needs to move at the next moment. After calculating the running position of each game character, the player can control the corresponding game character to run to the corresponding position. Alternatively, the electronic device can directly control each game character to run to its corresponding running position.

[0110] The game character position control method provided in this embodiment obtains the base dot matrix map of the target area in response to target commands. Based on the formation of the attacking team, it calculates the target position base points of each game character in the target area. Based on these base points, it calculates the character dot matrix map of each game character. Finally, based on the character dot matrix map and the base dot matrix map, it calculates the movement position of each game character. Thus, by digitizing the target area and game character tasks, and obtaining the movement positions of the game characters based on the base dot matrix map of the target area and the character dot matrix maps of the game characters, it simplifies the overall logic and iteration complexity while maintaining the team formation, thereby improving development efficiency.

[0111] This embodiment calculates the position of each game character from a team perspective, considering the team's base score and then combining it with the individual task score of each game character within the team. This assigns tasks to each character, maintaining team formation while supporting tactical design and improving game performance. In this embodiment, please refer to... Figure 3 In order to accurately obtain the base score of the entire team in the game, the steps of obtaining the base dot matrix map of the target area may include steps S201 to S204.

[0112] Step S201: Obtain the initial bitmap of the target area.

[0113] Step S202: Obtain the edge dot matrix map based on the boundary line of the target area.

[0114] Step S203: Obtain the attack point map based on the positions of the defensive characters in the defensive team and the positions of the target characters in each game character.

[0115] Step S204: Based on the initial dot matrix map, the edge dot matrix map, and the attack dot matrix map, obtain the base dot matrix map of the target area.

[0116] In this process, after dividing the target area into location points, an initial score is assigned to each location point to obtain the initial dot matrix map of the target area. That is, the initial dot matrix map includes the initial score of each location point in the target area.

[0117] For example, in a football game, the target area is the football field. Dividing the field into position points results in 107*68 small grids, or 107*68 position points. Assigning initial scores to these 107*68 position points yields the initial dot matrix of the field, which can be represented by a 107*68 array.

[0118] In this embodiment, the initial score of each location point in the target area is the same, and can be set according to actual needs without any specific limitation. Optionally, the initial score of each location point in the target area can be -9999.

[0119] After obtaining the initial bitmap of the target area, the initial bitmap can be stored. Upon receiving the target command, the target command can be responded to, the stored initial bitmap can be read, and the initial bitmap can be obtained.

[0120] In this embodiment, the boundary line of the target area represents the boundary that divides the target area from other areas. For example, for a sports field, the boundary line includes the baseline and sidelines. When a game character approaches the boundary line, it indicates that the game character has a possibility of crossing the target area. Therefore, the closer a position point in the target area is to the boundary line, the greater the probability that the game character will cross the target area when located at that position point. Based on this, this embodiment can calculate the sideline dot matrix map according to the distance between each position point and the boundary line.

[0121] Optionally, in this embodiment, the step of obtaining the edge dot matrix based on the boundary line of the target region may include:

[0122] (1) Calculate the distance between each location point in the target area and the boundary line based on the boundary line of the target area.

[0123] (2) Assign values ​​to each location point in the target area based on the distance between each location point in the target area and the boundary line to obtain the boundary line dot matrix.

[0124] Since the boundary line of the target area is fixed, after dividing the target area into its constituent points, the distance between each point and the boundary line can be calculated. After calculating the distance between each point and the boundary line, a value can be assigned to each point in the target area based on this distance, resulting in a boundary point map.

[0125] In this embodiment, when assigning a value to each location point in the target area based on the distance between each location point and the boundary line, a correspondence between distance and score can be pre-defined. The lower the distance, the lower the score, and the farther the distance, the higher the score. After obtaining the distance between each location point and the boundary line, the score corresponding to each distance can be found according to the correspondence, thereby assigning a value to the location point corresponding to each distance.

[0126] In this embodiment, when assigning a value to each location point in the target area based on its distance from the boundary line, a region radius can also be set, and the assignment region can be divided with the boundary line as the center. Within the assignment region, the closer a location point is to the boundary line, the lower its score; the farther a location point is from the boundary line, the higher its score; and locations outside the assignment region are not assigned a score.

[0127] After assigning values ​​to each location point in the target area based on its distance from the boundary line, a boundary line dot matrix is ​​obtained. This boundary line dot matrix includes the boundary distance score for each location point in the target area.

[0128] In multiplayer, two-player ball games, where there is an attacking team, there must also be a defending team. For example, in soccer, the attacking team is the team with the ball, and the defending team is the team opposite the ball-carrying player. Understandably, the roles within the defending team are defensive roles. However, in practical applications, when the attacking team launches an attack, there is a target role within the attacking team that initiates the attack. For example, in soccer, the ball-carrying player in the attacking team is the target role. During the game, both the target role and the defensive role affect the attacking team's formation and the positions of other players. Therefore, in this embodiment, when calculating the base dot matrix of the target area, it is also necessary to calculate the attack dot matrix based on the positions of the defensive roles within the defending team and the positions of the target roles among the various game roles in the attacking team.

[0129] In this embodiment, the step of obtaining the attack dot matrix based on the positions of the defensive characters in the defensive team and the positions of the target characters in each game character may include:

[0130] (1) Based on the position of the defender, calculate the first distance between each location point in the target area and the position of the defender, and based on the position of the target, calculate the second distance between each location point in the target area and the position of the target.

[0131] (2) Assign values ​​to each location point in the target area based on the first distance to obtain the defensive station point matrix. Assign values ​​to each location point in the target area based on the second distance to obtain the extrapolation point matrix.

[0132] (3) Based on the defensive position map and the extrapolation map, the offensive map is obtained.

[0133] The defensive character's position is the predicted position of the defensive character at the next moment, which can be predicted based on the defensive character's direction and speed. After obtaining the defensive character's position, the first distance between each location point in the target area and the defensive character's position can be calculated. After obtaining the first distance between each location point in the target area and the defensive character's position, a value can be assigned to each location point in the target area based on the first distance, resulting in a defensive position point matrix.

[0134] In this embodiment, when assigning a value to each location point in the target area based on the first distance, a pre-defined correspondence between the first distance and the score can be established: the closer the distance, the lower the score; the farther the distance, the higher the score. After obtaining the first distance between each location point and the defensive character's position, the score corresponding to each first distance can be found based on the correspondence, thereby assigning a value to each location point corresponding to the first distance.

[0135] In this embodiment, when assigning a value to each location point in the target area based on the first distance, a radius of the area can also be set, and the assignment area can be divided with the position of the defending character as the center. Within the assignment area, the closer the location point is to the position of the defending character, the lower the score assigned; the farther the location point is from the position of the defending character, the higher the score assigned; and location points outside the assignment area are not assigned a score.

[0136] After assigning a value to each location point in the target area based on the first distance, the defensive position point matrix can be obtained, which includes the defensive score of each location point in the target area.

[0137] Accordingly, after obtaining the position of the target character, the second distance between each position point in the target area and the position of the target character can be calculated. After obtaining the second distance between each position point in the target area and the position of the target character, a value can be assigned to each position point in the target area based on the second distance to obtain the extrapolated dot matrix map.

[0138] In this embodiment, when assigning a value to each location point in the target area based on the second distance, a pre-defined correspondence between the second distance and the score can be established: the lower the distance, the lower the score; and the farther the distance, the higher the score. After obtaining the second distance between each location point and the target character's position, the score corresponding to each second distance can be found based on the correspondence, thereby assigning a value to each location point corresponding to the second distance.

[0139] In this embodiment, when assigning a value to each location point in the target area based on the second distance, a radius of the area can also be set, and the assignment area can be divided with the location of the target character as the center. Within the assignment area, the closer a location point is to the location of the target character, the lower the score it is assigned; the farther a location point is from the location of the target character, the higher the score it is assigned; and location points outside the assignment area are not assigned a score.

[0140] After assigning a value to each location point in the target area based on the second distance, an extrapolated dot matrix can be obtained, which includes the extrapolated score of each location point in the target area.

[0141] It should be noted that the area radius set for calculating the edge point map, the area radius set for calculating the defensive position point map, and the area radius set for calculating the extrapolation point map can be the same or different. In this embodiment, the set area radius can be set according to actual needs and is not specifically limited.

[0142] The above assignment method is only an implementation method provided in this embodiment and is not a limitation on the assignment method. It can be adjusted according to actual needs.

[0143] After obtaining the extrapolation dot matrix and the defense dot matrix, the attack dot matrix is ​​obtained. In this embodiment, the attack dot matrix includes the extrapolation dot matrix and the defense dot matrix.

[0144] In this embodiment, to improve efficiency, a correspondence between the positions of defensive roles and defensive station dot matrix maps, as well as a correspondence between the positions of target roles and extrapolation dot matrix maps, can be pre-established. That is, for each position of a defensive role, a corresponding defensive station dot matrix map is pre-defined, and for each position of a target role, a corresponding extrapolation dot matrix map is pre-defined. Correspondingly, edge dot matrix maps can also be pre-established.

[0145] After establishing the correspondence between the defensive character's position and the defensive station dot matrix, the correspondence between the target character's position and the extrapolated dot matrix, and the edge dot matrix, the established dot matrix can be stored in binary form. Upon receiving a target command, the system responds by obtaining the defensive station dot matrix corresponding to the currently predicted defensive character's position based on the correspondence between the defensive character's position and the defensive station dot matrix, obtaining the extrapolated dot matrix corresponding to the currently predicted target character's position based on the correspondence between the target character's position and the extrapolated dot matrix, and retrieving the edge dot matrix from storage. This reduces computational load and improves processing efficiency in the game.

[0146] After obtaining the initial dot matrix map, the edge dot matrix map, and the attack dot matrix map, the base dot matrix map of the target area can be obtained based on the initial dot matrix map, the edge dot matrix map, and the attack dot matrix map.

[0147] In this embodiment, the step of obtaining the base dot matrix map of the target area based on the initial dot matrix map, the edge dot matrix map, and the attack dot matrix map may include:

[0148] Assign weights to the edge dot matrix and the attack dot matrix to obtain their weight values.

[0149] Based on the weight values ​​of the edge dot matrix and the attack dot matrix, the edge dot matrix and the attack dot matrix are superimposed on the initial dot matrix to obtain the base dot matrix of the target area.

[0150] When assigning weights to the edge dot matrix and the attack dot matrix, the weights can be set according to actual needs, and this embodiment does not impose specific restrictions. It should be noted that assigning weights to the attack dot matrix includes assigning weights to the outward dot matrix and the defense dot matrix.

[0151] After obtaining the weight values ​​of the edge dot matrix and the attack dot matrix, the edge dot matrix and the attack dot matrix can be superimposed on the initial dot matrix to obtain the base dot matrix of the target area.

[0152] In this embodiment, when the edge dot matrix and the attack dot matrix are superimposed on the initial dot matrix according to their weight values, it means that the edge distance score and attack score of each location point are added to the initial score of each location point according to the assigned weight values ​​to obtain the base score of each location point. For example, for a location point in the target area, if the initial score of the location point is a, the edge distance score is b, the defense score in the attack score is c, and the extrapolation score in the attack score is d, assuming the weight of the edge dot matrix is ​​X, the weight of the extrapolation dot matrix is ​​Y, and the weight of the defense dot matrix is ​​Z, then the base score of the location point is a + X*b + Y*c + Z*d.

[0153] After obtaining the base score of each location point in the target area, the base point map of the target area can be obtained.

[0154] In this embodiment, the base dot matrix of the target area represents the base score of the entire team. However, to determine the position of an individual game character, it is also necessary to analyze the individual game character's data. In this embodiment, the target position base points of each game character in the target area can be calculated based on the formation of the attacking team. Based on the target position base points of each game character in the target area, the character dot matrix of each game character can be calculated.

[0155] Given that the HR position map in the game is composed of multiple position base points, such as Figure 4 As shown, Figure 4This embodiment provides an HR position map. In this embodiment, each position base point corresponds to a position point in the target area, and the correspondence between the position base point and the position point in the target area changes with the formation of the attacking team. Each player can only appear at one position base point at a time, and at most one player can be at one position base point at any given time. Therefore, in this embodiment, each formation of the attacking team corresponds to a corresponding HR position map, and the HR position map will also change as the formation changes.

[0156] Since the position of the target character will affect the positions of other characters—for example, in soccer, the position of the player with the ball will affect the positions of other players—when calculating the base point of each game character's position in the target area, the target character's base point can be calculated first, and then the base points of other characters can be determined based on the target character's base point. Optionally, this can be achieved through the following steps:

[0157] Based on the formation of the attacking team, the target position base point of the target character in the game is determined.

[0158] The target position base point of the non-target character in the game is calculated based on the target position base point of the target character and the historical position base point of the non-target character in the game.

[0159] In determining the target position base point of the target character in the game based on the formation relationship of the attacking team, the HR position map corresponding to the current formation relationship can be determined first. Then, the HR position map is mapped to the target area to obtain the correspondence between each position base point in the HR position map and the position point in the target area. Then, based on the current position of the target character in the target area, the position base point closest to the current position of the target character is found, and the found closest position base point is used as the target position base point of the target character.

[0160] After obtaining the target position base point of the target character, the target position base point of the non-target characters in the game can be obtained based on the target position base point of the target character and the historical position base points of the non-target characters in the game.

[0161] It should be noted that, in this embodiment, non-target characters in the game include all game characters in the team of the target character, excluding the target character. For example, in a football game, the target character can be the player with the ball, and non-target characters include all players in the team of the player with the ball, excluding the player with the ball.

[0162] The historical position base point of a non-target character in the game refers to the position base point previously calculated for that non-target character. For example, if the last time a target command was triggered was t1, and the current time the target command is triggered is t2, and the position base point calculated for the non-target character at time t1 is position base point A, then position base point A is the previously calculated position base point for the non-target character. Similarly, for the next time t3, when calculating the position base point at time t3, the position base point calculated at time t2 is the historical position base point for the non-target character. When calculating the position base point of a non-target role for the first time, since there is no previous position base point calculation, the default base point for each role is determined based on the formation of the attacking team. This default base point is used as the previous position base point. For example, in a football game, if the default base point for the left-back role in the current formation is position base point A, then when calculating the left-back's position base point for the first time, position base point A is used as the historical position base point. If the first calculation yields the left-back's position base point as position base point B, then when calculating the left-back's position base point for the second time, position base point B is used as the historical position base point.

[0163] Optionally, in this embodiment, the step of calculating the target position base point of a non-target character in the game based on the target position base point of the target character and the historical position base points of non-target characters in the game may include the following steps.

[0164] Based on the historical position base points of non-target characters, determine the target range and the initial position base points within the target range.

[0165] Calculate the first distance score of the initial position base point based on the distance between the target position base point and the initial position base point of the target character.

[0166] The target score of the initial position base point is calculated based on the first distance score and the position score of the initial position base point.

[0167] Based on the target score, the target position base point of the non-target role is determined.

[0168] Specifically, for each non-target character in the game, a target range is determined centered on the historical position base point of that non-target character, with a set range length. The target range can be a rectangular area centered on the historical position base point, a circular area centered on the historical position base point, or a rhombus area centered on the historical position base point; specifically, there are no restrictions, and it can be set according to actual needs. The set range length can be determined according to the desired shape of the target range. For example, when the target range is a rectangular area, the range length includes both the length and width of the target range; or, for example, when the target range is a rhombus area, the range length includes the side length of the target range.

[0169] Optionally, in this embodiment, the target range determined based on the historical location base points of non-target characters can be a diamond-shaped range. For example... Figure 5 As shown, when the historical position base point of the non-target character is (3, 2) in the figure, the determined rhombus range can be the area circled by the black border.

[0170] Once the target area is determined, all points within the target area can serve as the base points for the non-target character. For example, for Figure 5 In the target range, the location points (5,2), (4,1), (4,2), (4,3), (3,0), (3,1), (3,2), (3,3), (3,4), (2,1), (2,2), (2,3), (1,2) can all be used as the location base points of the non-target character.

[0171] Given that in the game, other players may occupy certain position base points within each team member's target range, after determining the target range and the position points within the target range, position points that are not occupied by any character are selected from the position points within the target range as the initial position base points.

[0172] After obtaining the initial position base point of each non-target character, for each initial position base point of each non-target character, the first distance score of the initial position base point can be calculated based on the distance between the target position base point of the target character and the initial position base point.

[0173] When calculating the initial distance score of the initial position base point based on the distance between the target position base point and the initial position base point, a correspondence between distance and score can be established: the closer the target position base point is to the initial position base point, the lower the score; the farther the target position base point is from the initial position base point, the higher the score. Thus, after obtaining the distance between the target position base point and the initial position base point, the initial distance score of the initial position base point can be obtained according to the correspondence.

[0174] After obtaining the first distance score of the initial position base point, the target score of the initial position base point can be calculated based on the first distance score and the position score.

[0175] In this embodiment, the position score of the initial position base point represents the score of the environment in which the initial position base point is currently located, and can be obtained through the following steps:

[0176] (1) Based on the formation of the attacking team, determine the standard position base point of the non-target character, and calculate the second distance score of the initial position base point based on the distance between the standard position base point and the initial position base point.

[0177] (2) Based on the character attributes of the non-target character, obtain the basic score and additional score of the initial position base point.

[0178] (3) Obtain the number of characters within the set range of the initial position base point, and determine the congestion score of the initial position base point based on the number of characters.

[0179] (4) The position score of the initial position base point is calculated based on the second distance score, the base score, the additional score and the crowding score.

[0180] Based on the different identities of the game characters, each game character has a standard position base point in each formation relationship, which is the default position base point. Therefore, when determining the standard position base point of a non-target character according to the formation relationship, the standard position base point of the non-target character can be determined in that formation relationship based on the non-target character's game identity.

[0181] After obtaining the standard position base point of the non-target character, the distance between the standard position base point and the initial position base point can be calculated. Based on the distance between the standard position base point and the initial position base point, the second distance score of the initial position base point can be calculated.

[0182] In this embodiment, when calculating the second distance score of the initial position base point based on the distance between the standard position base point and the initial position base point, a correspondence between distance and score can be established: the farther the distance between the standard position base point and the initial position base point, the lower the score; the closer the distance between the standard position base point and the initial position base point, the higher the score. Thus, after obtaining the distance between the standard position base point and the initial position base point, the second distance score of the initial position base point can be obtained according to the correspondence.

[0183] For ball games, since different game characters have different roles, different positions have different effects on different game characters. Therefore, when calculating the position score of the initial position base point, the influence of the game character itself on the initial position base point is also considered. Based on this, in this embodiment, it is also necessary to obtain the basic score and additional score of the initial position base point according to the role attributes of non-target characters.

[0184] In this embodiment, when obtaining the basic score of the initial position base point based on the role attributes of the non-target role, the target position of the non-target role can be obtained based on its role attributes. The initial position base point is then assigned a value based on the distance between the target position and the initial position base point. For example, using a football game as an example, assuming the non-target role is a defender, based on the defender's role attributes, the target position of the non-target role can be determined to be relatively far back. Figure 5 Within the target range (1, 2), when the initial position base point is relatively forward, such as... Figure 5 In the case of (5, 2), the distance between the target station and the initial base point is relatively far. Therefore, the base point of the initial base point is assigned a lower basic score. When the initial base point is relatively far back, such as Figure 5 In the case of (2, 2), the distance between the target station and the initial base point is relatively close, therefore, the basic score assigned to the initial base point is higher. Thus, by assigning a value to the initial base point based on the distance between the target station and the initial base point, the basic score of the initial base point can be obtained.

[0185] When determining the bonus score for the initial position base point based on the character attributes of a non-target character, it's possible to check if the non-target character's character attribute is a specific character attribute. If it is, it checks if the initial position base point is the theoretical position base point corresponding to that specific character. If it is, the initial position base point is assigned a bonus score; otherwise, it is not. The specific character attribute can be set based on actual needs, while the theoretical position base point corresponding to that specific character is set according to that attribute. For example, in a football game, the specific character attribute could be a defender's attribute or a winger's attribute, and the theoretical position base point corresponding to that attribute could be set based on the defender's attribute, or the winger's attribute, and so on.

[0186] In this embodiment, when calculating the congestion score of the initial position base point, the number of characters within the set range of the initial position base point can be obtained by taking the initial position base point as the center and obtaining the number of characters in the 8-neighborhood of the initial position base point. That is, in this embodiment, the set range of the initial position base point can be the range of the 8-neighborhood of the initial position base point.

[0187] After obtaining the number of characters within the set range of the initial location base point, the congestion score of the initial location base point can be determined based on the number of characters. For the initial location base point, the more characters nearby there are, the fewer choices are available for that initial location base point. Based on this, in this embodiment, a correspondence between the number of characters and the congestion score can be pre-established: the more characters there are, the lower the congestion score; the fewer characters there are, the higher the congestion score. After obtaining the number of characters within the set range of the initial location base point, the corresponding congestion score can be obtained according to the established correspondence.

[0188] After obtaining the second distance score, basic score, additional score, and congestion score of the initial position base point through the above process, the second distance score, basic score, additional score, and congestion score of the initial position base point are superimposed to obtain the position score of the initial position base point.

[0189] In an optional implementation, after obtaining the second distance score, basic score, additional score, and congestion score of the initial location base point, the second distance score, basic score, additional score, and congestion score of the initial location base point can be weighted and summed, and the score obtained by weighted summation can be used as the location score of the initial location base point; alternatively, the average value of the second distance score, basic score, additional score, and congestion score of the initial location base point can be calculated, and the average value can be used as the location score of the initial location base point.

[0190] It is understood that the above method of calculating position scores is only an implementation method provided in this embodiment, and is not a limitation on the method of calculating position scores. It can be adjusted according to actual needs.

[0191] After obtaining the first distance score and position score of the initial position base point, the target score of the initial position base point can be calculated based on the first distance score and the position score of the initial position base point.

[0192] In one optional implementation, the first distance score and the position score are directly superimposed to obtain the target score of the initial position base point. In another optional implementation, the first distance score and the position score can be weighted and superimposed to obtain the target score of the initial position base point.

[0193] Once the target score of the initial position base point of the non-target character is obtained, the target position base point of the non-target character can be determined from the initial position base point of the non-target character based on the target score.

[0194] In this embodiment, the step of determining the target location base point of the non-target character based on the target score includes:

[0195] Select the N initial target position base points with the highest target scores.

[0196] Add a random number to the target score of each target's initial position base point to obtain a random score for each target's initial position base point.

[0197] Set the initial position base point of the target with the highest random score to the target position base point of the non-target character.

[0198] The process involves obtaining the target scores for the initial position base points of non-target characters, sorting these scores, and then selecting the top N initial position base points with the highest target scores as the target initial position base points. After selecting the target initial position base points, a random number is added to the target score of each target initial position base point to obtain a random score for each target initial position base point. The target initial position base point with the highest random score is then set as the target position base point for the non-target characters.

[0199] It should be noted that N is a positive integer and can be set according to actual needs. In this embodiment, N can be 2.

[0200] The position control method provided in this embodiment can randomly correct the calculation results by adding random numbers to the target score, thus creating more possibilities for the game.

[0201] In this embodiment, through the above process, the target position base points of non-target characters in the attacking team and the target position base points of target characters in the target area can be obtained, thus obtaining the target position base points of all game characters in the attacking team in the target area. After obtaining the target position base points of all game characters in the attacking team in the target area, the character dot matrix diagram of each game character can be calculated based on the target position base points of each game character in the target area.

[0202] Optionally, in this embodiment, the step of obtaining the character dot matrix of each game character based on the target position base point of each game character in the target area may include:

[0203] Calculate the third distance between each location point in the target area and the target location base point of each game character.

[0204] Based on the third distance, a value is assigned to each location point in the target area to obtain the character pixel map of each game character.

[0205] After obtaining the target position base point of each game character in the target area, the third distance between each position point in the target area and the target position base point of each game character can be calculated. Then, based on the third distance, each position point in the target area is assigned a value to obtain the character dot matrix of each game character.

[0206] In this embodiment, when assigning a value to each location point in the target area based on the third distance, a pre-defined correspondence between the third distance and the score can be established: the farther the distance, the lower the score; the closer the distance, the higher the score. Thus, after obtaining the third distance between each location point and the base location of each game character, the score corresponding to each third distance can be found based on the correspondence, thereby assigning a value to each location point corresponding to the third distance and obtaining the character dot matrix of each game character.

[0207] After obtaining the character pixel art of each game character and the base pixel art of the target area, the target position of each game character can be calculated based on the character pixel art of each game character and the base pixel art of the target area.

[0208] Optionally, in this embodiment, the step of obtaining the target position of each game character based on the character pixel map and the base pixel map may include:

[0209] By overlaying the character pixel art and the base pixel art, the target score for each point in the target area is obtained.

[0210] Set the position with the highest target score as the running position of the game character.

[0211] Overlaying the character dot matrix and the base dot matrix means adding the base score and the task score for each location point in the target area. For example, for a location point in the target area, if the base score for that location point is M and the task score is N, then the target score for that location point is M+N.

[0212] For each game character, the character's pixel art and the base pixel art of the target area are overlaid to obtain the target score for each position point in the target area. Then, the position point with the highest target score is set as the running position of the game character.

[0213] Since the positions of teammates also need to be considered in team games, in this embodiment, before calculating the running positions of each game character based on the character dot matrix and the base dot matrix, the position control method provided in this embodiment may further include the following steps:

[0214] Obtain the current position of each game character's target teammate in the target area, and calculate the fourth distance between each location point in the target area and the current position.

[0215] Based on the fourth distance, assign values ​​to each location point in the target area to obtain the dot matrix of each game character's teammates.

[0216] Accordingly, based on the character pixel art and the base pixel art, the steps to determine the movement positions of each game character include:

[0217] The character dot matrix, teammate dot matrix, and base dot matrix are overlaid to obtain the target score for each point in the target area. The point with the highest target score is set as the running position of the game character.

[0218] In this embodiment, for each game character, the target teammates are teammates other than the target character. For example, in a ball game, if the target character is the player with the ball, then the target teammates are teammates without the ball, excluding the player with the ball.

[0219] After obtaining the current position of the target teammate in the target area, the fourth distance between each position point in the target area and the current position can be calculated. Then, based on the fourth distance, a value is assigned to each position point in the target area to obtain the teammate dot matrix of each game character.

[0220] In this embodiment, a value is assigned to each location point in the target area based on the fourth distance. The area radius can also be set, and the assignment area is divided with the current location of the target teammate as the center. Within the assignment area, negative values ​​are assigned radiating outwards from the current location of the target teammate, with the score increasing linearly outwards. No score is assigned if the score exceeds the assignment area.

[0221] After assigning values ​​to each location point in the target area based on the fourth distance, the teammate dot matrix of each game character can be obtained. The obtained teammate dot matrix includes the teammate score of each location point in the target area.

[0222] After obtaining the character and teammate pixel images for each game character, the character pixel image, teammate pixel image, and base pixel image for each game character can be overlaid to obtain the target score for each position point in the target area. The position point with the highest target score is set as the running position for that game character.

[0223] It should be noted that, in this embodiment, overlaying the character dot matrix, teammate dot matrix, and base dot matrix refers to overlaying the base score, task score, and teammate score of each location point in the target area. For example, for a certain location point in the target area, if the base score of that location point is M, the task score is N, and the teammate score is L, then the target score of that location point is M+N+L.

[0224] In an optional implementation, to improve efficiency, a correspondence between location base points and character pixel maps, as well as a correspondence between teammate positions and teammate pixel maps, can be pre-established. That is, for each location base point, a corresponding character pixel map is pre-defined, and for each teammate position, a corresponding teammate pixel map is pre-defined. Thus, after obtaining the location base points of each game character in the target area, the corresponding character pixel map can be obtained based on the correspondence between location base points and character pixel maps; similarly, after obtaining the current position of the target teammate, the corresponding teammate pixel map can be obtained based on the correspondence between teammate positions and teammate pixel maps. This reduces computational load and improves processing efficiency in the game.

[0225] The game character position control method provided in this embodiment simplifies the target area into an array, changes the value of each element in the array by superimposing different images, and modifies different logical processing steps to adding or deleting a certain score dot matrix image, thus greatly simplifying the complexity of the overall logic and iteration. Furthermore, in this embodiment, the calculation of each dot matrix image can be pre-calculated offline; during superposition, only the dot matrix images at the corresponding positions need to be obtained and superimposed, reducing the amount of computation and improving efficiency. Therefore, this solution can also be used on mobile devices.

[0226] In addition, the game character position control method provided in this embodiment considers the team first, and then assigns tasks to characters who need to move, so that the overall formation can be maintained while supporting various other tactical designs, thus improving the game effect. At the same time, since this embodiment can overlay different graphs and adjust the weight of the scores of different graphs when calculating the position of each player, the score calculation of each player in each position is completely different, thereby highlighting the characteristics of different players' positions and making it highly configurable.

[0227] Based on the same inventive concept, please refer to the following: Figure 6 This embodiment provides a position control device 10, which is applied to... Figure 1 The electronic settings shown, such as Figure 6 As shown, the position control device 10 provided in this embodiment includes an instruction response module 11, a role processing module 12, and a position calculation module 13.

[0228] The instruction response module 11 is used to respond to the target instruction, obtain the basic dot matrix map of the target area, and obtain the target position base point of each game character in the attacking team in the target area according to the formation relationship of the attacking team; the basic dot matrix map includes the basic score of each position point in the target area.

[0229] The character processing module 12 is used to obtain a character dot matrix of each game character based on the target position base point of each game character in the target area; the character dot matrix includes the task score of each position point of the game character in the target area.

[0230] The position calculation module 13 is used to obtain the running position of each game character based on the character dot matrix and the basic dot matrix.

[0231] In an optional implementation, the instruction response module 11 is used to:

[0232] Obtain the initial bitmap of the target region; the initial bitmap includes the initial score of each location point in the target region.

[0233] Based on the boundary lines of the target area, a boundary line dot matrix is ​​obtained; the boundary line dot matrix includes the boundary distance score of each location point in the target area;

[0234] An attack point map is obtained based on the positions of the defensive roles in the defending team and the positions of the target roles in each game character; the attack point map includes the attack score for each position point in the target area.

[0235] Based on the initial dot matrix map, the edge dot matrix map, and the attack dot matrix map, the base dot matrix map of the target area is obtained.

[0236] In an optional implementation, the instruction response module 11 is used to:

[0237] Based on the position of the defender, the first distance between each point in the target area and the position of the defender is calculated, and based on the position of the target, the second distance between each point in the target area and the position of the target is calculated.

[0238] Based on the first distance, a value is assigned to each location point in the target area to obtain a defensive position point matrix. Based on the second distance, a value is assigned to each location point in the target area to obtain an extrapolated point matrix.

[0239] Based on the defensive position map and the extrapolation map, the offensive position map is obtained.

[0240] In an optional implementation, the instruction response module 11 is used to:

[0241] Based on the boundary line of the target area, the distance between each location point in the target area and the boundary line is calculated.

[0242] Based on the distance between each location point in the target area and the boundary line, a value is assigned to each location point in the target area to obtain the boundary line dot matrix.

[0243] In an optional implementation, the instruction response module 11 is used to:

[0244] Assign weights to the edge dot matrix and the attack dot matrix to obtain their weight values.

[0245] Based on the weight values ​​of the edge dot matrix and the attack dot matrix, the edge dot matrix and the attack dot matrix are superimposed on the initial dot matrix to obtain the base dot matrix of the target area.

[0246] In an optional implementation, the instruction response module 11 is used to:

[0247] Based on the formation of the attacking team, the target position base point of the target character in the game is determined.

[0248] The target position base point of the non-target character in the game is calculated based on the target position base point of the target character and the historical position base point of the non-target character in the game.

[0249] In an optional implementation, the instruction response module 11 is used to:

[0250] Based on the historical position base points of non-target characters, determine the target range and the initial position base points within the target range.

[0251] Calculate the first distance score of the initial position base point based on the distance between the target position base point and the initial position base point of the target character.

[0252] The target score of the initial position base point is calculated based on the first distance score and the position score of the initial position base point.

[0253] Based on the target score, the target position base point of the non-target role is determined.

[0254] In an optional implementation, before calculating the target score of the initial position base point based on the first distance score and the position score of the initial position base point, the instruction response module 11 is used to:

[0255] Based on the formation of the attacking team, the standard position base point of the non-target character is determined. Based on the distance between the standard position base point and the initial position base point, the second distance score of the initial position base point is calculated.

[0256] Based on the character attributes of the non-target character, obtain the basic score and additional score of the initial position base point.

[0257] Obtain the number of characters within the set range of the initial position base point, and determine the congestion score of the initial position base point based on the number of characters.

[0258] The position score of the initial position base point is calculated based on the second distance score, the base score, the additional score, and the crowding score.

[0259] In an optional implementation, the instruction response module 11 is used to:

[0260] Select the N initial target positions as base points with the highest target scores; N is a positive integer.

[0261] Add a random number to the target score of each target's initial position base point to obtain a random score for each target's initial position base point.

[0262] Set the initial position base point of the target with the highest random score to the position base point of the non-target character.

[0263] In an optional implementation, the role processing module 12 is used for:

[0264] Calculate the third distance between each location point in the target area and the base point of each game character's location.

[0265] Based on the third distance, a value is assigned to each location point in the target area to obtain the character pixel map of each game character.

[0266] In an optional implementation, the location calculation module 13 is used for:

[0267] By overlaying the character pixel art and the base pixel art, the target score for each point in the target area is obtained.

[0268] Set the position with the highest target score as the running position of the game character.

[0269] In an optional implementation, before obtaining the target position of each game character based on the character dot matrix and the base dot matrix, the character processing module 12 is used to:

[0270] Obtain the current position of each game character's target teammate in the target area, and calculate the fourth distance between each location point in the target area and the current position.

[0271] Based on the fourth distance, assign values ​​to each location point in the target area to obtain the dot matrix of teammates for each game character.

[0272] Accordingly, the location calculation module 13 is used for:

[0273] The character dot matrix, teammate dot matrix, and base dot matrix are overlaid to obtain the target score for each point in the target area. The point with the highest target score is set as the running position of the game character.

[0274] The position control device provided in this embodiment obtains a base dot matrix map of the target area in response to a target command. Based on the formation relationship of each game character, it calculates the target position base point of each game character in the target area. Based on the target position base point of each game character in the target area, it calculates the character dot matrix map of each game character. Based on the character dot matrix map and the base dot matrix map, it calculates the running position of each game character. Thus, by digitizing the target area and the game character tasks, and obtaining the running position of the game characters based on the base dot matrix map of the target area and the character dot matrix maps of the game characters, it simplifies the overall logic and iteration complexity while maintaining the team formation, thereby improving development efficiency.

[0275] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.

[0276] Based on the above, this embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the game character position control method described in any of the foregoing embodiments.

[0277] The storage medium can be, but is not limited to, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, and any other media capable of storing program code.

[0278] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the storage medium described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.

[0279] In summary, the game character position control method, device, electronic device, and storage medium provided in this invention, by responding to target commands, acquire a base dot matrix map of the target area, calculate the target position base point of each game character in the target area based on the formation relationship of each game character, calculate the character dot matrix map of each game character based on the target position base point of each game character in the target area, and calculate the running position of each game character based on the character dot matrix map and the base dot matrix map. Thus, by digitizing the target area and the game character tasks, and obtaining the running position of the game characters based on the base dot matrix map of the target area and the character dot matrix maps of the game characters, the overall logic and iteration complexity can be simplified while maintaining the team formation, thereby improving development efficiency.

[0280] The foregoing has provided a detailed description of the game character position control method, device, electronic device, and storage medium provided in the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of the present invention. Those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for controlling the position of a game character, characterized in that, The method includes: Responding to the target command, the system acquires a basic dot matrix map of the target area and, based on the formation of the attacking team, obtains the target position base points of each game character in the attacking team within the target area. The basic dot matrix map includes the base score for each position point in the target area. The basic dot matrix map is determined based on an initial dot matrix map, a sideline dot matrix map, and an attack dot matrix map. The initial dot matrix map includes the initial score for each position point in the target area. The sideline dot matrix map includes the sideline distance score for each position point in the target area. The attack dot matrix map is determined based on a defensive position dot matrix map and an extrapolation dot matrix map. The defensive position dot matrix map is obtained by calculating a first distance between each position point in the target area and the position of the defensive character based on the defensive character's position, and assigning a value to each position point in the target area based on the first distance. The extrapolation dot matrix map is obtained by calculating a second distance between each position point in the target area and the position of the target character based on the target character's position, and assigning a value to each position point in the target area based on the second distance. Calculate the third distance between each location point in the target area and the target location base point of each game character; assign a value to each location point in the target area based on the third distance to obtain the character dot matrix of each game character; the character dot matrix includes the task score of each game character at each location point in the target area; Based on the character dot matrix and the base dot matrix, the running positions of each game character are obtained; The step of obtaining the target position base point of each game character in the attacking team in the target area based on the formation relationship of the attacking team includes: Based on the formation of the attacking team, the target position base point of the target character in the game is determined; The target position base point of the non-target character in the game is calculated based on the target position base point of the target character and the historical position base point of the non-target character in the game.

2. The method for controlling the position of a game character according to claim 1, characterized in that, The steps to obtain the edge point map include: Based on the boundary line of the target area, the distance between each location point in the target area and the boundary line is calculated; Based on the distance between each location point in the target area and the boundary line, a value is assigned to each location point in the target area to obtain a boundary line dot matrix.

3. The method for controlling the position of a game character according to claim 1, characterized in that, The steps for obtaining the base raster map of the target region include: Weights are assigned to the edge dot matrix and the attack dot matrix to obtain the weight values ​​of the edge dot matrix and the attack dot matrix. Based on the weight values ​​of the edge dot matrix and the attack dot matrix, the edge dot matrix and the attack dot matrix are superimposed on the initial dot matrix to obtain the base dot matrix of the target area.

4. The method for controlling the position of a game character according to claim 1, characterized in that, The step of calculating the target position base point of the non-target character in the game based on the target position base point of the target character and the historical position base points of the non-target characters in the game includes: Based on the historical position base points of the non-target characters, determine the target range and the initial position base points within the target range; Calculate the first distance score of the initial position base point based on the distance between the target position base point of the target character and the initial position base point; The target score of the initial position base point is calculated based on the first distance score and the position score of the initial position base point. Based on the target score, the target position base point of the non-target role is determined.

5. The method for controlling the position of a game character according to claim 4, characterized in that, Before calculating the target score of the initial position base point based on the first distance score and the position score of the initial position base point, the method further includes: Based on the formation of the attacking team, the standard position base point of the non-target character is determined, and the second distance score of the initial position base point is calculated based on the distance between the standard position base point and the initial position base point. Based on the character attributes of the non-target character, the base score and additional score of the initial position base point are obtained; Obtain the number of characters within a set range from the initial location base point, and determine the congestion score of the initial location base point based on the number of characters. The position score of the initial position base point is calculated based on the second distance score, the base score, the additional score, and the congestion score.

6. The method for controlling the position of a game character according to claim 5, characterized in that, The step of determining the target location base point of the non-target character based on the target score includes: Select the N initial target positions as base points with the highest target scores; N is a positive integer. Add a random number to the target score of each target initial position base point to obtain a random score for each target initial position base point; The initial position base point of the target with the highest random score is set at the target position base point of the non-target character.

7. The method for controlling the position of a game character according to claim 1, characterized in that, The step of obtaining the running position of each game character based on the character dot matrix and the base dot matrix includes: The character dot matrix image and the base dot matrix image are superimposed to obtain the target score for each location point in the target area; Set the position with the highest target score as the running position of the game character.

8. The method for controlling the position of a game character according to claim 1, characterized in that, Before obtaining the running positions of each game character based on the character dot matrix and the base dot matrix, the method further includes: Obtain the current position of the target teammates of each game character in the target area, and calculate the fourth distance between each position point in the target area and the current position; Based on the fourth distance, a value is assigned to each location point in the target area to obtain the teammate dot matrix of each game character; The step of obtaining the running position of each game character based on the character dot matrix and the base dot matrix includes: The character dot matrix, the teammate dot matrix, and the base dot matrix are superimposed to obtain the target score for each position point in the target area. The position point with the highest target score is set as the running position of the game character.

9. A device for controlling the position of a game character, characterized in that, The position control device includes: The instruction response module is used to respond to target instructions, obtain a basic dot matrix map of the target area, and, based on the formation of the attacking team, obtain the target position base points of each game character in the target area. The basic dot matrix map includes the basic score of each position point in the target area. The basic dot matrix map is determined based on an initial dot matrix map, a sideline dot matrix map, and an attack dot matrix map. The initial dot matrix map includes the initial score of each position point in the target area. The sideline dot matrix map includes the sideline distance score of each position point in the target area. The attack dot matrix map is determined based on a defensive position dot matrix map and an extrapolation dot matrix map. The defensive position dot matrix map is obtained by calculating a first distance between each position point in the target area and the position of the defensive character based on the position of the defensive character, and assigning a value to each position point in the target area based on the first distance. The extrapolation dot matrix map is obtained by calculating a second distance between each position point in the target area and the position of the target character based on the position of the target character, and assigning a value to each position point in the target area based on the second distance. The character processing module is used to calculate the third distance between each location point in the target area and the target location base point of each game character; based on the third distance, a value is assigned to each location point in the target area to obtain the character dot matrix of each game character; the character dot matrix includes the task score of the game character at each location point in the target area; The position calculation module is used to obtain the running position of each game character based on the character dot matrix and the base dot matrix; The step of obtaining the target position base point of each game character in the attacking team in the target area based on the formation relationship of the attacking team includes: Based on the formation of the attacking team, the target position base point of the target character in the game is determined; The target position base point of the non-target character in the game is calculated based on the target position base point of the target character and the historical position base point of the non-target character in the game.

10. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the position control method for a game character as described in any one of claims 1 to 8.

11. A storage medium, characterized in that, The storage medium includes a computer program, which, when executed, controls the electronic device containing the storage medium to perform the position control method for the game character as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Role assignment method and device based on multiple agents, computer equipment and storage medium

    CN109254584A

  • Game role behavior control method and device and readable storage medium

    CN110134375A