Passing control method, device, equipment and storage medium
By obtaining the passing direction and determining the virtual object and point of the pass, and controlling the movement of the virtual ball, the problem of unrealistic passing in ball games is solved, thus improving the gaming experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2021-11-03
- Publication Date
- 2026-05-05
AI Technical Summary
Existing ball games lack handling for special situations during passing, resulting in an unrealistic passing experience and a poor gaming experience.
By responding to passing commands, the system obtains the passing direction, determines the virtual object and passing point, and controls the movement of the virtual ball so that the virtual object receives the ball at the passing point. It takes into account various passing scenarios, including factors such as angle difference, passing time, and the size of the virtual court, and adjusts the passing point to avoid collisions.
The realism of the virtual passing objects and passing receiving points has been improved, enhancing the gaming experience.
Smart Images

Figure CN116059642B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a passing control method, apparatus, device, and storage medium. Background Technology
[0002] With the rapid development of gaming technology, more and more users enjoy playing games on their mobile phones and computers. Among them, ball games are particularly popular with sports fans because they are not limited by factors such as venue or personnel.
[0003] Currently, in ball games, each user controls one player. However, the game lacks handling for special situations during passing, resulting in an unrealistic passing experience and a poor gaming experience. Summary of the Invention
[0004] The purpose of this application is to address the shortcomings of the prior art by providing a passing control method, device, equipment, and storage medium to solve the problem of poor gaming experience in the prior art.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0006] In a first aspect, one embodiment of this application provides a passing control method, the method comprising:
[0007] In response to a passing command for a virtual sphere in the game scene, obtain the passing direction corresponding to the passing command;
[0008] Based on the passing direction, the passing virtual object is determined from multiple cooperating virtual objects of the team to which the controlled virtual object belongs;
[0009] The passing point is determined based on the movement direction of the obtained virtual passing object;
[0010] Control the virtual sphere to move towards the passing point so that the virtual passing object receives the ball from the passing point.
[0011] In some embodiments, determining the passing virtual object from multiple cooperating virtual objects of the team to which the controlled virtual object belongs, based on the passing direction, includes:
[0012] The controlled virtual object is determined to point to multiple directions from each collaborative virtual object;
[0013] The passing virtual object is determined from the plurality of collaborative virtual objects based on the plurality of directions and the passing direction.
[0014] In some embodiments, determining the passing virtual object from the plurality of collaborative virtual objects based on the plurality of directions and the passing direction includes:
[0015] Obtain the angle difference between the plurality of directions and the passing direction;
[0016] Determine whether there exists at least one target virtual object among the plurality of collaborative virtual objects whose angle difference is less than or equal to a preset angle;
[0017] If at least one target virtual object exists, then the passing virtual object is determined from the at least one target virtual object.
[0018] In some embodiments, determining the passing virtual object from the at least one target virtual object includes:
[0019] The passing time is determined according to the passing instruction;
[0020] Calculate the passing distance based on the passing time and the size of the virtual court in the game scene;
[0021] Based on the passing distance, determine the passing detection point of the virtual sphere;
[0022] The target virtual object whose distance from the pass detection point meets the preset condition among the at least one target virtual objects is identified as the pass virtual object.
[0023] In some embodiments, determining the passing point based on the obtained movement direction of the virtual passing object includes:
[0024] Based on the direction of movement, determine the passing selection direction of the controlled virtual object pointing towards the passing point;
[0025] The passing point is determined based on the direction of movement and the direction of passing selection.
[0026] In some embodiments, determining the passing selection direction of the controlled virtual object towards the passing point based on the movement direction includes:
[0027] Based on the virtual goal in the game scene, the virtual stadium is divided into a central area and an edge area;
[0028] If the virtual passing object is in the central area, then connect the virtual passing object and the edge point of the opponent's virtual goal on the goal line to obtain the candidate area for the passing selection point direction;
[0029] If the direction of movement is within the coverage area of the candidate area, then the direction of movement is determined as the direction of the pass selection point.
[0030] In some embodiments, if the direction of movement is not within the coverage area of the candidate region, the method further includes:
[0031] Obtain the angle between the first direction from which the virtual passing object points to the first edge point of the opponent's virtual goal on the goal line and the direction of movement;
[0032] Obtain the angle between the second direction from which the virtual passing object points to the second edge point of the opponent's virtual goal on the goal line and the direction of movement;
[0033] The direction corresponding to the minimum value between the angle between the first direction and the direction of movement, and the angle between the second direction and the direction of movement, is determined as the passing point selection direction.
[0034] In some embodiments, if the virtual passing object is in the edge region, the method further includes:
[0035] Obtain the perpendicular line from the virtual passing object to the goal line of the opponent's virtual goal;
[0036] Based on the intersection of the vertical line and the goal line, the edge point of the virtual field, and the edge point of the opponent's virtual goal on the goal line, determine the first moving point and the second moving point in the direction of the goal line;
[0037] The determination region is obtained based on the first moving point and the second moving point;
[0038] If the direction of movement is within the coverage area of the determination area, then the direction of movement is determined to be the direction of the pass selection point.
[0039] In some embodiments, if the direction of movement is not within the coverage area of the determination area, the method further includes:
[0040] Obtain the angle between the third direction of the virtual passing object pointing to the first edge point of the judgment area and the direction of movement;
[0041] Obtain the fourth direction from which the virtual passing object points to the second edge point of the judgment area, and the angle between this direction and the direction of movement;
[0042] The direction corresponding to the minimum value of the angle between the third direction and the direction of movement, and the angle between the fourth direction and the direction of movement, is determined as the passing point selection direction.
[0043] In some embodiments, obtaining the determination region based on the first moving point and the second moving point includes:
[0044] If both the first moving point and the second moving point are within the virtual court, then connect the virtual passing object, the first moving point, and the second moving point to obtain the determination area;
[0045] If there is a moving point outside the virtual court among the first moving point and the second moving point, then the determination area is obtained based on the passing virtual object and the target edge point of the virtual court, wherein the target edge point is the edge point among the multiple edge points of the virtual court that is closest to the moving point outside the virtual court.
[0046] In some embodiments, determining the passing point based on the direction of movement and the direction of passing selection includes:
[0047] Obtain the angle between the moving direction and the passing point selection direction;
[0048] The passing point is determined in the direction of the passing selection based on the angle between the direction of movement and the direction of the passing selection.
[0049] In some embodiments, before controlling the virtual sphere to move toward the passing point, the method further includes:
[0050] If the distance between the passing point and the virtual wall in the virtual court is less than or equal to a preset distance, the passing point is adjusted according to the distance from the controlled virtual object to the passing point.
[0051] In some embodiments, adjusting the passing point based on the distance from the controlled virtual object to the passing point includes:
[0052] Obtain a virtual bounding box that is at a distance equal to the preset distance from the virtual wall;
[0053] Draw a circle with the controlled virtual object as the center and the distance from the controlled virtual object to the passing point as the radius;
[0054] The passing point is adjusted based on the intersection point of the circle and the boundary direction of the virtual bounding box.
[0055] In some embodiments, adjusting the passing point based on the intersection point of the circle and the boundary direction of the virtual bounding box includes:
[0056] Based on the intersection points of the circle and the boundary direction of the virtual bounding box, multiple candidate passing points are obtained;
[0057] The passing point is adjusted based on the multiple candidate passing points.
[0058] In some embodiments, adjusting the passing point based on the plurality of candidate passing points includes:
[0059] Obtain the distance between each candidate pass point and the virtual bounding box;
[0060] Determine at least one target passing point from the plurality of candidate passing points whose distance from the virtual bounding box satisfies a preset condition;
[0061] Obtain the controlled virtual object pointing to the passing point, and the deflection angle of the controlled virtual object pointing to each target passing point;
[0062] The passing point is adjusted based on the target passing point corresponding to the smallest deflection angle among the at least one target passing point.
[0063] Secondly, another embodiment of this application provides a passing control device, the device comprising:
[0064] The acquisition module is used to respond to a passing command for a virtual sphere in the game scene and acquire the passing direction corresponding to the passing command;
[0065] The determination module is used to determine the passing virtual object from multiple cooperative virtual objects of the team where the controlled virtual object is located, based on the passing direction, and to determine the passing point based on the movement direction of the obtained passing virtual object;
[0066] The control module is used to control the virtual sphere to move towards the passing point, so that the virtual passing object can receive the ball from the passing point.
[0067] In some embodiments, the determining module is specifically used for:
[0068] The controlled virtual object is determined to point to multiple directions from each collaborative virtual object;
[0069] The passing virtual object is determined from the plurality of collaborative virtual objects based on the plurality of directions and the passing direction.
[0070] In some embodiments, the determining module is specifically used for:
[0071] Obtain the angle difference between the plurality of directions and the passing direction;
[0072] Determine whether there exists at least one target virtual object among the plurality of collaborative virtual objects whose angle difference is less than or equal to a preset angle;
[0073] If at least one target virtual object exists, then the passing virtual object is determined from the at least one target virtual object.
[0074] In some embodiments, the determining module is specifically used for:
[0075] The passing time is determined according to the passing instruction;
[0076] Calculate the passing distance based on the passing time and the size of the virtual court in the game scene;
[0077] Based on the passing distance, determine the passing detection point of the virtual sphere;
[0078] The target virtual object whose distance from the pass detection point meets the preset condition among the at least one target virtual objects is identified as the pass virtual object.
[0079] In some embodiments, the determining module is specifically used for:
[0080] Based on the direction of movement, determine the passing selection direction of the controlled virtual object pointing towards the passing point;
[0081] The passing point is determined based on the direction of movement and the direction of passing selection.
[0082] In some embodiments, the determining module is specifically used for:
[0083] Based on the virtual goal in the game scene, the virtual stadium is divided into a central area and an edge area;
[0084] If the virtual passing object is in the central area, then connect the virtual passing object and the edge point of the opponent's virtual goal on the goal line to obtain the candidate area for the passing selection point direction;
[0085] If the direction of movement is within the coverage area of the candidate area, then the direction of movement is determined as the direction of the pass selection point.
[0086] In some embodiments, if the direction of movement is not within the coverage area of the candidate region, the acquisition module is further configured to:
[0087] Obtain the angle between the first direction from which the virtual passing object points to the first edge point of the opponent's virtual goal on the goal line and the direction of movement;
[0088] Obtain the angle between the second direction from which the virtual passing object points to the second edge point of the opponent's virtual goal on the goal line and the direction of movement;
[0089] The determining module is used to determine the direction corresponding to the minimum value of the angle between the first direction and the moving direction and the angle between the second direction and the moving direction as the passing point selection direction.
[0090] In some embodiments, if the virtual passing object is in the edge region, the acquisition module is further configured to:
[0091] Obtain the perpendicular line from the virtual passing object to the goal line of the opponent's virtual goal;
[0092] The determining module is further configured to determine the first moving point and the second moving point in the direction of the goal line based on the intersection of the vertical line and the goal line, the edge point of the virtual field, and the edge point of the opponent's virtual goal on the goal line;
[0093] The acquisition module is further configured to acquire a determination region based on the first moving point and the second moving point;
[0094] The determining module is further configured to determine the moving direction as the passing selection direction if the moving direction is within the coverage area of the determination area.
[0095] In some embodiments, if the direction of movement is not within the coverage area of the determination area, the acquisition module is further configured to:
[0096] Obtain the angle between the third direction of the virtual passing object pointing to the first edge point of the judgment area and the direction of movement;
[0097] Obtain the fourth direction from which the virtual passing object points to the second edge point of the judgment area, and the angle between this direction and the direction of movement;
[0098] The determining module is further configured to determine the direction corresponding to the minimum value of the angle between the third direction and the moving direction and the angle between the fourth direction and the moving direction as the passing point selection direction.
[0099] In some embodiments, the acquisition module is specifically used for:
[0100] If both the first moving point and the second moving point are within the virtual court, then connect the virtual passing object, the first moving point, and the second moving point to obtain the determination area;
[0101] If there is a moving point outside the virtual court among the first moving point and the second moving point, then the determination area is obtained based on the passing virtual object and the target edge point of the virtual court, wherein the target edge point is the edge point among the multiple edge points of the virtual court that is closest to the moving point outside the virtual court.
[0102] In some embodiments, the determining module is specifically used for:
[0103] Obtain the angle between the moving direction and the passing point selection direction;
[0104] The passing point is determined in the direction of the passing selection based on the angle between the direction of movement and the direction of the passing selection.
[0105] In some embodiments, it also includes:
[0106] An adjustment module is used to adjust the passing point based on the distance from the controlled virtual object to the passing point if the distance between the passing point and the virtual wall in the virtual court is less than or equal to a preset distance.
[0107] In some embodiments, the adjustment module is specifically used for:
[0108] Obtain a virtual bounding box that is at a distance equal to the preset distance from the virtual wall;
[0109] Draw a circle with the controlled virtual object as the center and the distance from the controlled virtual object to the passing point as the radius;
[0110] The passing point is adjusted based on the intersection point of the circle and the boundary direction of the virtual bounding box.
[0111] In some embodiments, the adjustment module is specifically used for:
[0112] Based on the intersection points of the circle and the boundary direction of the virtual bounding box, multiple candidate passing points are obtained;
[0113] The passing point is adjusted based on the multiple candidate passing points.
[0114] In some embodiments, the adjustment module is specifically used for:
[0115] Obtain the distance between each candidate pass point and the virtual bounding box;
[0116] Determine at least one target passing point from the plurality of candidate passing points whose distance from the virtual bounding box satisfies a preset condition;
[0117] Obtain the controlled virtual object pointing to the passing point, and the deflection angle of the controlled virtual object pointing to each target passing point;
[0118] The passing point is adjusted based on the target passing point corresponding to the smallest deflection angle among the at least one target passing point.
[0119] Thirdly, another embodiment of this application provides a passing control device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the passing control device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform any of the method embodiments of the first aspect.
[0120] Fourthly, another embodiment of this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method embodiment described in any of the first aspects.
[0121] The beneficial effects of this application are:
[0122] This application discloses a passing control method, apparatus, device, and storage medium. The method includes: responding to a passing command for a virtual sphere in a game scene; obtaining the passing direction corresponding to the passing command; determining a passing virtual object from multiple cooperating virtual objects in the team of the controlled virtual object based on the passing direction; determining a passing point based on the obtained movement direction of the passing virtual object; and controlling the virtual sphere to move towards the passing point so that the passing virtual object receives the ball at the passing point. This application can determine the passing virtual object and passing point based on the passing command in various situations, controlling the virtual sphere to move towards the passing point so that the passing virtual object receives the ball at the passing point, thus enhancing the realism of the passing virtual object and the passing receiving point and improving the gaming experience. Attached Figure Description
[0123] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0124] Figure 1 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 1 ;
[0125] Figure 2 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 2 ;
[0126] Figure 3 A schematic diagram of the straight-pipe direction provided in an embodiment of this application is shown;
[0127] Figure 4 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 3 ;
[0128] Figure 5 A schematic diagram illustrating the movement direction and pass selection direction provided in an embodiment of this application is shown;
[0129] Figure 6 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 4 ;
[0130] Figure 7 A schematic diagram of the virtual court provided in the embodiments of this application is shown. Figure 1 ;
[0131] Figure 8 A schematic diagram of the virtual court provided in the embodiments of this application is shown. Figure 2 ;
[0132] Figure 9 This illustration shows a portion of the virtual sports field provided in the embodiments of this application. Figure 1 ;
[0133] Figure 10 This illustration shows a portion of the virtual sports field provided in the embodiments of this application. Figure 2 ;
[0134] Figure 11 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 5 ;
[0135] Figure 12 A schematic diagram of the virtual wall provided in an embodiment of this application is shown;
[0136] Figure 13 A schematic diagram of the structure of the passing control device provided in an embodiment of this application is shown;
[0137] Figure 14 A schematic diagram of the structure of the passing control device provided in an embodiment of this application is shown. Detailed Implementation
[0138] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0139] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0140] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0141] In one embodiment of this application, the passing control method can run on a local terminal device or a server. When the passing control method runs on a server, it can be implemented and executed based on a cloud interaction system, which includes a server and client devices.
[0142] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of the passing control method are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. During gameplay, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0143] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0144] In one possible implementation, this invention provides a pass control method that provides a graphical user interface through a terminal device, wherein the terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.
[0145] To address the lack of handling for special situations in existing passing techniques, this application provides a passing control method that considers various passing scenarios. It determines the virtual passing object and passing point based on the passing command, controls the virtual ball to move towards the passing point, and enables the virtual passing object to receive the ball at the passing point. This enhances the realism of the virtual passing object and the passing receiving point, improving the gaming experience.
[0146] Figure 1 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 1 In this embodiment, the executing entity can be a passing control device, such as a mobile phone, tablet computer, or other device with data processing capabilities.
[0147] like Figure 1 As shown, the method includes:
[0148] S101, Respond to the passing command for the virtual sphere in the game scene and obtain the passing direction corresponding to the passing command.
[0149] The game scene can be any ball game. After downloading the ball game on the passing control device, opening and logging in, the game scene will be displayed on the graphical user interface. The ball game includes, but is not limited to, football, basketball, volleyball, ice hockey, and field hockey games.
[0150] The passing command for the virtual sphere in the game scene can be any of the following operations: touch operation on the passing control in the game scene, movement operation on the joystick device, or input operation on the input device.
[0151] The game scene can provide a passing control, which users can touch to pass the ball. This touch operation can be a press operation. Alternatively, the passing control device can be connected to a joystick device via wired or wireless means, allowing users to pass the ball by moving the joystick. Or, the passing control device can be connected to an input device via wired or wireless means, such as a keyboard, allowing users to perform input operations, such as passing operations, for example, by using keyboard shortcuts.
[0152] The pass command can specify the pass direction, such as the direction the controlled virtual object is facing forward, or the direction it is facing 45 degrees to the left. The controlled virtual object can move around the game scene. If the pass command is a movement operation applied to the joystick, the direction the movement operation points (joystick direction) is the pass direction. If the joystick cannot point in the movement direction, the direction the controlled virtual object is facing is used as the pass direction.
[0153] Therefore, when a user inputs a passing command for a virtual sphere in the game scene, the passing control device responds to the passing command and can obtain the passing direction corresponding to the passing command.
[0154] S102. Based on the passing direction, determine the passing virtual object from among multiple cooperating virtual objects of the team to which the controlled virtual object belongs.
[0155] Among them, the multiple collaborative virtual objects of the team to which the controlled virtual object belongs can be teammates of the controlled virtual object, and the passing virtual object is the collaborative virtual object to which the controlled virtual object passes the virtual ball, that is, the collaborative virtual object that receives the ball.
[0156] In this embodiment, the passing direction can be used as a filtering condition to determine the passing virtual object from multiple collaborative virtual objects of the team to which the controlled virtual object belongs. For example, the collaborative virtual object located in the passing direction can be determined from multiple collaborative virtual objects of the team to which the controlled virtual object belongs as the passing virtual object.
[0157] S103. Determine the passing point based on the movement direction of the obtained virtual passing object.
[0158] The passing point is the location where the controlled virtual object passes the virtual ball to the virtual court, that is, the receiving point of the passing virtual object in the virtual court. The virtual court can be an enclosed court with virtual walls around it.
[0159] The direction of movement of the virtual passing object can be the direction corresponding to the speed at which the virtual passing object moves in the virtual court.
[0160] Normally, the virtual passing object moves at a certain speed in the game scene. In order to accurately receive the virtual ball at the passing point, the direction of movement of the virtual passing object in the game scene can be obtained, and then the passing point can be determined based on the direction of movement of the virtual passing object.
[0161] S104. Control the virtual sphere to move towards the passing point so that the virtual object receiving the ball at the passing point can receive the ball.
[0162] After determining the virtual object and the passing point, you can control the virtual ball to move towards the passing point so that the virtual object can receive the ball at the passing point. In other words, you can control the controlled virtual object to pass the virtual ball to the passing point so that the virtual object can move to the passing point to receive the virtual ball.
[0163] It should be noted that the passing control method in this embodiment can be applied to through passes in football games. A through pass is a football term referring to the direct transfer of the ball to a teammate based on their movement during a football match. It is characterized by speed, directness, and effectiveness; that is, how to pass the ball to a teammate while they are moving. Here, "teammate" refers to a cooperating virtual object within the team to which the controlled virtual object belongs. Furthermore, for through passes in football games, the passing direction is called the through pass direction, the passing point is called the through pass point, and the passing virtual object is called the through pass virtual object.
[0164] The passing control method in this embodiment responds to a passing command for a virtual sphere in the game scene, obtains the passing direction corresponding to the passing command, determines the passing virtual object from multiple cooperative virtual objects in the team to which the controlled virtual object belongs based on the passing direction, determines the passing point based on the movement direction of the obtained passing virtual object, and controls the virtual sphere to move towards the passing point so that the passing virtual object can receive the ball at the passing point. This embodiment considers various passing scenarios, and can determine the passing virtual object and passing point based on the passing command, controlling the virtual sphere to move towards the passing point so that the passing virtual object can receive the ball at the passing point, thus enhancing the realism of the passing virtual object and the passing receiving point and improving the gaming experience.
[0165] Figure 2 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 2 ,like Figure 2 As shown, step S102, determining the passing virtual object from multiple cooperating virtual objects of the team to which the controlled virtual object belongs, based on the passing direction, may include:
[0166] S201. Determine multiple directions in which the controlled virtual object points to each collaborative virtual object.
[0167] S202. Determine the passing virtual object from multiple collaborative virtual objects based on multiple directions and passing directions.
[0168] The controlled virtual object and each collaborative virtual object are located within the virtual court, so multiple directions from the controlled virtual object to each collaborative virtual object can be determined; that is, there is a direction from the position of the controlled virtual object to the position of each collaborative virtual object.
[0169] Then, multiple directions and passing directions can be used as filtering conditions to determine the passing virtual object from multiple collaborative virtual objects. For example, the collaborative virtual object corresponding to the direction with the smallest deviation from the passing direction can be determined as the passing virtual object. This can prevent the passing virtual object from failing to receive the virtual ball.
[0170] In some embodiments, step S202, determining the passing virtual object from multiple collaborative virtual objects based on multiple directions and passing direction, may include:
[0171] Obtain the angle difference between multiple directions and the passing direction; determine whether there is at least one target virtual object among multiple collaborative virtual objects whose angle difference is less than or equal to a preset angle; if there is at least one target virtual object, determine the passing virtual object from at least one target virtual object.
[0172] The angle differences between multiple directions and the passing direction can be the deviation angle between the direction the controlled virtual object points to each collaborative virtual object and the passing direction. The angle differences between multiple directions and the passing direction are calculated, and then it is determined whether there is at least one target virtual object among the collaborative virtual objects whose angle difference is less than or equal to a preset angle. If at least one target virtual object exists, it indicates the existence of multiple candidate passing virtual objects, and the passing virtual object can be determined from these at least one target virtual object.
[0173] In some embodiments, determining the passing virtual object from at least one target virtual object may include:
[0174] The passing time is determined based on the passing command; the passing distance is calculated based on the passing time and the size of the virtual court in the game scene; the passing detection point of the virtual sphere is determined based on the passing distance; at least one target virtual object whose distance from the passing detection point meets the preset condition is identified as the passing virtual object.
[0175] The pressing time corresponding to the pass command is the pass time.
[0176] The pass command can be any of the following operations: touch operation applied to the pass control in the game scene, movement operation applied to the joystick device, or input operation applied to the input device.
[0177] If the pass command is a touch operation applied to the pass control, the pass time is the press time corresponding to the touch operation. For example, if the touch operation is a click operation, the pass time is the time it takes to press the pass control.
[0178] If the pass command is a movement operation applied to the joystick device, the pass time is the time it takes to move and press the joystick.
[0179] If the pass command is an input operation performed on an input device, the pass time is the press time corresponding to the input operation. For example, if the input device is a keyboard and a pass command is issued using the shortcut key Shift, the press time of the shortcut key Shift is the pass time.
[0180] Then, based on the mapping relationship between passing time and passing ratio, the passing time is converted into passing ratio, and the passing distance is calculated based on the passing ratio and the size of the virtual court. The maximum value of the pressing ratio is 1. This embodiment does not impose any special limitation on this mapping relationship.
[0181] For example, the passing distance (virtual_dist) = base distance (basis_dist) + press ratio (press_ratio) * press ratio (press_ratio) * maximum press impact distance (max_dist), that is, the passing distance is equal to the sum of the product of the press ratio and the product of the press ratio and the maximum press impact distance, and the base distance.
[0182] It should be noted that the base distance has a certain mapping relationship with the virtual court. For example, if the size of the virtual court is 30*20, then its corresponding base distance is 5. The maximum distance of pressure impact can be selected according to the actual situation; in this embodiment, 35 can be selected. This embodiment does not make any special limitations on the mapping relationship between the virtual court and the base distance, or on the maximum distance of pressure impact.
[0183] Next, the passing detection point of the virtual sphere can be determined based on the passing distance. The passing detection point is the reachable point of the virtual sphere after passing the distance. For example, the passing detection point (detect_pos) = the position of the controlled virtual object (player_pos) + the unit vector of the passing direction (joystick_direction) * the passing distance (virtual_dist).
[0184] After calculating the passing detection point of the virtual sphere, the distance between each target virtual object and the passing detection point can be calculated. At least one target virtual object is identified as the passing virtual object whose distance from the passing detection point meets the preset condition. The preset condition can be that the distance from the passing detection point is the smallest. In other words, the target virtual object with the smallest distance from the passing point is identified as the passing virtual object.
[0185] Taking through passes in football games as an example, Figure 3 A schematic diagram of the straight-pipe direction provided in an embodiment of this application is shown, as follows: Figure 3As shown, the team to which the controlled virtual object A belongs has two cooperative virtual objects B and C. The direction from the controlled virtual object A to the cooperative virtual object B is denoted as dir_1, and the direction from the controlled virtual object A to the cooperative virtual object C is denoted as direction dir_2.
[0186] The through pass direction (i.e., the passing direction) is directly above dir_3. The angle differences between dir_1, dir_2 and dir_3 are calculated and denoted as θ1 and θ2 respectively. Then, through pass candidate objects (i.e., at least one target virtual object) are determined from multiple collaborative virtual objects. The angle difference corresponding to the through pass candidate is less than or equal to a preset angle (i.e., theta). The specific value of theta can be selected according to the actual situation. In this embodiment, it is recommended to be 50.
[0187] Then, the distance between each through pass candidate and the detection point of the virtual football is calculated, and the through pass candidate with the smallest distance to the detection point of the virtual football is determined as the through pass target object (i.e., the virtual pass object).
[0188] The passing control method in this embodiment determines multiple directions from which a controlled virtual object points to each collaborative virtual object. Based on these multiple directions and the passing direction, a passing virtual object is determined from among the multiple collaborative virtual objects. Using the direction from which the controlled virtual object points to each collaborative virtual object and the passing direction as filtering conditions, a passing virtual object is determined from among the multiple collaborative virtual objects, ensuring that the passing virtual object can successfully receive the virtual ball.
[0189] Figure 4 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 3 ,like Figure 4 As shown, step S103, determining the passing point based on the movement direction of the obtained virtual passing object, may include:
[0190] S301. Based on the direction of movement, determine the passing selection direction of the controlled virtual object pointing to the passing point.
[0191] S302. Determine the passing point based on the direction of movement and the direction of the pass selection.
[0192] The passing selection direction can be the direction in which the controlled virtual object points to the passing point. That is, the passing point is located in the direction of the passing selection. For example, the passing point is located at a 45-degree angle to the upper right corner of the controlled virtual object.
[0193] In this embodiment, the movement direction of the controlled virtual object can be taken into consideration. Based on the movement direction of the controlled virtual object, the passing selection direction of the controlled virtual object pointing to the passing point can be determined. Then, the passing point can be determined based on the movement direction and the passing selection direction.
[0194] In some embodiments, determining the passing point based on the direction of movement and the direction of the passing selection may include:
[0195] Get the angle between the direction of movement and the direction of the pass selection point.
[0196] Determine the passing point in the direction of the pass selection based on the angle between the direction of movement and the direction of the pass selection.
[0197] The included angle can be the deviation angle of the movement direction relative to the passing selection point direction. Calculate the included angle between the movement direction and the passing selection point direction, and then determine the passing point in the passing selection point direction based on the included angle. For example, the distance between the virtual passing object and the passing point can be determined by using a calculation formula corresponding to the angle range, and then the passing point can be determined in the passing selection point direction based on this distance.
[0198] Taking through passes in football games as an example, Figure 5 The diagram illustrates the movement direction and pass selection direction provided in an embodiment of this application, as shown below. Figure 5 As shown, the controlled virtual object is A, the passing virtual object is B, the movement direction of the passing virtual object is denoted as the direction from point O to point M, and the through pass selection direction (i.e., the passing selection direction) is the direction from point O to point N. A point P is selected on the vector ON, the length of OP is denoted as d, and the angle between the movement direction and the passing selection direction is denoted as θ. If θ∈[0 degrees, 80 degrees], then d=k1*θ+b1; if θ∈[80 degrees, 180 degrees], then d=k2*θ+b2. Point P is determined by d, which is the through pass point. Among them, k1, k2, b1, and b2 are preset parameter values, which can be selected according to the actual situation.
[0199] The passing control method in this embodiment determines the passing selection direction of the controlled virtual object towards the passing point based on the movement direction, and then determines the passing point based on both the movement direction and the passing selection direction. By taking the movement direction of the controlled virtual object into account and determining the passing point along the passing selection direction, the accuracy of the passing point is improved, enabling the passing virtual object to successfully receive the virtual ball at the passing point.
[0200] Figure 6 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 4 ,like Figure 6 As shown, step S401, determining the passing selection direction of the controlled virtual object towards the passing point based on the movement direction, may include:
[0201] S401. Based on the virtual goal in the game scene, divide the virtual stadium into a central area and an edge area.
[0202] In the game scene, the virtual goal can include the virtual goal of the team to which the controlled virtual object belongs and the virtual goal of the opposing team (i.e., the opponent's virtual goal). Based on the line connecting the goalposts of the virtual goal of the team to which the controlled virtual object belongs and the goalposts of the opponent's virtual goal, the virtual field can be divided into a central area and an edge area.
[0203] It should be noted that each virtual goal has two goalposts. The central area of the virtual goal is the area formed by the line connecting the corresponding goalposts of the two virtual goals. The edge area of the virtual goal is the area on both sides of the central area, including the upper edge area and the lower edge area.
[0204] If the virtual object for passing is in the center area, steps S402-S406 can be executed; if the virtual object for passing is in the edge area, steps S407-S413 can be executed.
[0205] S402. Connect the virtual passing object and the edge point of the opponent's virtual goal on the goal line to obtain the candidate area for the passing selection point direction.
[0206] In the game scenario, all virtual goals are located outside the virtual field, and the goal lines of the virtual goals are located on the boundary of the virtual field. The edge point of the opponent's virtual goal on the goal line can be the boundary point of the opponent's virtual goal on the virtual field.
[0207] Determine whether the virtual passing object is in the center area of the virtual field. If the virtual passing object is in the center area, connect the virtual passing object and the edge points of the opponent's virtual goal on the goal line to obtain the candidate area for the passing selection point. The edge points of the opponent's virtual goal on the goal line include two points. The candidate area for the passing selection point is the area formed by these two edge points and the virtual passing object.
[0208] S403. If the direction of movement is within the coverage area of the candidate area, then the direction of movement is determined as the direction of passing the ball.
[0209] Determine whether the movement direction of the controlled virtual object is within the coverage area of the candidate area. If the movement direction is within the coverage area of the candidate area, then directly determine that the movement direction as the pass selection direction.
[0210] Taking through passes in football games as an example, Figure 7 A schematic diagram of the virtual court provided in the embodiments of this application is shown. Figure 1 ,like Figure 7As shown, the attack direction corresponding to the virtual ball is to the right, that is, the opponent's virtual goal is the virtual goal on the right. According to the line connecting the goalposts of the two virtual goals in the game scene, the virtual field is divided into a central area, an upper edge area, and a lower edge area. The through pass target object B is in the central area. Connect the through pass target object B and the edge points D and E on the goal line with the opponent's virtual goal. The area formed by the through pass target object B and D and E is determined as the candidate area for the through pass selection point direction. Since the movement direction of the through pass target object B is in this candidate area, the movement direction of the through pass target object B is determined as the through pass selection point direction.
[0211] It should be noted that if the through ball target B is located on the line connecting the goalposts of the two virtual goalposts, it can be determined that it is located in the central area.
[0212] S404. If the movement direction is not within the coverage area of the candidate area, obtain the first direction of the passing virtual object pointing to the first edge point of the opponent's virtual goal on the goal line, and the angle corresponding to the movement direction.
[0213] S405. Obtain the angle between the second direction of the virtual passing object pointing to the opponent's virtual goal on the second edge point of the goal line and the direction of movement.
[0214] S406. The direction corresponding to the minimum value of the angle between the first direction and the direction of movement, and the angle between the second direction and the direction of movement, is determined as the direction for selecting the passing point.
[0215] The edge point of the opponent's virtual goal on the goal line can be the boundary point of the opponent's virtual goal on the virtual field, including the first edge point and the second edge point. If the movement direction of the passing virtual object is not within the coverage area of the candidate area, the first direction of the passing virtual object pointing to the first edge point of the opponent's virtual goal on the goal line and the angle corresponding to the movement direction are determined, and the second direction of the passing virtual object pointing to the second edge point of the opponent's virtual goal on the goal line and the angle corresponding to the movement direction are determined. Then, the direction corresponding to the minimum value of the angle between the first direction and the movement direction and the angle between the second direction and the movement direction is determined as the passing selection direction. That is, if the angle between the first direction and the movement direction is less than the angle between the second direction and the movement direction, the first direction is determined as the passing selection direction. If the angle between the second direction and the movement direction is less than the angle between the first direction and the movement direction, the second direction is determined as the passing selection direction.
[0216] Taking through passes in football games as an example, in Figure 7 On this basis, Figure 8 A schematic diagram of the virtual court provided in the embodiments of this application is shown. Figure 2 ,like Figure 8As shown, if the direction of movement of the through ball target object B is not within the candidate area, then the first direction and the second direction pointing to the first edge point D and the second edge point E of the through ball target object B are obtained. Then, the angle between the first direction and the direction of movement is obtained and denoted as angle 1, and the angle between the second direction and the direction of movement is obtained and denoted as angle 2. The direction corresponding to the minimum value of angle 1 and angle 2 is determined as the passing selection point direction. If angle 1 is less than angle 2, then the first direction is the passing selection point direction.
[0217] S407. Obtain the perpendicular line from the passing virtual object to the goal line of the opponent's virtual goal.
[0218] S408. Based on the intersection of the perpendicular line and the goal line, the edge point of the virtual field, and the edge point of the opponent's virtual goal on the goal line, determine the first moving point and the second moving point in the direction of the goal line.
[0219] S409. Obtain the determination region based on the first moving point and the second moving point.
[0220] S410. If the direction of movement is within the coverage area of the judgment area, then the direction of movement is determined as the direction of passing the ball.
[0221] Determine whether the virtual passing object is in the center area of the virtual field. If the virtual passing object is in the edge area, obtain the perpendicular line from the virtual passing object to the goal line of the opponent's virtual goal. Based on the intersection of the perpendicular line and the goal line, the edge point of the virtual field, and the edge point of the opponent's virtual goal on the goal line, determine the first moving point and the second moving point in the direction of the goal line. The edge point of the virtual field can be the edge point closest to the target edge point of the opponent's virtual goal on the goal line among multiple edge points of the virtual field. The target edge point of the opponent's virtual goal on the goal line can be the edge point closest to the virtual passing object among two edge points of the opponent's virtual goal on the goal line.
[0222] Next, it is determined whether the first moving point and the second moving point are within the virtual court. If both are within the virtual court, the area formed by the first moving point, the second moving point, and the virtual passing object is taken as the judgment area. Then, it is determined whether the movement direction of the virtual passing object is within the coverage of the judgment area. If the movement direction of the virtual passing object is within the coverage of the judgment area, the movement direction is determined as the passing selection direction.
[0223] In some embodiments, step S409, obtaining the determination region based on the first moving point and the second moving point, may include:
[0224] If both the first moving point and the second moving point are within the virtual court, then connect the virtual passing object, the first moving point, and the second moving point to obtain the judgment area.
[0225] If there is a moving point outside the virtual court among the first moving point and the second moving point, then the judgment area is obtained based on the virtual passing object and the target edge point of the virtual court.
[0226] If both the first moving point and the second moving point are within the virtual court, then the passing virtual object, the first moving point, and the second moving point are connected to form a judgment area. If there is a moving point outside the virtual court among the first and second moving points, then the judgment area is formed by connecting the target edge point, which is closest to the first moving point and / or the second moving point, and the passing virtual object among the multiple edge points of the virtual court. The judgment area is obtained by connecting the target edge point, which is the edge point closest to the moving point outside the virtual court among the multiple edge points of the virtual court.
[0227] Taking through passes in football games as an example, Figure 9 This illustration shows a portion of the virtual sports field provided in the embodiments of this application. Figure 1 ,like Figure 9 As shown, taking the virtual through ball object B located in the upper edge region as an example, obtain the perpendicular line d1 from the virtual through ball object B to the goal line of the opponent's virtual goal. The intersection point with the goal line is P. The edge point of the opponent's virtual goal on the goal line is the edge point C closest to the virtual through ball object B, and the edge point farthest from it is D. The edge point of the virtual field is the edge point E closest to C. The distance between CE is L0. Half of the long side of the virtual field is d0, and the length of PD is d2.
[0228] Determine the first moving point Q1, with the length of Q1A1 being D1, satisfying D1 / d2=(d1 / d0)*k1, where k1 is a configuration parameter, with a suggested value of 1, and the position of the first moving point Q1 can be determined. Determine the second moving point Q2, with the distance of Q2D being D2, satisfying D2=k2*(L0-D1), where k2 is a configuration parameter, with a suggested value of 0.5, and the position of the second moving point Q2 can be determined.
[0229] Then, two rays are drawn from the virtual object B to points Q1 and Q2 to form a decision region. It is then determined whether the movement direction of the virtual object B is within the decision region. Figure 9 If the direction of movement is within the coverage area of the judgment zone, then the direction of movement is determined as the direction of passing selection.
[0230] It should be noted that if the first moving point Q1 is selected outside the virtual field, a ray is drawn from the through pass virtual object B to the edge point E of the virtual field and the second moving point Q2 to form a judgment area. If the second moving point Q2 is selected outside the virtual field, a ray is drawn from the through pass virtual object B to the first moving point Q1 and the edge point of the virtual field on the goal line that is closest to the second moving point Q2 to form a judgment area.
[0231] S411. If the direction of movement is not within the coverage area of the judgment area, obtain the third direction of the virtual object of the pass pointing to the first edge point of the judgment area, and the angle between the direction of movement and the direction of movement.
[0232] S412, Obtain the fourth direction of the second edge point of the judgment area pointed to by the virtual object of the pass, and the angle corresponding to the direction of movement.
[0233] S413. The direction corresponding to the minimum value of the angle between the third direction and the direction of movement, and the angle between the fourth direction and the direction of movement, is determined as the direction for selecting the passing point.
[0234] Taking through passes in football games as an example, Figure 10 This illustration shows a portion of the virtual sports field provided in the embodiments of this application. Figure 2 ,exist Figure 9 On the basis of, such as Figure 10 As shown, if the direction of movement is not within the coverage area of the judgment area, the third direction and the fourth direction of the first edge point Q1 and the second edge point Q2 of the judgment area are obtained from the through pass target object B. Then, the angle between the third direction and the direction of movement is obtained, denoted as angle 3, and the angle between the fourth direction and the direction of movement is obtained, denoted as angle 4. The direction corresponding to the minimum value of angle 3 and angle 4 is determined as the passing selection point direction. If angle 3 is less than angle 4, then the third direction is the passing selection point direction.
[0235] It should be noted that if no through ball target is selected, since the through ball target must have a passing direction, the movement direction of the controlled virtual object can be used as the through ball selection direction.
[0236] The passing control method in this embodiment improves the accuracy of the passing selection direction by combining the position of the virtual passing object in the virtual court and the direction of movement of the virtual passing object to determine the passing selection direction, which helps the virtual passing object to successfully receive the virtual ball.
[0237] Figure 11 A flowchart illustrating the passing control method provided in an embodiment of this application is shown. Figure 5 ,like Figure 11 As shown, before step S104, which involves controlling the virtual sphere to move towards the passing point, the method may further include:
[0238] S501. If the distance between the passing point and the virtual wall in the virtual stadium is less than or equal to the preset distance, then adjust the passing point according to the distance from the controlled virtual object to the passing point.
[0239] The preset distance can be determined according to the actual situation, for example, it can be 0.5 meters. The virtual court can be a closed court with virtual walls on all sides. In order to make the virtual ball hit the wall during the passing process, it can also be determined whether the distance between the passing point and the virtual wall in the virtual court is less than or equal to the preset distance. If so, the passing point is adjusted according to the distance from the controlled virtual object to the passing point, so that the distance between the adjusted passing point and the virtual wall is greater than the preset distance.
[0240] In some embodiments, step S501, adjusting the passing point based on the distance from the controlled virtual object to the passing point, includes:
[0241] Obtain a virtual bounding box that is at a preset distance from the virtual wall; draw a circle with the controlled virtual object as the center and the distance from the controlled virtual object to the passing point as the radius; adjust the passing point based on the intersection of the circle and the boundary of the virtual bounding box.
[0242] In this context, the distance between the virtual bounding box and the virtual wall is equal to a preset distance. Taking the virtual wall as the long wall as an example, the virtual bounding box is located inside the virtual wall, and the distance between the virtual bounding box and the virtual wall is equal to the preset distance. A circle is drawn with the controlled virtual object as the center and the distance from the controlled virtual object to the passing point as the radius. Based on the intersection of the circle and the boundary direction of the virtual bounding box, the candidate passing point can be determined, and then the passing point is adjusted based on the candidate passing point.
[0243] In some embodiments, candidate passing points can be obtained based on the intersection points of the circle and the boundary direction of the virtual bounding box. The passing point can be adjusted based on multiple candidate passing points. That is, candidate passing points that can be used to adjust the passing point are determined from multiple candidate passing points, and the determined candidate passing points are used to adjust the passing point.
[0244] In some embodiments, adjusting the passing point based on multiple candidate passing points includes:
[0245] Obtain the distance between each candidate passing point and the virtual bounding box; determine at least one target passing point from multiple candidate passing points whose distance to the virtual bounding box satisfies a preset condition; obtain the passing point pointed to by the controlled virtual object, and the deflection angle of the controlled virtual object pointing to each target passing point; adjust the passing point according to the target passing point corresponding to the smallest deflection angle among at least one target passing point.
[0246] The distance between each candidate passing point and the virtual bounding box is calculated. Then, from multiple candidate passing points, a target passing point is determined that meets a preset condition regarding its distance from the virtual bounding box. The preset condition may be that the distance from the virtual bounding box is no greater than a preset value, such as 0.1 meters, etc. This embodiment does not impose any particular limitation on this. The number of target passing points can be at least one.
[0247] Then, the controlled virtual object points to the passing point, and the deflection angle of the controlled virtual object to each target passing point is calculated. Based on the target passing point corresponding to the smallest deflection angle among at least one target passing point, the passing point is adjusted, that is, the target passing point corresponding to the smallest deflection angle is used to adjust the passing point.
[0248] Taking through passes in football games as an example, Figure 12 A schematic diagram of the virtual wall provided in an embodiment of this application is shown, such as... Figure 12 As shown, a virtual stadium is surrounded by virtual walls. Inside the virtual walls and at a preset distance from the virtual walls, there is a virtual boundary frame. The through pass point (passing point) is denoted as O, and the controlled virtual object is denoted as A. A circle is drawn with the controlled virtual object A as the center and the distance from the controlled virtual object to the passing point O as the radius. The intersection points of the circle and the boundary of the virtual boundary frame are denoted as O1, O2, O3, and O4, which are candidate passing points. Since the distances between O2, O3, and O4 and the virtual boundary frame meet the preset conditions, O2, O3, and O4 are the target passing points. Then, the deflection angles of the controlled virtual object A pointing to the through pass point Q and the controlled virtual object A pointing to O2, O3, and O4 are obtained. If the deflection angle of the controlled virtual object A pointing to the through pass point O and the controlled virtual object A pointing to O4 is the smallest, then the through pass point O is adjusted using O4, that is, the new through pass point is point O4.
[0249] In this embodiment of the passing control method, before controlling the virtual sphere to move towards the passing point, the method may further include: if the distance between the passing point and the virtual wall in the virtual court is less than or equal to a preset distance, then adjusting the passing point based on the distance from the controlled virtual object to the passing point. Adjusting the passing point can prevent the virtual sphere from hitting the wall during the pass, improving the gaming experience.
[0250] Figure 13 This illustration shows a schematic diagram of the structure of a passing control device provided in an embodiment of this application. This passing control device can be integrated into a passing control equipment, such as... Figure 13 As shown, the passing control device 60 may include:
[0251] The acquisition module 601 is used to respond to a passing command for a virtual sphere in the game scene and acquire the passing direction corresponding to the passing command.
[0252] The determining module 602 is used to determine the passing virtual object from multiple collaborative virtual objects of the team where the controlled virtual object is located according to the passing direction, and to determine the passing point according to the movement direction of the obtained passing virtual object;
[0253] The control module 603 is used to control the virtual sphere to move toward the passing point so that the virtual passing object can receive the ball from the passing point.
[0254] In some embodiments, the determining module 602 is specifically used for:
[0255] The controlled virtual object is determined to point to multiple directions from each collaborative virtual object;
[0256] The passing virtual object is determined from the plurality of collaborative virtual objects based on the plurality of directions and the passing direction.
[0257] In some embodiments, the determining module 602 is specifically used for:
[0258] Obtain the angle difference between the plurality of directions and the passing direction;
[0259] Determine whether there exists at least one target virtual object among the plurality of collaborative virtual objects whose angle difference is less than or equal to a preset angle;
[0260] If at least one target virtual object exists, then the passing virtual object is determined from the at least one target virtual object.
[0261] In some embodiments, the determining module 602 is specifically used for:
[0262] The passing time is determined according to the passing instruction;
[0263] Calculate the passing distance based on the passing time and the size of the virtual court in the game scene;
[0264] Based on the passing distance, determine the passing detection point of the virtual sphere;
[0265] The target virtual object whose distance from the pass detection point meets the preset condition among the at least one target virtual objects is identified as the pass virtual object.
[0266] In some embodiments, the determining module 602 is specifically used for:
[0267] Based on the direction of movement, determine the passing selection direction of the controlled virtual object pointing towards the passing point;
[0268] The passing point is determined based on the direction of movement and the direction of passing selection.
[0269] In some embodiments, the determining module 602 is specifically used for:
[0270] Based on the virtual goal in the game scene, the virtual stadium is divided into a central area and an edge area;
[0271] If the virtual passing object is in the central area, then connect the virtual passing object and the edge point of the opponent's virtual goal on the goal line to obtain the candidate area for the passing selection point direction;
[0272] If the direction of movement is within the coverage area of the candidate area, then the direction of movement is determined as the direction of the pass selection point.
[0273] In some embodiments, if the direction of movement is not within the coverage area of the candidate region, the acquisition module 601 is further configured to:
[0274] Obtain the angle between the first direction from which the virtual passing object points to the first edge point of the opponent's virtual goal on the goal line and the direction of movement;
[0275] Obtain the angle between the second direction from which the virtual passing object points to the second edge point of the opponent's virtual goal on the goal line and the direction of movement;
[0276] The determining module 602 is used to determine the direction corresponding to the minimum value of the angle between the first direction and the moving direction and the angle between the second direction and the moving direction as the passing point selection direction.
[0277] In some embodiments, if the virtual passing object is in the edge region, the acquisition module is further configured to:
[0278] Obtain the perpendicular line from the virtual passing object to the goal line of the opponent's virtual goal;
[0279] The determining module is further configured to determine the first moving point and the second moving point in the direction of the goal line based on the intersection of the vertical line and the goal line, the edge point of the virtual field, and the edge point of the opponent's virtual goal on the goal line;
[0280] The acquisition module 601 is further configured to acquire a determination region based on the first moving point and the second moving point;
[0281] The determining module 602 is further configured to determine the moving direction as the passing selection direction if the moving direction is within the coverage area of the determination area.
[0282] In some embodiments, if the moving direction is not within the coverage area of the determination area, the acquisition module 601 is further configured to:
[0283] Obtain the angle between the third direction of the virtual passing object pointing to the first edge point of the judgment area and the direction of movement;
[0284] Obtain the fourth direction from which the virtual passing object points to the second edge point of the judgment area, and the angle between this direction and the direction of movement;
[0285] The determining module 602 is further configured to determine the direction corresponding to the minimum value of the angle between the third direction and the moving direction and the angle between the fourth direction and the moving direction as the passing point selection direction.
[0286] In some embodiments, the acquisition module 601 is specifically used for:
[0287] If both the first moving point and the second moving point are within the virtual court, then connect the virtual passing object, the first moving point, and the second moving point to obtain the determination area;
[0288] If there is a moving point outside the virtual court among the first moving point and the second moving point, then the determination area is obtained based on the passing virtual object and the target edge point of the virtual court, wherein the target edge point is the edge point among the multiple edge points of the virtual court that is closest to the moving point outside the virtual court.
[0289] In some embodiments, the determining module 602 is specifically used for:
[0290] Obtain the angle between the moving direction and the passing point selection direction;
[0291] The passing point is determined in the direction of the passing selection based on the angle between the direction of movement and the direction of the passing selection.
[0292] In some embodiments, it also includes:
[0293] The adjustment module 604 is used to adjust the passing point according to the distance from the controlled virtual object to the passing point if the distance between the passing point and the virtual wall in the virtual court is less than or equal to a preset distance.
[0294] In some embodiments, the adjustment module 604 is specifically used for:
[0295] Obtain a virtual bounding box that is at a distance equal to the preset distance from the virtual wall;
[0296] Draw a circle with the controlled virtual object as the center and the distance from the controlled virtual object to the passing point as the radius;
[0297] The passing point is adjusted based on the intersection point of the circle and the boundary direction of the virtual bounding box.
[0298] In some embodiments, the adjustment module 604 is specifically used for:
[0299] Based on the intersection points of the circle and the boundary direction of the virtual bounding box, multiple candidate passing points are obtained;
[0300] The passing point is adjusted based on the multiple candidate passing points.
[0301] In some embodiments, the adjustment module 604 is specifically used for:
[0302] Obtain the distance between each candidate pass point and the virtual bounding box;
[0303] Determine at least one target passing point from the plurality of candidate passing points whose distance from the virtual bounding box satisfies a preset condition;
[0304] Obtain the controlled virtual object pointing to the passing point, and the deflection angle of the controlled virtual object pointing to each target passing point;
[0305] The passing point is adjusted based on the target passing point corresponding to the smallest deflection angle among the at least one target passing point.
[0306] The implementation process and principle of the passing control device in this embodiment can be found in the relevant description of the above method embodiment, and will not be repeated here.
[0307] Figure 14 A schematic diagram of the structure of the passing control device provided in an embodiment of this application is shown, as follows: Figure 14 As shown, the passing control device 80 includes a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions that can be executed by the processor. When the passing control device 80 is running, the processor 801 communicates with the memory 802 through the bus 803. The processor 801 executes the machine-readable instructions to perform the above-described method embodiment.
[0308] This application also provides a computer-readable storage medium storing a computer program, which is executed by a processor to perform the above-described method embodiments.
[0309] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0310] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0311] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A passing control method, characterized in that, include: In response to a passing command for a virtual sphere in the game scene, obtain the passing direction corresponding to the passing command; Based on the passing direction, the passing virtual object is determined from multiple cooperating virtual objects of the team to which the controlled virtual object belongs; The passing point is determined based on the movement direction of the obtained virtual passing object; Control the virtual sphere to move towards the passing point so that the virtual passing object receives the ball from the passing point; The step of determining the passing point based on the movement direction of the obtained virtual passing object includes: Based on the direction of movement, determine the passing selection direction of the controlled virtual object pointing towards the passing point; Obtain the angle between the moving direction and the passing point selection direction; Based on the angle between the moving direction and the passing selection direction, a passing point is determined in the passing selection direction. The passing point is determined by the distance between the virtual passing object and the passing point, which is determined based on the angle, and then determined in the passing selection direction based on the distance. Determining the passing selection direction of the controlled virtual object towards the passing point based on the movement direction includes: Based on the goalposts of the two virtual goals in the game scene, the virtual stadium is divided into a central area and an edge area; If the virtual passing object is in the central area, then connect the virtual passing object and the edge point of the opponent's virtual goal on the goal line to obtain the candidate area for the passing selection point direction; If the direction of movement is within the coverage area of the candidate area, then the direction of movement is determined as the direction of the pass selection point.
2. The method according to claim 1, characterized in that, The step of determining the passing virtual object from multiple cooperating virtual objects of the team to which the controlled virtual object belongs, based on the passing direction, includes: The controlled virtual object is determined to point to multiple directions from each collaborative virtual object; The passing virtual object is determined from the plurality of collaborative virtual objects based on the plurality of directions and the passing direction.
3. The method according to claim 2, characterized in that, The step of determining the passing virtual object from the plurality of collaborative virtual objects based on the plurality of directions and the passing direction includes: Obtain the angle difference between the plurality of directions and the passing direction; Determine whether there exists at least one target virtual object among the plurality of collaborative virtual objects whose angle difference is less than or equal to a preset angle; If at least one target virtual object exists, then the passing virtual object is determined from the at least one target virtual object.
4. The method according to claim 3, characterized in that, Determining the passing virtual object from the at least one target virtual object includes: The passing time is determined according to the passing instruction; Calculate the passing distance based on the passing time and the size of the virtual court in the game scene; Based on the passing distance, determine the passing detection point of the virtual sphere; The target virtual object whose distance from the pass detection point meets the preset condition among the at least one target virtual objects is identified as the pass virtual object.
5. The method according to claim 1, characterized in that, If the direction of movement is not within the coverage area of the candidate region, the method further includes: Obtain the angle between the first direction from which the virtual passing object points to the first edge point of the opponent's virtual goal on the goal line and the direction of movement; Obtain the angle between the second direction from which the virtual passing object points to the second edge point of the opponent's virtual goal on the goal line and the direction of movement; The direction corresponding to the minimum value between the angle between the first direction and the direction of movement, and the angle between the second direction and the direction of movement, is determined as the passing selection direction.
6. The method according to claim 1, characterized in that, If the virtual passing object is in the edge region, the method further includes: Obtain the perpendicular line from the virtual passing object to the goal line of the opponent's virtual goal; Based on the intersection of the vertical line and the goal line, the edge point of the virtual field, and the edge point of the opponent's virtual goal on the goal line, determine the first moving point and the second moving point in the direction of the goal line; The determination region is obtained based on the first moving point and the second moving point; If the direction of movement is within the coverage area of the determination area, then the direction of movement is determined to be the direction of the pass selection point.
7. The method according to claim 6, characterized in that, If the direction of movement is not within the coverage area of the determination area, the method further includes: Obtain the angle between the third direction of the virtual pass object pointing to the first edge point of the judgment area and the direction of movement; Obtain the fourth direction of the virtual passing object pointing to the second edge point of the judgment area, and the angle between the direction of movement and the direction of movement. The direction corresponding to the minimum value of the angle between the third direction and the direction of movement, and the angle between the fourth direction and the direction of movement, is determined as the passing point selection direction.
8. The method according to claim 6, characterized in that, The step of obtaining the determination region based on the first moving point and the second moving point includes: If both the first moving point and the second moving point are within the virtual court, then connect the virtual passing object, the first moving point, and the second moving point to obtain the determination area; If there is a moving point outside the virtual court among the first moving point and the second moving point, then the determination area is obtained based on the passing virtual object and the target edge point of the virtual court, wherein the target edge point is the edge point among the multiple edge points of the virtual court that is closest to the moving point outside the virtual court.
9. The method according to claim 1, characterized in that, Before controlling the virtual sphere to move towards the passing point, the method further includes: If the distance between the passing point and the virtual wall in the virtual court is less than or equal to a preset distance, the passing point is adjusted according to the distance from the controlled virtual object to the passing point.
10. The method according to claim 9, characterized in that, The step of adjusting the passing point based on the distance from the controlled virtual object to the passing point includes: Obtain a virtual bounding box that is at a distance equal to the preset distance from the virtual wall; Draw a circle with the controlled virtual object as the center and the distance from the controlled virtual object to the passing point as the radius; The passing point is adjusted based on the intersection point of the circle and the boundary direction of the virtual bounding box.
11. The method according to claim 10, characterized in that, The step of adjusting the passing point based on the intersection point of the circle and the boundary direction of the virtual bounding box includes: Based on the intersection points of the circle and the boundary direction of the virtual bounding box, multiple candidate passing points are obtained; The passing point is adjusted based on the multiple candidate passing points.
12. The method according to claim 11, characterized in that, The step of adjusting the passing point based on the multiple candidate passing points includes: Obtain the distance between each candidate pass point and the virtual bounding box; Determine at least one target passing point from the plurality of candidate passing points whose distance from the virtual bounding box satisfies a preset condition; Obtain the controlled virtual object pointing to the passing point, and the deflection angle of the controlled virtual object pointing to each target passing point; The passing point is adjusted based on the target passing point corresponding to the smallest deflection angle among the at least one target passing point.
13. A passing control device, characterized in that, include: The acquisition module is used to respond to a passing command for a virtual sphere in the game scene and acquire the passing direction corresponding to the passing command; The determination module is used to determine the passing virtual object from multiple cooperative virtual objects of the team where the controlled virtual object is located, based on the passing direction, and to determine the passing point based on the movement direction of the obtained passing virtual object; A control module is used to control the virtual sphere to move toward the passing point so that the virtual passing object can receive the ball from the passing point; The determining module is specifically used for: Based on the direction of movement, determine the passing selection direction of the controlled virtual object pointing towards the passing point; Obtain the angle between the moving direction and the passing point selection direction; Based on the angle between the moving direction and the passing selection direction, a passing point is determined in the passing selection direction. The passing point is determined by the distance between the virtual passing object and the passing point, which is determined based on the angle, and then determined in the passing selection direction based on the distance. The determining module is specifically used for: Based on the goalposts of the two virtual goals in the game scene, the virtual stadium is divided into a central area and an edge area; If the virtual passing object is in the central area, then connect the virtual passing object and the edge point of the opponent's virtual goal on the goal line to obtain the candidate area for the passing selection point direction; If the direction of movement is within the coverage area of the candidate area, then the direction of movement is determined as the direction of the pass selection point.
14. A passing control device, characterized in that, include: The system includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the pass control device is in operation, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the method according to any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method according to any one of claims 1-12.
Citation Information
Patent Citations
Game device, method for controlling game device, program, and information storage medium
US20110136557A1