Virtual character sight line orientation adjustment method, terminal and storage medium
By filtering and adjusting objects in the game environment, and using interpolation animation to adjust the virtual character's gaze direction based on object type and target gaze point, the problem of uncontrollable gaze in game photo mode was solved, thus improving photo quality.
Patent Information
- Application Number
- CN202311195986.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2025-01-10
AI Technical Summary
In the game environment, the virtual character controlled by the player cannot control the direction of its gaze in photo mode, resulting in unsatisfactory photo effects that fail to meet the player's needs.
By filtering objects that meet preset conditions in the game environment, determining the target gaze point, and adjusting the gaze direction according to the object type, interpolation animation is used to transition the gaze direction of the target object to the target gaze point.
It enables precise adjustment of the virtual character's gaze direction in photo mode, improving the visual effects of the game and meeting the recording needs of players.
Smart Images

Figure CN119280793A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image display technology, and in particular to a method, a terminal and a storage medium for adjusting the sight direction of a virtual character. Background Art
[0002] In the related art, a player user can control a protagonist object in a game environment to play the game. In general games, a photo control is provided for the player user to trigger the control to enter a photo mode. When the photo mode is triggered, the posture of the protagonist object before entering the photo mode is obtained, and the protagonist object's photo image is set with the posture.
[0003] In real life, when taking a photo of a person, the person will look towards the camera or gaze at a certain point to achieve a better photo effect. However, in the photo mode of the game environment, generally speaking, the direction of sight of the character not controlled by the current player cannot be controlled, which will cause the eyes of the person being photographed to be "aimless", and ultimately lead to unsatisfactory picture effects after taking the photo, which cannot meet the requirements of players and users. Summary of the invention
[0004] The embodiment of the present invention provides a method, a terminal and a storage medium for adjusting the sight line direction of a virtual character, so as to obtain a better picture effect by adjusting the sight line direction of a target object, and meet the needs of players to record the current game screen.
[0005] In a first aspect, an embodiment of the present invention provides a method for adjusting the sight direction of a virtual character, the method comprising:
[0006] In response to the sight direction adjustment event, determining at least one first object whose position satisfies a first preset condition among a plurality of objects in the game environment;
[0007] Get the target gaze point;
[0008] Among the at least one first object, determining at least one second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition;
[0009] In response to a selection operation of a player user on a target object among the at least one second object, determining an object type of the target object;
[0010] The sight line direction is adjusted based on the target object and the target gaze point in a sight line direction adjustment manner corresponding to the determined object type.
[0011] Optionally, determining at least one first object whose position satisfies a first preset condition among the multiple objects in the game environment includes:
[0012] Among multiple objects in the game environment, determine at least one first object whose position is within a controllable range, wherein the controllable range is a range centered on the protagonist object controlled by the player user and with a preset distance as a radius.
[0013] Optionally, determining, among the at least one first object, at least one second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition comprises:
[0014] For any one of the at least one first object, determining an angle between a line between the any one object and the target gaze point and a body orientation of the any one object;
[0015] If the angle corresponding to any one of the objects does not exceed a preset limited range, the any one of the objects is determined as a second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition.
[0016] Optionally, acquiring the target gaze point includes:
[0017] If the configured target gaze mode is to look at a camera in the game environment, the position of the camera is determined as the target gaze point.
[0018] Optionally, obtaining the target gaze point includes:
[0019] If the configured target gaze mode is to look at the protagonist object controlled by the player user, the position of the protagonist object is determined as the target gaze point;
[0020] The method further comprises:
[0021] Among the at least one first object, the protagonist object is eliminated.
[0022] Optionally, acquiring the target gaze point includes:
[0023] If the configured target gaze mode is a custom mode, obtaining the gaze point input by the player user in the screen coordinate system;
[0024] Determine a target gaze point corresponding to the received gaze point in the game environment, wherein the game environment is a three-dimensional virtual environment.
[0025] Optionally, the adjusting the sight line direction based on the target object and the target gaze point by using a sight line direction adjustment method corresponding to the determined object type includes:
[0026] When the object type of the target object is a player character or a first type NPC non-player character, recording the original state information before adjusting the sight direction of the target object, the first type NPC being an NPC having a state synchronization protocol with the server;
[0027] Pause the state synchronization process between the local target object and the server;
[0028] locally generating a replica object having the same original state information as the target object, and hiding the target object;
[0029] The sight line direction of the replica object is adjusted to be toward the target gaze point.
[0030] Optionally, adjusting the sight line direction of the replica object to be toward the target gaze point includes:
[0031] Determining an original gaze point of the replica object before adjusting the gaze direction;
[0032] Based on the original gaze point, the target gaze point, and a pre-made head turning motion and eye movement motion corresponding to the target object, a first interpolation animation is generated in which the sight line direction of the replica object transitions from the original gaze point to the target gaze point;
[0033] Play the first interpolation animation.
[0034] Optionally, the method further comprises:
[0035] In response to the adjustment exit instruction, obtaining current state information of the target object from the server;
[0036] displaying the target object;
[0037] Based on the current state information, adjusting the current state of the target object and deleting the replica object;
[0038] Start the state synchronization process between the local target object and the server.
[0039] Optionally, the target object is a non-humanoid object, the skeleton corresponding to the target object for completing the head turning action is preconfigured, the eye model of the target object is an independently set model and the eyeball in the eye model is movable.
[0040] Optionally, the adjusting the sight line direction based on the target object and the target gaze point by using a sight line direction adjustment method corresponding to the determined object type includes:
[0041] When the object type of the target object is a second type NPC, determining the original gaze point of the target object before adjusting the sight direction, wherein the second type NPC is an NPC that does not have a state synchronization protocol with the server;
[0042] Based on the original gaze point, the target gaze point, and the pre-made head turning motion and eye movement motion corresponding to the target object, a second interpolation animation is generated in which the sight direction of the target object transitions from the original gaze point to the target gaze point;
[0043] Play the second interpolation animation.
[0044] Optionally, the adjusting the sight line direction based on the target object and the target gaze point by using a sight line direction adjustment method corresponding to the determined object type includes:
[0045] When the object type of the target object is a third type NPC, determining an initial animation performance action and a preset idle action of the target object, wherein the third type NPC is an animation performance type NPC;
[0046] Generating a third interpolation animation transitioning from the initial animation performance action to the idle action;
[0047] Playing the third interpolation animation to make the target object enter an idle state, wherein the idle state refers to an idle animation state of the target object when it is not controlled by the player user;
[0048] After the target object enters the idle state, the sight direction of the target object in the idle state is adjusted to be toward the target gaze point.
[0049] Optionally, the adjusting the sight line direction of the target object in the idle state to be toward the target gaze point includes:
[0050] Determine the original gaze point of the target object in the idle state before adjusting the gaze direction;
[0051] Based on the original gaze point, the target gaze point, and the pre-made head turning motion and eye movement motion corresponding to the target object, a fourth interpolation animation is generated in which the sight line direction of the target object transitions from the original gaze point to the target gaze point;
[0052] The fourth interpolation animation is played.
[0053] Optionally, the method further comprises:
[0054] In response to the adjustment exit instruction, the target object exits the idle state;
[0055] The performance animation of the target object continues to be played starting from the animation playback node corresponding to the initial animation performance action.
[0056] In a second aspect, an embodiment of the present invention provides a terminal comprising a processor and a memory, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the method for adjusting the line of sight of a virtual character in the first aspect.
[0057] In a third aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of a terminal, the processor can at least implement the method for adjusting the line of sight of a virtual character in the first aspect.
[0058] By adopting the present invention, each object can be screened based on the position of each object in the game environment to screen out at least one first object that meets the first preset condition. After obtaining the target gaze point, at least one first object can also be screened based on the positional relationship between the body orientation of each first object and the target gaze point to screen out at least one second object that can be used as a photographing object (target object) that meets the second preset condition. The player user can be allowed to select from at least one second object, and after the player user selects the target object as the photographing object, the object type of the target object can be determined. Different sight line direction adjustment methods are provided for different object types, and the sight line direction adjustment method corresponding to the object type of the target object can be used to adjust the sight line direction of the target object. In this way, the target object can be fixed on the target gaze point in a specific mode, thereby adjusting the sight line direction of the target object to obtain a better picture effect, meeting the needs of the player user to record the current game screen. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0060] Figure 1 A schematic diagram of a flow chart of a method for adjusting the sight direction of a virtual character provided by an embodiment of the present invention;
[0061] Figure 2 A schematic diagram of a sight direction adjustment scenario provided by an embodiment of the present invention;
[0062] Figure 3 A schematic diagram of another sight direction adjustment scenario provided by an embodiment of the present invention;
[0063] Figure 4 A schematic diagram of another sight direction adjustment scenario provided by an embodiment of the present invention;
[0064] Figure 5 A flow chart of a method for adjusting the sight direction provided for a player character or a first type of NPC provided in an embodiment of the present invention;
[0065] Figure 6 A schematic flow chart of a method for adjusting the sight direction provided for a second type of NPC provided in an embodiment of the present invention;
[0066] Figure 7 A schematic flow chart of a method for adjusting the sight direction provided for a third type of NPC provided in an embodiment of the present invention;
[0067] Figure 8 A schematic diagram of the structure of a virtual character sight direction adjustment device provided by an embodiment of the present invention;
[0068] Fig. 9 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0070] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0071] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0072] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0073] Figure 1 The present invention provides a flowchart of a method for adjusting the sight direction of a virtual character, which can be applied to a terminal. Figure 1 As shown, the method comprises the following steps:
[0074] 101. In response to a sight direction adjustment event, determine at least one first object whose position satisfies a first preset condition among multiple objects in a game environment.
[0075] 102. Get the target gaze point.
[0076] 103. In the at least one first object, determine at least one second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition.
[0077] 104. In response to a selection operation of a player user on a target object among the at least one second object, determine an object type of the target object.
[0078] 105. Adjust the sight line direction based on the target object and the target gaze point using a sight line direction adjustment method corresponding to the determined object type.
[0079] Among them, the above-mentioned sight direction adjustment event can be, for example, a photo mode trigger button provided to the player user in the game interface, and the player user triggers the button to enter the photo mode. When the photo mode is triggered, it is considered that the sight direction adjustment event is detected. The above method is a sight direction adjustment event actively triggered by the player user, or the sight direction adjustment event can also be triggered in a passive manner. For example, when the player user controls the protagonist game character, a certain script node is entered. If the script node is bound to entering the photo mode, the sight direction adjustment event can also be triggered. However, those skilled in the art should understand that whether the user actively triggers the photo, the script node triggers the photo, or the recording of the current screen is triggered in any other way, whether it is triggered by an action in the game program or an external action, it can be considered that a sight direction adjustment event has been generated.
[0080] Take taking photos as an example. In daily life, people will look at a certain point when taking photos, which can achieve better artistic effects. Similarly, when taking photos of virtual characters in the game, their gaze direction can be adjusted to make the virtual characters look more realistic, which can also achieve better artistic effects and improve the player's gaming experience.
[0081] After entering the photo mode, the target gaze point can be obtained. The target gaze point can be set by the player user through relevant operations. In the embodiment of the present invention, three methods of setting the target gaze point are provided. Of course, in addition to the three methods of setting the target gaze point described in the embodiment of the present invention, other methods of setting the target gaze point can be added according to actual needs, all of which are within the protection scope required by the embodiment of the present invention. The three methods of setting the target gaze point will be introduced one by one below.
[0082] (1) Looking towards the camera: Optionally, the process of obtaining the target gaze point can be implemented as follows: if the configured target gaze mode is to look towards the camera in the game environment, the position of the camera is determined as the target gaze point.
[0083] In actual applications, players can select the target gaze mode they want to use from the multiple gaze modes provided in the photo mode. Figure 2 As shown, if the target gaze mode selected by the player user is to let the photographed subject look at the camera in the game environment, the position of the camera can be determined and set as the target gaze point. It should be noted that the photographed subject can be one or more. When there are multiple photographed subjects, all photographed subjects can look at the same set target gaze point.
[0084] (2) Looking at the main character object: Optionally, the process of obtaining the target gaze point can be implemented as follows: if the configured target gaze mode is to look at the main character object controlled by the player user, then the position of the main character object is determined as the target gaze point;
[0085] In actual applications, players can select the target gaze mode they want to use from the multiple gaze modes provided in the photo mode. Figure 3 As shown, if the target gaze mode selected by the player user is to let the photographed object look at the protagonist object controlled by the player user, the position of the protagonist object can be obtained and set as the target gaze point. It should be noted that if the mode of looking at the protagonist object is selected, the direction of the protagonist object's sight cannot be adjusted at present, because the protagonist object cannot look at itself. In addition, it should be noted that when there are multiple photographed objects, all photographed objects can look at the same set target gaze point.
[0086] (3) Looking at a custom position: Optionally, the process of obtaining a target gaze point can be implemented as follows: if the configured target gaze mode is a custom mode, obtaining a gaze point input by the player user in the screen coordinate system; and determining a target gaze point corresponding to the received gaze point in the game environment, wherein the game environment is a three-dimensional virtual environment.
[0087] In addition to the above-mentioned methods, in the embodiment of the present invention, the player user is also allowed to freely select the target gaze point in the game environment through the custom mode. Figure 4 As shown, if the target gaze mode selected by the player user is a custom mode, the gaze point input by the player user in the screen coordinate system can be obtained. For example, multiple optional gaze points can be automatically generated for the player user to select from, or an adjustable control point can be displayed in the UI (User Interface) interface, and the player user can set the gaze point by dragging the adjustable control point. When it is detected that the player user stops dragging the adjustable control point, the position where the adjustable control point finally stops is the position of the gaze point input by the player user.
[0088] It is understandable that since the player user can only select the gaze point through the interface presented to the player user, and the interface is generally drawn in the screen coordinate system, the screen coordinate system is a two-dimensional coordinate system, and the photographed object is in the game environment, which is a three-dimensional virtual environment. Therefore, for the photographed object, it can only look at a certain gaze point in the three-dimensional virtual environment where it is located. Since the gaze point selected by the player user and the three-dimensional virtual environment where the photographed object is located are not in the same coordinate system, the gaze point input by the player user needs to be mapped to the corresponding position in the three-dimensional virtual environment first, and the mapped position is the position of the target gaze point.
[0089] In addition, in some optional embodiments, the player user can also directly select the target gaze point in the three-dimensional virtual environment. In this case, there is no need to map the target gaze point selected by the player user. The target gaze point selected by the player user is directly a point in the three-dimensional virtual environment.
[0090] The above describes the method of setting the target gaze point. On the other hand, before, after, or at the same time as setting the target gaze point, at least one first object whose position meets the first preset condition can be determined among multiple objects in the game environment. The at least one first object is the aforementioned photographing object that can be selected by the player user. It should be noted that in the embodiment of the present invention, the virtual character that can be used as the photographing object can not only be the protagonist object controlled by the player user, but also can be various types of NPC (Non-Player Character), player characters of non-protagonist objects controlled by other player users, etc. Although there are many types of object categories of photographing objects that can be selected by the player user, not all game characters that appear in the game environment can be used as the current photographing object. All game characters in the game environment need to be screened to select at least one first object suitable for the player user to select. The position of the first object needs to meet the first preset condition.
[0091] In certain optional embodiments, optionally, the process of determining at least one first object whose position satisfies a first preset condition among multiple objects in the game environment can be implemented as follows: among multiple objects in the game environment, determining at least one first object whose position is within a controllable range, wherein the controllable range is a range centered on the protagonist object controlled by the player user and with a preset distance as a radius.
[0092] In actual applications, the position of the protagonist object controlled by the player user can be obtained first, and then a controllable range can be determined with the protagonist object as the center and a preset distance as the radius. The game characters within the controllable range can be used as the first object. For example, the distance between game character A and the protagonist object is 11, the distance between game character B and the protagonist object is 2, and the distance between game character C and the protagonist object is 5, and the distance corresponding to the set controllable range is 10, then game character A cannot be used as the first object, but game characters B and C can be used as the first object.
[0093] It is worth noting that if some game characters are too far away from the main character object, it is generally impossible for them to appear in the same photographed image at the same time as an object at a farther distance. Therefore, it is necessary to eliminate the object at a farther distance to prevent it from being used as a photographed object. Specifically, there are two reasons why the first object that does not meet the distance requirement needs to be eliminated: First, due to the performance limitations of the game itself, it will not load infinitely far game characters without limit (for example, only the detailed texture of the game character with a radius of 200m centered on the origin of the screen coordinate system is loaded, and only the blurred figure is loaded for the game character beyond the above distance, and the detailed texture is not loaded. This blurred figure does not have the concept of eyeballs and sight); second, from the actual game needs, the player user can only see the game environment content within the screen display range. If the player user is allowed to control the sight direction of the game character that is too far away, it does not have practical significance.
[0094] It should be noted that after determining at least one first object, if the target sight adjustment mode selected by the player user is to look at the protagonist object, the protagonist object can be removed from the at least one first object because, as mentioned above, the protagonist object cannot look at itself.
[0095] Furthermore, after at least one first object is finally determined and the target gaze point is set, the at least one first object can be further screened to select a suitable second object for the player user to select as a photographing object. Based on this, at least one second object can be determined in the at least one first object, the positional relationship between the body orientation and the target gaze point meeting the second preset condition.
[0096] Optionally, the above process of determining the second object can be implemented as follows: for any object among at least one first object, determine the angle between the line between any object and the target gaze point and the body orientation of any object; if the angle corresponding to any object does not exceed a preset limit range, then any object is determined as the second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition.
[0097] It can be understood that, for any first object i, the body orientation of the first object i at the moment of entering the photo mode is S1, the position of the first object i at the moment of entering the photo mode is P1, and the position of the set target gaze point is P2, then a line can be connected between P1 and P2, and the connecting line is l. There is a certain angle between the connecting line l and the body orientation S1, which can be recorded as △C, and it can be judged whether the angle △C exceeds the preset limit range. If △C does not exceed the preset limit range, the above-mentioned first object i can be determined as a second object that meets the requirements.
[0098] It is worth noting that when a certain game character can be used as a second object, the game character can be displayed to the player user in the photo mode, so that the player user can choose whether to use it as the final photo object.
[0099] It should be noted that, when the camera mode is triggered, the line of sight of the game character is generally not consistent with the target gaze point, that is, the game character is looking at other locations. After the player user sets the target gaze point, the line of sight of the game character selected as the camera object needs to be adjusted to the target gaze point. The adjustment process can generally include two parts: adjusting the position of the eyeballs and turning the head.
[0100] It is worth noting that if the direction of the game character's body is greatly different from the direction of the target gaze point when the photo mode is triggered, such as the game character is facing sideways or almost facing away from the target gaze point, assuming that only the eyeballs and head of the game character are turned, the head needs to be relatively rotated at a large angle, which is obviously inconsistent with reality and does not conform to aesthetic settings, because a person's head cannot be rotated too much. Based on this, when it is found that an object in at least one of the first objects needs to turn its head beyond a limited range if it needs to look at the target gaze point, it is eliminated as a second object that is not a candidate for the photo object.
[0101] After determining at least one second object, the at least one second object can be displayed to the player user for the player user to select a photographing object (target object) therefrom. Specifically, in response to the player user's selection operation of the target object in the at least one second object, the object type of the target object can be determined.
[0102] Among them, the object type may include but is not limited to: protagonist object, player characters of non-protagonist objects controlled by other player users, first type NPC, second type NPC and third type NPC, etc.
[0103] Among them, the first type of NPC can be an NPC that has a state synchronization protocol with the server. The NPC that has a state synchronization protocol with the server refers to an NPC that synchronizes state information with the server. That is, when an NPC is a first type NPC, if a terminal changes the NPC's state information due to some operation events, the changed state information of the NPC needs to be uploaded to the server, and the server distributes the changed state information to all terminals loaded with the NPC. In other words, the first type of NPC needs to synchronize its functions, action performance, parameter information, etc. with the server in real time, and needs to be consistent in the game screen of all player users.
[0104] The second type of NPC may be an NPC that does not have a state synchronization protocol with the server, that is, the NPC's state information is only valid in the current terminal, and does not need to be uploaded to the server, let alone synchronized to other terminals. In other words, different player users can display different performances and functions according to their game progress and the main characters they control, and do not need to be displayed consistently in the game screens of all player users.
[0105] The third type of NPC can be an animation performance type NPC, which is an NPC that performs animation actions according to a predetermined script or a pre-written script under the triggering of certain set events, and is used to enrich the performance of the game environment scene. For players, animation performance type NPCs cannot be controlled or interacted with, and can only watch animation performances, which is a non-idle state. The non-idle state can be simply understood as uncontrollable and uninteractive.
[0106] For target objects with different object types, the embodiments of the present invention provide different ways of adjusting the sight line direction, and the specific adjustment methods will be introduced in the following embodiments, which will not be described in detail here. Through the sight line direction adjustment method corresponding to the object type of the target object, the sight line direction can be adjusted based on the target object and the target fixation point, so as to finally adjust the sight line direction of the target object to be toward the set target fixation point.
[0107] Among them, it is worth noting that, before adjustment, the line of sight of the target object is generally not toward the target gaze point, so it is necessary to slowly move and transition the line of sight of the target object toward the target gaze point, rather than directly mutating the line of sight of the target object to the target gaze point, which would be abrupt. In order to achieve the goal of slowly transitioning the original line of sight of the target object to the target gaze point, the artist can design multiple eyeball rotation and head rotation animations for the target object and other game characters in advance. In the process of adjusting the line of sight, the pre-designed animation can be called up, and an interpolated animation can be generated and played based on the angle that needs to be rotated. After the interpolated animation is played, the line of sight of the target object falls exactly on the target gaze point, thus completing the process of slowly transitioning the line of sight of the target object from the original direction to the target gaze point.
[0108] The following will introduce the process of adjusting the sight direction for target objects of different object types through several different embodiments.
[0109] The embodiment of the present invention provides a process for adjusting the sight direction of a target object when the target object type is a player character or a first type NPC. Figure 5 As shown, the adjustment process may include:
[0110] 501. Record original state information before adjusting the sight direction of the target object.
[0111] 502. Pause the state synchronization process between the local target object and the server.
[0112] 503. Generate a replica object locally that has the same original state information as the target object, and hide the target object.
[0113] 504. Adjust the sight direction of the replica object to be toward the target gaze point.
[0114] Before actually adjusting the sight direction of the target object, the original state information of the target object that last interacted with the server is recorded. The original state information may refer to information such as the position, state, direction, and action of the target object.
[0115] Next, a replica object with the same original state information as the target object can be generated locally, and the target object can be hidden. It should be noted that in addition to the original state information, other information is required to replicate the replica object, such as the texture information, model information, etc. of the target object. This information was originally stored locally, so it can be directly obtained locally. After obtaining the original state information and other information necessary to replicate the target object, the target object can be replicated based on this information, and then a replica object with the same original state information as the target object can be obtained.
[0116] In addition, the target object needs to be hidden, that is, the target object is not displayed in the game environment. Hiding the target object can be set by setting the display / hide property of the target object. When the display / hide property of the target object is set to display, the target object can be displayed in the game environment. When the display / hide property of the target object is set to hide, the target object no longer appears in the game environment, and the player user and other player users cannot see the target object.
[0117] Subsequently, the state synchronization process between the local and server of the target object can be suspended. Meanwhile, it should be noted that in order to make the replica object belong only to the local, the replica object can be generated as a second type NPC accordingly.
[0118] Finally, the sight direction of the replica object can be adjusted to face the target gaze point.
[0119] Optionally, the process of adjusting the sight direction of the replica object to be toward the target gaze point can be implemented as follows: determining the original gaze point of the replica object before adjusting the sight direction; generating a first interpolation animation of the replica object's sight direction transitioning from the original gaze point to the target gaze point based on the original gaze point, the target gaze point, and pre-made head turning movements and eye movement movements corresponding to the target object; and playing the first interpolation animation.
[0120] In actual applications, in order to achieve the goal of slowly transitioning the line of sight of the target object from the original gaze point to the target gaze point, the artist can design multiple basic animations of head turning movements and eye movement movements for the target object in advance, and the basic animation can be carried in an animation sequence or action montage. In the process of adjusting the line of sight, the pre-designed basic animation can be called, and the first interpolation animation is generated based on the angle required to be rotated determined by the positions of the original gaze point and the target gaze point, and then the first interpolation animation is played. After the first interpolation animation is played, the line of sight of the target object falls exactly on the target gaze point, thus completing the process of slowly transitioning the line of sight of the target object from the original gaze point to the target gaze point.
[0121] It is worth noting that if the sight direction of the target object is adjusted directly, since the target object needs to be synchronized with the server, where state synchronization also includes synchronization of sight direction, this will result in that if player user A and player user B respectively use the target object as the photographing object to adjust the sight direction in the same period of time, player user A adjusts the sight direction of the target object to the target gaze point P1, and the server broadcasts the current sight direction of the target object to all player users, including player user B. In the photographing mode, player user B adjusts the sight direction of the target object to the target gaze point P2, and the server broadcasts the sight direction adjusted by player user B to all player users, including player user A. For player user A, the sight direction that has just been adjusted is adjusted to another direction, and the gaming experience is poor. In order to solve this problem, the embodiment of the present invention can be used to generate a local replica object that is the same as the target object, and then the sight direction of the replica object can be adjusted separately on the terminal used by the player user, which can achieve an ideal photographing effect without affecting the gaming experience of other player users, and there will be no control conflicts between multiple player users.
[0122] In some optional embodiments, when the player user wants to exit the photo mode, there is no need to display the replica object and restore to the previous game environment. Based on this, optionally, in response to the adjustment exit instruction, the current state information of the target object is obtained from the server; based on the current state information, the target object is generated and the replica object is deleted; and the state synchronization process between the local and server of the target object is started.
[0123] It is understandable that when exiting the photographing mode, an adjustment exit instruction can be generated accordingly. When the instruction is detected, the state information of the target object at the time of exiting the photographing mode, that is, the current state information, can be obtained from the server. Then, the target object data can be adjusted based on the current state information and the target object can be displayed. Subsequently, it is necessary to restore the state synchronization process between the local and server of the target object that was previously blocked.
[0124] In some optional embodiments, the target object may be a non-humanoid object in addition to a common humanoid object. That is, a non-humanoid virtual character may also adjust the sight direction in the camera mode in the following manner provided by the embodiment of the present invention. Optionally, if the target object is a non-humanoid object, the skeleton corresponding to the target object for completing the head turning action is pre-configured, the eye model of the target object is an independently set model, and the eyeball in the eye model is movable.
[0125] Specifically, when the target object is in an idle state, set the bones of its "head" and the body parts that need to be turned. At the same time, the model of its "eyes" can be separated to ensure that the "eyeballs" in the eye model can rotate. In addition, it is necessary to make basic animations for the head turning action and eyeball movement action in the idle state, so that during the adjustment process, an interpolation animation for adjusting the line of sight direction can be generated based on the basic animation. The specific principle is similar to the principle of adjusting the line of sight direction of a humanoid object. You can refer to the process of adjusting the line of sight direction when the target object is a humanoid object, and I will not elaborate on it here.
[0126] The embodiment of the present invention provides a process for adjusting the sight direction of a target object when the target object type is a second type NPC. Figure 6 As shown, the adjustment process may include:
[0127] 601. Determine the original gaze point of the target object before adjusting the gaze direction.
[0128] 602. Based on the original gaze point, the target gaze point, and the pre-made head turning motion and eye movement motion corresponding to the target object, generate a second interpolation animation for the target object's sight line direction to transition from the original gaze point to the target gaze point.
[0129] 603. Play the second interpolation animation.
[0130] It is worth noting that the second type of NPC is an NPC that does not have a state synchronization protocol with the server, that is, the NPC's state information is only valid in the current terminal, and does not need to be uploaded to the server, let alone synchronized to other terminals. In other words, different player users can show different performances and functions according to the game progress and the protagonist objects they control in the game, and do not need to be consistent in the game screen of all player users. Since the second type of NPC has the characteristic of not needing to be consistent in the game screen of all player users, each player user can adjust the line of sight of the second type NPC, and the process of different player users adjusting the line of sight does not affect each other.
[0131] In actual applications, in order to achieve the goal of slowly transitioning the target object's sight direction from the original gaze point to the target gaze point, the artist can design multiple basic animations of head turning movements and eye movement movements for the target object in advance, and the basic animation can be carried in an animation sequence or action montage. In the process of adjusting the sight direction, the pre-designed basic animation can be called, and a second interpolation animation can be generated based on the angle required to be rotated determined by the positions of the original gaze point and the target gaze point, and then the second interpolation animation is played. After the second interpolation animation is played, the sight direction of the target object falls exactly on the target gaze point, thus completing the process of slowly transitioning the sight direction of the target object from the original gaze point to the target gaze point.
[0132] It is worth noting that since the second type of NPC does not need to synchronize its status with the server, including the need to synchronize its sight direction, even within the same period of time, player user A and player user B respectively use the target object as the photographing object to adjust their sight direction. Player user A adjusts the sight direction of the target object to the target gaze point P1, and other players do not know that the sight direction of the target object has been adjusted to P1, including player user B. While player user B is in the photographing mode, he adjusts the sight direction of the target object to the target gaze point P2, and other players do not know that the sight direction of the target object has been adjusted to P2. Therefore, the sight adjustment processes of player user A and player user B for the target object are independent and will not affect each other.
[0133] The embodiment of the present invention provides a process for adjusting the sight direction of a target object when the target object type is a third type NPC. Figure 7 As shown, the adjustment process may include:
[0134] 701. Determine an initial animation performance action and a preset idle action of a target object.
[0135] 702. Generate a third interpolation animation that transitions from the initial animation performance action to the idle action.
[0136] 703. Play the third interpolation animation to make the target object enter an idle state, where the idle state refers to an idle animation state of the target object when it is not controlled by the player user.
[0137] 704. After the target object enters the idle state, adjust the sight direction of the target object in the idle state to be toward the target gaze point.
[0138] In actual applications, if the target object is an NPC of the animation performance type, the target object is in a non-idle state, that is, it cannot be controlled, and of course its sight direction cannot be controlled. At this time, the target object needs to be transitioned from the non-idle state to the idle state first, and in the idle state, the player user can freely adjust the sight direction of the target object.
[0139] First, we can determine the initial animation performance action of the target object when the camera mode is triggered. For example, if the target object is triggered to enter the camera mode when it opens its mouth to eat, then the action of opening its mouth to eat is the initial animation performance action of the target object. At the same time, we can also obtain the idle action of the target object in the idle animation state when it is not controlled by the player user. This idle action is pre-designed.
[0140] Since the initial animation performance action and the idle action are generally different, it is necessary to transition from the initial animation performance action to the idle action, and then control the target object to enter the idle state. Specifically, a third interpolation animation can be generated to transition from the initial animation performance action to the idle action, and the third interpolation animation can be played. After the third interpolation animation is played, the target object can enter the idle state. When the target object is in the idle state, the sight direction of the target object can be adjusted to face the target gaze point.
[0141] Optionally, the above-mentioned process of adjusting the line of sight of the target object to be toward the target gaze point can be implemented as follows: determining the original gaze point of the target object in an idle state before adjusting the line of sight; based on the original gaze point, the target gaze point, and pre-made head turning movements and eye movement movements corresponding to the target object, generating a fourth interpolation animation in which the line of sight of the target object transitions from the original gaze point to the target gaze point; and playing the fourth interpolation animation.
[0142] In actual applications, in order to achieve the goal of slowly transitioning the line of sight of the target object from the original gaze point to the target gaze point, the artist can design multiple basic animations of head turning movements and eye movement movements for the target object in advance, and the basic animation can be carried in an animation sequence or action montage. In the process of adjusting the line of sight, the pre-designed basic animation can be called, and the fourth interpolation animation can be generated based on the angle required to be rotated determined by the positions of the original gaze point and the target gaze point, and then the fourth interpolation animation can be played. After the fourth interpolation animation is played, the line of sight of the target object falls exactly on the target gaze point, thus completing the process of slowly transitioning the line of sight of the target object from the original gaze point to the target gaze point.
[0143] In some optional embodiments, when the player user wants to exit the photo mode, in response to adjusting the exit instruction, the target object can be exited from the idle state; and the performance animation of the target object can be continued to be played starting from the animation playback node corresponding to the initial animation performance action.
[0144] It is understandable that after the player user completes the photo shooting operation on the target object, the player user wants to exit the photo shooting mode. The player user can find the exit button in the photo shooting mode, and can exit the photo shooting mode by triggering the button. After exiting the photo shooting mode, it is also necessary to convert the target object from the idle state to the non-idle state, and at the same time continue to play the target object's performance animation starting from the animation playback node corresponding to the initial animation performance action performed by the target object at the moment of entering the photo shooting mode. For example, when the target object is triggered to enter the photo shooting mode when opening its mouth to eat, after exiting the photo shooting mode, the target object can continue to perform the performance animation of opening its mouth to eat, which is similar to the pause and resume playback function during video playback.
[0145] By adopting the present invention, each object can be screened based on the position of each object in the game environment to screen out at least one first object that meets the first preset condition. After obtaining the target gaze point, at least one first object can also be screened based on the positional relationship between the body orientation of each first object and the target gaze point to screen out at least one second object that can be used as a photographing object (target object) that meets the second preset condition. The player user can be allowed to select from at least one second object, and after the player user selects the target object as the photographing object, the object type of the target object can be determined. Different sight line direction adjustment methods are provided for different object types, and the sight line direction adjustment method corresponding to the object type of the target object can be used to adjust the sight line direction of the target object. In this way, the target object can be fixed on the target gaze point in a specific mode, so that a better picture effect can be obtained by adjusting the sight line direction of the target object, meeting the setting requirements of the player user for recording the current game screen.
[0146] The following will describe in detail one or more embodiments of the virtual character sight line direction adjustment device of the present invention. Those skilled in the art will appreciate that these virtual character sight line direction adjustment devices can be configured using commercially available hardware components through the steps taught in this solution.
[0147] Figure 8 A schematic diagram of a virtual character sight direction adjustment device provided by an embodiment of the present invention is shown in FIG. Figure 8 As shown, the device comprises:
[0148] A screening module 81, configured to determine, in response to a sight direction adjustment event, at least one first object whose position satisfies a first preset condition among a plurality of objects in the game environment;
[0149] An acquisition module 82, used to acquire a target gaze point;
[0150] The screening module 81 is used to determine, from the at least one first object, at least one second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition;
[0151] A determination module 83, configured to determine an object type of the target object in the at least one second object in response to a selection operation of the player user on the target object;
[0152] The adjustment module 84 is configured to adjust the sight line direction based on the target object and the target gaze point by using a sight line direction adjustment method corresponding to the determined object type.
[0153] Optionally, the screening module 81 is used to:
[0154] Among multiple objects in the game environment, determine at least one first object whose position is within a controllable range, wherein the controllable range is a range centered on the protagonist object controlled by the player user and with a preset distance as a radius.
[0155] Optionally, the screening module 81 is used to:
[0156] For any one of the at least one first object, determining an angle between a line between the any one object and the target gaze point and a body orientation of the any one object;
[0157] If the angle corresponding to any one of the objects does not exceed a preset limited range, the any one of the objects is determined as a second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition.
[0158] Optionally, the acquisition module 82 is used to:
[0159] If the configured target gaze mode is to look at a camera in the game environment, the position of the camera is determined as the target gaze point.
[0160] Optionally, the acquisition module 82 is used to:
[0161] If the configured target gaze mode is to look at the protagonist object controlled by the player user, the position of the protagonist object is determined as the target gaze point;
[0162] Among the at least one first object, the protagonist object is eliminated.
[0163] Optionally, the acquisition module 82 is used to:
[0164] If the configured target gaze mode is a custom mode, obtaining the gaze point input by the player user in the screen coordinate system;
[0165] Determine a target gaze point corresponding to the received gaze point in the game environment, wherein the game environment is a three-dimensional virtual environment.
[0166] Optionally, the adjustment module 84 is used to:
[0167] When the object type of the target object is a player character or a first type NPC non-player character, recording the original state information before adjusting the sight direction of the target object, the first type NPC being an NPC having a state synchronization protocol with the server;
[0168] Pause the state synchronization process between the local target object and the server;
[0169] locally generating a replica object having the same original state information as the target object, and hiding the target object;
[0170] The sight line direction of the replica object is adjusted to be toward the target gaze point.
[0171] Optionally, the adjustment module 84 is used to:
[0172] Determining an original gaze point of the replica object before adjusting the gaze direction;
[0173] Based on the original gaze point, the target gaze point, and the pre-made head turning motion and eye movement motion corresponding to the target object, a first interpolation animation is generated in which the sight line direction of the replica object transitions from the original gaze point to the target gaze point;
[0174] Play the first interpolation animation.
[0175] Optionally, the device further comprises an exit module, wherein the exit module is configured to:
[0176] In response to the adjustment exit instruction, obtaining current state information of the target object from the server;
[0177] displaying the target object;
[0178] Based on the current state information, adjust the current state of the target object and delete the replica object;
[0179] Start the state synchronization process between the local target object and the server.
[0180] Optionally, the target object is a non-humanoid object, the skeleton corresponding to the target object for completing the head turning action is preconfigured, the eye model of the target object is an independently set model and the eyeball in the eye model is movable.
[0181] Optionally, the adjustment module 84 is used to:
[0182] When the object type of the target object is a second type NPC, determining the original gaze point of the target object before adjusting the sight direction, wherein the second type NPC is an NPC that does not have a state synchronization protocol with the server;
[0183] Based on the original gaze point, the target gaze point, and a pre-made head turning motion and eye movement motion corresponding to the target object, a second interpolation animation is generated in which the sight direction of the target object transitions from the original gaze point to the target gaze point;
[0184] Play the second interpolation animation.
[0185] Optionally, the adjustment module 84 is used to:
[0186] When the object type of the target object is a third type NPC, determining an initial animation performance action and a preset idle action of the target object, wherein the third type NPC is an animation performance type NPC;
[0187] Generating a third interpolation animation transitioning from the initial animation performance action to the idle action;
[0188] Playing the third interpolation animation to make the target object enter an idle state, wherein the idle state refers to an idle animation state of the target object when it is not controlled by the player user;
[0189] After the target object enters the idle state, the sight direction of the target object in the idle state is adjusted to be toward the target gaze point.
[0190] Optionally, the adjustment module 84 is used to:
[0191] Determine the original gaze point of the target object in the idle state before adjusting the gaze direction;
[0192] Based on the original gaze point, the target gaze point, and the pre-made head turning motion and eye movement motion corresponding to the target object, a fourth interpolation animation is generated in which the sight line direction of the target object transitions from the original gaze point to the target gaze point;
[0193] The fourth interpolation animation is played.
[0194] Optionally, the exit module is further used to:
[0195] In response to the adjustment exit instruction, the target object exits the idle state;
[0196] The performance animation of the target object continues to be played starting from the animation playback node corresponding to the initial animation performance action.
[0197] Figure 8 The device shown can perform the aforementioned Figures 1 to 7 The method for adjusting the line of sight of a virtual character provided in the illustrated embodiment, the detailed execution process and technical effects thereof refer to the description in the aforementioned embodiment, which will not be repeated here.
[0198] In one possible design, the above Figure 8 The structure of the virtual character sight direction adjustment device shown can be implemented as a terminal, such as Fig. 9 As shown, the terminal may include: a processor 91 and a memory 92. The memory 92 stores executable code, and when the executable code is executed by the processor 91, the processor 91 can at least implement the above-mentioned Figures 1 to 7 The illustrated embodiment provides a method for adjusting the direction of a virtual character's line of sight.
[0199] Optionally, the terminal may further include a communication interface 93 for communicating with other devices.
[0200] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of a terminal, the processor can at least implement the above-mentioned Figures 1 to 7 The illustrated embodiment provides a method for adjusting the direction of a virtual character's line of sight.
[0201] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0202] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0203] The virtual character sight direction adjustment method provided in the embodiment of the present invention can be executed by a certain program / software, and the program / software can be provided by the network side. The terminal mentioned in the above embodiment can download the program / software to a local non-volatile storage medium, and when it needs to execute the above virtual character sight direction adjustment method, the program / software is read into the memory by the CPU, and then the CPU executes the program / software to implement the virtual character sight direction adjustment method provided in the above embodiment. The execution process can refer to the above Figures 1 to 7 Instructions in .
[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for adjusting the sight direction of a virtual character, characterized in that: include: In response to the sight direction adjustment event, determining at least one first object whose position satisfies a first preset condition among a plurality of objects in the game environment; Get the target gaze point; Among the at least one first object, determining at least one second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition; In response to a selection operation of a player user on a target object among the at least one second object, determining an object type of the target object; The sight line direction is adjusted based on the target object and the target gaze point in a sight line direction adjustment manner corresponding to the determined object type.
2. The method according to claim 1, characterized in that The step of determining at least one first object whose position satisfies a first preset condition among a plurality of objects in the game environment comprises: Among multiple objects in the game environment, determine at least one first object whose position is within a controllable range, wherein the controllable range is a range centered on the protagonist object controlled by the player user and with a preset distance as a radius.
3. The method according to claim 1, characterized in that The step of determining, among the at least one first object, at least one second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition comprises: For any one of the at least one first object, determining an angle between a line between the any one object and the target gaze point and a body orientation of the any one object; If the angle corresponding to any one of the objects does not exceed a preset limited range, the any one of the objects is determined as a second object whose positional relationship between the body orientation and the target gaze point satisfies a second preset condition.
4. The method according to claim 1, characterized in that: The adjusting the sight line direction based on the target object and the target gaze point by using the sight line direction adjustment method corresponding to the determined object type includes: When the object type of the target object is a player character or a first type NPC non-player character, recording the original state information before adjusting the sight direction of the target object, the first type NPC being an NPC having a state synchronization protocol with the server; Pause the state synchronization process between the local target object and the server; locally generating a replica object having the same original state information as the target object, and hiding the target object; The sight line direction of the replica object is adjusted to be toward the target gaze point.
5. The method according to claim 4, characterized in that The adjusting the sight line direction of the replica object to be toward the target gaze point includes: Determining an original gaze point of the replica object before adjusting the gaze direction; Based on the original gaze point, the target gaze point, and the pre-made head turning motion and eye movement motion corresponding to the target object, a first interpolation animation is generated in which the sight line direction of the replica object transitions from the original gaze point to the target gaze point; Play the first interpolation animation.
6. The method according to claim 1, characterized in that The adjusting the sight line direction based on the target object and the target gaze point by using the sight line direction adjustment method corresponding to the determined object type includes: When the object type of the target object is a second type NPC, determining the original gaze point of the target object before adjusting the sight direction, wherein the second type NPC is an NPC that does not have a state synchronization protocol with the server; Based on the original gaze point, the target gaze point, and a pre-made head turning motion and eye movement motion corresponding to the target object, a second interpolation animation is generated in which the sight direction of the target object transitions from the original gaze point to the target gaze point; Play the second interpolation animation.
7. The method according to claim 1, characterized in that The adjusting the sight line direction based on the target object and the target gaze point by using the sight line direction adjustment method corresponding to the determined object type includes: When the object type of the target object is a third type NPC, determining an initial animation performance action and a preset idle action of the target object, wherein the third type NPC is an animation performance type NPC; Generating a third interpolation animation transitioning from the initial animation performance action to the idle action; Playing the third interpolation animation to make the target object enter an idle state, wherein the idle state refers to an idle animation state of the target object when it is not controlled by the player user; After the target object enters the idle state, the sight direction of the target object in the idle state is adjusted to be toward the target gaze point.
8. The method according to claim 7, characterized in that The step of adjusting the sight line direction of the target object in the idle state to be toward the target gaze point includes: Determine the original gaze point of the target object in the idle state before adjusting the gaze direction; Based on the original gaze point, the target gaze point, and the pre-made head turning motion and eye movement motion corresponding to the target object, a fourth interpolation animation is generated in which the sight line direction of the target object transitions from the original gaze point to the target gaze point; The fourth interpolation animation is played.
9. A terminal, characterized in that: include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the method for adjusting the sight direction of a virtual character as described in any one of claims 1-8.
10. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of a terminal, the processor is caused to execute the method for adjusting the sight direction of a virtual character according to any one of claims 1 to 8.