Action interaction method and device of virtual character in game scene and electronic equipment
By adjusting the position and rotation angle of virtual character sampling points, the action performance that adapts to body shape changes is solved, and the problem of pre-designed virtual character action interaction in the prior art is solved, reducing game development costs and improving flexibility.
Patent Information
- Application Number
- CN202311768272.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2043-12-20
AI Technical Summary
In the prior art, when realizing the action interaction of virtual characters, interactive animations need to be designed based on the fixed body shape of the virtual characters in advance, resulting in high game development costs and low flexibility.
By receiving target action interaction requests between virtual characters, obtain the position and rotation angle of the sampling point, adjust the sampling point to adapt to body shape changes, generate the game performance of the action, and avoid redesigning interactive animations.
Reduces game development costs, increases the flexibility of game resources, and allows virtual characters to change in size without redesigning interactive animations.
Smart Images

Figure CN119280815A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of game development technology, and in particular to a method, device and electronic device for action interaction of a virtual character in a game scene. Background Art
[0002] Customizing the body shape of virtual characters in games has always been a topic of great concern to players. With the continuous improvement of game technology, more and more games have begun to provide the function of customizing the body shape of virtual characters, allowing players to adjust the height, shoulder width, leg length and other parameters of the virtual characters according to their own preferences, so that the body shape of the virtual characters becomes more in line with the player's preferences. This can not only satisfy the player's pursuit of beauty, but also increase the playability and sense of immersion of the game.
[0003] However, in the prior art, when implementing the action interaction of virtual characters, it is necessary to design the interaction animation in advance according to the fixed body shape of the virtual characters. For example, when implementing the handshake action between an adult character and another adult character and a child character, it is necessary to design a set of handshake animations between adults and a set of handshake animations between adults and children in advance, and once the body shape of one of the virtual characters changes, the handshake animation needs to be redesigned, which leads to the problems of high game development cost and low flexibility. Summary of the invention
[0004] The present application provides a method, device and electronic device for action interaction of virtual characters in a game scene, so as to solve the problem in the prior art that when realizing the action interaction of virtual characters, the interaction actions need to be designed in advance according to the fixed body shape of the virtual characters, resulting in high game development costs and low flexibility.
[0005] In a first aspect, an embodiment of the present application provides a method for action interaction of a virtual character in a game scene, the method comprising:
[0006] Receiving a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized or pre-configured by a game player;
[0007] In response to the target action interaction request, obtaining a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, wherein the first sampling point is a skeletal part of the first virtual character in contact with the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part of the second virtual character in contact with the first virtual character when completing the target interaction action;
[0008] Determining actual interaction point positions of the first sampling point and the second sampling point according to the first position and the second position;
[0009] Adjusting the positions and rotation angles of the first sampling point and the second sampling point based on the actual interaction point positions and pre-recorded target interaction information, wherein the target interaction information is the relative distance information and relative rotation angle information between the sampling point and the interaction point when two virtual characters of the same body size complete the target interaction action;
[0010] Based on the information of the adjusted first sampling point and the second sampling point, the full body skeleton positions of the first virtual character and the second virtual character are determined respectively, and according to the full body skeleton positions, the game performance of the target interactive action is generated.
[0011] Optionally, the obtaining a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character includes:
[0012] Respectively controlling the first virtual character and the second virtual character to perform action interaction according to a preset standard interaction animation, and controlling the first virtual character and the second virtual character to stop action interaction when reaching a marked frame of the standard interaction animation, wherein the standard interaction animation is an interaction animation pre-made according to an interaction process of a virtual character of the same body size when completing the target interaction action, and the marked frame is a video frame corresponding to the moment when the virtual character starts action interaction in the standard interaction animation;
[0013] The staying position of the first sampling point in the marking frame is determined as the first position, and the staying position of the second sampling point in the marking frame is determined as the second position.
[0014] Optionally, determining actual interaction point positions of the first sampling point and the second sampling point according to the first position and the second position includes:
[0015] Determine, according to the first position and the second position, a distance between the first sampling point and the second sampling point in a target direction, wherein the target direction is consistent with a contact direction between the first sampling point and the second sampling point when the target interaction action is completed;
[0016] According to the distance, a first interaction animation is matched for the first virtual character from a preset interaction animation set, and a second interaction animation is matched for the second virtual character, wherein the distance between the sampling point in the first interaction animation and the sampling point in the second interaction animation is the smallest, and the standard interaction animation belongs to the interaction animation set;
[0017] adjusting the first sampling point from the first position to a third position according to the first interactive animation, and adjusting the second sampling point from the second position to a fourth position according to the second interactive animation;
[0018] A midpoint position between the third position and the fourth position is determined as the actual interaction point position.
[0019] Optionally, adjusting the position and rotation angle of the first sampling point and the second sampling point based on the actual interaction point position and pre-recorded target interaction information includes:
[0020] Acquiring the target interaction information, wherein the target interaction information is determined based on the sampling points and interaction points of the virtual characters of the same body shape in the marked frame;
[0021] Determine, according to the target interaction information, an actual relative distance and an actual relative rotation angle between the first sampling point and the actual interaction point position, and an actual relative distance and an actual relative rotation angle between the second sampling point and the actual interaction point position to complete the target interaction action;
[0022] The positions and rotation angles of the first sampling point and the second sampling point are adjusted according to the actual relative distance and the actual relative rotation angle between the first sampling point and the actual interaction point position, and the actual relative distance and the actual relative rotation angle between the second sampling point and the actual interaction point position.
[0023] Optionally, the determining the full body skeleton positions of the first virtual character and the second virtual character based on the information of the adjusted first sampling point and the second sampling point respectively comprises:
[0024] Acquire a first body parameter of the first virtual character and a second body parameter of the second virtual character;
[0025] Based on the adjusted position information of the first sampling point and the first body shape parameter, the whole body skeleton of the first virtual character is matched in sequence according to a preset matching order to determine the position of the whole body skeleton of the first virtual character; and based on the adjusted position information of the second sampling point and the second body shape parameter, the whole body skeleton of the second virtual character is matched in sequence according to the preset matching order to determine the position of the whole body skeleton of the second virtual character.
[0026] Optionally, the preset matching order is to use the adjusted position information of the first sampling point or the adjusted position information of the second sampling point as the matching starting point, and to match the positions of other bones of the first virtual character or the second virtual character in order from near to far.
[0027] Optionally, the first body shape parameter and the second body shape parameter both include arm length, torso length, leg length, the position of the shoulder bones relative to the sternum and the midpoint position of the two kneecaps;
[0028] The method of matching the whole body skeleton of the first virtual character in sequence according to a preset matching order based on the adjusted position information of the first sampling point and the first body shape parameter to determine the whole body skeleton position of the first virtual character includes:
[0029] In the case where the first sampling point is a hand bone of the first virtual character, determining a shoulder bone position of the first virtual character according to the arm length;
[0030] Determining the position of the sternum of the first virtual character according to the position of the shoulder bone of the first virtual character and the position of the shoulder bone relative to the sternum, and determining the position of the elbow bone of the first virtual character according to the position of the shoulder bone of the first virtual character and the position of the hand bone of the first virtual character;
[0031] Determining the pelvic position of the first virtual character according to the midpoint position of the sternum position of the first virtual character and the positions of the two kneecaps;
[0032] The torso bone position of the first virtual character is determined according to the sternum position of the first virtual character, the pelvic position of the first virtual character and the torso length, and the knee bone position of the first virtual character is determined according to the pelvic position of the first virtual character and the leg length.
[0033] In a second aspect, an embodiment of the present application further provides a device for interacting with a virtual character in a game scene, the device comprising:
[0034] A receiving module, configured to receive a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized by a game player or pre-configured;
[0035] an acquisition module, configured to acquire, in response to the target action interaction request, a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, wherein the first sampling point is a skeletal part at which the first virtual character contacts the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part at which the second virtual character contacts the first virtual character when completing the target interaction action;
[0036] A determination module, configured to determine actual interaction point positions of the first sampling point and the second sampling point according to the first position and the second position;
[0037] an adjustment module, configured to adjust the positions and rotation angles of the first sampling point and the second sampling point based on the actual interaction point positions and pre-recorded target interaction information, wherein the target interaction information is the relative distance information and relative rotation angle information between the sampling point and the interaction point when two virtual characters of the same body size complete the target interaction action;
[0038] A generation module is used to determine the full body skeleton positions of the first virtual character and the second virtual character respectively based on the information of the adjusted first sampling point and the second sampling point, and generate the game performance of the target interactive action according to the full body skeleton positions.
[0039] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0040] Memory, used to store computer programs;
[0041] The processor is used to implement the action interaction method of the virtual character in the game scene described in any one of the first aspects when executing the program stored in the memory.
[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for action interaction of a virtual character in a game scene as described in any one of the first aspects is implemented.
[0043] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by receiving a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized or pre-configured by game players; in response to the target action interaction request, a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character are obtained, wherein the first sampling point is a skeletal part at which the first virtual character contacts the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part at which the first virtual character contacts the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part at which the first virtual character contacts the second virtual character when completing the target interaction action. The skeletal parts of the two virtual characters that contact with the first virtual character when completing the target interactive action; according to the first position and the second position, determine the actual interactive point positions of the first sampling point and the second sampling point; based on the actual interactive point positions and the pre-recorded target interactive information, adjust the positions and rotation angles of the first sampling point and the second sampling point, wherein the target interactive information is the relative distance information and relative rotation angle information of the sampling points and the interactive points when two virtual characters of the same body size complete the target interactive action; based on the adjusted information of the first sampling point and the second sampling point, respectively determine the whole body skeletal positions of the first virtual character and the second virtual character, and generate the game performance of the target interactive action according to the whole body skeletal positions. Through the above method, the actual interactive point positions of the first sampling point and the second sampling point when performing the target interactive action can be determined according to the first position corresponding to the first sampling point of the first virtual character and the second position corresponding to the second sampling point of the second virtual character, and then the whole body skeletal positions of the first virtual character and the second virtual character can be determined according to the actual interactive point positions, so as to realize the game performance of the target interactive action between the first virtual character and the second virtual character. In this way, even if the body shapes of the first virtual character and the second virtual character change, there is no need to redesign new interactive animations, thereby reducing game development costs and improving the flexibility of game resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0047] Figure 1 A schematic diagram of a flow chart of a method for interactive actions of a virtual character in a game scene provided by an embodiment of the present application;
[0048] Figure 2 A schematic diagram of a flow chart of another method for interacting with virtual characters in a game scene provided by an embodiment of the present application;
[0049] Figure 3 A schematic diagram of the structure of a motion interaction device for a virtual character in a game scene provided by an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0052] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0053] In order to solve the problem in the prior art that when realizing the action interaction of virtual characters, it is necessary to design the interactive animation in advance according to the fixed body shape of the virtual characters, resulting in high game development costs and low flexibility, the present application provides a method, device and electronic device for action interaction of virtual characters in a game scene, which can reduce the cost of game development and improve the flexibility of game resources.
[0054] See also Figure 1 , Figure 1The present invention provides a flowchart of a method for interactively performing actions of a virtual character in a game scene. Figure 1 As shown, the action interaction method of the virtual character in the game scene may include the following steps:
[0055] Step 101: receiving a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized by game players or pre-configured.
[0056] Specifically, the first virtual character and the second virtual character may be different virtual characters in the same game scene, which may be a player character in the game application (i.e., the body shape of the character may be customized by the game player), or a non-player character in the game application (i.e., the body shape of the character has been pre-configured in the game application, and the body shape of the character cannot be adjusted at will). The target action interaction request is used to request the second virtual character to complete a target interaction action with the first virtual character, such as handshake, kiss, hug, and other interaction actions.
[0057] In this step, when the first virtual character wants to complete the target interaction action with the second virtual character, the first virtual character can send a target action interaction request to the second virtual character, requesting the second virtual character to complete the target interaction action with the first virtual character. It should be noted that the second virtual character in the embodiment of the present application can be one virtual character or multiple virtual characters. For example, when character A sends a handshake action request to character B and character C at the same time, the first virtual character is character A, and the second virtual character is character B and character C.
[0058] Step 102: In response to the target action interaction request, obtain a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, wherein the first sampling point is a skeletal part of the first virtual character that contacts with the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part of the second virtual character that contacts with the first virtual character when completing the target interaction action.
[0059] Specifically, the first sampling point is the bone part of the first virtual character that contacts the second virtual character when completing the target interactive action, and the second sampling point is the bone part of the second virtual character that contacts the first virtual character when completing the target interactive action. For example, when the target interactive action between the first virtual character and the second virtual character is a handshake action, the first sampling point is the hand bone of the first virtual character, and the second sampling point is the hand bone of the second virtual character. When the target interactive action between the first virtual character and the second virtual character is a kissing action, the first sampling point is the head bone of the first virtual character, and the second sampling point is the head bone of the second virtual character, etc.
[0060] In this step, after receiving the target action interaction request sent by the first virtual character to the second virtual character, in response to the target action interaction request, the first sampling point of the first virtual character and the second sampling point of the second virtual character can be determined according to the type of the target interaction action requested by the target action interaction request, and then the first sampling point of the first virtual character and the second sampling point of the second virtual character can be directly sampled according to the positions of the first virtual character and the second virtual character in the game screen to obtain the first position corresponding to the first sampling point of the first virtual character and the second position corresponding to the second sampling point of the second virtual character; or the first virtual character and the second virtual character can be controlled to perform action interaction according to a preset standard interaction animation, and the first virtual character and the second virtual character can be controlled to stop the action interaction when the marked frame of the standard interaction animation is reached, and then the first position is determined according to the stop position of the first sampling point in the marked frame, and the second position is determined according to the stop position of the second sampling point.
[0061] Step 103: Determine actual interaction point positions of the first sampling point and the second sampling point according to the first position and the second position.
[0062] Specifically, the above-mentioned actual interaction point position refers to the interaction position when the first sampling point of the first virtual character and the second sampling point of the second virtual character perform the target interaction action. Taking the handshake action as an example, the first sampling point is the hand skeleton of the first virtual character, and the second sampling point is the hand skeleton of the second virtual character. The actual interaction point position is the position where the palms of both parties are clasped. As an optional implementation, the actual interaction point position can be the midpoint between the first sampling point and the second sampling point, or a position close to the midpoint.
[0063] Step 104: Based on the actual interaction point position and the pre-recorded target interaction information, the position and rotation angle of the first sampling point and the second sampling point are adjusted, wherein the target interaction information is the relative distance information and relative rotation angle information between the sampling point and the interaction point when two virtual characters of the same body size complete the target interaction action.
[0064] Specifically, the target interaction information is obtained based on a pre-made standard interaction animation, where the standard interaction animation refers to the interaction animation when a virtual character performs a target interaction action with a character of the same body size. When obtaining the target interaction information, the animation file of the standard interaction animation can be called and played for two virtual characters of the same body size at the same time, and then the relative distance information and relative rotation angle information between the sampling point and the interaction point when the two virtual characters of the same body size complete the target interaction action are recorded and used as the target interaction information.
[0065] In this step, after the actual interaction point position is obtained, the position and rotation angle of the first sampling point and the second sampling point can be adjusted according to the actual interaction point position and the pre-recorded target interaction information, so that the first sampling point and the second sampling point can meet the execution conditions for completing the target interaction action.
[0066] Step 105: Based on the information of the adjusted first sampling point and the second sampling point, the full body skeleton positions of the first virtual character and the second virtual character are determined respectively, and according to the full body skeleton positions, a game performance of the target interactive action is generated.
[0067] In this step, after determining the adjusted position and rotation angle of the first sampling point, as well as the position and rotation angle of the second sampling point, the full body skeletons of the first virtual character and the second virtual character can be matched to corresponding positions using Inverse Kinematics (IK), thereby obtaining the full body skeleton positions of the first virtual character and the second virtual character. The game application can then generate a game performance of a target interactive action based on the full body skeleton positions of the first virtual character and the second virtual character, such as generating a game screen of the first virtual character and the second virtual character shaking hands or kissing.
[0068] In this embodiment, the actual interaction point position of the first sampling point and the second sampling point when performing the target interaction action can be determined according to the first position corresponding to the first sampling point of the first virtual character and the second position corresponding to the second sampling point of the second virtual character, and then the whole body skeletal position of the first virtual character and the second virtual character can be determined according to the actual interaction point position to achieve the game performance of the target interaction action between the first virtual character and the second virtual character. In this way, even if the body shapes of the first virtual character and the second virtual character change, there is no need to redesign a new interaction animation, thereby reducing the cost of game development and improving the flexibility of game resources.
[0069] Furthermore, the above step 102, obtaining a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, specifically includes:
[0070] Respectively controlling the first virtual character and the second virtual character to perform action interaction according to a preset standard interaction animation, and controlling the first virtual character and the second virtual character to stop the action interaction when reaching a marked frame of the standard interaction animation, wherein the standard interaction animation is an interaction animation pre-made according to the interaction process of virtual characters of the same body size when completing a target interaction action, and the marked frame is a video frame corresponding to the moment when the virtual character starts the action interaction in the standard interaction animation;
[0071] The staying position of the first sampling point in the marked frame is determined as the first position, and the staying position of the second sampling point in the marked frame is determined as the second position.
[0072] Specifically, the standard interactive animation is an interactive animation artificially created in advance based on the interactive process of virtual characters of the same body size when completing the target interactive action. For example, when the target interactive action is a handshake action, the standard interactive animation is an animation of the arm swinging up and down in the horizontal direction, and the marked frame of the standard interactive animation can be the frame in which the arm is just in the horizontal direction.
[0073] In one embodiment, after receiving a target action interaction request sent by a first virtual character to a second virtual character, in response to the target action interaction request, a first sampling point of the first virtual character and a second sampling point of the second virtual character can be determined according to the type of the target interaction action requested by the target action interaction request, and then the first virtual character and the second virtual character are controlled to perform action interaction according to a preset standard interaction animation, respectively, and the first virtual character and the second virtual character are controlled to stop action interaction when a marked frame of the standard interaction animation is reached, and then the first sampling point and the second sampling point are sampled, and the stop position of the first sampling point in the marked frame is determined as the first position, and the stop position of the second sampling point is determined as the second position.
[0074] In this way, by sampling the first sampling point and the second sampling point respectively when the first virtual character and the second virtual character perform the standard interaction animation, the distance between the first sampling point and the second sampling point without any interference can be obtained, which makes it convenient to select the interaction animation corresponding to the first virtual character and the second virtual character from the preset interaction animation set according to the distance between the two, so as to determine the actual interaction point position.
[0075] Furthermore, the above step 103, determining the actual interaction point position of the first sampling point and the second sampling point according to the first position and the second position, includes:
[0076] Determine, according to the first position and the second position, a distance between the first sampling point and the second sampling point in a target direction, wherein the target direction is consistent with a contact direction of the first sampling point and the second sampling point when completing a target interaction action;
[0077] According to the distance, a first interactive animation is matched for the first virtual character from a preset interactive animation set, and a second interactive animation is matched for the second virtual character, wherein the distance between the sampling point in the first interactive animation and the sampling point in the second interactive animation is the smallest, and the standard interactive animation belongs to the interactive animation set;
[0078] Adjusting the first sampling point from the first position to the third position according to the first interactive animation, and adjusting the second sampling point from the second position to the fourth position according to the second interactive animation;
[0079] A midpoint position between the third position and the fourth position is determined as the actual interaction point position.
[0080] Specifically, the above interactive animation set includes non-standard interactive animations in addition to standard interactive animations. Continuing with the handshake action as an example, the non-standard interactive animations may be a handshake animation with the arm slightly raised and a handshake animation with the arm slightly extended. The above target direction refers to the contact direction of the first sampling point and the second sampling point when the target interactive action is completed. Since the height of the virtual character is the most influential factor in the target interactive action among the body shape parameters, for most target interactive actions, the target interactive direction is the vertical direction.
[0081] In one embodiment, when determining the actual interaction point position of the first sampling point and the second sampling point, the distance between the first sampling point and the second sampling point in the target direction can be determined first according to the first position and the second position, and then the first interaction animation is matched for the first virtual character from the preset interaction animation set according to the acquired distance, and the second interaction animation is matched for the second virtual character. Taking the handshake action as an example, if the hand bones of the first virtual character and the second virtual character extending their arms are close in the vertical direction, it means that the first virtual character and the second virtual character are similar in size, and the first virtual character and the second virtual character match the standard handshake animation. If the hand bones of the first virtual character and the second virtual character extending their arms are apart in the vertical direction beyond a preset threshold, the party with the higher hand bone plays a handshake animation with the arm extended downward, and the party with the lower hand bone plays a handshake animation with the arm extended upward. In this way, the first sampling point can be adjusted from the first position to the third position according to the first interaction animation, and the second sampling point can be adjusted from the second position to the fourth position according to the second interaction animation, and then the midpoint position between the third position and the fourth position is determined as the actual interaction point position.
[0082] Through the above method, the corresponding interaction animations can be matched for the first virtual character and the second virtual character from the preset interaction animation set, so that the distance between the first sampling point and the second sampling point is minimized without interference. This not only reduces the later adjustment distance between the first sampling point and the second sampling point, but also allows the interaction animation of each virtual character to be adapted to its body shape, so that the first virtual character and the second virtual character are more vivid and lifelike when performing target action interaction.
[0083] Furthermore, the above step 104, adjusting the position and rotation angle of the first sampling point and the second sampling point based on the actual interaction point position and the pre-recorded target interaction information, includes:
[0084] Obtaining target interaction information, wherein the target interaction information is determined based on sampling points and interaction points of virtual characters of the same body shape in the marked frame;
[0085] Determine, according to the target interaction information, an actual relative distance and an actual relative rotation angle between a first sampling point and an actual interaction point position, and an actual relative distance and an actual relative rotation angle between a second sampling point and an actual interaction point position to complete the target interaction action;
[0086] The positions and rotation angles of the first sampling point and the second sampling point are adjusted according to the actual relative distance and the actual relative rotation angle between the first sampling point and the actual interaction point position, and the actual relative distance and the actual relative rotation angle between the second sampling point and the actual interaction point position.
[0087] Specifically, the target interaction information refers to information determined based on the sampling points and interaction points of virtual characters of the same body shape in the marking frame, and the target interaction information may include information such as the relative distance and relative rotation angle between the sampling point and the interaction point.
[0088] In one embodiment, when adjusting the position and rotation angle of the first sampling point and the second sampling point, it is necessary to first obtain target interaction information, and then determine the actual relative distance and actual relative rotation angle between the first sampling point and the actual interaction point position, and the actual relative distance and actual relative rotation angle between the second sampling point and the actual interaction point position to complete the target interaction action according to the target interaction information, and then adjust the position and rotation angle of the first sampling point and the second sampling point according to the actual relative distance and actual relative rotation angle between the first sampling point and the actual interaction point position, and the actual relative distance and actual relative rotation angle between the second sampling point and the actual interaction point position. In this way, it can be ensured that the adjusted first sampling point and the second sampling point can cooperate with each other to complete the target interaction action.
[0089] Further, the above step 105, based on the information of the adjusted first sampling point and the second sampling point, respectively determines the whole body skeleton positions of the first virtual character and the second virtual character, respectively determines the whole body skeleton positions of the first virtual character and the second virtual character, including:
[0090] Obtaining a first body shape parameter of the first virtual character and a second body shape parameter of the second virtual character;
[0091] Based on the adjusted position information of the first sampling point and the first body shape parameter, the whole body skeleton of the first virtual character is matched in sequence according to a preset matching order to determine the position of the whole body skeleton of the first virtual character; and based on the adjusted position information of the second sampling point and the second body shape parameter, the whole body skeleton of the second virtual character is matched in sequence according to a preset matching order to determine the position of the whole body skeleton of the second virtual character.
[0092] Specifically, the first body shape parameter and the second body shape parameter may include but are not limited to parameters such as arm length, torso length, leg length, the position of the shoulder bones relative to the sternum, and the midpoint position of the two kneecaps. The preset matching order may be pre-set according to the type of the target interactive action. For example, when the target interactive action is a handshake action, the preset matching order is hand bones-shoulder bones-sternum bones-pelvic bones-trunk bones-elbow bones-knee bones; when the target interactive action is a kissing action, the preset matching order is head bones-shoulder bones-sternum bones-pelvic bones-trunk bones-limb bones, etc.
[0093] In one embodiment, when determining the full body skeleton position of the first virtual character and the second virtual character, the first body shape parameter of the first virtual character and the second body shape parameter of the second virtual character can be obtained first, and then based on the position information of the adjusted first sampling point and the first body shape parameter, the full body skeleton of the first virtual character is matched in sequence according to a preset matching order to determine the full body skeleton position of the first virtual character, and based on the position information of the adjusted second sampling point and the second body shape parameter, the full body skeleton of the second virtual character is matched in sequence according to a preset matching order to determine the full body skeleton position of the second virtual character. In this way, the game performance of the target interactive action generated according to the full body skeleton position of the first virtual character and the second virtual character can be made more natural and realistic. Taking the handshake action as an example, when the sampling point position of a virtual character is very low, the virtual character can be made to bend its legs and waist to conform to the movement of the human body.
[0094] Furthermore, the preset matching order is to use the adjusted position information of the first sampling point or the adjusted position information of the second sampling point as the matching starting point, and to match the positions of other bones of the first virtual character or the second virtual character in order from near to far.
[0095] In one embodiment, when performing full-body skeleton matching, IK can be used to achieve it, that is, first use the adjusted position information of the first sampling point or the adjusted position information of the second sampling point as the matching starting point, and then match the positions of other bones of the first virtual character or the second virtual character in order from near to far. For example, when the target interactive action is a handshake action, the preset matching order is hand bones-shoulder bones-elbow bones and sternum bones-pelvic bones-trunk bones-knee bones. In this way, the game performance of the target interactive action generated according to the full-body skeleton positions of the first virtual character and the second virtual character can be made more natural and realistic. Taking the handshake action as an example, when the sampling point position of a virtual character is very low, the virtual character can be made to bend his legs and bend his waist to conform to human body movements.
[0096] Further, the first body shape parameter and the second body shape parameter both include arm length, torso length, leg length, the position of the shoulder bones relative to the sternum and the midpoint position of the two kneecaps;
[0097] The above step 105, based on the adjusted position information of the first sampling point and the first body shape parameter, sequentially matches the whole body skeleton of the first virtual character in a preset matching order to determine the whole body skeleton position of the first virtual character, includes:
[0098] In the case where the first sampling point is a hand bone of the first virtual character, determining a shoulder bone position of the first virtual character according to the arm length;
[0099] Determine the sternum position of the first virtual character according to the shoulder bone position of the first virtual character and the position of the shoulder bone relative to the sternum, and determine the elbow bone position of the first virtual character according to the shoulder bone position of the first virtual character and the hand bone position of the first virtual character;
[0100] Determining the pelvic position of the first virtual character according to the midpoint position of the sternum position and the positions of both kneecaps of the first virtual character;
[0101] The torso bone position of the first virtual character is determined according to the sternum position of the first virtual character, the pelvic position of the first virtual character and the torso length, and the knee bone position of the first virtual character is determined according to the pelvic position and the leg length of the first virtual character.
[0102] In one embodiment, when the first sampling point is the hand skeleton of the first virtual character, that is, the target interactive action is a handshake action, it can be determined whether the distance from the hand skeleton to the shoulder skeleton exceeds the arm length. If the distance from the hand skeleton to the shoulder skeleton exceeds the arm length, the position of the shoulder skeleton is moved to the position of the hand skeleton so that the distance from the hand skeleton to the shoulder skeleton does not exceed the arm length. After determining the position of the shoulder skeleton, the position of the sternum can be determined according to the position of the shoulder skeleton and the position of the shoulder skeleton relative to the sternum. In addition, the position of the elbow skeleton can be calculated using the TwoBoneIK algorithm (i.e., an inverse kinematics solution algorithm applicable to two-dimensional and three-dimensional skeletal systems) with the hand skeleton as the target skeleton, the elbow skeleton as the action skeleton, and the shoulder skeleton as the root skeleton. After determining the position of the sternum, the position of the pelvis can be calculated using the TwoBoneIK algorithm with the sternum as the target skeleton, the midpoint position of the two kneecap positions as the root skeleton, and the pelvis as the action skeleton. After calculating the position of the pelvis, the sternum can be used as the target bone and the pelvis as the root bone, and the forward and backward reaching inverse kinematics (FABRIK) can be used to calculate the position of the trunk bones. After calculating the position of the trunk bones, the foot bones (which are determined based on the position of the pelvis and the length of the legs) can be used as the target bones, the knees as the action bones, and the pelvis as the root bone, and the TwoBoneIK algorithm can be used to calculate the position of the knee bones. In this way, the whole body bone position of the virtual character when performing the target interactive action can be accurately obtained, thereby achieving the game performance of the target interactive action.
[0103] In one embodiment, the action interaction process of the virtual character in the game scene provided by the embodiment of the present application is as follows: Figure 2 As shown, it includes a resource preparation phase and an interactive use phase, which may specifically include the following steps:
[0104] Step 201: Set candidate sampling points.
[0105] A plurality of candidate sampling points are set up on the virtual character, such as the hand bones, elbow bones, pelvis bones, knee bones, foot bones, etc. of the virtual character as candidate sampling points.
[0106] Step 202: Create an interactive animation group (ie, the interactive animation set mentioned above).
[0107] Art students will create a set of interactive animations, including standard interactive animations and non-standard interactive animations. Standard interactive animations are animations that can complete interactive actions without any interference under standard body shapes. Taking handshake animations as an example, art students need to create a set of standard handshake animations with virtual characters of the same body shape, as well as a set of handshake animations with the arm slightly raised and a handshake animation with the arm slightly extended, etc., as non-standard interactive animations.
[0108] Step 203: Establish a marker frame.
[0109] Set a marker frame for the standard interaction animation. The marker frame of the handshake animation should be the frame where you extend your hand and hold the other person's hand.
[0110] Step 204: Set the sampling points required for the target interactive action.
[0111] When setting the required sampling points for the target interaction action, you can select from the aforementioned candidate sampling points. The sampling point of the handshake action is the hand bone of the outstretched hand.
[0112] Step 205: record the relative information between the sampling points and the interaction points in the standard interactive animation (ie, the target interaction information mentioned above).
[0113] Control both virtual characters to play the standard interactive animation and stop at the marked frame. At this time, both virtual characters can complete the interactive effect. Assume that the midpoint of the sampling points of both virtual characters is the interaction point, and record the relative position and rotation angle of the sampling points of both virtual characters relative to the interaction point, which can also be called the interactive position and interactive rotation.
[0114] Step 206: Play the adaptation animation.
[0115] Both virtual characters play the standard interactive animation and stay until the marked frame. Then find the corresponding sampling points of both virtual characters, calculate the positions of the sampling points of both virtual characters, and select the appropriate interactive animation from the interactive animation group. Taking the handshake action as an example, if the hand bone positions of both virtual characters are similar, both virtual characters will select the standard handshake animation. If the difference in the hand bone positions of both virtual characters exceeds the preset threshold, the higher one plays the handshake animation with the arm extended downward, and the lower one plays the handshake animation with the arm extended upward.
[0116] Step 207: Calculate the actual interaction points between the two virtual characters.
[0117] The midpoint of the sampling points of both virtual characters is taken as the actual interaction point.
[0118] Step 208: Sampling point position matching.
[0119] According to the relative information between the sampling point and the interaction point recorded in step 205, the position and rotation of the skeleton of the sampling points of both virtual characters are adjusted.
[0120] Step 209: Use the full body IK algorithm to calculate the skeleton positions of both virtual characters.
[0121] In this embodiment, one or a group of animation files can be used to complete the action interaction between characters of different body shapes, thereby greatly reducing the workload of action art and the size of the project package. In addition, the function of customizing the body shape of the character can also be used to realize the action interaction of the character of the customized body shape.
[0122] See also Figure 3 , Figure 3 This is a schematic diagram of a structure of a motion interaction device for a virtual character in a game scene provided by an embodiment of the present application. Figure 3 As shown, the device 300 includes:
[0123] The receiving module 301 is used to receive a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized by a game player or pre-configured;
[0124] An acquisition module 302 is used to acquire, in response to a target action interaction request, a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, wherein the first sampling point is a skeletal part of the first virtual character that contacts with the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part of the second virtual character that contacts with the first virtual character when completing the target interaction action;
[0125] A determination module 303, configured to determine actual interaction point positions of the first sampling point and the second sampling point according to the first position and the second position;
[0126] An adjustment module 304 is used to adjust the position and rotation angle of the first sampling point and the second sampling point based on the actual interaction point position and the pre-recorded target interaction information, wherein the target interaction information is the relative distance information and relative rotation angle information between the sampling point and the interaction point when two virtual characters of the same body size complete the target interaction action;
[0127] The generation module 305 is used to determine the whole body skeleton positions of the first virtual character and the second virtual character respectively based on the information of the adjusted first sampling point and the second sampling point, and generate the game performance of the target interactive action according to the whole body skeleton positions.
[0128] Furthermore, the acquisition module 302 includes:
[0129] A control submodule, for controlling the first virtual character and the second virtual character to perform action interaction according to a preset standard interaction animation, and controlling the first virtual character and the second virtual character to stop action interaction when reaching a marked frame of the standard interaction animation, wherein the standard interaction animation is an interaction animation pre-made according to the interaction process of virtual characters of the same body size when completing a target interaction action, and the marked frame is a video frame corresponding to the moment when the virtual character starts to perform action interaction in the standard interaction animation;
[0130] The first determining submodule is used to determine the stay position of the first sampling point in the marked frame as the first position, and determine the stay position of the second sampling point in the marked frame as the second position.
[0131] Further, the determination module 303 includes:
[0132] A second determination submodule is used to determine the distance between the first sampling point and the second sampling point in a target direction according to the first position and the second position, wherein the target direction is consistent with the contact direction of the first sampling point and the second sampling point when completing the target interaction action;
[0133] A matching submodule, for matching a first interactive animation for the first virtual character from a preset interactive animation set according to the distance, and matching a second interactive animation for the second virtual character, wherein the distance between the sampling point in the first interactive animation and the sampling point in the second interactive animation is the smallest, and the standard interactive animation belongs to the interactive animation set;
[0134] A first adjustment submodule, configured to adjust the first sampling point from the first position to the third position according to the first interactive animation, and to adjust the second sampling point from the second position to the fourth position according to the second interactive animation;
[0135] The third determining submodule is used to determine the midpoint position between the third position and the fourth position as the actual interaction point position.
[0136] Furthermore, the adjustment module 304 includes:
[0137] A first acquisition submodule is used to acquire target interaction information, wherein the target interaction information is determined based on sampling points and interaction points of virtual characters of the same body shape in the marked frame;
[0138] a fourth determination submodule, configured to determine, based on the target interaction information, an actual relative distance and an actual relative rotation angle between the first sampling point and the actual interaction point position, and an actual relative distance and an actual relative rotation angle between the second sampling point and the actual interaction point position to complete the target interaction action;
[0139] The second adjustment submodule is used to adjust the position and rotation angle of the first sampling point and the second sampling point according to the actual relative distance and the actual relative rotation angle between the first sampling point and the actual interaction point position, and the actual relative distance and the actual relative rotation angle between the second sampling point and the actual interaction point position.
[0140] Furthermore, the generating module 305 includes:
[0141] A second acquisition submodule is used to acquire a first body shape parameter of the first virtual character and a second body shape parameter of the second virtual character;
[0142] The fifth determination submodule is used to match the whole body skeleton of the first virtual character in sequence according to a preset matching order based on the adjusted position information of the first sampling point and the first body shape parameter to determine the whole body skeleton position of the first virtual character, and to match the whole body skeleton of the second virtual character in sequence according to a preset matching order based on the adjusted position information of the second sampling point and the second body shape parameter to determine the whole body skeleton position of the second virtual character.
[0143] Furthermore, the preset matching order is to use the adjusted position information of the first sampling point or the adjusted position information of the second sampling point as the matching starting point, and to match the positions of other bones of the first virtual character or the second virtual character in order from near to far.
[0144] Further, the first body shape parameter and the second body shape parameter both include arm length, torso length, leg length, the position of the shoulder bones relative to the sternum and the midpoint position of the two kneecaps; the generation module 305 includes:
[0145] A sixth determination submodule, for determining a shoulder bone position of the first virtual character according to an arm length when the first sampling point is a hand bone of the first virtual character;
[0146] a seventh determination submodule, for determining the position of the sternum of the first virtual character according to the position of the shoulder bone of the first virtual character and the position of the shoulder bone relative to the sternum, and determining the position of the elbow bone of the first virtual character according to the position of the shoulder bone of the first virtual character and the position of the hand bone of the first virtual character;
[0147] an eighth determination submodule, for determining a pelvic position of the first virtual character according to a midpoint position of a sternum position and a position of both kneecaps of the first virtual character;
[0148] The ninth determination submodule is used to determine the torso bone position of the first virtual character according to the sternum position of the first virtual character, the pelvic position of the first virtual character and the torso length, and to determine the knee bone position of the first virtual character according to the pelvic position and the leg length of the first virtual character.
[0149] It should be noted that the device 300 can implement the action interaction method of the virtual character in the game scene provided by any of the aforementioned method embodiments, and can achieve the same technical effect, which will not be described one by one here.
[0150] like Figure 4 As shown, the embodiment of the present application further provides an electronic device, including a processor 411, a communication interface 412, a memory 413 and a communication bus 414, wherein the processor 411, the communication interface 412, and the memory 413 communicate with each other through the communication bus 414.
[0151] Memory 413, used for storing computer programs;
[0152] In one embodiment of the present application, the processor 411 is used to execute the program stored in the memory 413 to implement the action interaction method of the virtual character in the game scene provided by any of the above method embodiments, including:
[0153] Receiving a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized by a game player or pre-configured;
[0154] In response to the target action interaction request, obtaining a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, wherein the first sampling point is a skeletal part of the first virtual character in contact with the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part of the second virtual character in contact with the first virtual character when completing the target interaction action;
[0155] Determine the actual interaction point position of the first sampling point and the second sampling point according to the first position and the second position;
[0156] Adjusting the positions and rotation angles of the first sampling point and the second sampling point based on the actual interaction point positions and the pre-recorded target interaction information, wherein the target interaction information is the relative distance information and relative rotation angle information between the sampling point and the interaction point when two virtual characters of the same body size complete the target interaction action;
[0157] Based on the information of the adjusted first sampling point and the second sampling point, the full body skeleton positions of the first virtual character and the second virtual character are determined respectively, and according to the full body skeleton positions, a game performance of the target interactive action is generated.
[0158] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the action interaction method of a virtual character in a game scene provided by any of the aforementioned method embodiments is implemented.
[0159] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0161] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0162] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for interactive action of a virtual character in a game scene, characterized in that: The method comprises: Receiving a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized or pre-configured by a game player; In response to the target action interaction request, obtaining a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, wherein the first sampling point is a skeletal part of the first virtual character in contact with the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part of the second virtual character in contact with the first virtual character when completing the target interaction action; Determining actual interaction point positions of the first sampling point and the second sampling point according to the first position and the second position; Adjusting the positions and rotation angles of the first sampling point and the second sampling point based on the actual interaction point positions and pre-recorded target interaction information, wherein the target interaction information is the relative distance information and relative rotation angle information between the sampling point and the interaction point when two virtual characters of the same body size complete the target interaction action; Based on the information of the adjusted first sampling point and the second sampling point, the full body skeleton positions of the first virtual character and the second virtual character are determined respectively, and according to the full body skeleton positions, the game performance of the target interactive action is generated.
2. The method according to claim 1, characterized in that The obtaining of a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character includes: Respectively controlling the first virtual character and the second virtual character to perform action interaction according to a preset standard interaction animation, and controlling the first virtual character and the second virtual character to stop action interaction when reaching a marked frame of the standard interaction animation, wherein the standard interaction animation is an interaction animation pre-made according to an interaction process of a virtual character of the same body size when completing the target interaction action, and the marked frame is a video frame corresponding to the moment when the virtual character starts action interaction in the standard interaction animation; The staying position of the first sampling point in the marking frame is determined as the first position, and the staying position of the second sampling point in the marking frame is determined as the second position.
3. The method according to claim 2, characterized in that The determining, according to the first position and the second position, actual interaction point positions of the first sampling point and the second sampling point includes: Determine, according to the first position and the second position, a distance between the first sampling point and the second sampling point in a target direction, wherein the target direction is consistent with a contact direction between the first sampling point and the second sampling point when the target interaction action is completed; According to the distance, a first interaction animation is matched for the first virtual character from a preset interaction animation set, and a second interaction animation is matched for the second virtual character, wherein the distance between the sampling point in the first interaction animation and the sampling point in the second interaction animation is the smallest, and the standard interaction animation belongs to the interaction animation set; adjusting the first sampling point from the first position to a third position according to the first interactive animation, and adjusting the second sampling point from the second position to a fourth position according to the second interactive animation; A midpoint position between the third position and the fourth position is determined as the actual interaction point position.
4. The method according to claim 2, characterized in that: The adjusting the position and the rotation angle of the first sampling point and the second sampling point based on the actual interaction point position and the pre-recorded target interaction information includes: Acquiring the target interaction information, wherein the target interaction information is determined based on the sampling points and interaction points of the virtual characters of the same body shape in the marked frame; Determine, according to the target interaction information, an actual relative distance and an actual relative rotation angle between the first sampling point and the actual interaction point position, and an actual relative distance and an actual relative rotation angle between the second sampling point and the actual interaction point position to complete the target interaction action; The positions and rotation angles of the first sampling point and the second sampling point are adjusted according to the actual relative distance and the actual relative rotation angle between the first sampling point and the actual interaction point position, and the actual relative distance and the actual relative rotation angle between the second sampling point and the actual interaction point position.
5. The method according to claim 1, characterized in that The method of determining the whole body skeleton positions of the first virtual character and the second virtual character based on the information of the adjusted first sampling point and the second sampling point, and determining the whole body skeleton positions of the first virtual character and the second virtual character respectively, comprises: Acquire a first body parameter of the first virtual character and a second body parameter of the second virtual character; Based on the adjusted position information of the first sampling point and the first body shape parameter, the whole body skeleton of the first virtual character is matched in sequence according to a preset matching order to determine the position of the whole body skeleton of the first virtual character; and based on the adjusted position information of the second sampling point and the second body shape parameter, the whole body skeleton of the second virtual character is matched in sequence according to the preset matching order to determine the position of the whole body skeleton of the second virtual character.
6. The method according to claim 5, characterized in that The preset matching order is to use the adjusted position information of the first sampling point or the adjusted position information of the second sampling point as the matching starting point, and to match the positions of other bones of the first virtual character or the second virtual character in order from near to far.
7. The method according to claim 6, characterized in that The first body shape parameter and the second body shape parameter both include arm length, torso length, leg length, the position of the shoulder bones relative to the sternum, and the midpoint position of the two kneecaps; The method of matching the whole body skeleton of the first virtual character in sequence according to a preset matching order based on the adjusted position information of the first sampling point and the first body shape parameter to determine the whole body skeleton position of the first virtual character includes: In the case where the first sampling point is a hand bone of the first virtual character, determining a shoulder bone position of the first virtual character according to the arm length; Determining the position of the sternum of the first virtual character according to the position of the shoulder bone of the first virtual character and the position of the shoulder bone relative to the sternum, and determining the position of the elbow bone of the first virtual character according to the position of the shoulder bone of the first virtual character and the position of the hand bone of the first virtual character; Determining the pelvic position of the first virtual character according to the midpoint position of the sternum position of the first virtual character and the positions of the two kneecaps; The torso bone position of the first virtual character is determined according to the sternum position of the first virtual character, the pelvic position of the first virtual character and the torso length, and the knee bone position of the first virtual character is determined according to the pelvic position of the first virtual character and the leg length.
8. A motion interaction device for a virtual character in a game scene, characterized in that: The device comprises: A receiving module, configured to receive a target action interaction request sent by a first virtual character to a second virtual character, wherein the first virtual character and the second virtual character are different virtual characters in the same game scene, and the body parameters of the first virtual character and the second virtual character are customized by a game player or pre-configured; an acquisition module, configured to acquire, in response to the target action interaction request, a first position corresponding to a first sampling point of the first virtual character and a second position corresponding to a second sampling point of the second virtual character, wherein the first sampling point is a skeletal part at which the first virtual character contacts the second virtual character when completing the target interaction action, and the second sampling point is a skeletal part at which the second virtual character contacts the first virtual character when completing the target interaction action; A determination module, configured to determine actual interaction point positions of the first sampling point and the second sampling point according to the first position and the second position; an adjustment module, configured to adjust the positions and rotation angles of the first sampling point and the second sampling point based on the actual interaction point positions and pre-recorded target interaction information, wherein the target interaction information is the relative distance information and relative rotation angle information between the sampling point and the interaction point when two virtual characters of the same body size complete the target interaction action; A generation module is used to determine the full body skeleton positions of the first virtual character and the second virtual character respectively based on the information of the adjusted first sampling point and the second sampling point, and generate the game performance of the target interactive action according to the full body skeleton positions.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the action interaction method of the virtual character in the game scene described in any one of claims 1-7 when executing the program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for action interaction of a virtual character in a game scene as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Interaction control method and device in game, electronic equipment and readable storage medium
CN113559520A
Virtual scene interaction method and device, storage medium and electronic device
CN114168044A
Method and device for controlling skeleton of virtual character, storage medium and electronic device
CN114419211A
Virtual character animation generation method and device, electronic equipment and storage medium
CN115496841A
Game interaction method and device, computer readable storage medium and electronic equipment
CN116899237A