Method, device and electronic device for interactive motion of virtual characters in game scenes

By obtaining the sampling point positions of the virtual character and adjusting its position and rotation angle, game performances adapted to different body shapes are generated, solving the problem of high interaction costs of virtual character actions in existing technologies and achieving flexible game development and natural action performance.

CN119280815BActive Publication Date: 2025-09-23ARC GAMES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311768272.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2025-09-23
Estimated Expiration
2043-12-20

AI Technical Summary

Technical Problem

In the existing technology, virtual character action interaction requires pre-designed interactive animations based on fixed body shapes, resulting in high game development costs and low flexibility.

Method used

By receiving action interaction requests between virtual characters, the sampling point position is obtained, and the sampling point position and rotation angle are adjusted according to the actual interaction point position and pre-recorded target interaction information to generate game performance and adapt to virtual characters of different body shapes.

Benefits of technology

It reduces game development costs, improves the flexibility of game resources, and enables natural interactive actions between virtual characters of different sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119280815B_ABST
    Figure CN119280815B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, and electronic device for action interaction of virtual characters in a game scene. The method comprises: 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, 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; determining the actual interaction point positions of the first sampling point and the second sampling point based on 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; determining the full-body skeletal 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 generating a game performance of the target interaction action based on the full-body skeletal positions. This can reduce game development costs and improve the flexibility of game resources.
Need to check novelty before this filing date? Find Prior Art

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 interest to players. With the continuous advancement of gaming technology, more and more games are offering the ability to customize the body shape of virtual characters, allowing players to adjust parameters such as height, shoulder width, and leg length to their preferences, making the body shape of the virtual character more suitable for the player. This not only satisfies players' pursuit of aesthetics but also increases game playability and immersion.

[0003] However, existing technologies for implementing interactive virtual character movements require pre-designed animations based on the fixed body shapes of the virtual characters. For example, to implement a handshake between an adult character, another adult character, and a child character, a set of handshake animations between the adults and another between the adult and the child must be pre-designed. Furthermore, if the body shape of one of the virtual characters changes, the handshake animations must be redesigned, resulting in high game development costs and limited 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 interactive 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 interactive actions 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 that contacts 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 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 type 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 the game performance of the target interactive action is generated according to the full body skeleton positions.

[0011] Optionally, 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 an 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-produced based on the interaction process of virtual characters of the same body type when completing the target interaction action, and the marked frame is a video frame corresponding to the moment when the virtual characters start the action interaction in the standard interaction animation;

[0013] The staying position of the first sampling point in the mark frame is determined as the first position, and the staying position of the second sampling point in the mark 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] determining, based on 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] Matching a first interaction animation for the first virtual character and a second interaction animation for the second virtual character from a preset interaction animation set according to the distance, 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 between the third position and the fourth position is determined as the actual interaction point position.

[0019] Optionally, adjusting the positions and rotation angles 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 sampling points and interaction points of the virtual characters of the same body shape in the marked frame;

[0021] determining, 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 for completing 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 adjusted information of the 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 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 of the kneecaps;

[0028] The step of matching the entire 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 entire skeleton position of the first virtual character includes:

[0029] In a 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 a sternum position of the first virtual character based on a shoulder bone position of the first virtual character and a position of the shoulder bone relative to the sternum, and determining an elbow bone position of the first virtual character based on the shoulder bone position of the first virtual character and a hand bone position of the first virtual character;

[0031] determining a pelvic position of the first virtual character according to a midpoint between a 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 and the second virtual character are in contact when completing the target interaction action, and the second sampling point is a skeletal part at which the second virtual character and the first virtual character are in contact when completing the target interaction action;

[0036] a determining module, configured to determine actual interaction point positions of the first sampling point and the second sampling point based on 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 information about the relative distances and relative rotation angles between the sampling points and the interaction points when two virtual characters of the same 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 based on the information of the adjusted first sampling point and the second sampling point, and generate a 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, comprising 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 for storing computer programs;

[0041] The processor is configured to implement the method for interactive actions of a virtual character in a game scene according to any one of the first aspects when executing a 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, which, when executed by a processor, implements the action interaction method for a virtual character in a game scene as described in any one of the first aspects.

