Game scene control method and device, storage medium and electronic device
By obtaining game scene parameters and matching model resources from the model resource library to create virtual characters, the problem of high cost and low efficiency of manual configuration of virtual characters is solved, achieving the effect of reducing production costs and improving the efficiency of virtual character creation.
Patent Information
- Application Number
- CN202011255744.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-11
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-11-11
AI Technical Summary
In the existing technology, manually configuring virtual characters in game scenes has problems such as high labor costs and low configuration efficiency.
By obtaining the target scene parameters of the target game scene, obtain the target model resources that match the target character model from the model resource library, and use these resources to create the target virtual character, thereby reducing production costs and improving the efficiency of virtual character creation.
It reduces manual consumption, improves the efficiency of virtual character creation, and solves the high cost and low efficiency problems of manual configuration of virtual characters.
Smart Images

Figure CN112402981B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for controlling a game scene, a storage medium, and an electronic device. Background Art
[0002] In order to enhance the realistic atmosphere in the game and improve the realism of the game world, some humanoid NPCs (Non-Player Characters) can be created in the game scene to make the overall atmosphere of the game world closer to reality. In the related art, a large number of NPCs are usually planted manually at designated locations in the scene, and the actions and sound effects to be played are configured.
[0003] However, the above-mentioned method of manually configuring virtual characters in the game scene has the problems of high labor cost and low configuration efficiency. Summary of the invention
[0004] The present application provides a method and device for controlling a game scene, a storage medium and an electronic device, so as to at least solve the problem of high labor cost and low configuration efficiency in the related art of manually configuring virtual characters in the game scene.
[0005] According to one aspect of an embodiment of the present application, a method for controlling a game scene is provided, comprising: obtaining target scene parameters of a target game scene, wherein the target scene parameters are used to represent scene features of the target game scene; obtaining target model resources matching a target character model from a model resource library according to the target scene parameters, wherein the target model resources are used to control appearance features of the target character model; and using the target model resources to create a target virtual character corresponding to the target character model for the target game scene.
[0006] Optionally, obtaining target model resources matching the target role model from the model resource library according to the target scene parameters includes: obtaining a target role model set matching the target scene parameters from multiple role model sets, wherein each role model set in the multiple role model sets contains multiple role models, each role model belongs to a role model group, different role model sets have different proportions of role models belonging to different role model groups, and the target role model set contains multiple target role models; obtaining the target model resources matching each target role model from the model resource library.
[0007] Optionally, the target model resource includes a target model texture and a target model pendant; the use of the target model resource to create a target virtual character corresponding to the target character model for the target game scene includes: using the target model texture to map the target character model to obtain the mapped target character model; adding the target model pendant to the mapped target character model to obtain the target virtual character corresponding to the target character model.
[0008] Optionally, before using the target model map to map the target character model to obtain the mapped target character model, the method also includes: selecting the target model map from multiple model maps corresponding to the target character model; selecting the target model pendant from multiple model pendants corresponding to the target character model.
[0009] Optionally, the target model resource also includes a target action parameter group corresponding to the target model widget, and the target action parameter group is used to indicate the widget actions that the target model widget is allowed to execute; after using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method also includes: when the target virtual character performs a first character behavior in the target game scene, selecting target action parameters that match the first character behavior from the target action parameter group; controlling the target model widget to execute the target widget action corresponding to the target action parameters.
[0010] Optionally, the use of the target model resources to create a target virtual character corresponding to the target character model for the target game scene includes: when there are multiple target virtual character models, using the target model resources corresponding to each target character model through the central processing unit of the target device and the graphics processor of the target device to create the target virtual character corresponding to each target character model for the target game scene, wherein the graphics processor is used to perform animation calculation and skinning processing for some character models among the multiple target character models.
[0011] Optionally, after using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method further includes: when the target virtual character includes multiple candidate virtual characters corresponding to different accuracies, dynamically calling a virtual character that matches the target distance from the multiple candidate virtual characters according to the target distance between the target position of the target virtual character and a target lens, wherein the target lens is a lens of the target object; controlling the display of the virtual character that matches the target distance at the target position of the target game scene displayed on the target client, wherein the target client is a client corresponding to the target object.
[0012] Optionally, after using the target model resource to create a target virtual character corresponding to the target role model for the target game scene, the method further includes: controlling the target virtual character to perform a second role behavior in the target game scene through a target artificial intelligence model assigned to the target virtual character, wherein the target artificial intelligence model is used to control the target virtual character to perform anthropomorphic actions in the target game scene.
[0013] According to another aspect of an embodiment of the present application, a control device for a game scene is provided, comprising: a first acquisition unit, used to acquire target scene parameters of a target game scene, wherein the target scene parameters are used to represent scene features of the target game scene; a second acquisition unit, used to acquire target model resources matching a target character model from a model resource library according to the target scene parameters, wherein the target model resources are used to control the appearance features of the target character model; and a creation unit, used to use the target model resources to create a target virtual character corresponding to the target character model for the target game scene.
[0014] Optionally, the second acquisition unit includes: a first acquisition module, used to acquire a target role model set matching the target scene parameters from multiple role model sets, wherein each role model set in the multiple role model sets includes multiple role models, each role model belongs to a role model group, different role model sets have different proportions of role models belonging to different role model groups, and the target role model set includes multiple target role models; a second acquisition module, used to acquire the target model resources matching each of the target role models from the model resource library.
[0015] Optionally, the target model resource includes a target model texture and a target model pendant; the creation unit includes: a mapping module, used to use the target model texture to map the target character model, and obtain the mapped target character model; an adding module, used to add the target model pendant to the mapped target character model, and obtain the target virtual character corresponding to the target character model.
[0016] Optionally, the device also includes: a first selection unit, used to select the target model texture from multiple model textures corresponding to the target character model before using the target model texture to map the target character model to obtain the mapped target character model; and a second selection unit, used to select the target model pendant from multiple model pendants corresponding to the target character model.
[0017] Optionally, the target model resource also includes a target action parameter group corresponding to the target model widget, and the target action parameter group is used to indicate the widget actions that the target model widget is allowed to execute; the device also includes: a second selection unit, used to select target action parameters that match the first character behavior from the target action parameter group during the process of the target virtual character performing the first character behavior in the target game scene after the target model resource is used to create a target virtual character corresponding to the target character model for the target game scene; a first control unit, used to control the target model widget to execute the target widget action corresponding to the target action parameters.
[0018] Optionally, the creation unit includes: a creation module, which is used to create the target virtual characters corresponding to each target character model for the target game scene by using the target model resources corresponding to each target character model through the central processing unit of the target device and the graphics processor of the target device when there are multiple target virtual character models, wherein the graphics processor is used to perform animation calculation and skinning processing for some character models among the multiple target character models.
[0019] Optionally, the device also includes: a calling unit, which is used to dynamically call a virtual character that matches the target distance from the multiple candidate virtual characters according to the target distance between the target position of the target virtual character and a target lens, after the target model resource is used to create a target virtual character corresponding to the target character model for the target game scene, when the target virtual character contains multiple candidate virtual characters corresponding to different accuracies, wherein the target lens is a lens of the target object; a second control unit, which is used to control the display of the virtual character that matches the target distance at the target position of the target game scene displayed on the target client, wherein the target client is a client corresponding to the target object.
[0020] Optionally, the device also includes: a third control unit, which is used to control the target virtual character to perform a second role behavior in the target game scene through a target artificial intelligence model assigned to the target virtual character after creating a target virtual character corresponding to the target role model for the target game scene using the target model resource, wherein the target artificial intelligence model is used to control the target virtual character to perform anthropomorphic actions in the target game scene.
[0021] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.
[0022] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when executed.
[0023] In an embodiment of the present application, a method of matching a role model and a model resource is adopted. The target scene parameters of the target game scene are obtained, wherein the target scene parameters are used to represent the scene characteristics of the target game scene; target model resources matching the target role model are obtained from a model resource library according to the target scene parameters, wherein the target model resources are used to control the appearance characteristics of the target role model; and a target virtual role corresponding to the target role model is created for the target game scene using the target model resources. When creating a virtual role, model resources are allocated to the role model from the model resources, and then the corresponding virtual role is created. The model resources are matched to the role model based on the scene parameters (time attributes, weather attributes). There is no need to manually configure virtual characters for each scene, thereby achieving the purpose of reducing production costs and achieving the technical effect of reducing labor consumption and improving the efficiency of virtual role creation, thereby solving the problem of high labor costs and low configuration efficiency in the method of manually configuring virtual characters in game scenes in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0026] Figure 1 is a schematic diagram of a hardware environment of an optional method for controlling a game scene according to an embodiment of the present application;
[0027] Figure 2 is a flowchart of an optional method for controlling a game scene according to an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of an optional method for controlling a game scene according to an embodiment of the present application;
[0029] Figure 4 is a flowchart of another optional method for controlling a game scene according to an embodiment of the present application;
[0030] Figure 5 is a structural block diagram of an optional game scene control device according to an embodiment of the present application;
[0031] Figure 6 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] According to one aspect of an embodiment of the present application, a method for controlling a game scene is provided. Optionally, in this embodiment, the method for controlling a game scene can be applied to Figure 1 In the hardware environment composed of the terminal 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal 102 through a network, and can be used to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104, and can also be used to process cloud services. The above network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 102 is not limited to a PC (Personal Computer), a mobile phone, a tablet computer, etc. The control method of the game scene of the embodiment of the present application can be executed by the server 104, or by the terminal 102, or by the server 104 and the terminal 102. Among them, the terminal 102 executes the control method of the game scene of the embodiment of the present application, and it can also be executed by the client installed thereon (for example, the client of the target game).
[0035] Taking the control method of the game scene in this embodiment executed by the server 104 as an example, Figure 2 is a flow chart of an optional method for controlling a game scene according to an embodiment of the present application, such as Figure 2As shown, the process of the method may include the following steps:
[0036] Step S202, obtaining target scene parameters of the target game scene, wherein the target scene parameters are used to represent scene features of the target game scene.
[0037] The control method of the game scene in this embodiment can be applied to the scene of creating a virtual character in the game scene, and the game scene can be a three-dimensional game scene of the target game. The target game can be a single-player game or a multiplayer game, a battle game, or a non-battle game (for example, a business game). For example, the target game can be an MMO (Massive Multiplayer Online) game, an AR (Augmented Reality) game, a VR (Virtual Reality) game, or other types of games. The game type is not limited in this embodiment.
[0038] The target game may have one or more game scenes, for example, a main game scene, a copy game scene, or other types of game scenes. There may be one or more main game scenes, and different game scenes may be connected by portals. A user may be transferred from one game scene to another through a portal, or may be transferred from one game scene to another by using a transfer item (for example, a transfer scroll, etc.) or a transfer authority, which is not limited in this embodiment.
[0039] For the target game scene of the target game, the server (e.g., the background server of the target game) needs to create multiple target virtual characters, such as multiple NPCs, for the target game scene. In order to create each target virtual character, the server can obtain the target scene parameters of the target game scene, and the target scene parameters are used to represent the scene characteristics of the target game scene, such as environmental attributes (e.g., downtown area, weather, etc.), time attributes (e.g., rush hour, weekend, spring, summer, autumn, winter, etc.).
[0040] Step S204: acquiring a target model resource that matches the target character model from a model resource library according to the target scene parameters, wherein the target model resource is used to control the appearance characteristics of the target character model.
[0041] The model resource library can store model resources made by artists for different character models. Model resources are used to control the appearance characteristics of the corresponding character models. Model resources can be a combination of multiple sub-model resources (for example, textures, pendants, etc.) (a set of combined model resources), or multiple separate sub-model resources. Multiple sets of sub-model resources can be made for each character model or character models with different expressions, so that multiple virtual characters can be created through permutations and combinations (the corresponding model resources are combined to create the corresponding virtual characters).
[0042] Optionally, each role model can be configured with multiple sets of model resources, and different model resources can be applicable to one or more scenarios, corresponding to one or more scenario parameters. For the target role model, the server can obtain the model resources that match it from the model resource library according to the target scenario parameters, that is, the target model resources, which can be used to control the appearance characteristics of the corresponding role model (target role model), and the above appearance characteristics can be explicit characteristics, such as appearance characteristics, accessories characteristics, etc.
[0043] When there are multiple target role models, the model resources allocated by the server to different target role models may be the same or different. For target role models of the same type, the target model resources allocated to them may be the same or different, which is not limited in this embodiment.
[0044] Step S206: Use the target model resource to create a target virtual character corresponding to the target character model for the target game scene.
[0045] According to the target model resource, the server can create a target virtual character corresponding to the target character model. The created target virtual character can be displayed in the target game scene. In the case of multiple target model resources, the corresponding target virtual characters can be created in a serial or parallel manner.
[0046] The client of the target game can be run on the terminal device of the user (player, corresponding to an object), and the client can communicate with the server. The user can log in to the above client running on his terminal device by using an account and password, a dynamic password, or an associated application login, and control the virtual character (player character) created by him or generated for him to perform game operations in the game scene. The target game scene can be displayed on the above client, and the created target virtual character can be displayed in the target game scene.
[0047] Through the above steps S202 to S206, the target scene parameters of the target game scene are obtained, wherein the target scene parameters are used to represent the scene characteristics of the target game scene; according to the target scene parameters, target model resources matching the target character model are obtained from the model resource library, wherein the target model resources are used to control the appearance characteristics of the target character model; the target model resources are used to create a target virtual character corresponding to the target character model for the target game scene, thereby solving the problem of high labor cost and low configuration efficiency in the method of manually configuring virtual characters in the game scene in the related art, reducing labor consumption and improving the efficiency of virtual character creation.
[0048] As an optional embodiment, acquiring a target model resource matching the target role model from a model resource library according to the target scene parameter includes:
[0049] S11, acquiring a target role model set matching the target scene parameters from a plurality of role model sets, wherein each role model set in the plurality of role model sets includes a plurality of role models, each role model belongs to a role model group, different role model sets have different proportions of role models belonging to different role model groups, and the target role model set includes a plurality of target role models;
[0050] S12, acquiring target model resources matching each target role model from a model resource library.
[0051] In the case where there are multiple target role models, the multiple role models correspond to multiple target virtual roles, and the multiple target virtual roles are virtual roles (e.g., NPCs) to be created for the target game scene. Each target virtual role corresponds to at least one target role model among the multiple target role models. If each target virtual role corresponds to one target role model, the multiple target virtual roles correspond to the multiple role models one-to-one. If each target virtual role corresponds to multiple role models, different target role models corresponding to the same target virtual role can correspond to models of different precisions of the target virtual role.
[0052] Relevant personnel can organize maps, models, pendants, etc. into a table and associate them with resources. Each resource corresponds to a unique serial number as the resource identifier. When calling, use the array method to control the random range, randomly select a set of resources (i.e., model resources) within the specified range, and combine them into a character model (virtual character, such as NPC).
[0053] During the configuration process, relevant personnel can control the random range (the range of selected resources) by setting some key parameters. For example, on weekdays, there will be more people carrying briefcases, people carrying school bags, and office workers, while on weekends, there will be more people carrying shopping bags and wearing casual clothes.
[0054] When creating NPCs, NPCs with similar action characteristics can be integrated into a group (role model set), and multiple groups of NPCs can be used as a plan (role model set). Each plan can highlight the characteristics of the plan (scene parameters) by allocating proportions of different groups of NPCs (that is, the proportions of role models belonging to different role model groups in different role model sets are different): rush hour on the morning, downtown area on weekends, etc. Each role model set can be configured with appropriate environmental parameters (scene parameters).
[0055] For example, when making NPC models, artists do not need to create a complete set of resources for each NPC representation. Instead, they can use one model to correspond to multiple sets of model resources (for example, multiple sets of textures, multiple sets of pendants, and multiple sets of actions). By arranging and combining multiple NPCs, the pressure of manual configuration can be reduced, and a large number of unique character resources can be automatically generated with only a small amount of configuration.
[0056] Optionally, in this embodiment, solutions that match the characteristics of the current environment can be called by judging the time, weather, etc. Through the matching relationship between the scene parameters and the role model set, the server can use the target scene parameters to obtain a matching target role model set from multiple role model sets, and the target role model set includes multiple target virtual characters.
[0057] For each target role model, the server can obtain target model resources matching each target role model from the model resource library. The target model resources matched to different target role models can be the same (for example, both belong to the same role model set) or different (for example, both belong to different role model sets), which is not limited in this embodiment.
[0058] Through this embodiment, by allocating proportions of different groups of NPCs to different sets of character models, thereby matching the scene parameters of the game scene and determining the configuration scheme of the corresponding virtual characters, the realism of the game scene can be improved.
[0059] Optionally, in this embodiment, the model resource may include multiple resources, including but not limited to at least one of the following: model texture, model widget, widget action.
[0060] As an optional embodiment, the target model resource includes a target model map and a target model pendant; using the target model resource to create a target virtual character corresponding to the target character model for the target game scene includes:
[0061] S21, mapping the target character model using the target model map to obtain the mapped target character model;
[0062] S22, adding a target model pendant to the mapped target role model to obtain a target virtual role corresponding to the target role model.
[0063] If the target model resource includes a target model map and a target model pendant, the server may first use the target model map to map the target role model to obtain the mapped target role model. The model mapping process may refer to the relevant technology and is not limited in this embodiment.
[0064] After obtaining the mapped target character model, the server may add a target model pendant to it to obtain a target virtual character corresponding to the target character model. The number of target model pendants may be one or more, and different target model pendants may be pendants of the same part or different parts of the target virtual character, and may include but are not limited to at least one of the following: back ornaments, head ornaments, neck ornaments, hand ornaments, waist ornaments, etc.
[0065] For example, when loading an NPC, you can initialize the widget information. The widget information comes from the NPC widget table, and you can select the index of the NPC random widget through a random function. Create a widget, load the widget model, and add the widget to the model, so that you can execute the corresponding widget action through the NPC's existing widget information.
[0066] Through this embodiment, by mapping the character model and adding pendants, the created virtual character can be enriched and the richness of the game scene display can be improved.
[0067] As an optional embodiment, before mapping the target character model using the target model map to obtain the mapped target character model, the method further includes:
[0068] S31, selecting a target model map from a plurality of model maps corresponding to the target character model;
[0069] S32, selecting a target model widget from a plurality of model widgets corresponding to the target role model.
[0070] For a type of role model, multiple sets of textures and multiple sets of pendants can be configured to achieve one-time production of resources and configurations and multiple reuse. For a target role model, the server can select the target model texture from multiple model textures corresponding to the target role model, and select the target model pendant from multiple model pendants corresponding to the target role model.
[0071] The target model map and / or the target model pendant may be randomly selected, sequentially selected, or selected in other ways, which is not limited in this embodiment.
[0072] Through this embodiment, by configuring multiple sets of textures and multiple sets of pendants for a type of character model, it is convenient to create resources and configurations once and reuse them in multiple places, thereby reducing labor costs and improving the richness of created virtual characters.
[0073] Optionally, in this embodiment, the target model resource may further include a target action parameter group corresponding to the target model widget, where the target action parameter group is used to indicate the widget actions that the target model widget is allowed to execute.
[0074] Relevant personnel can configure multiple sets of actions (action parameter groups) for each widget or each type of widget, and each set of actions is a widget action that the widget or the type of widget is allowed to execute.
[0075] As an optional embodiment, after using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method further includes:
[0076] S41, in the process of the target virtual character performing the first character behavior in the target game scene, selecting a target action parameter matching the first character behavior from the target action parameter group;
[0077] S42, controlling the target model widget to execute a target widget action corresponding to the target action parameter.
[0078] When assigning a model pendant to a role model, the server can simultaneously transmit a set of action parameters controlling the model pendant to the action controller of the role model, so that the model plays the action matching the pendant when performing actions such as standing and moving.
[0079] During the process of the target virtual character performing the first character behavior in the target game scene, the server can select target action parameters that match the target character behavior from the target action parameter group, that is, select the current widget action to be executed from the widget actions that the target model widget is allowed to execute when the target virtual character performs the first character behavior.
[0080] For the selected target action parameters, the server can control the target model widget to execute the target widget action corresponding to the target action parameters. The execution start time and end time of the above target widget action can be determined according to the first character behavior (for example, the amplitude of the activity, etc.) and the widget properties of the target model widget, which is not limited in this embodiment.
[0081] Through this embodiment, the pendant action of the model pendant is controlled according to the role behavior of the virtual character, so that the degree of simulation of the model pendant can be improved.
[0082] As an optional embodiment, using the target model resource to create a target virtual character corresponding to the target character model for the target game scene includes:
[0083] S51, when there are multiple target virtual character models, target model resources corresponding to each target character model are used by the central processing unit and the graphics processor of the target device to create target virtual characters corresponding to each target character model for the target game scene, wherein the graphics processor is used to perform animation calculation and skinning processing for some character models among the multiple target character models.
[0084] In the related art, character skinning calculations are usually performed on the CPU (Central Processing Unit) and submitted one by one to the GPU (Graphics Processing Unit) for rendering. Therefore, when there are a large number of characters in the scene, the drawcall and animation calculations will be quite large, thus affecting the overall operating efficiency.
[0085] Optionally, in this embodiment, when there are multiple target virtual characters (target character models) to be created, part of the CPU's computing work can be transferred to the GPU for execution, thereby reducing the animation calculation and skinning on the CPU. In the scene processing of a large number of characters, CPU consumption is the main bottleneck, and the above method can greatly improve the overall operating efficiency.
[0086] Transferring a portion of the CPU's computing work to the GPU for execution may be achieved by introducing animation instancing, etc. Other methods of transferring the CPU's computing work to the GPU for execution may be used in this embodiment.
[0087] Through this embodiment, by transferring a part of the CPU's animation calculation and skinning to the GPU for execution, the narrowness of model creation can be improved, thereby improving the operating efficiency of the device.
[0088] As an optional embodiment, after using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method further includes:
[0089] S61, when the target virtual character includes multiple candidate virtual characters corresponding to different precisions, dynamically calling a virtual character matching the target distance from the multiple candidate virtual characters according to the target distance between the target position of the target virtual character and the target lens, wherein the target lens is a lens of the target object;
[0090] S62, controlling the display of a virtual character matching the target distance at a target position of a target game scene displayed on a target client, wherein the target client is a client corresponding to the target object.
[0091] In related technologies, in order to maintain a high-quality artistic expression, the character models in the game often have high precision. However, when there are a large number of models, high-precision models will cause great pressure on device performance (a large number of NPC resources will cause tight device performance), greatly reducing the smoothness and stability of the game.
[0092] Optionally, in this embodiment, models with multiple precisions can be created and dynamically called according to the distance from the player's camera. This greatly reduces the performance pressure of the device without reducing the accuracy of the model that can be seen. The above process can be achieved by introducing Lod (Levels of Detail) or other technologies.
[0093] Lod refers to the allocation of resources for object rendering based on the location and importance of the nodes of the object model in the display environment, reducing the number of faces and details of non-important objects to achieve efficient rendering operations.
[0094] For the target virtual character, the server may first obtain the target distance between the target position of the target virtual character in the target game scene and the target lens. The target lens is the lens of the target object (corresponding to the lens of the target user), that is, the lens of the target game scene displayed on the target client corresponding to the target object.
[0095] The target virtual character may include multiple candidate virtual characters corresponding to different accuracies. According to the target distance, the server may dynamically call a virtual character that matches the target distance from multiple candidate virtual characters. The accuracy of the virtual character that matches the target distance is negatively correlated with the target distance. That is, the farther the distance from the target lens, the lower the accuracy of the selected virtual character, and the closer the distance to the target lens, the higher the accuracy of the selected virtual character.
[0096] Multiple candidate virtual characters of different precisions for the same virtual character may be pre-generated, and virtual characters of different precisions may be dynamically called according to the distance from the cameras of different players and displayed on the clients of each player.
[0097] Through this embodiment, different precision models are dynamically called for display according to the distance from the player's camera, so that the required (in-camera) character resources can be rendered emphatically, thereby reducing the performance pressure of the device and improving the rationality of device resource usage.
[0098] As an optional embodiment, after using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method further includes:
[0099] S71, controlling the target virtual character to perform a second role behavior in a target game scene through a target artificial intelligence model assigned to the target virtual character, wherein the target artificial intelligence model is used to control the target virtual character to perform anthropomorphic actions in the target game scene.
[0100] The unchanging NPC behavior in the game scene will cause the user to have a low sense of immersion. Facing the same characters and behaviors for a long time will greatly reduce the realism of the scene. In order to make the NPC behavior more consistent with normal human behavior and enhance the sense of reality, AI (Artificial Intelligence) can be configured for units (virtual characters, role models) to allow the units to perform more realistic operations when facing different environments, making the characters more realistic and their behaviors closer to humans in the real world.
[0101] For the target virtual character, the server can control the target virtual character to perform a second character behavior in the target game scene through the target AI model assigned to the target virtual character. The second character behavior can be a character behavior that matches the target game scene or target scene parameters. The target AI model is used to control the target virtual character to perform anthropomorphic actions in the target game scene.
[0102] For example, Figure 3 As shown in the figure, when the pedestrian character reaches the intersection, it will determine the status of the traffic light at the intersection. If the light is green, it will continue to move, and if the light is red, it will stop and wait.
[0103] Through this embodiment, by configuring AI for the virtual character, the virtual character can perform more realistic operations when facing different environments, thereby improving the realism of the game scene.
[0104] It should be noted that, in this embodiment, the control method of the above-mentioned game scene is explained by taking server execution as an example. The control method of the above-mentioned game scene can also be executed by the terminal device, or can also be executed by the server and the terminal device together.
[0105] The following is an explanation of the control method of the game scene in the embodiment of the present application in conjunction with an optional example. In this example, the virtual character is an NPC.
[0106] like Figure 4 As shown, the process of the method for controlling the game scene in this optional example may include the following steps:
[0107] Step S402, when making an NPC, the artist makes multiple sets of textures, pendants and actions for each model.
[0108] When making NPCs, artists create multiple sets of textures, multiple sets of pendants, and multiple sets of pendant actions for each model. Each pendant can correspond to one or more sets of pendant actions to adapt to different game scenes and different character actions.
[0109] Step S404, when loading the model, the program will randomly assign suitable maps and pendants according to the time and weather conditions of the scene.
[0110] When loading the model, the server program can randomly assign suitable textures and pendants based on the time and weather conditions of the current game scene.
[0111] Step S406: The widget calls the corresponding action group according to the pre-set action parameters.
[0112] Step S408, assigning a set of AI to each unit to control some complex behaviors.
[0113] Step S410, reference Lod and Animation Instancing to perform model processing.
[0114] By referencing Lod and Animation Instancing, the pressure on device performance caused by creating NPCs in large quantities can be reduced: by introducing Lod, models of various precisions can be created, and different precision models can be dynamically called according to the distance from the player's camera; by introducing Animation Instancing, part of the CPU's calculation work can be transferred to the GPU for execution.
[0115] Through this example, the production cost can be reduced by producing the art resources and configurations once and reusing them in multiple places. The AI-controlled model can be used to perform some complex behaviors, which can improve the realism of the character and make the behavior closer to humans in the real world. By introducing LOD, only the required (in-camera) character resources are rendered, which can reduce the performance pressure of the device.
[0116] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0118] According to another aspect of an embodiment of the present application, a game scene control device for implementing the above-mentioned game scene control method is also provided. Figure 5 is a structural block diagram of an optional game scene control device according to an embodiment of the present application, such as Figure 5 As shown, the above-mentioned device may include:
[0119] (1) a first acquisition unit 502, configured to acquire a target scene parameter of a target game scene, wherein the target scene parameter is used to represent a scene feature of the target game scene;
[0120] (2) a second acquisition unit 504, connected to the first acquisition unit 502, configured to acquire a target model resource matching the target character model from a model resource library according to the target scene parameter, wherein the target model resource is used to control the appearance characteristics of the target character model;
[0121] (3) A creation unit 506, connected to the second acquisition unit 504, configured to use the target model resource to create a target virtual character corresponding to the target character model for the target game scene.
[0122] It should be noted that the first acquisition unit 502 in this embodiment can be used to execute the above step S202, the second acquisition unit 504 in this embodiment can be used to execute the above step S204, and the creation unit 506 in this embodiment can be used to execute the above step S206.
[0123] Through the above module, target scene parameters of the target game scene are obtained, wherein the target scene parameters are used to represent the scene characteristics of the target game scene; target model resources matching the target character model are obtained from the model resource library according to the target scene parameters, wherein the target model resources are used to control the appearance characteristics of the target character model; and the target model resources are used to create a target virtual character corresponding to the target character model for the target game scene, thereby solving the problem of high labor cost and low configuration efficiency in the method of manually configuring virtual characters in the game scene in the related art, reducing labor consumption and improving the efficiency of virtual character creation.
[0124] As an optional embodiment, the second obtaining unit 504 includes:
[0125] A first acquisition module is used to acquire a target role model set matching the target scene parameters from a plurality of role model sets, wherein each role model set in the plurality of role model sets includes a plurality of role models, each role model belongs to a role model group, different role model sets have different proportions of role models belonging to different role model groups, and the target role model set includes a plurality of target role models;
[0126] The second acquisition module is used to acquire target model resources matching each target role model from the model resource library.
[0127] Optionally, in this embodiment, the target model resource includes a target model texture and a target model pendant.
[0128] As an optional embodiment, the creating unit 506 includes:
[0129] A mapping module, used for mapping a target role model using a target model map to obtain a mapped target role model;
[0130] The adding module is used to add a target model pendant to the mapped target role model to obtain a target virtual role corresponding to the target role model.
[0131] As an optional embodiment, the above device also includes:
[0132] A first selection unit is used to select a target model texture from a plurality of model textures corresponding to the target character model before using the target model texture to map the target character model and obtaining the mapped target character model;
[0133] The second selection unit is used to select a target model widget from a plurality of model widgets corresponding to the target role model.
[0134] Optionally, in this embodiment, the target model resource further includes a target action parameter group corresponding to the target model widget, and the target action parameter group is used to indicate the widget actions that the target model widget is allowed to execute.
[0135] As an optional embodiment, the above device also includes:
[0136] A second selection unit is used to select a target action parameter matching the first character behavior from the target action parameter group when the target virtual character performs the first character behavior in the target game scene after creating the target virtual character corresponding to the target character model for the target game scene using the target model resource;
[0137] The first control unit is used to control the target model widget to execute a target widget action corresponding to the target action parameter.
[0138] As an optional embodiment, the creating unit 506 includes:
[0139] A creation module is used to create target virtual characters corresponding to each target character model for a target game scene by using the target model resources corresponding to each target character model through the central processing unit and the graphics processor of the target device when there are multiple target virtual character models, wherein the graphics processor is used to perform animation calculation and skinning processing for some of the multiple target character models.
[0140] As an optional embodiment, the above device also includes:
[0141] a calling unit, for dynamically calling a virtual character that matches the target distance from the multiple candidate virtual characters according to a target distance between a target position of the target virtual character and a target lens, after creating a target virtual character corresponding to the target character model for the target game scene using the target model resource, when the target virtual character includes multiple candidate virtual characters corresponding to different accuracies, wherein the target lens is a lens of the target object;
[0142] The second control unit is used to control the display of a virtual character matching the target distance at a target position of a target game scene displayed on a target client, wherein the target client is a client corresponding to the target object.
[0143] As an optional embodiment, the above device also includes:
[0144] A third control unit is used to control the target virtual character to perform a second role behavior in the target game scene through a target artificial intelligence model assigned to the target virtual character after creating a target virtual character corresponding to the target role model for the target game scene using the target model resources, wherein the target artificial intelligence model is used to control the target virtual character to perform anthropomorphic actions in the target game scene.
[0145] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
[0146] According to another aspect of an embodiment of the present application, an electronic device for implementing the control method of the above-mentioned game scene is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0147] Figure 6 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 6 As shown, it includes a processor 602, a communication interface 604, a memory 606 and a communication bus 608, wherein the processor 602, the communication interface 604 and the memory 606 communicate with each other through the communication bus 608, wherein,
[0148] Memory 606, used to store computer programs;
[0149] The processor 602 is used to implement the following steps when executing the computer program stored in the memory 606:
[0150] S1, obtaining target scene parameters of a target game scene, wherein the target scene parameters are used to represent scene features of the target game scene;
[0151] S2, acquiring a target model resource matching the target character model from a model resource library according to the target scene parameters, wherein the target model resource is used to control the appearance characteristics of the target character model;
[0152] S3, using the target model resource to create a target virtual character corresponding to the target character model for the target game scene.
[0153] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0154] The communication interface is used for communication between the above electronic device and other devices.
[0155] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0156] As an example, the memory 602 may include, but is not limited to, the first acquisition unit 502, the second acquisition unit 504, and the creation unit 506 in the control device of the game scene. In addition, it may also include, but is not limited to, other modules in the control device of the game scene, which will not be repeated in this example.
[0157] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0158] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0159] It can be understood by those skilled in the art that Figure 6The structure shown is for illustration only. The device for implementing the control method of the above-mentioned game scene may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 6 It does not limit the structure of the above electronic device. For example, the terminal device may also include Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 6 Different configurations shown.
[0160] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0161] According to another aspect of the embodiments of the present application, a storage medium is further provided. Optionally, in this embodiment, the storage medium can be used to execute the program code of any of the above-mentioned game scene control methods in the embodiments of the present application.
[0162] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.
[0163] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:
[0164] S1, obtaining target scene parameters of a target game scene, wherein the target scene parameters are used to represent scene features of the target game scene;
[0165] S2, acquiring a target model resource matching the target character model from a model resource library according to the target scene parameters, wherein the target model resource is used to control the appearance characteristics of the target character model;
[0166] S3, using the target model resource to create a target virtual character corresponding to the target character model for the target game scene.
[0167] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.
[0168] Optionally, in this embodiment, the storage medium may include but is not limited to: a U disk, a ROM, a RAM, a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0169] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0170] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0171] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0172] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0174] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0175] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for controlling a game scene, It is characterized in that include: Acquire target scene parameters of a target game scene, wherein the target scene parameters are used to represent scene features of the target game scene; Acquiring a target model resource matching the target character model from a model resource library according to the target scene parameter, wherein the target model resource is used to control the appearance characteristics of the target character model; Using the target model resource to create a target virtual character corresponding to the target character model for the target game scene; Wherein, acquiring a target model resource matching the target role model from a model resource library according to the target scene parameter includes: Acquire a target role model set matching the target scene parameter from a plurality of role model sets, wherein each role model set in the plurality of role model sets includes a plurality of role models, each role model belongs to a role model group, different role model sets have different proportions of role models belonging to different role model groups, and the target role model set includes a plurality of the target role models; The target model resources matching each target role model are obtained from the model resource library, wherein the model resources in the model resource library support determining a resource selection range in an array manner, and a set of model resources are randomly selected within the resource selection range to form a role model.
2. The method according to claim 1, It is characterized in that The target model resource includes a target model map and a target model pendant; and using the target model resource to create a target virtual character corresponding to the target character model for the target game scene includes: Mapping a target character model using the target model map to obtain the mapped target character model; The target model pendant is added to the mapped target role model to obtain the target virtual role corresponding to the target role model.
3. The method according to claim 2, It is characterized in that Before mapping the target character model using the target model map to obtain the mapped target character model, the method further includes: Selecting the target model map from a plurality of model maps corresponding to the target character model; The target model widget is selected from a plurality of model widgets corresponding to the target role model.
4. The method according to claim 2, It is characterized in that The target model resource further includes a target action parameter group corresponding to the target model widget, wherein the target action parameter group is used to indicate the widget actions that the target model widget is allowed to execute; After using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method further includes: In the process of the target virtual character performing a first character behavior in the target game scene, selecting a target action parameter matching the first character behavior from the target action parameter group; The target model widget is controlled to execute a target widget action corresponding to the target action parameter.
5. The method according to claim 1, It is characterized in that The using the target model resource to create a target virtual character corresponding to the target character model for the target game scene comprises: In the case where there are multiple target virtual character models, the target model resources corresponding to each target character model are used by the central processing unit of the target device and the graphics processor of the target device to create the target virtual characters corresponding to each target character model for the target game scene, wherein the graphics processor is used to perform animation calculation and skinning processing for some character models among the multiple target character models.
6. The method according to claim 1, It is characterized in that After using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method further includes: In the case where the target virtual character includes a plurality of candidate virtual characters corresponding to different precisions, dynamically calling a virtual character matching the target distance from the plurality of candidate virtual characters according to a target distance between a target position of the target virtual character and a target lens, wherein the target lens is a lens of a target object; Controlling display of a virtual character that matches the target distance at the target position of the target game scene displayed on a target client, wherein the target client is a client corresponding to the target object.
7. The method according to any one of claims 1 to 6, It is characterized in that After using the target model resource to create a target virtual character corresponding to the target character model for the target game scene, the method further includes: The target virtual character is controlled to perform a second role behavior in the target game scene by a target artificial intelligence model assigned to the target virtual character, wherein the target artificial intelligence model is used to control the target virtual character to perform anthropomorphic actions in the target game scene.
8. A control device for a game scene, It is characterized in that include: A first acquisition unit, configured to acquire a target scene parameter of a target game scene, wherein the target scene parameter is used to represent a scene feature of the target game scene; A second acquisition unit, configured to acquire a target model resource matching the target character model from a model resource library according to the target scene parameter, wherein the target model resource is used to control the appearance characteristics of the target character model; A creation unit, configured to use the target model resource to create a target virtual character corresponding to the target character model for the target game scene; Wherein, the second acquisition unit includes: A first acquisition module is used to acquire a target role model set matching the target scene parameter from a plurality of role model sets, wherein each role model set in the plurality of role model sets includes a plurality of role models, each role model belongs to a role model group, different role model sets have different proportions of role models belonging to different role model groups, and the target role model set includes a plurality of the target role models; The second acquisition module is used to obtain the target model resources matching each target role model from the model resource library, wherein the model resources in the model resource library support the use of an array to determine a resource selection range, and randomly select a set of model resources within the resource selection range to combine into a role model.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, in, The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is configured to execute the method steps of any one of claims 1 to 7 by running the computer program stored in the memory.
10. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the method steps described in any one of claims 1 to 7 when run.
