Virtual character switching method and device, equipment and storage medium
By obtaining and replacing virtual character attribute data in the existing technology, seamless switching of virtual character styles is achieved, solving the problem of unsmooth switching in the existing technology, and improving the switching effect.
Patent Information
- Application Number
- CN202310252198.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2024-09-10
AI Technical Summary
In the prior art, when switching virtual characters, it is necessary to re-initialize and load a new virtual character, resulting in insufficient smoothness of the switching.
By obtaining the second attribute data and replacing the first attribute data, switching of virtual character styles is achieved without changing the controller, and the step of replacing the control system is omitted.
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 CN118615709A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for switching virtual characters. Background Art
[0002] During the game, the player often needs to switch the virtual character being controlled, switching the currently controlled virtual character to another virtual character.
[0003] In the related art, when a virtual character is switched, 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.
[0004] However, the above switching process will result in the switching of virtual characters not being smooth enough. Summary of the invention
[0005] The embodiment of the present application provides a method, device, equipment and storage medium for switching virtual characters. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for switching a virtual character is provided, the method comprising:
[0007] Displaying a virtual character in a first style constructed based on first attribute data, and controlling the action of the virtual character in the first style through a first controller, wherein the first attribute data is used to define that the virtual character is in the first style;
[0008] 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, and the second style is different from the first style;
[0009] Using the second attribute data to replace the first attribute data;
[0010] 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 continued to be controlled by the first controller.
[0011] According to one aspect of an embodiment of the present application, a device for switching a virtual character is provided, the device comprising:
[0012] A display module, configured to display a virtual character in a first style constructed based on first attribute data, and to control the action of the virtual character in the first style through a first controller, wherein the first attribute data is used to define that the virtual character is in the first style;
[0013] an acquisition module, configured to acquire second attribute data in response to a switching operation during the process of displaying 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;
[0014] A replacement module, used to replace the first attribute data with the second attribute data;
[0015] 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 continue to control the action of the virtual character in the second style through the first controller.
[0016] According to one aspect of an embodiment of the present application, a terminal device is provided, the terminal device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-mentioned virtual character switching method.
[0017] 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.
[0018] 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. The computer program is loaded and executed by a processor to implement the above-mentioned virtual character switching method.
[0019] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:
[0020] Without changing the controller of the virtual character, the virtual character's attribute data is replaced to switch the virtual character in the first style to the virtual character in the second style. Compared with the related art, which requires the creation of 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
[0021] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0022] Figure 2 is a flow chart of a method for switching virtual characters provided by an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a user interface for a user to switch virtual characters provided by an embodiment of the present application;
[0024] Figure 4 This is an effect diagram of replacing skeleton data and model data provided by an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a virtual character after switching provided by an embodiment of the present application;
[0026] Figure 6 is a flowchart of obtaining second attribute data provided by an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of obtaining second exclusive skeleton data provided by an embodiment of the present application;
[0028] Figure 8 It is a schematic diagram of client replacement model data provided by an embodiment of the present application;
[0029] Fig. 9 This is a schematic diagram of replacing attribute data of a client provided by an embodiment of the present application;
[0030] Fig.10 is a block diagram of a virtual character switching device provided by an embodiment of the present application;
[0031] Fig.11 This is a structural block diagram of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0033] 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 may include: a terminal device 10 and a server 20.
[0034] 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. Optionally, the target application can be an application that needs to be downloaded and installed, or it can be a click-to-use application, which is not limited in the embodiments of the present application.
[0035] In the embodiment of the present application, the target application may be a game application, including a shooting application, a racing application, a multiplayer online tactical competitive game, etc., which is not limited in the present application. In some embodiments, the above-mentioned game application can provide a virtual environment for the virtual character that the user substitutes and operates to perform activities in the virtual environment, such as walking, jumping, crawling, fighting, etc. The virtual environment is the environment displayed (or provided) when the application is running on the terminal device. For different applications, the form or shape of the virtual character provided by it will also be different, and the corresponding functions will also be different, which can be designed according to actual needs, which is not limited in the embodiment of the present application. Optionally, a client of the above-mentioned application is running in the terminal device 10. In some embodiments, the above-mentioned application is an application developed based on a three-dimensional virtual environment engine, such as the virtual environment engine can be UE4 (Unreal Engine 4), Unity engine, etc., which can build a three-dimensional virtual environment, virtual characters and virtual props, etc., to bring a more immersive gaming experience to the user.
[0036] The virtual environment is a scene created for virtual characters to carry out activities (such as game competitions), such as virtual houses, virtual islands, virtual maps, etc. It can be a simulation of the real world, a semi-simulated and semi-fictional three-dimensional world, or a purely fictional three-dimensional world. The virtual environment can be any of a two-dimensional virtual environment, a 2.5-dimensional virtual environment, and a three-dimensional virtual environment.
[0037] The above-mentioned virtual character refers to an active object in a virtual environment controlled by a controller of a client, and may be at least one of a virtual person, a virtual animal, and a cartoon character. Optionally, when the virtual environment is a three-dimensional virtual environment, the virtual character may 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. Optionally, the virtual character is a three-dimensional character constructed based on three-dimensional human skeleton technology, and the virtual character realizes different external images by wearing different skins. In some implementations, the virtual character may 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 a game character controlled by a user account in the game application. The virtual character may be in the form of a person, or in the form of an animal, a cartoon, or other forms, which is not limited in the embodiments of the present application.
[0038] The server 20 is used to provide background services for the client of the target application installed and running in the terminal device 10. For example, the server 20 can be the background server of the above-mentioned game application. The server 20 can be a single server, or a server cluster composed of multiple servers, or a cloud computing service center. Optionally, the server 20 provides background services for the target applications in multiple terminal devices 10 at the same time. The terminal device 10 and the server 20 can communicate with each other through the network.
[0039] In the embodiment of the present application, the virtual character can be controlled by the controller of the client to perform different behaviors or actions in the virtual environment. When the user needs to switch the display style of the controlled virtual character, for example, switch the costume of the virtual character, switch the form of the virtual character, switch the identity of the virtual character, etc., the virtual character controlled by the user in the first style can be switched to the virtual character in the second style by triggering the switch button. Moreover, when the display style of the virtual character is switched, the virtual character before and after the switch is controlled by the same controller, so that the switching process of the virtual character will not cause the problem of unsmooth switching connection.
[0040] 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 may be Figure 1 The terminal device 10 in the implementation environment of the scheme shown, for example, the execution subject of each step can be the client of the target application. In the following method embodiment, for the convenience of description, only the execution subject of each step is introduced as the "client". The method can include at least one of the following steps 210 to 240:
[0041] Step 210, displaying a virtual character in a first style constructed based on first attribute data, and controlling the action of the virtual character in the first style through a first controller, wherein the first attribute data is used to define that the virtual character is in the first style.
[0042] The first attribute data refers to various feature data of the virtual character required for displaying the virtual character in the first style, and can be used to characterize various character features of the virtual character in the first style, including the skeleton features, model features, animation features, etc. of the virtual character. The first attribute data includes first skeleton data, first model data, and first animation data.
[0043] The first style refers to any style in which a virtual character is displayed in a virtual environment. Different types of virtual characters can present several different styles, and the same type of virtual characters can also present several different styles. The different styles presented by virtual characters can also be called different schools of virtual characters, that is, the first style can also be called the first school. The same type of virtual characters present several different styles, and several different styles can be presented according to different categories such as the identity and gender of the virtual characters. For example, a virtual character in the form of a human figure is one type of virtual character, and a virtual character in the form of an animal is another type of virtual character. The virtual character in the form of a human figure can include multiple categories such as men, women, warriors, doctors, and students. The virtual character in the form of an animal can include multiple categories such as tigers, lions, and antelopes. The virtual character in the warrior category can be presented in multiple styles such as archers, swordsmen, and swordsmen. When it is only an archer, it can also present different styles according to different clothing, hairstyles, expressions, etc. Here, the multiple styles under the warrior category are all obtained based on the virtual character in the form of a human figure.
[0044] The first controller is a controller for a virtual character in a first style. 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.
[0045] In some embodiments, the first attribute data includes first bone data, which is obtained by adjusting basic bone data based on first exclusive bone data. The first exclusive bone data is exclusive bone data corresponding to the first style, and the bone data is used to construct the body skeleton of the virtual character.
[0046] Skeleton data is used to construct the body skeleton of a virtual character. Basic skeletal data refers to the basic data required to construct the body skeleton of a virtual character. The basic skeletal data of virtual characters of the same type and different styles are the same, while the basic skeletal data of virtual characters of different types and different styles are different. For example, the basic skeletal data of virtual characters in human form are the same, and are all basic skeletal data generated based on 3D human skeleton technology, while the basic skeletal data of virtual characters in human form are different from those of virtual characters in animal form.
[0047] The first exclusive skeleton data is skeleton data specific to the virtual character when it is presented in the first style. Optionally, the first exclusive skeleton data may be skeleton data corresponding to the first style, and is used to indicate a body shape or skeleton specific to the virtual character of the first style. For example, the first exclusive skeleton data may include the skeleton length corresponding to the height of the virtual character of the first style, the skeleton hardness of the virtual character of the first style, the skeleton thickness of the virtual character of the first style, etc.
[0048] 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 shape features, for example, the same height, the same head circumference, the same arm length and other same skeleton features.
[0049] After determining the role type to which the virtual character belongs, for example, after determining that the virtual character is a virtual character in human form, it can be determined that the basic skeleton data of the virtual character is the basic skeleton data of the human form, and the basic skeleton data of the human form is copied to obtain the copy skeleton data based on the basic skeleton data of the human form. Then, based on the first exclusive skeleton data corresponding to the first style, the copied copy skeleton data is modified and adjusted to obtain the first skeleton data.
[0050] In some embodiments, the first attribute data also 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.
[0051] The first model data refers to the appearance data required to construct the appearance of a virtual character displayed in a first style, and may include data corresponding to other items attached to the virtual character, such as the virtual character's hairstyle, clothing, accessories, props, etc.
[0052] In some embodiments, the first attribute data further 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.
[0053] The first animation data refers to the action data of the virtual character displayed in the first style, and the matching degree and smoothness between the action performed by the client through the first controller. The first animation data is related to the first skeleton data and the action 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 other styles to the first style, the first animation data is the 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 other styles to the first style, the first animation data is the animation data related to the walking state obtained from the animation database corresponding to the first style.
[0054] 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.
[0055] Step 220: In the process of displaying the virtual character in the first style, in response to the switching operation, obtaining second attribute data, 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.
[0056] The second attribute data refers to various feature data of the virtual character required for the virtual character to be displayed in the second style, and can be used to characterize various character features of the virtual character in the second style, including the skeleton features, model features, animation features, etc. of the virtual character. The second attribute data includes second skeleton data, second model data, and second animation data. The second style refers to any other style of the virtual character displayed in the virtual environment except the first style.
[0057] The switching operation is an operation performed by the user, and 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.
[0058] Optionally, the switching operation may be an operation of a user triggering a shortcut key. For example, if the user controls the first controller on the client through a keyboard, the shortcut key may be a Tab key on the keyboard, or a Ctrl key on the keyboard + any letter key or number key, and so on.
[0059] Optionally, the switching operation may be a user clicking on a second style virtual character on a UI (User Interface) of the client, such as Figure 3 The user clicks on the UI interface for switching virtual characters of different styles. A number of avatars 301 of virtual characters of different styles are displayed on the UI interface. The user can complete the switching operation by clicking on any one of the avatars 301. Figure 3 Among the avatars 301 shown, currently only two avatars correspond to styles that the user can choose to switch. Completing corresponding task requirements can unlock other styles of virtual characters, thereby enabling switching of more styles of virtual characters.
[0060] 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 a virtual character of a specific style, while the method of triggering a virtual character of a specific style on the UI interface can achieve switching to a virtual character of a specific style at one time.
[0061] In some embodiments, during the process of controlling a virtual character of a first style to move through a first controller, second attribute data is obtained in response to a switching operation; or, during the process of controlling a virtual character of a first style to fight through the first controller, second attribute data is obtained in response to a switching operation.
[0062] Fighting refers to the process in which a virtual character in the first style controlled by the first controller competes or fights with 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.
[0063] This application does not specifically limit the timing of the client responding to the switching operation. For example, it can be during the process of controlling the movement of the virtual character in the first style through the first controller, or it can be during the process of controlling the virtual character in the first style to fight through the first controller. During the process of controlling the virtual character in the first style to perform any action or behavior through the first controller, the client can respond to the switching operation triggered by the user and obtain the second attribute data corresponding to the second style.
[0064] By listing that in the process of controlling a virtual character of a first style to move and fight through a first controller, the second attribute data can be obtained in response to a 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.
[0065] Step 230: Use the second attribute data to replace the first attribute data.
[0066] 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 process of replacing the first attribute data with the second attribute data is realized. Figure 4 As shown, Figure 4 The process of using the second skeleton data and the second model data to replace the corresponding first skeleton data and the first model data is shown, so that the appearance of the virtual character is switched from the first style to the second style. Figure 4 The virtual character 41 in the first style is converted into the virtual character 42 in the transition state. The virtual character 42 in the transition state has a different body shape and skeleton compared to the virtual character 41 in the first style. Then the first model data is replaced by the second model data. Figure 4 The virtual character 42 in the transition state is converted into a virtual character 43 in the second style. Compared with the virtual character 42 in the transition state, the virtual character 43 in the second style has changed appearance in terms of clothing, hairstyle, etc. The first animation data is then replaced with the second animation data, so that the action smoothness of the virtual character displayed in the second style after the replacement remains unchanged and matches the action state of the virtual character displayed in the first style before the replacement.
[0067] Optionally, 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.
[0068] If the second skeleton data included in the second attribute data is the same as the first skeleton data included in the first attribute data, then firstly, it means 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, for example, both are virtual characters in human form. Secondly, it means that the body skeleton of the virtual character corresponding to the second skeleton data is the same or similar to 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 the same or similar to those of the virtual character in the first style, that is, the appearance, height, etc. are exactly the same or similar as usually said.
[0069] 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 is also a clear difference in appearance features.
[0070] Step 240: Switch the virtual character in the first style to a virtual character in the second style constructed based on the second attribute data, and continue to control the actions of the virtual character in the second style through the first controller.
[0071] 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. Figure 5 The user interface shown, Figure 5 The switched virtual character 51 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.
[0072] It should be noted that the process of switching a virtual character in a first style to a virtual character in a 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 can be achieved.
[0073] For the virtual character in the second style after switching, the client can still control the actions of the virtual character in the second style through the first controller. The first controller is for the controlled virtual character. When 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 change. During the switching process, the control system of the virtual character controlled by the client through the first controller does not change substantially.
[0074] The technical solution provided in the embodiment of the present application realizes switching 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 has not changed, and the step of replacing the entire control system is omitted. Thereby, while realizing 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 realized, thereby improving the switching effect.
[0075] Please refer to Figure 6 , which shows a flowchart of obtaining second attribute data provided by an embodiment of the present application. The second attribute data includes second skeleton data, second model data and second animation data. The method may include at least one of the following steps 610 to 630:
[0076] Step 610, obtaining second exclusive skeleton data, which 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; wherein the second attribute data includes the second skeleton data, and the second skeleton data is used to replace the first skeleton data.
[0077] The second exclusive skeleton data is skeleton data specific to the virtual character when it is presented in the second style. Optionally, the second exclusive skeleton data may be skeleton data corresponding to the second style, and is used to indicate a body shape or skeleton specific to the virtual character of the second style. For example, the second exclusive skeleton data may include the skeleton length corresponding to the height of the virtual character of the second style, the skeleton hardness of the virtual character of the second style, the skeleton thickness of the virtual character of the second style, etc.
[0078] The process of obtaining the second exclusive bone data can be referred to Figure 7 , for the exclusive skeleton data of each style, the skeleton file corresponding to the virtual character of different styles can be designed by the character design tool first, and the character design tool here can be the third-party design software such as MAYA software, Max software. And then the skeleton file corresponding to the virtual character of different styles can be imported into the virtual engine in some form, and the skeleton file here can be stored in the unreal engine with the file forms such as json (JavaScript ObjectNotation, JS object notation) format, text format, etc., and the virtual engine can be the virtual engine such as UE4, Unity engine. When the client responds to the switching operation, when it is necessary 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 the virtual plug-in (unreal plugin), thereby obtaining the second exclusive skeleton data.
[0079] 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 the copy skeleton data based on the basic skeleton data. Then, based on the second exclusive skeleton data corresponding to the second style, the copied copy skeleton data is modified and adjusted to obtain the second skeleton data.
[0080] 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 the effect of changing the body skeleton of the virtual character can also be achieved, and the operation is faster and more convenient.
[0081] In some embodiments, based on the characteristic parameters of the target bone contained in the second exclusive bone data, the characteristic parameters of the target bone contained in the basic bone data are adjusted to obtain the second bone data; wherein the characteristic parameters of the target bone are used to specify at least one of the size, shape, position, and angle of the target bone.
[0082] The target bone is a characteristic bone of each style of virtual character, and is the main difference between each style of virtual character and other styles of virtual characters. The characteristic parameters of the target bone 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 target bone contained in the basic bone data are not special, and only enable the virtual character to be displayed in the initialization state, while the characteristic parameters of the target bone contained in the second exclusive bone data enable the virtual character to be displayed in the second style.
[0083] The characteristic parameters of the target bone are used to specify at least one of the size, shape, position, and angle of the target bone. For example, the characteristic parameters of the target bone can specify the bone length and width of the target bone, the shape characteristics of the target bone, the position of the target bone among all bones, the setting angle, the setting direction, etc.
[0084] The target bones corresponding to virtual characters of different styles are not necessarily the same. When the corresponding target bones are the same, the characteristic parameters of the target bones are not necessarily the same. The characteristic parameters of the target bones corresponding to the virtual characters of each style include at least one characteristic parameter of the target bones that is different from the characteristic parameters of the target bones corresponding to the virtual characters of other styles. Optionally, for example, the characteristic parameters of the target bones corresponding to the virtual characters of the second style may include only one characteristic parameter of the target bones that is different from the characteristic parameters of the target bones corresponding to the virtual characters of the first style.
[0085] After obtaining the copy bone data based on the basic bone data, the characteristic parameters of the target bone contained in the copy bone data are adjusted and modified based on the characteristic parameters of the target bone contained in the second exclusive bone data, so as to obtain the second bone data.
[0086] By modifying the characteristic parameters of the target bone 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.
[0087] Step 620, obtaining 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.
[0088] 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 other items attached to the virtual character, such as the virtual character's hairstyle, clothing, accessories, props, etc.
[0089] 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.
[0090] 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.
[0091] 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 loaded asynchronously. The second model data can only be used to replace the first model data after the second skeleton data is used to replace the first skeleton data.
[0092] The specific method of using the second model data to replace the first model data is to use each appearance resource contained in the second model data to replace each appearance resource corresponding to the first model data. For the specific replacement process, please refer to Figure 8 After the basic skeleton data is adjusted based on the second exclusive skeleton data to obtain the second skeleton data, each appearance resource contained in the second model data is used to replace each corresponding appearance resource contained in the first model data. For example, the body-related clothing resources contained in the second model data are used to replace the body-related clothing resources contained in the first model data, the item-related props and accessory resources contained in the second model data are used to replace the item-related props and accessory resources contained in the first model data, and the hair-related hairstyle resources contained in the second model data are used to replace the hair-related hairstyle resources contained in the first model data.
[0093] By using asynchronous loading to replace various appearance resources, 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, so as to better achieve the effect of seamless switching of character styles.
[0094] Step 630, obtaining 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.
[0095] The second animation data refers to the action data of the virtual character displayed in the second style, and the matching degree and smoothness between the action performed by the client through the first controller. The second animation data is related to the second skeleton data, and the action 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, when the virtual character switches from the first style to the second style, the second skeleton data of the virtual character can be compatible and adapted with the action of the virtual character during the switching, ensuring the smooth connection between the action of the virtual character when displayed in the second style and the action of the virtual character when displayed in the first style.
[0096] In some embodiments, obtaining the second animation data includes: determining a target action currently performed by a virtual character in the first style; selecting animation data corresponding to the target action 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.
[0097] 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 target action performed by the virtual character in the first style in response to the switching operation, the animation data corresponding to the target action is selected from the multiple candidate animation data corresponding to the second style as the second animation data. For example, if the target 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 as the second animation data from the multiple candidate animation data corresponding to the second style; if the target 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 as the second animation data from the multiple candidate animation data corresponding to the second style, and so on.
[0098] By selecting corresponding animation data as the second animation data according to the target 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 guaranteed, thereby improving the smoothness of the action connection when switching.
[0099] It should be noted that the step of obtaining the second animation data, the step of obtaining the second skeleton data and the step of 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 referred to Fig. 9As shown. 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 with 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 the skeleton data, model data and animation data is executed synchronously, so the process of loading various attribute data can be realized synchronously. After obtaining the second skeleton data, the second model data and the second animation data corresponding to the second style, the data in the first attribute data are replaced in sequence in a sequential execution manner. First, the second skeleton data is used to replace the first skeleton data. After the replacement of the skeleton data is completed, 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 performance of the virtual character. After the replacement of the model data is completed, the second animation data is used to replace the first animation data, so that the action fluency of the virtual character displayed in the second style after the replacement remains unchanged, and matches the action state of the virtual character displayed in the first style before the replacement. It supports users to switch styles in any state of the virtual character, whether in combat or moving state. While achieving seamless switching of character styles, it is compatible with the needs of different animation performances and avoids the problem of unsmooth character connection in related technologies.
[0100] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0101] Please refer to Fig.10 , which shows a block diagram of a virtual character switching device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned virtual character switching method, and 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 set in the terminal device. Fig.10 As shown, the device 1000 may include: a display module 1010 , an acquisition module 1020 , a replacement module 1030 and a switching module 1040 .
[0102] The display module 1010 is used to display a virtual character in a first style constructed based on first attribute data, and control the action of the virtual character in the first style through a first controller, wherein the first attribute data is used to define that the virtual character is in the first style.
[0103] The acquisition module 1020 is used to acquire second attribute data in response to a switching operation during the process of displaying 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.
[0104] The replacement module 1030 is used to replace the first attribute data with the second attribute data.
[0105] The switching module 1040 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 continue to control the action of the virtual character in the second style through the first controller.
[0106] 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:
[0107] 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.
[0108] 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.
[0109] In some embodiments, the adjustment unit is used to:
[0110] Based on the characteristic parameters of the target bone contained in the second exclusive bone data, the characteristic parameters of the target bone contained in the basic bone data are adjusted to obtain the second bone data;
[0111] Among them, the characteristic parameters of the target bone are used to specify at least one of the size, shape, position and angle of the target bone.
[0112] 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:
[0113] A second acquisition unit, configured to acquire second model data, where the second model data is model data corresponding to the second style;
[0114] The second attribute data includes the second model data, and the second model data is used to replace the first model data.
[0115] 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.
[0116] 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:
[0117] 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.
[0118] In some embodiments, the third acquisition unit is used to:
[0119] Determining a target action currently being performed by the virtual character in the first style;
[0120] Animation data corresponding to the target 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.
[0121] In some embodiments, the acquisition module 1020 is used to:
[0122] 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;
[0123] or,
[0124] 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.
[0125] The technical solution provided in the embodiment of the present application realizes switching 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 has not changed, and the step of replacing the entire control system is omitted. Thereby, while realizing 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 realized, thereby improving the switching effect.
[0126] It should be noted that the device provided in the above embodiment, 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 is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0127] Please refer to Fig.11 , which shows a block diagram of a terminal device 1100 provided in one embodiment of the present application. The terminal device 1100 may be any electronic device with data calculation, processing and storage functions. The terminal device 1100 may be used to implement the virtual character switching method provided in the above embodiment.
[0128] Typically, the terminal device 1100 includes: a processor 1101 and a memory 1102 .
[0129] 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), and 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.
[0130] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the 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.
[0131] Those skilled in the art will understand that Fig.11 The structure shown in the figure 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.
[0132] In an illustrative embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor of a terminal device, the computer program implements the above-mentioned virtual character switching method. Optionally, the above-mentioned 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, etc.
[0133] In an exemplary embodiment, a computer program product is also provided, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium. A processor of a terminal device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the terminal device executes the above-mentioned virtual character switching method.
[0134] It should be noted that before collecting the relevant data of the user and during the process of collecting the relevant data of the user, the present application can display a prompt interface, a pop-up window or output a voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that the relevant data is currently being collected, so that the present application only starts to execute the relevant steps of obtaining the relevant data of the user after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining the relevant data of the user are terminated, that is, the relevant data of the user 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 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 relevant data need to comply with the relevant laws, regulations and standards of 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 under full authorization.
[0135] 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: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after 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 are not limited to this.
[0136] The above description is only 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 protection scope of the present application.
Claims
1. A method for switching a virtual character, characterized in that: The method comprises: Displaying a virtual character in a first style constructed based on first attribute data, and controlling the action of the virtual character in the first style through a first controller, wherein 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, and the second style is 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 continued to be controlled by the first controller.
2. The method according to claim 1, characterized in that: 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, characterized in that 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 target bone contained in the second exclusive bone data, the characteristic parameters of the target bone contained in the basic bone data are adjusted to obtain the second bone data; Among them, the characteristic parameters of the target bone are used to specify at least one of the size, shape, position and angle of the target bone.
4. The method according to claim 1, characterized in that: 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, characterized in that 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 claim 1, characterized in that 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, characterized in that The obtaining of the second animation data comprises: Determining a target action currently being performed by the virtual character in the first style; Animation data corresponding to the target 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, characterized in that: 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, characterized in that: The device comprises: A display module, configured to display a virtual character in a first style constructed based on first attribute data, and to control the action of the virtual character in the first style through a first controller, wherein 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 the process of displaying 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 continue to control the action of the virtual character in the second style through the first controller.
10. A terminal device, characterized in that: The terminal device includes 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 virtual character switching method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the method for switching virtual characters according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is loaded and executed by a processor to implement the method for switching virtual characters according to any one of claims 1 to 8.
