Virtual object processing method, computing device, storage medium and computer program product
By responding to action playback instructions in a virtual scene, determining and playing target actions, and dynamically adjusting the position of the virtual object according to the location difference information, the problem of high cost of virtual object interaction actions is solved, and natural and smooth interactive actions are achieved, reducing the use of computing and storage resources.
Patent Information
- Application Number
- CN202411939823.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art has high costs in the production and storage process of virtual object interactive actions in virtual scenes, and the computing resources and storage resources occupy a large amount, making it difficult to meet the natural and smooth performance needs of complex interactive actions.
By responding to the action playback command, the target action set of the target virtual object is determined, and the target action is selected and played from it. When the target action playback time reaches the preset adjustment time, the position difference information between the target virtual object and the associated object is calculated, and the position of the target virtual object is dynamically adjusted to achieve natural and smooth interactive action performance.
It reduces the cost of interactive action production, reduces the use of computing resources and storage resources, and ensures the natural and smooth performance of virtual object interactive actions.
Smart Images

Figure CN119680190A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular, to a virtual object processing method, a computing device, a storage medium, and a computer program product. Background Art
[0002] In actual applications, in virtual scenes, virtual objects usually perform a variety of interactive actions. For example, virtual objects can perform interactive actions such as cooperative attack and cooperative dance, and a single virtual object can also perform scene interactive actions such as hopping over and climbing. In order to meet the interactive action performance requirements between virtual objects, fixed animation sequences at fixed positions can usually be pre-recorded to display the interactive actions between virtual objects in the form of story animation. However, when there are many interactive actions between virtual objects, it is necessary to produce and store the animation sequences corresponding to each interactive action one by one for subsequent playback. This will result in a high cost for the production of interactive actions and a large occupation of computing resources and storage resources. Therefore, an effective technical solution is urgently needed to solve the above problems. Summary of the invention
[0003] In view of this, an embodiment of this specification provides a virtual object processing method. One or more embodiments of this specification also relate to a virtual object processing device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0004] According to a first aspect of an embodiment of this specification, a virtual object processing method is provided, including: In response to an action play instruction for a target virtual object, determining a target action set corresponding to the target virtual object; Determine a target action from the target action set and play the target action; When it is determined that the playback time of the target action reaches the preset adjustment time, determining position difference information between the target virtual object and a virtual object associated with the target virtual object; According to the position difference information, the current position information of the target virtual object is adjusted.
[0005] According to a second aspect of an embodiment of this specification, there is provided a virtual object processing device, including: A first determination module is configured to determine a target action set corresponding to the target virtual object in response to an action play instruction for the target virtual object; A playing module, configured to determine a target action from the target action set and play the target action; A second determination module is configured to determine position difference information between the target virtual object and a virtual object associated with the target virtual object when it is determined that the playback time of the target action reaches a preset adjustment time; The adjustment module is configured to adjust the current position information of the target virtual object according to the position difference information.
[0006] According to a third aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above method are implemented.
[0007] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and the steps of the above method are implemented when the computer program / instruction is executed by a processor.
[0008] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0009] An embodiment of the present specification provides a virtual object processing method, including: in response to an action play instruction for a target virtual object, determining a target action set corresponding to the target virtual object; determining a target action from the target action set and playing the target action; when it is determined that the play time of the target action reaches a preset adjustment time, determining position difference information between the target virtual object and the associated virtual objects of the target virtual object; and adjusting the current position information of the target virtual object according to the position difference information.
[0010] The above method can determine the target action set corresponding to the current target virtual object after responding to the action play instruction for the target virtual object, and determine and play the target action from the target action set. When it is determined that the play time of the target action reaches the preset adjustment time, the position difference information between the target virtual object and the associated virtual object is determined, and the current position information of the target virtual object is adjusted according to the position difference information. By pre-defining the target action set, the target action is directly determined and played from the target action set, and the position difference information is dynamically calculated and the current position information of the target virtual object is adjusted, so as to ensure that the animation performance of the interactive action between the target virtual object and the associated virtual object is natural and smooth, without the need to prepare the animation sequence corresponding to each interactive action in advance, and on the basis of reducing the cost of interactive action production, the natural and smooth interactive action can be ensured, and the occupation of computing resources and storage resources can be further reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 is a flow chart of a virtual object processing method provided by an embodiment of this specification; Figure 2 is a processing flow chart of a virtual object processing method provided by an embodiment of this specification; Figure 3 is a structural diagram of a virtual object processing device provided by an embodiment of this specification; Figure 4 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0012] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0013] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0014] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0015] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0016] First, the terms involved in one or more embodiments of this specification are explained.
[0017] Motion Matching: is an advanced motion synthesis technology that generates natural and smooth character motion by seamlessly combining pre-recorded motion capture data with real-time simulated character motion.
[0018] Footsteps IK (Inverse Kinematics): is a mathematical method used to calculate joint angles so that the end effector (such as a foot or hand) can reach a specified target position. For footsteps, this means keeping the character's feet accurately placed on the ground or other surface, even if the surface is uneven or the character is doing complex movements.
[0019] 3D MAX: Three-dimensional computer graphics software. It is widely used in game development, film and television special effects, architectural visualization and other fields to create complex 3D models, animations, renderings and simulations.
[0020] DCC: Digital Content Creation refers to the use of computer software and hardware tools to create, edit, manage and publish content in digital form. This type of content can be multimedia elements such as static images, animations, videos, audios, 3D models, virtual reality (VR), augmented reality (AR) experiences, that is, digital content creation. The scope of digital content creation includes two-dimensional / three-dimensional, audio / video editing and synthesis, dynamic / interactive content creation, image editing, etc.
[0021] In practical applications, when the virtual scene is a game scene, with the development of 3D ARPG game technology, the performance of virtual character actions in the game is becoming more and more important. Usually, the problem of the expressiveness of the action of a single character can be solved, such as MotionMatching, footstep IK, stride adjustment and other technologies. For the performance of scene interaction, such as overtaking, climbing, walking on cliffs, etc. With the needs of game narrative, the demand for interactive performance between virtual characters is increasing. Usually, a pre-recorded fixed animation sequence with a fixed position can be used, which is often used in plot animation. In order to meet more daily situations, such as mutual performance in battle, many games are produced in a special way (such as execution animation, special program development for each special action), so they cannot be mass-produced, and because of the high difficulty and long production time, they are gradually unable to meet the needs of game production, and an effective technical solution is urgently needed to solve the above problems.
[0022] In this specification, a virtual object processing method is provided. This specification also relates to a virtual object processing device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.
[0023] See also Figure 1 , Figure 1 A flowchart of a virtual object processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0024] Step 102: In response to an action play instruction for a target virtual object, determine a target action set corresponding to the target virtual object.
[0025] Specifically, the virtual object processing method provided in the embodiments of this specification can be applied to the field of virtual scenes. The field of virtual scenes may include but is not limited to the field of games, the field of virtual reality, etc. For ease of understanding, the embodiments of this specification take the application of the virtual object processing method in the field of games as an example for explanation, and do not limit the application of the virtual object processing method to other virtual scenes.
[0026] Among them, the target virtual object can be understood as a virtual character in a virtual scene, such as a game character in a game scene, the action playing instruction can be understood as an instruction to make the target virtual object perform a certain action, such as an instruction to make the game character in the game scene perform an attack action, an execution action, a dance action, a running action, etc., the target action set can be understood as an action set of multiple actions that the target virtual object can perform, and the target action set can be determined according to the game play. Different game plays can correspond to different action sets. For example, when the game play is a cooperative attack gameplay, the target action set can be a set including cooperative attack actions, or a set including single-player attack actions. The embodiments of this specification do not limit this.
[0027] In actual applications, the action play instruction can be initiated according to the game process in the game scene. For example, the game player controls the game character (i.e., the target virtual object) to enter the battle scene, and during the battle, the action play instruction for the attack action of the target virtual object can be triggered, or in the plot of the game, the game character performs a dance interaction operation, then the action play instruction for the dance action of the target virtual object can be triggered at this time, and the embodiments of this specification are not limited to this.
[0028] Based on this, during the operation of the game engine, in response to the action play instruction for the target virtual object, the target action set corresponding to the target virtual object under the current game play can be determined. In specific implementation, the target action set corresponding to the target virtual object can be determined according to the current game play, or the game plot, or the control instruction of the game player for the target virtual object.
[0029] Furthermore, in response to the action play instruction for the target virtual object, determining the target action set corresponding to the target virtual object includes: In response to an action play instruction for a target virtual object, a target action set corresponding to the target virtual object is determined from a plurality of candidate action sets.
[0030] The candidate action set may include multiple actions for candidates.
[0031] Specifically, in response to an action play instruction for a target virtual object, a target action set corresponding to the target virtual object can be determined from multiple candidate action sets based on a currently selected game play, or based on a current game operation for the target virtual object.
[0032] For example, multiple candidate action sets may include candidate action set 1 including multiple single-player attack actions, and candidate action set 2 including multiple cooperative attack actions. In response to an action play instruction for a target virtual object, based on the current game operation for the target virtual object, if it is determined that the distance between the target virtual object and the target virtual object's associated virtual object is less than a preset distance threshold, candidate action set 2 including multiple cooperative attack actions may be selected as the target action set.
[0033] In summary, by selecting a target action set, it is convenient to subsequently select a suitable target action from the target action set.
[0034] In practical applications, before responding to the action play instruction for the target virtual object and determining the target action set corresponding to the target virtual object, the method further includes: Creating a candidate action set, wherein the candidate action set includes multiple candidate actions; For each candidate action among the multiple candidate actions, a preset adjustment time corresponding to each candidate action is configured, and the number of virtual objects corresponding to each candidate action is configured, wherein the preset adjustment time is used to adjust the position of the virtual object.
[0035] Among them, the candidate action can be understood as the action of the target virtual object. The preset adjustment time can be understood as the time period for adjusting the position of the target virtual object, and can also be understood as the alignment time period between the target virtual object and the associated virtual object. The associated virtual object can be understood as the virtual object associated with the target virtual object, such as the game character of the teammate of the target virtual object in the game. The number of virtual objects can be understood as the number of virtual objects required to complete the candidate action. For example, if the candidate action is a cooperative attack action, the cooperative attack action requires at least 2 virtual objects to complete, then the number of virtual objects corresponding to the cooperative attack action can be 2 or 3, or if the candidate action is a single-player attack action, the single-player attack action only requires 1 virtual object to complete, then the number of virtual objects corresponding to the single-player attack action can be 1.
[0036] Specifically, before the game is run, multiple candidate action sets can be created in advance, each candidate action set contains multiple candidate actions, and each candidate action is configured with a preset adjustment time and number of virtual objects. Furthermore, each candidate action can also be configured with information such as the virtual object gameplay state, the distance range between virtual objects, the facing range, dependent obstacle information, and camera trajectory. For example, for a backstab action between virtual object 1 and virtual object 2, virtual object 1 needs to face away from virtual object 2. Based on this, the facing range between virtual object 1 and virtual object 2 can be configured for the backstab action.
[0037] In practical applications, the concept of positioning points is introduced in the art production stage of the game, and when the DCC software is exported, the position, rotation, frame number and other information of the positioning points are additionally exported. The concept of alignment time period is introduced in the planning and production stage. In the game engine, the information of the alignment time period is attached to the action animation of each candidate action, and the action trajectory and lens trajectory of each candidate action are configured. In specific implementation, when creating a candidate action, the virtual object that completes the candidate action can be determined. For example, virtual object 1 and virtual object 2 jointly complete the candidate action, then the bones of skeleton object 1 (i.e. virtual object 1) and the bones of skeleton object 2 (i.e. virtual object 2) can be selected in 3D MAX for binding, and the relative position and rotation of the bones of skeleton object 1 and the bones of skeleton object 2 are calculated in each frame animation of the candidate action, and the calculation results are exported to curve information or independent files when exporting, so as to realize the creation and configuration of the candidate action. In addition, in the game engine, a time period for dynamically adjusting the modified position (i.e. preset adjustment time) can be configured for each candidate action according to the actual needs of the game play, and the required number of characters (i.e. number of virtual objects) can be configured for each candidate action according to the actual needs of the game play.
[0038] In summary, by pre-creating a set of candidate actions and configuring the preset adjustment time and number of virtual objects, it is convenient to subsequently select the target action and adjust the position according to the preset adjustment time, so as to achieve a natural and smooth action display of the target virtual object.
[0039] Step 104: Determine a target action from the target action set and play the target action.
[0040] Specifically, in determining the target action set, a target action may be selected from a plurality of candidate actions included in the target action set and the target action may be played.
[0041] In addition, while playing the target action, the associated virtual object of the target virtual object can be determined and saved. Among them, the associated virtual object of the target virtual object can be understood as a virtual object that completes the target action together with the target virtual object. It can be understood that the associated virtual object can be 1, then the target action is an action completed by two people. The associated virtual objects can also be 2 or more, then the target action is an action completed by three or more people.
[0042] In a specific implementation, determining the target action from the target action set includes: Traversing multiple candidate actions included in the target action set, and reading action trajectories and lens trajectories of the multiple candidate actions; According to the action trajectory and the lens trajectory, a candidate action among the multiple candidate actions that meets a preset action condition is determined as the target action.
[0043] The preset action condition can be understood as the condition under which the target action can be played normally. The action trajectory can be understood as the trajectory of the virtual object that completes the candidate action when the candidate action is played, and the lens trajectory can be understood as the trajectory of the game lens for the candidate action.
[0044] Specifically, since the action trajectory and lens trajectory are configured for each candidate action when the candidate action set is created in advance, when the game is running, the multiple candidate actions included in the target action set can be traversed, and the action trajectory and lens trajectory of each configured candidate action can be read, and based on the action trajectory and lens trajectory of each candidate action, the candidate action that can be played normally among the multiple candidate actions can be determined as the target action.
[0045] In summary, by screening multiple candidate actions, a target action that meets the conditions is obtained, and the smoothness of the target action playback is ensured.
[0046] Further, the determining, according to the action trajectory and the lens trajectory, a candidate action among the multiple candidate actions that meets a preset action condition as the target action includes: According to the action trajectory and the lens trajectory, obstacle detection is performed on the multiple candidate actions in the virtual scene where the target virtual object is located to obtain an obstacle detection result; According to the obstacle detection result, a candidate action among the multiple candidate actions that meets the preset action condition is determined as the target action.
[0047] Specifically, according to the action trajectory and lens trajectory of each candidate action, physical obstacle detection can be performed on each candidate action in the virtual scene where the target virtual object is located to obtain obstacle detection results, and according to the obstacle detection results, the candidate action without physical obstacles is determined as the target action.
[0048] In actual applications, when performing physical obstacle detection on multiple candidate actions, physical obstacle detection can be performed on the multiple candidate actions in turn to obtain the obstacle detection result of each candidate action. When it is determined that there is no physical obstacle for a candidate action based on the obstacle detection result, the candidate action is determined as the target action. That is to say, each candidate action in the target action set is traversed, the action trajectory and the shot trajectory of the action are read, physical obstacle detection is performed in the actual scene, the first candidate action without any physical obstacles is found and determined as the target action, and the target action is started to be played by two or more people, or the playback of the target action can also be delayed.
[0049] In summary, by performing obstacle detection on each candidate action, the target action is determined, and when the target action is subsequently played, obstacles that cause the action to be unsmooth or clipping can be avoided, thereby ensuring the smoothness and authenticity of the action playback.
[0050] Step 106: When it is determined that the playback time of the target action reaches the preset adjustment time, position difference information between the target virtual object and the virtual object associated with the target virtual object is determined.
[0051] In actual applications, when the game is running, the program selects the action sequence and shot sequence that can be run from the candidate actions in a predictive manner based on the real-time game world environment, character and other information, and then calculates the difference based on the character world space coordinates and character animation space coordinates that are passed in, and gives the obtained difference to the configured alignment time period for geometric distribution and correction. At the same time, based on the protagonist (i.e., the target virtual object), the frame number difference of the two-person or multi-person action animation is calculated, and the time scaling value is calculated based on the length of the alignment time period, and the time scaling value is applied in the alignment time period, so as to achieve the consistency of the world space position and animation space position of the two-person or multi-person at the end of the alignment time period. And then strictly follow the subsequent animation sequence of the animation.
[0052] In a specific implementation, the determining of the position difference information between the target virtual object and the virtual object associated with the target virtual object includes: Determine a distance difference and a facing angle difference between the target virtual object and a virtual object associated with the target virtual object; Determining a reference distance difference and a reference orientation angle difference corresponding to the target action according to a preset adjustment time corresponding to the target action; The position difference information between the target virtual object and the associated virtual object is calculated according to the distance difference and the facing angle difference, the reference distance difference and the reference facing angle difference.
[0053] Among them, the distance difference can be understood as the difference in three-dimensional distances between the target virtual object and the associated virtual object, the facing angle difference can be understood as the difference in facing angles between the target virtual object and the associated virtual object, the reference distance difference can be understood as the difference in reference three-dimensional distances between the target virtual object and the associated virtual object in the animation space corresponding to the target action within the preset adjustment time, and the reference facing angle difference can be understood as the difference in reference facing angles between the target virtual object and the associated virtual object in the animation space corresponding to the target action within the preset adjustment time.
[0054] Specifically, the distance difference and the orientation angle difference between the target virtual object and the associated virtual object can be determined, and according to the preset adjustment time corresponding to the target action, the reference distance difference and the reference orientation angle difference of the target action within the preset adjustment time can be determined, and the difference between the distance difference and the reference distance difference, as well as the difference between the orientation angle difference and the reference orientation angle, can be calculated, and the difference can be determined as the position difference information between the target virtual object and the associated virtual object.
[0055] In practical applications, the distance difference and the orientation angle difference can be understood as the character world space coordinates of the target virtual object and the associated virtual object, and the reference distance difference and the reference orientation angle difference can be understood as the character animation space coordinates of the target virtual object and the associated virtual object. In specific implementation, when the target action is played to the preset adjustment time, the current position rotation of the associated virtual object can be obtained, and the distance difference and the orientation angle difference between the target virtual object and the associated virtual object can be calculated. According to the preset adjustment time, the reference distance difference and the reference orientation angle difference of the animation space are obtained from the additional information derived from the target action, and the difference between the distance difference and the reference distance difference, and the difference between the orientation angle difference and the reference orientation angle difference are calculated as position difference information.
[0056] In addition, the above step 106 can be executed for each frame of the action animation of the target action, so as to obtain the position difference information of the target virtual object and the associated virtual object in each frame of the action animation of the target action, and based on the position difference information of each frame, the position of the target virtual object and the associated virtual object is subsequently adjusted so that the target virtual object and the associated virtual object perform the target action.
[0057] In summary, by calculating the position difference information, it is convenient to correct the position of the target virtual object according to the position difference information, thereby ensuring the consistency of the world space position and animation space position of the target virtual object and the associated virtual objects after the preset adjustment time, so as to facilitate the subsequent animation sequence of the action animation of the target action to be executed strictly.
[0058] Step 108: adjusting the current position information of the target virtual object according to the position difference information.
[0059] Specifically, adjusting the current position information of the target virtual object according to the position difference information includes: Calculating an adjustment position parameter corresponding to the target virtual object according to the position difference information and a preset adjustment time corresponding to the target action; The current position information of the target virtual object is determined, and the adjustment position parameter is superimposed on the current position information to adjust the current position information of the target virtual object.
[0060] The current position information of the target virtual object may be understood as the position and angle of the target virtual object at the current moment.
[0061] In practical applications, the target action can be corrected for each frame within the preset adjustment time according to the calculated adjustment position parameters. Specifically, the position of the target action that needs to be adjusted in the current game frame within the preset adjustment time can be calculated according to the preset calculation strategy (i.e., the adjustment position parameters, such as the position and orientation parameters that need to be adjusted at present). In specific implementation, in one embodiment of the present application, the preset calculation strategy can be to calculate the adjustment position parameters according to the time linear difference, that is, the adjustment position parameters can be calculated according to the frame interval duration (i.e., according to the duration between each game frame when the game is running), the duration of the preset adjustment time, and the above-mentioned position difference information. In specific implementation, the adjustment position parameter can be the frame interval duration ÷ the duration of the preset adjustment time × the position difference information, and the adjustment position parameter is superimposed on the current position information of the target virtual object to achieve the position adjustment of the target virtual object, thereby reducing the difficulty of realizing the interactive action of two people. In another embodiment of this embodiment, the preset calculation strategy can also be to calculate the adjustment position parameter according to other calculation methods, such as the calculation of the adjustment position parameter can be realized based on a curve function.
[0062] Furthermore, for the associated virtual object that executes the target action, the adjustment position parameter corresponding to the associated virtual object can also be calculated based on the position difference information and the preset adjustment time corresponding to the target action, the current position information of the associated virtual object can be determined, and the adjustment position parameter of the associated virtual object can be superimposed on the current position information of the associated virtual object to adjust the current position information of the associated virtual object. For example, when the target action is jointly executed by virtual object 1 and virtual object 2, the positions of virtual object 1 and virtual object 2 can be adjusted respectively according to the above method; or, when the target action is jointly executed by multiple virtual objects such as virtual object 1, virtual object 2 and virtual object 3, the positions of multiple virtual objects such as virtual object 1, virtual object 2 and virtual object 3 can be adjusted respectively according to the above method to execute the target action.
[0063] In summary, the above method can determine the target action set corresponding to the current target virtual object after responding to the action play instruction for the target virtual object, and determine and play the target action from the target action set. When it is determined that the play time of the target action reaches the preset adjustment time, the position difference information between the target virtual object and the associated virtual object is determined, and the current position information of the target virtual object is adjusted according to the position difference information. By pre-defining the target action set, the target action is directly determined and played from the target action set, and the position difference information is dynamically calculated and the current position information of the target virtual object is adjusted, thereby ensuring that the animation performance of the interactive action between the target virtual object and the associated virtual object is natural and smooth, without the need to prepare the animation sequence corresponding to each interactive action in advance, and on the basis of reducing the cost of interactive action production, the natural and smooth interactive action can be ensured, further reducing the occupation of computing resources and storage resources.
[0064] The following combination Figure 2 Taking the application of the virtual object processing method provided in this specification in the interactive action of two players in a game as an example, the virtual object processing method is further explained. Figure 2 A processing flow chart of a virtual object processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps.
[0065] Step 202: In 3D MAX, select the bones of skeleton object 1 and the bones of skeleton object 2 for binding.
[0066] Specifically, taking the candidate action as a two-person action as an example, the skeleton object 1 and the skeleton object 2 can be understood as the target virtual object and the associated virtual object for completing the two-person action.
[0067] Step 204: Calculate the relative position and rotation of the bones of skeleton object 1 and the bones of skeleton object 2 in each frame of the candidate action.
[0068] Step 206: When exporting, the calculation results are exported to curve information or an independent file to achieve the creation of candidate actions.
[0069] Step 208: Based on the game editing tool and according to the gameplay, a preset adjustment time is configured for each candidate action.
[0070] Step 210: Based on the game editing tool and according to the gameplay, configure the number of virtual objects for each candidate action and create multiple candidate action sets.
[0071] Step 212: When the game is running, based on information such as the gameplay and the current number of virtual objects, a target action set is selected from multiple candidate action sets, each candidate action in the target action set is traversed, the action trajectory and lens trajectory of each candidate action are read, physical obstacle detection is performed in the virtual scene, and the first candidate action without physical obstacles is found as the target action and played.
[0072] Step 214: while playing the target action, save the associated virtual object that completes the target action together with the target virtual object.
[0073] Step 216: the target action is played to a preset adjustment time, the current position rotation of the associated virtual object is obtained, and the distance difference and the facing angle difference between the target virtual object and the associated virtual object are calculated.
[0074] Step 218: According to the preset adjustment time, obtain the reference distance difference and reference orientation angle difference of the animation space from the additional information derived from the target action.
[0075] Step 220: Calculate position difference information according to the distance difference and the orientation angle difference, the reference distance difference and the reference orientation angle difference.
[0076] Step 222: within the preset adjustment time, correct each frame of the target action, calculate the position adjustment parameter according to the frame interval duration, the preset adjustment time duration, and the position difference information, and superimpose it on the current position information of the target virtual object.
[0077] It can be understood that the above steps 202 to 210 are the process of pre-creating the candidate action set in the game production stage, and the above steps 212 to 222 are the process of real-time determination and playback of the target action in the game running stage. The above method can determine the target action set corresponding to the current target virtual object after responding to the action play instruction for the target virtual object, and determine and play the target action from the target action set. When it is determined that the play time of the target action reaches the preset adjustment time, the position difference information between the target virtual object and the associated virtual object is determined, and the current position information of the target virtual object is adjusted according to the position difference information. By pre-defining the target action set, the target action is directly determined and played from the target action set, and the position difference information is dynamically calculated and the current position information of the target virtual object is adjusted, so as to ensure that the animation performance of the interactive action between the target virtual object and the associated virtual object is natural and smooth, without the need to prepare the animation sequence corresponding to each interactive action in advance, and on the basis of reducing the cost of interactive action production, the natural and smooth interactive action can be ensured, and the occupation of computing resources and storage resources can be further reduced.
[0078] Corresponding to the above method embodiment, this specification also provides a virtual object processing device embodiment, Figure 3 FIG. 1 is a schematic diagram showing the structure of a virtual object processing device provided by an embodiment of the present specification. Figure 3 As shown, the device comprises: A first determination module 302 is configured to determine a target action set corresponding to the target virtual object in response to an action play instruction for the target virtual object; A playing module 304 is configured to determine a target action from the target action set and play the target action; The second determination module 306 is configured to determine the position difference information between the target virtual object and the virtual object associated with the target virtual object when it is determined that the playback time of the target action reaches the preset adjustment time; The adjustment module 308 is configured to adjust the current position information of the target virtual object according to the position difference information.
[0079] In an optional embodiment, the second determining module 306 is further configured to: Determine a distance difference and a facing angle difference between the target virtual object and a virtual object associated with the target virtual object; Determining a reference distance difference and a reference orientation angle difference corresponding to the target action according to a preset adjustment time corresponding to the target action; The position difference information between the target virtual object and the associated virtual object is calculated according to the distance difference and the facing angle difference, the reference distance difference and the reference facing angle difference.
[0080] In an optional embodiment, the adjustment module 308 is further configured to: Calculating an adjustment position parameter corresponding to the target virtual object according to the position difference information and a preset adjustment time corresponding to the target action; The current position information of the target virtual object is determined, and the adjustment position parameter is superimposed on the current position information to adjust the current position information of the target virtual object.
[0081] In an optional embodiment, the playing module 304 is further configured to: Traversing multiple candidate actions included in the target action set, and reading action trajectories and lens trajectories of the multiple candidate actions; According to the action trajectory and the lens trajectory, a candidate action among the multiple candidate actions that meets a preset action condition is determined as the target action.
[0082] In an optional embodiment, the playing module 304 is further configured to: According to the action trajectory and the lens trajectory, obstacle detection is performed on the multiple candidate actions in the virtual scene where the target virtual object is located to obtain an obstacle detection result; According to the obstacle detection result, a candidate action among the multiple candidate actions that meets the preset action condition is determined as the target action.
[0083] In an optional embodiment, the first determining module 302 is further configured to: In response to an action play instruction for a target virtual object, a target action set corresponding to the target virtual object is determined from a plurality of candidate action sets.
[0084] In an optional embodiment, the device further includes a creation module configured to: Creating a candidate action set, wherein the candidate action set includes multiple candidate actions; For each candidate action among the multiple candidate actions, a preset adjustment time corresponding to each candidate action is configured, and the number of virtual objects corresponding to each candidate action is configured, wherein the preset adjustment time is used to adjust the position of the virtual object.
[0085] The above-mentioned device can determine the target action set corresponding to the current target virtual object after responding to the action playback instruction for the target virtual object, and determine and play the target action from the target action set. When it is determined that the playback time of the target action reaches the preset adjustment time, the position difference information between the target virtual object and the associated virtual object is determined, and the current position information of the target virtual object is adjusted according to the position difference information. By pre-defining the target action set, the target action is directly determined and played from the target action set, and the position difference information is dynamically calculated and the current position information of the target virtual object is adjusted, thereby ensuring that the animation performance of the interactive action between the target virtual object and the associated virtual object is natural and smooth, without the need to prepare the animation sequence corresponding to each interactive action in advance, and on the basis of reducing the cost of interactive action production, the natural and smooth interactive action can be ensured, further reducing the occupation of computing resources and storage resources.
[0086] The above is a schematic scheme of a virtual object processing device of this embodiment. It should be noted that the technical scheme of the virtual object processing device and the technical scheme of the virtual object processing method described above belong to the same concept, and the details not described in detail in the technical scheme of the virtual object processing device can be referred to the description of the technical scheme of the virtual object processing method described above.
[0087] Figure 4The block diagram of a computing device 400 according to one embodiment of the present specification is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.
[0088] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0089] In one embodiment of the present application, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0090] The computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 400 may also be a mobile or stationary server.
[0091] The processor 420 is used to execute the following computer program / instructions, which implement the steps of the above-mentioned virtual object processing method when executed by the processor.
[0092] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the virtual object processing method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the virtual object processing method embodiment.
[0093] An embodiment of the present specification further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned virtual object processing method when executed by a processor.
[0094] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the virtual object processing method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the virtual object processing method embodiment.
[0095] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned virtual object processing method when executed by a processor.
[0096] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above virtual object processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above virtual object processing method.
[0097] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0098] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0099] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0100] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0101] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A virtual object processing method, characterized in that: include: In response to an action play instruction for a target virtual object, determining a target action set corresponding to the target virtual object; Determine a target action from the target action set and play the target action; When it is determined that the playback time of the target action reaches the preset adjustment time, determining position difference information between the target virtual object and a virtual object associated with the target virtual object; According to the position difference information, the current position information of the target virtual object is adjusted.
2. The method according to claim 1, characterized in that The determining of the position difference information between the target virtual object and the virtual object associated with the target virtual object includes: Determine a distance difference and a facing angle difference between the target virtual object and a virtual object associated with the target virtual object; Determining a reference distance difference and a reference orientation angle difference corresponding to the target action according to a preset adjustment time corresponding to the target action; The position difference information between the target virtual object and the associated virtual object is calculated according to the distance difference and the facing angle difference, the reference distance difference and the reference facing angle difference.
3. The method according to claim 1 or 2, characterized in that: The adjusting the current position information of the target virtual object according to the position difference information includes: Calculating an adjustment position parameter corresponding to the target virtual object according to the position difference information and a preset adjustment time corresponding to the target action; The current position information of the target virtual object is determined, and the adjustment position parameter is superimposed on the current position information to adjust the current position information of the target virtual object.
4. The method according to claim 1, characterized in that: The determining a target action from the target action set comprises: Traversing multiple candidate actions included in the target action set, and reading action trajectories and lens trajectories of the multiple candidate actions; According to the action trajectory and the lens trajectory, a candidate action among the multiple candidate actions that meets a preset action condition is determined as the target action.
5. The method according to claim 4, characterized in that The step of determining, according to the action trajectory and the lens trajectory, a candidate action among the plurality of candidate actions that meets a preset action condition as the target action comprises: According to the action trajectory and the lens trajectory, obstacle detection is performed on the multiple candidate actions in the virtual scene where the target virtual object is located to obtain an obstacle detection result; According to the obstacle detection result, a candidate action among the multiple candidate actions that meets the preset action condition is determined as the target action.
6. The method according to claim 1, characterized in that The step of determining, in response to an action play instruction for a target virtual object, a target action set corresponding to the target virtual object comprises: In response to an action play instruction for a target virtual object, a target action set corresponding to the target virtual object is determined from a plurality of candidate action sets.
7. The method according to any one of claims 1-2, 4-6, characterized in that: Before the step of responding to the action play instruction for the target virtual object and determining the target action set corresponding to the target virtual object, the method further comprises: Creating a candidate action set, wherein the candidate action set includes multiple candidate actions; For each candidate action among the multiple candidate actions, a preset adjustment time corresponding to each candidate action is configured, and the number of virtual objects corresponding to each candidate action is configured, wherein the preset adjustment time is used to adjust the position of the virtual object.
8. A computing device, characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any one of claims 1 to 7.
10. A computer program product, characterized in that The method comprises a computer program / instruction which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Virtual object control method and device
CN120884889A