[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 the 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 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 come into contact with the first virtual character when completing the target interactive action; determining the actual interaction point positions of the first sampling point and the second sampling point based on 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 points and the interaction points when two virtual characters of the same body type complete the target interactive action; determining the full-body skeletal positions of the first virtual character and the second virtual character based on the adjusted information of the first sampling point and the second sampling point, and generating a game performance of the target interactive action based on the full-body skeletal positions. In this way, the actual interaction point positions of the first sampling point and the second sampling point when performing the target interactive action can be determined based on 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 full-body skeletal positions of the first virtual character and the second virtual character can be determined based on the actual interaction point positions, so as to achieve 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0046] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0047] Figure 1 A flowchart 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 flowchart 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] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0052] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in 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 equipment for the 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 1This is a flow chart of a method for interactive action of a virtual character in a game scene provided by an embodiment of the present application. Figure 1 As shown, the action interaction method of the virtual character in the game scene may include the following steps:

[0055] Step 101: 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 game players or pre-configured.

[0056] Specifically, the first virtual character and the second virtual character can be different virtual characters in the same game scene. They can be player characters in the game application (i.e., the body shape of the character can be customized by the game player) or non-player characters in the game application (i.e., the body shape of the character is pre-configured in the game application and 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 a handshake, kiss, hug, or other interaction action.

[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 handshake action requests to character B and character C at the same time, the first virtual character is character A, and the second virtual characters are 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 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 the first virtual character when completing the target interaction action.

[0059] Specifically, the first sampling point is the skeletal part where the first virtual character and the second virtual character come into contact when completing the target interaction action, and the second sampling point is the skeletal part where the second virtual character and the first virtual character come into contact when completing the target interaction action. For example, when the target interaction action between the first and second virtual characters is a handshake, 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. When the target interaction action between the first and second virtual characters is a kiss, the first sampling point is the head skeleton of the first virtual character, and the second sampling point is the head skeleton of the second virtual character, and so on.

[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, 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 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 a first position corresponding to the first sampling point of the first virtual character and a 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 reaching a marked frame of the standard interaction animation, 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 actual interaction point location refers to the interaction location between the first sampling point of the first virtual character and the second sampling point of the second virtual character when performing the target interaction action. For example, in a handshake, 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 location is the point where the palms of the two parties meet. As an alternative embodiment, the actual interaction point location can be the midpoint between the first sampling point and the second sampling point, or a position near the midpoint.

[0063] Step 104: 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, where 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 size complete the target interaction action.

[0064] Specifically, the target interaction information is obtained based on a pre-created standard interaction animation. This standard interaction animation refers to the animation of a virtual character performing a target interaction action with a character of the same size. To obtain the target interaction information, the animation file for the standard interaction animation can be simultaneously called and played for two virtual characters of the same size. The relative distance and rotation angle between the sampling point and the interaction point when the two virtual characters of the same size complete the target interaction action are then recorded and used as the target interaction information.

[0065] In this step, after obtaining the actual interaction point position, 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 whole body skeleton positions of the first virtual character and the second virtual character are determined respectively, and a game performance of the target interactive action is generated according to the whole body skeleton positions.

[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 the 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 locations of the first and second sampling points when performing a target interaction action can be determined based on 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. Furthermore, the full-body skeletal positions of the first and second virtual characters can be determined based on these actual interaction point locations to achieve the game performance of the target interaction action between the first and second virtual characters. This eliminates the need to redesign new interaction animations even if the body shapes of the first and second virtual characters change, thereby reducing game development costs and increasing 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 and second virtual characters to perform an action interaction according to a preset standard interaction animation, and controlling the first and second virtual characters 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-created based on the interaction process of virtual characters of the same body type when completing a target interaction action, and the marked frame is a video frame corresponding to the moment when the virtual characters begin 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 interaction animation is pre-created based on the interaction process of a virtual character of the same body type completing the target interaction action. For example, if the target interaction action is a handshake, the standard interaction animation is an animation of an arm swinging horizontally up and down. The marked frame of this standard interaction animation can be the frame where the arm is exactly horizontal.

[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, and when the mark frame of the standard interaction animation is reached, the first virtual character and the second virtual character are controlled to stop the action interaction, and then the first sampling point and the second sampling point are sampled, and the stop position of the first sampling point in the mark 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 interactive animation, the distance between the first sampling point and the second sampling point can be obtained without any interference, which makes it convenient to subsequently select the interactive animation corresponding to the first virtual character and the second virtual character from the preset interactive animation set based on the distance between the two to determine the actual interaction point position.

[0075] Furthermore, the above step 103, determining the actual interaction point positions of the first sampling point and the second sampling point based on the first position and the second position, includes:

[0076] determining, based on 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 the 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 aforementioned interactive animation set includes not only standard interactive animations but also non-standard interactive animations. Continuing with the handshake example, non-standard interactive animations could include a slightly raised arm handshake animation or a slightly lowered arm handshake animation. The target direction refers to the contact direction between the first and second sampling points when completing the target interactive action. Since the avatar's height is the most influential body parameter on the target interactive action, for most target interactive actions, the target interactive direction is vertical.

[0081] In one embodiment, when determining the actual interaction point location of a first sampling point and a second sampling point, the distance between the first sampling point and the second sampling point in the target direction can be first determined based on the first and second positions. Then, based on the obtained distance, a first interaction animation is matched for the first virtual character and a second interaction animation is matched for the second virtual character from a preset interaction animation set. Taking a handshake action as an example, if the vertical distance between the hand bones of the first and second virtual characters extending their arms is similar, it indicates that the first and second virtual characters have similar body shapes, and in this case, the first and second virtual characters are matched with a standard handshake animation. If the vertical distance between the hand bones of the first and second virtual characters extending their arms exceeds a preset threshold, the handshake animation with the arm extended downward is played for the hand with the higher hand bone, and the handshake animation with the arm extended upward is played for the hand with the lower hand bone. In this way, the first sampling point can be adjusted from the first position to the third position based on the first interaction animation, and the second sampling point can be adjusted from the second position to the fourth position based on the second interaction animation. The midpoint between the third and fourth positions is then determined as the actual interaction point location.

[0082] Through the above method, 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 distance between the first sampling point and the second sampling point during subsequent adjustment, but also allows the interaction animation of each virtual character to adapt to its body shape, making the movements of the first virtual character and the second virtual character more vivid and realistic when performing target actions in 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, based on 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 the actual interaction point position for completing 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 marked frame. 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. Then, based on the target interaction information, the actual relative distance and actual relative rotation angle between the first sampling point and the actual interaction point position, as well as the actual relative distance and actual relative rotation angle between the second sampling point and the actual interaction point position, are determined to complete the target interaction action. Then, based on the actual relative distance and actual relative rotation angle between the first sampling point and the actual interaction point position, as well as the actual relative distance and actual relative rotation angle between the second sampling point and the actual interaction point position, the positions and rotation angles of the first sampling point and the second sampling point are adjusted. In this way, it is ensured that the adjusted first sampling point and the second sampling point can cooperate with each other to complete the target interaction action.

[0089] Furthermore, the above step 105, based on the information of the adjusted first sampling point and the second sampling point, respectively determining the full body skeleton positions of the first virtual character and the second virtual character, respectively determining the full body skeleton positions of the first virtual character and the second virtual character, includes:

[0090] Obtaining a first body parameter of the first virtual character and a second body 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 can be pre-set according to the type of 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-torso 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-torso bones-limb bones, etc.

[0093] In one embodiment, when determining the full body skeletal 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 skeletal 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 skeletal position of the second virtual character. In this way, the game performance of the target interactive action generated based on the full body skeletal 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 human body movement.

[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, it can be implemented using the IK method, that is, first using 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 matching 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 over to conform to human body movements.

[0096] Furthermore, the first body shape parameter and the second body shape parameter each 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, matching the entire 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 entire skeleton position of the first virtual character, includes:

[0098] In a 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] Determining the position of the sternum of the first virtual character based on the position of the shoulder bones of the first virtual character and the position of the shoulder bones relative to the sternum, and determining the position of the elbow bones of the first virtual character based on the position of the shoulder bones of the first virtual character and the position of the hand bones of the first virtual character;

[0100] determining a pelvic position of the first avatar according to a midpoint between a sternum position and both kneecap positions of the first avatar;

[0101] The torso bone position of the first virtual character is determined according to the sternum position, pelvic position and torso length of the first virtual character, and the knee bone position of the first virtual character is determined according to the pelvic position and 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 length of the arm. If the distance from the hand skeleton to the shoulder skeleton exceeds the length of the arm, the position of the shoulder skeleton is moved toward the position of the hand skeleton so that the distance from the hand skeleton to the shoulder skeleton does not exceed the length of the arm. After determining the position of the shoulder skeleton, the position of the sternum can be determined based on 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 of the position of the two kneecaps as the root skeleton, and the pelvis as the action skeleton. After calculating the position of the pelvis, the position of the torso bones can be calculated using the forward and backward reaching inverse kinematics (FABRIK) algorithm, with the sternum as the target bone and the pelvis as the root bone. After calculating the position of the torso bones, the position of the knee bones can be calculated using the TwoBoneIK algorithm, with the foot bones (which are determined based on the pelvic position and leg length) as the target bones, the knee as the active bone, and the pelvis as the root bone. In this way, the full body skeletal position of the virtual character when performing the target interactive action can be accurately obtained, thereby achieving the target interactive action's game performance.

[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] Multiple candidate sampling points are set up on the virtual character, such as the hand bones, elbow bones, pelvis, 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 and non-standard ones. Standard interactive animations are those that can be completed without any interaction, given a standard body type. For example, art students will need to create a standard handshake animation with a virtual character of the same body type, as well as a set of non-standard interactive animations, such as a slightly raised arm handshake animation and a slightly lowered arm handshake animation.

[0108] Step 203: Set up a marker frame.

[0109] Set a marker frame for the standard interactive animation. The marker frame of the handshake animation should be the frame where you extend your hand and shake 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 candidate sampling points mentioned above. The sampling point for 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 pause until the marked frame. At this time, the two virtual characters can complete the interaction 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 interaction position and interaction rotation.

[0114] Step 206: Play the adaptation animation.

[0115] Both avatars play a standard interaction animation and pause until the marked frame. Then, corresponding sampling points are found for both avatars, their positions are calculated, and a matching interaction animation is selected from the interactive animation set. For example, if the hand skeletal positions of both avatars' outstretched hands are similar, both avatars use the standard handshake animation. If the difference in hand skeletal positions exceeds a preset threshold, the handshake animation with the arm extended downwards plays for the avatar with the hand higher up, and the handshake animation with the arm extended upwards plays for the avatar with the hand lower up.

[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 points and the interaction points recorded in step 205 , the positions and rotations of the sampling point skeletons 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 implement the motion interactions between characters of different body types, significantly reducing the workload of motion art and the size of the project package. Furthermore, the player can customize the body type of the character, enabling the motion interactions of the character with the customized body type.

[0122] See also Figure 3 , Figure 3 This is 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. Figure 3 As shown, the device 300 includes:

[0123] A receiving module 301 is 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;

[0124] An acquisition module 302 is configured 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 the second virtual character when the target action is completed, and the second sampling point is a skeletal part of the second virtual character that contacts the first virtual character when the target action is completed;

[0125] A determination module 303 is configured to determine actual interaction point positions of the first sampling point and the second sampling point based on the first position and the second position;

[0126] An adjustment module 304 is 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 and rotation angle information between the sampling point and the interaction point when two virtual characters of the same 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 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 and second virtual characters to perform interactive actions according to a preset standard interactive animation, and controlling the first and second virtual characters to stop the interactive action when a marked frame of the standard interactive animation is reached, wherein the standard interactive animation is a pre-created interactive animation based on the interactive process of virtual characters of the same body type when completing a target interactive action, and the marked frame is a video frame corresponding to the moment when the virtual characters begin the interactive action in the standard interactive animation;

[0130] The first determining submodule is configured 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] Furthermore, the determination module 303 includes:

[0132] a second determining submodule, configured to determine a distance between the first sampling point and the second sampling point in a target direction based on the first position and the second position, 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;

[0133] a matching submodule, configured to match a first interactive animation for the first virtual character and a second interactive animation for the second virtual character from a preset interactive animation set based on the distance, 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 configured to determine a midpoint 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 configured 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, for completing the target interaction action;

[0139] The second adjustment submodule is configured to adjust the positions and rotation angles 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 configured 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] Furthermore, 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 determining submodule, configured to determine a shoulder bone position of the first virtual character according to the arm length when the first sampling point is a hand bone of the first virtual character;

[0146] a seventh determination submodule, configured to determine a sternum position of the first virtual character based on the shoulder bone position of the first virtual character and the position of the shoulder bone relative to the sternum, and to determine an elbow bone position of the first virtual character based on the shoulder bone position of the first virtual character and the position of the hand bone of the first virtual character;

[0147] an eighth determination submodule, configured to determine a pelvic position of the first virtual character based on a midpoint between the sternum position and the kneecap positions of the first virtual character;

[0148] The ninth determination submodule is used to determine the torso bone position of the first virtual character based on 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 based on the pelvic position and 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 in detail 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, for storing computer programs;

[0152] In one embodiment of the present application, the processor 411 is configured to execute a program stored in the memory 413 to implement the method for interactively interacting with a virtual character in a game scene provided by any of the aforementioned 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 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 that contacts 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 the first virtual character when completing the target interaction action;

[0155] Determining actual interaction point positions of the first sampling point and the second sampling point based on the first position and the second position;

[0156] Adjusting the positions and rotation angles of the first and second sampling points based on the actual interaction point positions and pre-recorded target interaction information, where the target interaction information is the relative distance and rotation angle between the sampling points and the interaction point when two virtual characters of the same 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 a game performance of the target interactive action is generated according to the full body skeleton positions.

[0158] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for action interaction 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. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling 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 certain parts of the embodiment.

[0161] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only 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 "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence 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 to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0162] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

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 that contacts 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 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 type complete the target interaction action; Determining the full-body skeletal positions of the first virtual character and the second virtual character based on the adjusted information of the first sampling point and the second sampling point, respectively, and generating a game representation of the target interactive action according to the full-body skeletal positions; The determining, based on the first position and the second position, actual interaction point positions of the first sampling point and the second sampling point includes: determining, based on 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; 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; 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 between the third position and the fourth position is determined as the actual interaction point position.

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 an 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-produced based on the interaction process of virtual characters of the same body size when completing the target interaction action, the marked frame is a video frame corresponding to the moment when the virtual character starts the action interaction in the standard interaction animation, and the standard interaction animation belongs to the interaction animation set; The staying position of the first sampling point in the mark frame is determined as the first position, and the staying position of the second sampling point in the mark frame is determined as the second position.

3. The method according to claim 2, characterized in that The adjusting the positions and rotation angles of the first sampling point and the second sampling point based on the actual interaction point position and pre-recorded target interaction information includes: Acquiring the target interaction information, wherein the target interaction information is determined based on sampling points and interaction points of the virtual characters of the same body shape in the marked frame; determining, 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 for completing 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.

4. The method according to claim 1, wherein The method of determining the full body skeleton positions of the first virtual character and the second virtual character based on the adjusted information of the first sampling point and the second sampling point, and determining the full body skeleton positions of the first virtual character and the second virtual character, respectively, includes: 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.

5. The method according to claim 4, 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 match the positions of other bones of the first virtual character or the second virtual character in order from near to far.

6. The method according to claim 5, 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 step of matching the entire 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 entire skeleton position of the first virtual character includes: In a 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 a sternum position of the first virtual character based on a shoulder bone position of the first virtual character and a position of the shoulder bone relative to the sternum, and determining an elbow bone position of the first virtual character based on the shoulder bone position of the first virtual character and a hand bone position of the first virtual character; determining a pelvic position of the first virtual character according to a midpoint between a 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.

7. 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 and the second virtual character are in contact when completing the target interaction action, and the second sampling point is a skeletal part at which the second virtual character and the first virtual character are in contact when completing the target interaction action; a determining module, configured to determine actual interaction point positions of the first sampling point and the second sampling point based on 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 information about the relative distances and relative rotation angles between the sampling points and the interaction points when two virtual characters of the same size complete the target interaction action; a generation module, configured to determine the full-body skeletal positions of the first virtual character and the second virtual character based on the adjusted information of the first sampling point and the second sampling point, respectively, and generate a game representation of the target interactive action based on the full-body skeletal positions; Wherein, the determination module includes: a second determining submodule, configured to determine a distance between the first sampling point and the second sampling point in a target direction based on the first position and the second position, 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; a matching submodule, configured to match a first interactive animation for the first virtual character from a preset interactive animation set according to the distance, and to match 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; a first adjustment submodule, configured to adjust the first sampling point from the first position to a third position according to the first interactive animation, and to adjust the second sampling point from the second position to a fourth position according to the second interactive animation; The third determining submodule is configured to determine a midpoint between the third position and the fourth position as the actual interaction point position.

8. 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 via the communication bus; Memory for storing computer programs; The processor is configured to implement the method for interactive actions of a virtual character in a game scene as described in any one of claims 1 to 6 when executing a program stored in the memory.

9. 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 interactive actions of a virtual character in a game scene according to any one of claims 1 to 6 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