Virtual character switching method and apparatus, device, and storage medium
By obtaining and replacing virtual character attribute data, and using the same controller to switch virtual character styles, the problem of unsmooth switching in the existing technology is solved, seamless switching of virtual characters between different styles is realized, and the switching effect is improved.
Patent Information
- Application Number
- PCT/CN2024/071993
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-06
- Filing Date
- 2024-01-12
- Publication Date
- 2024-09-12
AI Technical Summary
In the prior art, when switching virtual characters, it is necessary to re-initialize and load a new virtual character, causing the switching process to be unsmooth.
By obtaining the second attribute data, replacing the first attribute data, and using the same controller to switch virtual character styles, the step of changing the control system is avoided.
It realizes the seamless switching of virtual characters between different styles, improves the switching effect and avoids the problem of unsmooth character connection.
Smart Images

Figure CN2024071993_12092024_PF_FP_ABST
Abstract
Description
Virtual character switching method, device, equipment and storage medium
[0001] This application claims priority to Chinese patent application No. 2023102521981, filed on March 6, 2023, entitled “Method, device, equipment and storage medium for switching virtual characters”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for switching virtual characters. Background Art
[0003] During the game, players often need to switch the virtual character they are controlling, switching the currently controlled virtual character to another virtual character.
[0004] In the related art, when switching a virtual character, it is equivalent to reinitializing and loading a new virtual character. That is, it is necessary to load the data of the new virtual character and create a new controller, and then control the newly created virtual character through the new controller.
[0005] However, the above switching process will result in the switching of virtual characters not being smooth enough.
[0006] Summary of the Invention
[0007] The present invention provides a method, apparatus, device, and storage medium for switching virtual characters. The technical solution is as follows:
[0008] According to one aspect of an embodiment of the present application, a method for switching a virtual character is provided, the method being executed by a terminal device, the method comprising:
[0009] Displaying a virtual character in a first style constructed based on first attribute data, wherein the movement of the virtual character in the first style is controlled by a first controller, and the first attribute data is used to define that the virtual character is in the first style;
[0010] During display of the virtual character in the first style, in response to a switching operation, obtaining second attribute data, the second attribute data being used to define a second style of the virtual character, the second style being different from the first style;
[0011] Using the second attribute data to replace the first attribute data;
[0012] The virtual character in the first style is switched to a virtual character in the second style constructed based on the second attribute data, and the actions of the virtual character in the second style are controlled by the first controller.
[0013] According to one aspect of an embodiment of the present application, a device for switching a virtual character is provided, the device comprising:
[0014] A display module, configured to display a virtual character in a first style constructed based on first attribute data, wherein the action of the virtual character in the first style is controlled by a first controller, wherein the first attribute data is used to define that the virtual character is in the first style;
[0015] an acquisition module, configured to acquire, in response to a switching operation, second attribute data during display of the virtual character in the first style, wherein the second attribute data is used to define a second style of the virtual character, the second style being different from the first style;
[0016] a replacement module, configured to replace the first attribute data with the second attribute data;
[0017] The switching module is used to switch the virtual character in the first style to a virtual character in the second style constructed based on the second attribute data, and the action of the virtual character in the second style is controlled by the first controller.
[0018] According to one aspect of an embodiment of the present application, a terminal device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above-mentioned virtual character switching method.
[0019] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned virtual character switching method.
[0020] According to one aspect of an embodiment of the present application, a computer program product is provided. The computer program product includes a computer program, and the computer program is loaded and executed by a processor to implement the above-mentioned virtual character switching method.
[0021] The technical solutions provided in the embodiments of the present application can bring the following beneficial effects:
[0022] Without changing the controller of the virtual character, the attribute data of the virtual character is replaced to switch the virtual character from a first style to a second style. Compared with the related art, which requires creating a new controller, reloading the overall data of the virtual character in the second style, and replacing the overall data of the virtual character in the first style, which leads to the problem of unsmooth connection during the switching process, the embodiment of the present application still controls the virtual character through the same controller before and after the switching. Except for the change in the style of the virtual character, the control system has not changed, and the step of replacing the entire control system is omitted. Therefore, while achieving the style switching of the virtual character, the problem of unsmooth character connection can be avoided, and the seamless switching of the virtual character between different styles is achieved, thereby improving the switching effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] FIG1 is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0024] FIG2 is a flow chart of a method for switching virtual characters provided by one embodiment of the present application;
[0025] FIG3 is a schematic diagram of a user interface for switching virtual characters provided by one embodiment of the present application;
[0026] FIG4 is an effect diagram of replacing skeleton data and model data provided by one embodiment of the present application;
[0027] FIG5 is a schematic diagram of a virtual character after switching provided by an embodiment of the present application;
[0028] FIG6 is a flowchart of obtaining second attribute data provided by one embodiment of the present application;
[0029] FIG7 is a schematic diagram of obtaining second exclusive skeleton data according to an embodiment of the present application;
[0030] FIG8 is a schematic diagram of client replacement model data provided by one embodiment of the present application;
[0031] FIG9 is a schematic diagram of a client replacing attribute data provided by an embodiment of the present application;
[0032] FIG10 is a block diagram of a device for switching a virtual character provided by one embodiment of the present application;
[0033] FIG11 is a structural block diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0035] Please refer to Figure 1, which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment can be implemented as a virtual character switching system. The solution implementation environment can include: a terminal device 10 and a server 20.
[0036] The number of terminal devices 10 can be one or more. The terminal device 10 can be an electronic device such as a mobile phone, a tablet computer, a game console, an e-book reader, a multimedia playback device, a wearable device, a PC (Personal Computer), a vehicle-mounted terminal, etc. The client of the target application (such as a game application, an XR (Extended Reality) application) can be installed in the terminal device 10. In some embodiments, the target application can be an application that needs to be downloaded and installed, or it can be an application that can be used immediately, which is not limited in the embodiments of the present application.
[0037] In embodiments of the present application, the target application may be a game application, including shooting applications, racing applications, multiplayer online tactical competitive games, and the like, which are not limited in this application. In some embodiments, the aforementioned game application can provide a virtual environment for a user to immerse themselves in and manipulate a virtual character, which can perform activities such as walking, jumping, crawling, and fighting in the virtual environment. The virtual environment is the environment displayed (or provided) when the application is running on a terminal device. Different applications may have different forms or shapes of virtual characters, and their corresponding functions may also vary. This can be designed based on actual needs, which are not limited in this embodiment of the present application. In some embodiments, the terminal device 10 runs a client for the aforementioned application. In some embodiments, the aforementioned application is developed based on a three-dimensional virtual environment engine, such as UE4 (Unreal Engine 4) or Unity Engine, which can create a three-dimensional virtual environment, virtual characters, and virtual props, providing users with a more immersive gaming experience.
[0038] The virtual environment refers to a scene created for virtual characters to carry out activities (e.g., gaming competitions), such as a virtual house, virtual island, or virtual map. It can be a simulation of the real world, a semi-simulated, semi-fictional three-dimensional world, or a purely fictional three-dimensional world. The virtual environment can be any of two-dimensional, 2.5-dimensional, and three-dimensional.
[0039] The above-mentioned virtual character refers to an movable object in a virtual environment controlled by a controller of the client, and can be at least one of a virtual person, a virtual animal, and an animated character. In some embodiments, when the virtual environment is a three-dimensional virtual environment, the virtual character can be a three-dimensional virtual model, and each virtual character has its own shape and volume in the three-dimensional virtual environment, occupying a part of the space in the three-dimensional virtual environment. In some embodiments, the virtual character is a three-dimensional character constructed based on three-dimensional human skeleton technology, and the virtual character achieves different external images by wearing different skins. In some implementations, the virtual character can also be implemented using a 2.5-dimensional or 2-dimensional model, which is not limited in the embodiments of the present application. Taking the target application as a game application as an example, the virtual character refers to the game character controlled by the user account in the game application. The virtual character can be in the form of a human, or an animal, a cartoon or other form, which is not limited in the embodiments of the present application.
[0040] The server 20 is used to provide background services for the client of the target application installed and running on the terminal device 10. For example, the server 20 can be the background server of the aforementioned game application. The server 20 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. In some embodiments, the server 20 provides background services for the target applications on multiple terminal devices 10 simultaneously. The terminal devices 10 and the server 20 can communicate with each other via a network.
[0041] In an embodiment of the present application, a virtual character can be controlled by a controller on a client to perform different behaviors or actions in a virtual environment. When a user needs to switch the display style of the controlled virtual character, for example, to switch the virtual character's clothing, appearance, or identity, the user can trigger a switch button to switch the virtual character displayed in a first style to a virtual character displayed in a second style. Furthermore, when switching the display style of the virtual character, the virtual character before and after the switch is controlled by the same controller, thereby preventing the problem of unsmooth switching during the switching of the virtual character.
[0042] Please refer to Figure 2, which shows a flow chart of a method for switching virtual characters provided by an embodiment of the present application. The execution subject of each step of the method can be the terminal device 10 in the implementation environment of the solution shown in Figure 1, for example, the execution subject of each step can be the client of the target application. In the following method embodiment, for ease of description, only the execution subject of each step is introduced as the "client". The method may include at least one of the following steps 210 to 240:
[0043] Step 210 , displaying a virtual character in a first style constructed based on first attribute data, wherein the actions of the virtual character in the first style are controlled by a first controller, and the first attribute data is used to define the first style of the virtual character.
[0044] The first attribute data refers to various feature data of the virtual character required for displaying the virtual character in the first style. It can be used to represent various character features of the virtual character in the first style, including the virtual character's skeletal features, model features, animation features, etc. The first attribute data includes first skeletal data, first model data, and first animation data.
[0045] A first style refers to any style displayed by a virtual character in a virtual environment. Different types of virtual characters can present several different styles, and virtual characters of the same type can also present several different styles. These different styles of virtual characters can also be referred to as different schools of virtual characters, meaning the first style can also be referred to as the first school. Virtual characters of the same type can present several different styles, and these styles can be differentiated based on different categories, such as the virtual character's identity and gender. For example, a human-shaped virtual character is one type of virtual character, while an animal-shaped virtual character is another type of virtual character. Human-shaped virtual characters can include male, female, warrior, doctor, student, and other categories, while animal-shaped virtual characters can include tiger, lion, antelope, and other categories. A warrior-shaped virtual character can appear in various styles, such as an archer, swordsman, or swordsman. Even when acting solely as an archer, different styles can be presented based on different clothing, hairstyle, expression, and other settings. The various styles within the warrior category are all derived from the human-shaped virtual character.
[0046] The first controller is a controller for a virtual character in a first style, and the client can control the actions of the virtual character in the first style by controlling the first controller on the client. For example, the virtual character can be controlled to perform actions such as jumping, walking, turning, and fighting. In some embodiments, the first controller is used to control each skeleton of the virtual character separately, and the purpose of controlling the actions of the virtual character is achieved by controlling the skeleton. In some embodiments, the first controller is used to control each muscle of the virtual character separately, and the purpose of controlling the actions of the virtual character is achieved by controlling the muscles. The embodiment of the present application does not limit the specific form of the first controller. For example, in the embodiment of the present application, no matter how the style of the virtual character changes, the same controller is always maintained, that is, without changing the controller, the control of the actions of virtual characters of different styles is achieved.
[0047] In some embodiments, the first attribute data includes first skeleton data, which is obtained by adjusting the basic skeleton data based on the first exclusive skeleton data. The first exclusive skeleton data is exclusive skeleton data corresponding to the first style, and the skeleton data is used to construct the body skeleton of the virtual character.
[0048] Skeletal data is used to construct the avatar's body skeleton. Basic skeletal data refers to the foundational data required to build the avatar's body skeleton. While the basic skeletal data for different styles of avatars of the same type is the same, the basic skeletal data for different styles of avatars of different types is different. For example, the basic skeletal data for human-shaped avatars is the same, generated based on 3D human skeleton technology. However, the basic skeletal data for human-shaped avatars is different from that for animal-shaped avatars.
[0049] The first exclusive skeleton data is the skeletal data that is unique to the virtual character when it is presented in the first style. In some embodiments, the first exclusive skeleton data can be the skeletal data corresponding to the first style, which is used to indicate the body shape or skeleton unique to the virtual character of the first style. For example, the first exclusive skeleton data can include the skeleton length corresponding to the height of the virtual character of the first style, the bone hardness of the virtual character of the first style, the skeleton thickness of the virtual character of the first style, etc. In some embodiments, the exclusive skeleton data corresponding to virtual characters of different styles are different. In some embodiments, the exclusive skeleton data corresponding to virtual characters of different styles are recorded in the server of the target application.
[0050] The first skeleton data refers to the complete skeleton data required to construct the body skeleton of the virtual character displayed in the first style. The virtual characters constructed based on the first skeleton data have the same body features, for example, the same height, the same head circumference, the same arm length, and other similar skeleton features.
[0051] After determining the character type of the virtual character, for example, determining that the virtual character is a human-shaped virtual character, the basic skeletal data of the virtual character can be determined to be basic skeletal data of the human-shaped form, and the basic skeletal data of the human-shaped form can be copied to obtain duplicate skeletal data based on the basic skeletal data of the human-shaped form. The copied duplicate skeletal data can then be modified and adjusted based on the first exclusive skeletal data corresponding to the first style to obtain the first skeletal data.
[0052] In some embodiments, the first attribute data further includes first model data, where the first model data is model data corresponding to the first style, and the model data is used to define the appearance of the virtual character.
[0053] The first model data refers to the appearance data required to construct the appearance of the virtual character displayed in the first style, and may include data corresponding to the virtual character's hairstyle, clothing, accessories, props, and other items attached to the virtual character.
[0054] In some embodiments, the first attribute data further includes first animation data, which is animation data corresponding to the first style, and the animation data is used to define the actions of the virtual character.
[0055] The first animation data refers to the motion data that shows the matching and smoothness between the movements of the virtual character displayed in the first style and the movements controlled by the client through the first controller. The first animation data is related to the first skeletal data and the motion state of the virtual character when switching to the first style. If the display style of the virtual character is in a jumping state when switching from another style to the first style, the first animation data is animation data related to the jumping state obtained from the animation database corresponding to the first style. If the display style of the virtual character is in a walking state when switching from another style to the first style, the first animation data is animation data related to the walking state obtained from the animation database corresponding to the first style.
[0056] Based on the first skeleton data, the first model data and the first animation data, a virtual character presented in a first style can be constructed, and the actions of the virtual character in the first style can be controlled by controlling a first controller on the client.
[0057] Step 220 : During the process of displaying the virtual character in the first style, in response to a switching operation, obtaining second attribute data, the second attribute data being used to define that the virtual character is in a second style, the second style being different from the first style.
[0058] Second attribute data refers to various feature data of the virtual character required for displaying the virtual character in the second style. It can be used to characterize various features of the virtual character in the second style, including the virtual character's skeletal features, model features, animation features, etc. The second attribute data includes second skeletal data, second model data, and second animation data. The second style refers to any style other than the first style used to display the virtual character in the virtual environment.
[0059] The switching operation is an operation performed by the user. The client can generate a corresponding switching instruction according to the user's switching operation, so that the client can obtain the second attribute data according to the switching instruction.
[0060] In some embodiments, the switching operation may be an operation in which the user triggers a shortcut key. For example, if the user controls the first controller on the client via a keyboard, the shortcut key may be the Tab key on the keyboard, or the Ctrl key on the keyboard plus any letter key or number key, etc.
[0061] In some embodiments, the switching operation can be performed by the user clicking on the second style of the virtual character on the client's UI (User Interface), as shown in Figure 3. The user clicks on the UI interface for switching between different styles of virtual characters, and the UI displays several avatars 301 of different styles of virtual characters. The user can complete the switching operation by clicking on any of the avatars 301. Among the avatars 301 shown in Figure 3, only two styles corresponding to the avatars are currently selectable by the user. Completing corresponding task requirements can unlock other styles of the virtual character, enabling switching between more styles of virtual characters.
[0062] However, the above method of completing the switching operation by the user triggering the shortcut key cannot select the desired style. The client responds to the user's operation of triggering the shortcut key and can obtain the attribute data corresponding to the pre-set style located after the first style. When the client responds to the user's operation of clicking on a virtual character of any style on the UI interface, the attribute data corresponding to any style can be obtained. If the user wants to switch to a virtual character of a specific style, the method of completing the switching operation by triggering the shortcut key may require multiple switching operations to switch to the virtual character of the specific style. However, by triggering the virtual character of a specific style on the UI interface, switching to the virtual character of the specific style can be achieved at one time.
[0063] In some embodiments, during the process of controlling the movement of a virtual character in a first style through a first controller, second attribute data is obtained in response to a switching operation; or, during the process of controlling the battle of a virtual character in a first style through the first controller, second attribute data is obtained in response to a switching operation.
[0064] Fighting refers to the process in which the virtual character in the first style controlled by the first controller is in competition or battle with the virtual characters controlled by other controllers, and moving refers to the virtual character in the first style controlled by the first controller being in other states except the fighting state.
[0065] This application does not specifically limit the timing of the client's response to the switching operation. For example, it can be during the process of controlling the movement of the virtual character in the first style via the first controller, or during the process of controlling the virtual character in the first style via the first controller to engage in combat. During the process of controlling the virtual character in the first style via the first controller to perform any action or behavior, the client can respond to the user-triggered switching operation and obtain the second attribute data corresponding to the second style.
[0066] By listing that during the process of controlling the virtual character of the first style to move and fight via the first controller, the second attribute data can be obtained in response to the switching operation, indicating that the present application does not limit the timing of the client responding to the switching operation, and the virtual character of the first style can complete the style switching when performing any behavior. Therefore, the embodiment of the present application enables the virtual character of the first style to obtain the second attribute data in response to the switching operation when performing any behavior, thereby enriching the methods for obtaining the second attribute data and improving the efficiency of style switching.
[0067] Step 230: Use the second attribute data to replace the first attribute data.
[0068] The process of replacing the first attribute data with the second attribute data is achieved by using the second skeleton data, the second model data, and the second animation data to replace the corresponding first skeleton data, the first model data, and the first animation data, respectively. The replacement process is shown in Figure 4, which illustrates the process of replacing the corresponding first skeleton data and first model data with the second skeleton data and the second model data, thereby switching the appearance of the virtual character from the first style to the second style. By replacing the first skeleton data with the second skeleton data, the virtual character 41 in the first style in Figure 4 is transformed into the virtual character 42 in the transition state. The body shape and skeleton of the virtual character 42 in the transition state are changed compared to the virtual character 41 in the first style. The first model data is then replaced with the second model data, and the virtual character 42 in the transition state in Figure 4 is transformed into the virtual character 43 in the second style. The appearance of the virtual character 43 in the second style is changed compared to the virtual character 42 in the transition state. The second animation data is then replaced with the first animation data, ensuring that the movement fluidity of the virtual character displayed in the second style remains unchanged after the replacement, matching the movement state of the virtual character displayed in the first style before the replacement.
[0069] In some embodiments, the second skeleton data included in the second attribute data may be the same as or different from the first skeleton data included in the first attribute data.
[0070] If the second skeletal data included in the second attribute data is identical to the first skeletal data included in the first attribute data, then this first indicates that the type of virtual character corresponding to the second skeletal data is the same as the type of virtual character corresponding to the first skeletal data, for example, both are virtual characters in human form. Secondly, this indicates that the body skeleton of the virtual character corresponding to the second skeletal data is identical or similar to the body skeleton of the virtual character corresponding to the first skeletal data. In terms of appearance, the height, arm length, skull structure, etc. of the virtual character in the second style are identical or similar to those of the virtual character in the first style, i.e., their appearance and height are identical or similar.
[0071] If the second skeleton data included in the second attribute data is different from the first skeleton data included in the first attribute data, it can be indicated that the type of the virtual character corresponding to the second skeleton data is the same as the type of the virtual character corresponding to the first skeleton data, or it can be indicated that the type of the virtual character corresponding to the second skeleton data is different from the type of the virtual character corresponding to the first skeleton data. When the type of the virtual character corresponding to the second skeleton data is the same as the type of the virtual character corresponding to the first skeleton data, for example, when both are virtual characters in the form of human figures, the body skeleton of the virtual character corresponding to the second skeleton data is different from the body skeleton of the virtual character corresponding to the first skeleton data. From the perspective of appearance features, the height, arm length, skull structure, etc. of the virtual character in the second style are different from those of the virtual character in the first style, that is, the appearance, height, etc. that can be usually observed are different. When the type of the virtual character corresponding to the second skeleton data is different from the type of the virtual character corresponding to the first skeleton data, for example, the virtual character corresponding to the second skeleton data is a virtual character in the form of human figures, and the virtual character corresponding to the first skeleton data is a virtual character in the form of animals. The body skeleton of the virtual character corresponding to the second skeleton data is different from the body skeleton of the virtual character corresponding to the first skeleton data, and there are also obvious differences in appearance features.
[0072] In step 240 , the virtual character in the first style is switched to a virtual character in the second style constructed based on the second attribute data, and the actions of the virtual character in the second style are controlled by the first controller.
[0073] By replacing the first attribute data with the second attribute data, the virtual character in the first style can be switched to a virtual character in the second style constructed based on the second attribute data. The switched virtual character can refer to the user interface shown in Figure 5. The switched virtual character 51 in Figure 5 is in the process of fighting, and the action state of the switched virtual character can be connected to the action state of the virtual character in the first style.
[0074] It should be noted that the process of switching a virtual character in the first style to a virtual character in the second style is completed within one frame. The switching process completed within one frame here only refers to the process of replacing the first attribute data with the second attribute data, and the process of obtaining the second attribute data is not included in this frame. After the client obtains the second attribute data in response to the user's switching operation, it completes the replacement of the attribute data within one frame, thereby realizing the process of switching the virtual character in the first style to the virtual character in the second style. Therefore, in the process of switching from a virtual character in the first style to a virtual character in the second style, there will be no problems of unsmooth connection or stuck connection, and seamless switching of different styles of virtual characters will be achieved.
[0075] After the virtual character is switched to the second style, the client can still control the actions of the virtual character in the second style through the first controller. The first controller is specific to the controlled virtual character. If the controlled virtual character does not change, only the display style of the virtual character is switched, and the corresponding controller does not need to be changed. During the switching process, the control system used by the client to control the virtual character through the first controller does not actually change.
[0076] The technical solution provided in the embodiment of the present application switches a virtual character in a first style to a virtual character in a second style by replacing the attribute data of the virtual character without changing the controller of the virtual character. Compared with the related art that requires creating a new controller, reloading the overall data of the virtual character in the second style, and replacing the overall data of the virtual character in the first style, which leads to the problem of unsmooth connection during the switching process, the embodiment of the present application still controls the virtual character through the same controller before and after the switching. Except for the change in the style of the virtual character, the control system does not change, and the step of replacing the entire control system is omitted. Therefore, while achieving the style switching of the virtual character, the problem of unsmooth character connection can be avoided, and the seamless switching of the virtual character between different styles is achieved, thereby improving the switching effect.
[0077] Please refer to Figure 6, which shows a flowchart of obtaining second attribute data provided by one embodiment of the present application. The second attribute data includes at least one of second skeleton data, second model data, and second animation data. The method may include at least one of the following steps 610 to 630:
[0078] Step 610, obtain second exclusive skeleton data, which is exclusive skeleton data corresponding to the second style; adjust the basic skeleton data based on the second exclusive skeleton data to obtain second skeleton data; wherein, the second attribute data includes the second skeleton data, and the second skeleton data is used to replace the first skeleton data.
[0079] The second exclusive skeletal data is skeletal data specific to the virtual character when presented in the second style. In some embodiments, the second exclusive skeletal data may be skeletal data corresponding to the second style, and is used to indicate a body shape or skeleton specific to the virtual character in the second style. For example, the second exclusive skeletal data may include the skeletal length corresponding to the height of the virtual character in the second style, the skeletal strength of the virtual character in the second style, the thickness of the skeletal structure of the virtual character in the second style, etc.
[0080] The process of obtaining the second exclusive skeleton data can refer to Fig. 7, for the exclusive skeleton data of each style, can first design the skeleton file corresponding to the avatar of different styles by character design tool, and the character design tool here can be third-party design software such as MAYA software, Max software.And then the skeleton file corresponding to the avatar of different styles can be imported in virtual engine in some form, the skeleton file here can be stored in Unreal Engine with file forms such as json (JavaScript Object Notation, JS object notation) format, text format, and virtual engine can be virtual engines such as UE4, Unity engine.When the client responds to switching operation, when needing to obtain the second exclusive skeleton data, the skeleton file corresponding to the second exclusive skeleton data in the virtual engine can be parsed by virtual plug-in unit (unreal plugin), thereby obtain the second exclusive skeleton data.
[0081] After determining the character type of the virtual character, that is, determining the basic skeleton data of the virtual character, the basic skeleton data is copied to obtain duplicate skeleton data based on the basic skeleton data. Then, based on the second exclusive skeleton data corresponding to the second style, the copied duplicate skeleton data is modified and adjusted to obtain the second skeleton data.
[0082] By adjusting the basic skeleton data based on the second exclusive skeleton data to obtain the second skeleton data, the replacement of the overall data of the second style virtual character in the related technology is avoided, and at the same time, the effect of changing the body skeleton of the virtual character can be achieved, and the operation is faster and more convenient.
[0083] In some embodiments, based on the characteristic parameters of the first bone contained in the second exclusive bone data, the characteristic parameters of the first bone contained in the basic bone data are adjusted to obtain the second bone data; wherein the characteristic parameters of the first bone are used to specify at least one of the size, shape, position, and angle of the first bone.
[0084] The first skeleton is a characteristic skeleton possessed by each style of virtual character, and is the main difference between each style of virtual character and virtual characters of other styles. In some embodiments, the first skeleton is at least one bone in the skeleton inside the virtual character, such as the first skeleton is a head skeleton, a hand skeleton, a leg skeleton, or a torso skeleton. The characteristic parameters of the first skeleton enable the virtual character to be displayed in a specific style, and allow the display style of the virtual character to have its specific body shape characteristics. The characteristic parameters of the first skeleton contained in the basic skeleton data are not special and only enable the virtual character to present the display form of the initialized state, while the characteristic parameters of the first skeleton contained in the second exclusive skeleton data enable the virtual character to be displayed in the second style.
[0085] The characteristic parameters of the first bone are used to specify at least one of the size, shape, position, and angle of the first bone. For example, the characteristic parameters of the first bone can specify the bone length and width of the first bone, the shape characteristics of the first bone, the position of the first bone among all bones, the setting angle, the setting direction, etc.
[0086] The first skeletons corresponding to virtual characters of different styles are not necessarily the same. When the corresponding first skeletons are the same, the characteristic parameters of the first skeletons are not necessarily the same. The characteristic parameters of the first skeleton corresponding to the virtual characters of each style include at least one characteristic parameter of the first skeleton that is different from the characteristic parameters of the first skeleton corresponding to the virtual characters of other styles. In some embodiments, the characteristic parameters of the first skeleton corresponding to the virtual character of the second style may include only one characteristic parameter of the first skeleton that is different from the characteristic parameters of the first skeleton corresponding to the virtual character of the first style.
[0087] After obtaining the copy bone data based on the basic bone data, the characteristic parameters of the first bone contained in the copy bone data are adjusted and modified based on the characteristic parameters of the first bone contained in the second exclusive bone data, thereby obtaining the second bone data.
[0088] By modifying the characteristic parameters of the first skeleton contained in the skeleton data as described above, the complexity of the process of obtaining the second skeleton data can be reduced, and the acquisition rate of the second skeleton data can be increased, thereby better achieving the effect of seamless switching of character styles.
[0089] Step 620: Acquire second model data, where the second model data is model data corresponding to the second style; wherein the second attribute data includes the second model data, and the second model data is used to replace the first model data.
[0090] The second model data refers to the appearance data required to construct the appearance of the virtual character displayed in the second style, and may include data corresponding to the virtual character's hairstyle, clothing, accessories, props, and other items attached to the virtual character.
[0091] In some embodiments, each appearance resource included in the second model data replaces each appearance resource included in the first model data in an asynchronous loading manner.
[0092] Asynchronous loading means that while data loading is being processed according to an operation request, other operations can be responded to and data loading corresponding to other operations can be performed. For example, while the hairstyle resources in the second model data are used to replace the hairstyle resources in the first model data, the clothing resources in the second model data can be used to replace the clothing resources in the first model data.
[0093] It should be noted that the asynchronous loading mentioned here refers to the process of replacing the various appearance resources contained in the first model data with the various appearance resources contained in the second model data. It does not mean that the process of replacing the first model data with the second model data and the process of replacing the first skeleton data with the second skeleton data are asynchronously loaded. Only after the second skeleton data is used to replace the first skeleton data can the second model data be used to replace the first model data.
[0094] The specific method of replacing the first model data with the second model data is to replace the corresponding appearance resources contained in the first model data with the appearance resources contained in the second model data. The specific replacement process can be referred to Figure 8. After the basic skeleton data is adjusted based on the second exclusive skeleton data to obtain the second skeleton data, the corresponding appearance resources contained in the first model data are replaced with the appearance resources contained in the second model data. For example, the body-related clothing resources contained in the second model data are replaced with the body-related clothing resources contained in the first model data, the item-related props and accessories resources contained in the second model data are replaced with the item-related props and accessories resources contained in the first model data, and the hair-related hairstyle resources contained in the second model data are replaced with the hair-related hairstyle resources contained in the first model data.
[0095] In an embodiment of the present application, by obtaining the second model data and using asynchronous loading to achieve the replacement of each appearance resource, the time for replacing the first model data with the second model data can be shortened, and the efficiency of data replacement can be improved, thereby better achieving the effect of seamless switching of character styles.
[0096] Step 630: Acquire second animation data, where the second animation data is animation data corresponding to the second style; wherein the second attribute data includes the second animation data, and the second animation data is used to replace the first animation data.
[0097] The second animation data refers to the motion data that determines the matching and smoothness between the movements of the virtual character displayed in the second style and the movements controlled by the client via the first controller. The second animation data is related to the second skeletal data and the motion state of the virtual character when switching from the first style to the second style. By replacing the first animation data with the second animation data, the second skeletal data of the virtual character can be compatible and adapted with the movements of the virtual character during the switch when the virtual character switches from the first style to the second style, ensuring the smooth connection between the movements of the virtual character when displayed in the second style and when displayed in the first style.
[0098] In some embodiments, obtaining the second animation data includes: determining the first action currently performed by the virtual character in the first style; selecting the animation data corresponding to the first action from multiple candidate animation data corresponding to the second style as the second animation data; wherein different actions correspond to different animation data.
[0099] Each style of virtual character corresponds to an animation database, which contains animation data corresponding to different actions, and different actions correspond to different animation data. According to the first action performed by the virtual character in the first style in response to the switching operation, the animation data corresponding to the first action is selected from the multiple candidate animation data corresponding to the second style as the second animation data. For example, if the first action performed by the virtual character in the first style in response to the switching operation is a walking action, the animation data corresponding to the walking action is selected from the multiple candidate animation data corresponding to the second style as the second animation data; if the first action performed by the virtual character in the first style in response to the switching operation is a jumping action, the animation data corresponding to the jumping action is selected from the multiple candidate animation data corresponding to the second style as the second animation data, and so on. The target action in the embodiment of the present application refers to at least one of the above-mentioned different actions. The target action includes but is not limited to jumping, running, squatting, and raising hands.
[0100] By selecting corresponding animation data as second animation data based on the first action performed by the virtual character in the first style in response to the switching operation, the action matching degree of the virtual character when switching styles can be better ensured, thereby improving the smoothness of the action connection when switching.
[0101] It should be noted that the step of obtaining the second animation data and the step of obtaining the second skeleton data and obtaining the second model data can be performed synchronously, and the steps of replacing the second skeleton data, replacing the second model data and replacing the second animation data can be performed separately. The specific process of obtaining data and loading data can be shown in Figure 9. After the client responds to the switching operation triggered by the user, the client synchronously distributes the switching event of the character style to each data system that needs to refresh the data. Each system that needs to refresh the data is bound to a monitoring event. When the monitoring event detects the switching event, each system performs its duties and loads and replaces the corresponding data respectively. Among them, the process of loading skeleton data, model data and animation data is performed synchronously, so the process of loading various attribute data can be implemented synchronously. After obtaining the second skeleton data, second model data and second animation data corresponding to the second style, the various data in the first attribute data are replaced in sequence by a sequential execution method. First, the second skeleton data is used to replace the first skeleton data. After the skeleton data is replaced, the second model data is used to replace the first model data, and the appearance resources such as the body, hair, and items are replaced respectively to refresh the appearance of the virtual character. After the model data is replaced, the second animation data is used to replace the first animation data, so that the movement smoothness of the virtual character displayed in the second style after the replacement remains unchanged, matching the movement state of the virtual character displayed in the first style before the replacement. Users are supported to switch styles in any state of the virtual character, whether in combat or mobile state, while achieving seamless switching of character styles while being compatible with the needs of different animation performances, avoiding the problem of unsmooth character connection in related technologies.
[0102] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0103] Please refer to Figure 10, which shows a block diagram of a virtual character switching device provided by one embodiment of the present application. This device has the function of implementing the virtual character switching method described above. The function can be implemented by hardware or by hardware executing corresponding software. The device can be the terminal device described above, or it can be installed in a terminal device. As shown in Figure 10, the device 1000 may include: a display module 1010, an acquisition module 1020, a replacement module 1030, and a switching module 1040.
[0104] The display module 1010 is used to display a virtual character in a first style constructed based on first attribute data, where the actions of the virtual character in the first style are controlled by a first controller, and the first attribute data is used to define the virtual character in the first style.
[0105] The acquisition module 1020 is configured to acquire second attribute data in response to a switching operation during the display of the virtual character in the first style, wherein the second attribute data is used to define that the virtual character is in a second style, which is different from the first style.
[0106] The replacement module 1030 is configured to replace the first attribute data with the second attribute data.
[0107] The switching module 1040 is configured to switch the virtual character in the first style to a virtual character in the second style constructed based on the second attribute data, wherein the actions of the virtual character in the second style are controlled by the first controller.
[0108] In some embodiments, the first attribute data includes first skeleton data, the first skeleton data is obtained by adjusting basic skeleton data based on first exclusive skeleton data, the first exclusive skeleton data is exclusive skeleton data corresponding to the first style, and the skeleton data is used to construct the body skeleton of the virtual character; the acquisition module 1020 includes:
[0109] The first acquisition unit is used to acquire second exclusive skeleton data, where the second exclusive skeleton data is exclusive skeleton data corresponding to the second style.
[0110] An adjustment unit is used to adjust the basic skeleton data based on the second exclusive skeleton data to obtain second skeleton data; wherein the second attribute data includes the second skeleton data, and the second skeleton data is used to replace the first skeleton data.
[0111] In some embodiments, the adjustment unit is configured to:
[0112] Based on the characteristic parameters of the first bone contained in the second specific skeleton data, the characteristic parameters of the first bone contained in the basic skeleton data are adjusted to obtain the second skeleton data;
[0113] The characteristic parameters of the first bone are used to specify at least one of the size, shape, position, and angle of the first bone.
[0114] In some embodiments, the first attribute data includes first model data, the first model data is model data corresponding to the first style, and the model data is used to define the appearance of the virtual character; the acquisition module 1020 includes:
[0115] a second acquiring unit, configured to acquire second model data, where the second model data is model data corresponding to the second style;
[0116] The second attribute data includes the second model data, and the second model data is used to replace the first model data.
[0117] In some embodiments, each appearance resource included in the second model data replaces each appearance resource included in the first model data by asynchronous loading.
[0118] In some embodiments, the first attribute data includes first animation data, the first animation data is animation data corresponding to the first style, and the animation data is used to define the action of the virtual character; the acquisition module 1020 includes:
[0119] The third acquisition unit is used to acquire second animation data, where the second animation data is animation data corresponding to the second style; wherein the second attribute data includes the second animation data, and the second animation data is used to replace the first animation data.
[0120] In some embodiments, the third acquiring unit is configured to:
[0121] determining a first action currently being performed by the virtual character in the first style;
[0122] Animation data corresponding to the first action is selected from a plurality of candidate animation data corresponding to the second style as the second animation data; wherein different actions correspond to different animation data.
[0123] In some embodiments, the acquisition module 1020 is configured to:
[0124] In a process of controlling the movement of the virtual character in the first style by the first controller, in response to the switching operation, acquiring the second attribute data;
[0125] or,
[0126] During the process of controlling the virtual character in the first style to fight with the first controller, the second attribute data is acquired in response to the switching operation.
[0127] The technical solution provided in the embodiment of the present application switches a virtual character in a first style to a virtual character in a second style by replacing the attribute data of the virtual character without changing the controller of the virtual character. Compared with the related art that requires creating a new controller, reloading the overall data of the virtual character in the second style, and replacing the overall data of the virtual character in the first style, which leads to the problem of unsmooth connection during the switching process, the embodiment of the present application still controls the virtual character through the same controller before and after the switching. Except for the change in the style of the virtual character, the control system does not change, and the step of replacing the entire control system is omitted. Therefore, while achieving the style switching of the virtual character, the problem of unsmooth character connection can be avoided, and the seamless switching of the virtual character between different styles is achieved, thereby improving the switching effect.
[0128] It should be noted that the apparatus provided in the above embodiments, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0129] Please refer to Figure 11, which shows a block diagram of a terminal device 1100 provided in one embodiment of the present application. The terminal device 1100 can be any electronic device with data computing, processing, and storage functions. The terminal device 1100 can be used to implement the virtual character switching method provided in the above embodiment.
[0130] Typically, the terminal device 1100 includes a processor 1101 and a memory 1102 .
[0131] The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1101 may also include an AI processor for processing computing operations related to machine learning.
[0132] Memory 1102 may include one or more computer-readable storage media, which may be non-transitory. Memory 1102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory storage devices. In some embodiments, the non-transitory computer-readable storage media in memory 1102 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned virtual character switching method.
[0133] Those skilled in the art will understand that the structure shown in FIG11 does not constitute a limitation on the terminal device 1100 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0134] In an exemplary embodiment, a computer-readable storage medium is also provided, storing a computer program that, when executed by a processor of a terminal device, implements the aforementioned virtual character switching method. In some embodiments, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, or the like.
[0135] In an exemplary embodiment, a computer program product is also provided, the computer program product including a computer program stored in a computer-readable storage medium. A processor of a terminal device reads the computer program from the computer-readable storage medium and executes the computer program, causing the terminal device to perform the above-mentioned virtual character switching method.
[0136] It should be noted that before collecting the user's relevant data and during the process of collecting the user's relevant data, this application can display a prompt interface, pop-up window or output voice prompt information. The prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining the user's relevant data after obtaining the user's confirmation operation on the prompt interface or pop-up window. Otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining the user's relevant data are terminated, that is, the user's relevant data is not obtained. In other words, the information involved in this application (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals are all authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the relevant data of the virtual character controlled by the client through the controller involved in this application are all obtained with full authorization.
[0137] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application do not limit this.
[0138] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for switching a virtual character, the method being executed by a terminal device, the method include: Displaying a virtual character in a first style constructed based on first attribute data, wherein the action of the virtual character in the first style is controlled by a first controller, and the first attribute data is used to define that the virtual character is in the first style; In the process of displaying the virtual character in the first style, in response to a switching operation, obtaining second attribute data, the second attribute data being used to define that the virtual character is in a second style, the second style being different from the first style; Using the second attribute data to replace the first attribute data; The virtual character in the first style is switched to a virtual character in the second style constructed based on the second attribute data, and the actions of the virtual character in the second style are controlled by the first controller.
2. The method according to claim 1, in, The first attribute data includes first skeleton data, the first skeleton data is obtained by adjusting basic skeleton data based on first exclusive skeleton data, the first exclusive skeleton data is exclusive skeleton data corresponding to the first style, and the skeleton data is used to construct the body skeleton of the virtual character; The obtaining of the second attribute data comprises: Acquire second exclusive skeleton data, where the second exclusive skeleton data is exclusive skeleton data corresponding to the second style; Adjusting the basic skeleton data based on the second exclusive skeleton data to obtain second skeleton data; The second attribute data includes the second skeleton data, and the second skeleton data is used to replace the first skeleton data.
3. The method according to claim 2, in, The step of adjusting the basic skeleton data based on the second dedicated skeleton data to obtain the second skeleton data includes: Based on the characteristic parameters of the first bone contained in the second exclusive bone data, the characteristic parameters of the first bone contained in the basic bone data are adjusted to obtain the second bone data; The characteristic parameters of the first bone are used to specify at least one of the size, shape, position and angle of the first bone.
4. The method according to any one of claims 1 to 3, in, The first attribute data includes first model data, the first model data is model data corresponding to the first style, and the model data is used to define the appearance of the virtual character; The obtaining of the second attribute data comprises: Acquire second model data, where the second model data is model data corresponding to the second style; The second attribute data includes the second model data, and the second model data is used to replace the first model data.
5. The method according to claim 4, in, The appearance resources included in the second model data replace the appearance resources included in the first model data in an asynchronous loading manner.
6. The method according to any one of claims 1 to 5, in, The first attribute data includes first animation data, the first animation data is animation data corresponding to the first style, and the animation data is used to define the action of the virtual character; The obtaining of the second attribute data comprises: Acquire second animation data, where the second animation data is animation data corresponding to the second style; The second attribute data includes the second animation data, and the second animation data is used to replace the first animation data.
7. The method according to claim 6, in, The obtaining of the second animation data comprises: Determining a first action currently performed by the virtual character in the first style; Animation data corresponding to the first action is selected from a plurality of candidate animation data corresponding to the second style as the second animation data; wherein different actions correspond to different animation data.
8. The method according to any one of claims 1 to 7, in, The step of acquiring second attribute data in response to a switching operation during displaying the virtual character in the first style includes: In the process of controlling the virtual character in the first style to move by the first controller, in response to the switching operation, acquiring the second attribute data; or, In the process of controlling the virtual character in the first style to fight by the first controller, the second attribute data is acquired in response to the switching operation.
9. A device for switching a virtual character, the device include: A display module, configured to display a virtual character in a first style constructed based on first attribute data, wherein the action of the virtual character in the first style is controlled by a first controller, and the first attribute data is used to define that the virtual character is in the first style; an acquisition module, configured to acquire second attribute data in response to a switching operation during display of the virtual character in the first style, wherein the second attribute data is used to define that the virtual character is in a second style, and the second style is different from the first style; A replacement module, used to replace the first attribute data with the second attribute data; The switching module is used to switch the virtual character in the first style to a virtual character in the second style constructed based on the second attribute data, and the action of the virtual character in the second style is controlled by the first controller.
10. A terminal device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the virtual character switching method according to any one of claims 1 to 8.
11. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the virtual character switching method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, wherein the computer program is loaded and executed by a processor to implement the method for switching a virtual character according to any one of claims 1 to 8.
Citation Information
Patent Citations
Virtual role switching method and device, electronic equipment and storage medium
CN112546638A
Game role switching method and device and electronic equipment
CN112999662A
Virtual role control method and device
CN113209614A
Virtual character control method and device, terminal and storage medium
CN113332724A
Drawing processing program, drawing processing device, and drawing processing method
JP2010110504A
