Method, device and electronic equipment for generating weather effects in a game
Patent Information
- Application Number
- CN202310841407.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-07-10
AI Technical Summary
但是,该方式需要玩家手动不断调节组件设置参数,才能得到随游戏关卡变化的天气效果,获取到符合要求的天气变化效果需要消耗大量人力和时间,导致玩家游戏体验感较差
[0009] This invention provides a method, apparatus, and electronic device for generating weather effects in games. First, it acquires level data of a target game level and determines the level element features based on the level data. Then, it determines target weather features that match the level element features. Next, it associates and saves the target weather features with the level data. When the target game level is run based on the level data, weather change effects are generated according to the target weather features. This method automatically matches the corresponding target weather features based on the level element features of the target game level, thus obtaining weather change effects that match the characteristics of the target game level. Therefore, this method can not only automatically generate different weather change effects based on the characteristics of different game levels to adapt to different game scenarios, but also eliminates the need for manually creating weather change effects for game levels, improving the efficiency of weather effect production and reducing production time and workload.
Smart Images

Figure CN117018606B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game technology, and in particular to a method, apparatus, and electronic device for generating weather effects in games. Background Technology
[0002] In user-generated games, players can create game levels in the game editor according to their own needs. These levels are then available for trial by the player or other players. When creating weather changes for a game level, players need to manually select skybox and ambient light components, and control the rhythm and content of weather changes by setting their attributes, triggers, and motion states. However, this method requires players to constantly adjust component settings to achieve weather effects that change with the game level. Obtaining satisfactory weather effects consumes a significant amount of manpower and time, resulting in a poor player experience. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus, and electronic device for generating weather effects in games, so as to automatically configure weather change effects that are consistent with the game level based on the level elements of the game level, thereby enhancing the player's gaming experience.
[0004] In a first aspect, the present invention provides a method for generating weather effects in a game. The method includes: acquiring level data of a target game level; determining level element features of the target game level based on the level data; wherein the level element features include: features of level elements of the target game level indicated by the level data; determining target weather features that match the level element features; associating and saving the target weather features with the level data; and generating weather change effects of the target game level based on the target weather features when running the target game level based on the level data.
[0005] Secondly, the present invention provides a device for generating weather effects in a game. The device includes: a feature determination module, used to: acquire level data of a target game level, and determine level element features of the target game level based on the level data; wherein, the level element features include: features of level elements of the target game level indicated by the level data; a feature matching module, used to determine target weather features that match the level element features; a feature storage module, used to associate and store the target weather features with the level data; and a feature application module, used to generate weather change effects of the target game level based on the target weather features when running the target game level based on the level data.
[0006] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, and the processor executing the machine-executable instructions to implement the above-mentioned method for generating weather effects in the game.
[0007] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the aforementioned method for generating weather effects in the game.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] This invention provides a method, apparatus, and electronic device for generating weather effects in games. First, it acquires level data of a target game level and determines the level element features based on the level data. Then, it determines target weather features that match the level element features. Next, it associates and saves the target weather features with the level data. When the target game level is run based on the level data, weather change effects are generated according to the target weather features. This method automatically matches the corresponding target weather features based on the level element features of the target game level, thus obtaining weather change effects that match the characteristics of the target game level. Therefore, this method can not only automatically generate different weather change effects based on the characteristics of different game levels to adapt to different game scenarios, but also eliminates the need for manually creating weather change effects for game levels, improving the efficiency of weather effect production and reducing production time and workload.
[0010] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for generating weather effects in a game, as provided in an embodiment of the present invention;
[0014] Figure 2 A flowchart illustrating another method for generating weather effects in a game, provided as an embodiment of the present invention;
[0015] Figure 3 A schematic diagram of a device for generating weather effects in a game, provided in an embodiment of the present invention;
[0016] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0018] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0019] In user-generated games, players can create game levels according to their needs in the game editor. When creating weather changes for game levels, players need to manually select skybox and ambient light components, and control the rhythm and content of weather changes by setting properties, triggers, and motion states for these components. However, customizing skybox and ambient light settings by users presents the following problems:
[0020] (1) It is time-consuming to manually select and compare a large number of options in the option library.
[0021] (2) To improve the beauty and quality of game levels and create weather effects that fit the changes of game levels, players need to set keyframes and weather change parameters in the timeline, or write statements through triggers. This method is also time-consuming and laborious.
[0022] (3) This method requires certain professional knowledge and skills to set weather changes, which is too high for novice players and takes up too much time that could have been used to design the core gameplay for experienced players, resulting in a poor gaming experience.
[0023] To address the aforementioned issues, this invention provides a method, apparatus, and electronic device for generating weather effects in games, which can be applied to weather setting scenarios in game levels.
[0024] In one embodiment of this disclosure, the method for generating weather effects in a game can run on a local terminal device or a server. When the generation of weather effects in a game runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices.
[0025] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of the weather effect generation method in the game are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally decodes and outputs the game screen through the client device.
[0026] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0027] In one possible implementation, embodiments of this disclosure provide a method for generating weather effects in a game, such as... Figure 1 As shown, the method includes the following specific steps:
[0028] Step S102: Obtain the level data of the target game level, and determine the level element features of the target game level based on the level data; wherein, the level element features include: the features of the level elements of the target game level indicated by the level data.
[0029] In its implementation, the target game level comprises multiple level elements, including but not limited to: motion components set within the target game level and level configuration parameters for the target game level. The level data includes: component configuration parameters for the motion components set within the target game level and level configuration parameters for the target game level itself. Motion components typically refer to configurable components within the game level. These components can function as obstacles or designated items, primarily for player use. Players can use motion components to jump, dodge, or turn. Specifically, the component configuration parameters for different motion components may vary, and the specific values corresponding to the component configuration parameters for each motion component can be determined based on player actions. For example, motion component configuration parameters may include the difficulty and placement position of the motion component. The level configuration parameters for the target game level may include specific values corresponding to the length of the level track, the game level completion time limit, and the virtual camera perspective and movement method.
[0030] In one specific embodiment, the components that can be set in the game level include a variety of types: terrain components, mechanism components, decorative components, and combination components, etc. Each type of component also contains multiple components. For example, mechanism components also include motion mechanism components, functional mechanism components, logic components, object components, and floor components. Among them, motion mechanism components also include components such as cylinders, gears, cross gears, and clockwise turntables.
[0031] In practical applications, the aforementioned level elements include, but are not limited to: level track length and complexity, difficulty and placement of moving components, placement of designated items, level time limits, and virtual camera perspective and movement. The track length and complexity affect the overall playtime of the game level; designated items include furniture or deceleration items, which, when placed in the game level, will produce effects such as acceleration or deceleration for the player; level time limits increase the game's tension and affect its pace; the virtual camera perspective and movement are determined during level design, and users determine the virtual camera perspective by setting camera properties and set the movement by writing triggers or setting keyframes on a timeline.
[0032] Step S104: Determine the target weather features that match the above-mentioned checkpoint element features.
[0033] In practical implementation, the aforementioned target weather features include at least one of the following: skybox color, skybox brightness, skybox orientation, ambient light type, ambient light color, ambient light intensity, ambient light position, and ambient light direction. Specifically, the settings parameters of the skybox and the ambient light affect the weather effects in the game level; therefore, the weather features are all settings parameters corresponding to the skybox and ambient light.
[0034] In practical implementation, factors such as player behavior, game rhythm, and overall level art can be considered to design correspondences between level element features and weather characteristics. These correspondences include, but are not limited to: the higher the complexity of the level track, the more frequent the changes in the skybox's attitude angle and the position and intensity of the ambient light, aligning with the player's high-frequency actions (such as jumping, dodging, and turning); the greater the difficulty of the moving components (also known as obstacles), the darker the skybox and the weaker the ambient light; the denser the placement of obstacles, the closer the colors of the skybox and ambient light are to cool tones; and the placement of specific items, such as... When speed-up items are used, the skybox becomes brighter, and the colors of the ambient light and skybox become closer to warm tones; when speed-down items are used, the skybox becomes darker, and the colors of the ambient light and skybox become closer to cool tones; the shorter the level time limit, the darker the skybox and the weaker the ambient light, with more point light sources; conversely, the longer the level time limit, the brighter the skybox and the more area light sources, resulting in softer lighting in the game levels; the more dynamic the virtual camera's perspective and movement, the greater the changes in the skybox's angle and the direction of the ambient light, creating a tense game rhythm.
[0035] Based on the above description, according to the correspondence between level element features and weather features, the target weather features that match the level element features of the target game level can be automatically calculated.
[0036] Step S106: Associate and save the target weather features with the aforementioned checkpoint data.
[0037] After obtaining the target weather features that match the level element features of the target game level, it is also necessary to associate and save the target weather features with the level data of the target game level so that when the target game level is run, the weather effects of the target game level can be controlled through the target weather features.
[0038] Step S108: When running the target game level based on the level data, generate the weather change effect of the target game level according to the target weather characteristics.
[0039] In practical implementation, when running the target game level, the system generates weather change effects for the target game level based on the target weather features saved in association with the level data. Specifically, throughout the target game level's track, the virtual objects within the level occupy different positions, and the corresponding level elements in the game scene also differ, naturally resulting in different target weather features. Thus, as the target game level progresses, different target weather features are obtained based on different level elements, thereby generating different weather effects.
[0040] This invention provides a method for generating weather effects in a game. First, level data of the target game level is acquired. Based on the level data, the level element features of the target game level are determined. Then, target weather features matching the level element features are determined. Next, the target weather features are associated with and saved with the level data. When the target game level is run based on the level data, weather change effects for the target game level are generated according to the target weather features. In this method, corresponding target weather features can be automatically matched based on the level element features of the target game level, thereby obtaining weather change effects that match the characteristics of the target game level. Therefore, this method can not only automatically generate different weather change effects based on the characteristics of different game levels, adapting to different game scenarios, but also eliminates the need for manually creating weather change effects for game levels, improving the efficiency of weather effect production and reducing production time and workload.
[0041] This invention also provides another method for generating weather effects in a game. This method is implemented based on the above embodiments. The method focuses on describing the specific process of determining target weather features that match the characteristics of level elements (specifically implemented through step S204 below), and the specific process of generating the weather change effects of the target game level based on the target weather features when running the target game level based on level data (implemented through steps S208-S210 below); Figure 2 As shown, the method includes the following specific steps:
[0042] Step S202: Obtain the level data of the target game level, and determine the level element features of the multiple level elements contained in the target game level based on the level data.
[0043] In one specific embodiment, the present invention can provide a convenient way to generate weather change effects, such as providing a designated control for "one-click generation of weather effects" in the settings entry of the skybox and ambient light. Furthermore, in response to a trigger operation on the designated control, the level data of the target game level is obtained; wherein, the designated control is used to: configure the weather change effects of the target game level according to the level data of the target game level.
[0044] Step S204: For each level element corresponding to a level element feature, determine the target weather feature that matches the level element feature corresponding to the current level element.
[0045] In its specific implementation, this invention determines the level element features corresponding to each level element, and then obtains the target weather features that match each level element feature based on the preset correspondence between level element features and weather features. This allows the game level's weather effects to be generated based on the target weather features that match the level element features of the environment in which the virtual object is located during the game level's runtime.
[0046] Step S206: Associate and save the target weather features corresponding to each level element feature contained in the target game level with the level data.
[0047] Step S208: When running the target game level based on the level data, determine the target weather feature corresponding to the first level element that corresponds to the location of the virtual object in the target game level.
[0048] During the target game's execution, the game environment in which the virtual object is currently located needs to be determined based on its position. This environment could be a game scene within a specified range of the virtual object's location, or a game scene parallel to the virtual object's location. Then, based on the first level element corresponding to the current game environment, target weather features matching the features of the first level element are determined from the target weather features associated with and stored in the level data. The first level element includes, but is not limited to, features of moving components within the game environment in which the virtual object is currently located, and features of the target game level's configuration parameters.
[0049] Step S210: Combine the target weather features corresponding to the elements of the first level to obtain combined weather features, and update the weather effects in the target game level based on the combined weather features.
[0050] In practical implementation, the first level element typically includes multiple level elements, each with its own level element characteristics. These level element characteristics, in turn, correspond to a matching target weather characteristic. In other words, each level element has a corresponding target weather characteristic. The target weather characteristics corresponding to all first level elements and their positions relative to the virtual object in the target game level are combined to obtain a combined weather characteristic. The weather effects in the target game level are then updated based on this combined weather characteristic.
[0051] For example, if there are two level 1 elements, where the target weather feature for the first element is setting the skybox color to the first color, and the target weather feature for the second element is setting the ambient light to the second color, then the skybox color in the current game environment's weather effect will be set to the first color, and the ambient light will be set to the second color. If both level 1 elements need to have a specific weather feature adjusted, the average value of the weather features corresponding to these two level 1 elements can be chosen as the final adjustment value.
[0052] The above method can generate unique weather effects based on player-created game levels. Furthermore, these weather effects perfectly match the rhythm, difficulty, and atmosphere of the game levels, increasing their uniqueness. In addition, players can quickly generate weather effects that better suit the characteristics and gameplay experience of their game levels, improving the player experience and saving significant game development time, resulting in higher-quality UGC content and faster production speed.
[0053] The following examples focus on describing how to determine target weather characteristics.
[0054] Specifically, the process of determining the target weather features that match the checkpoint element features can include: inputting the checkpoint element features into a pre-trained target model and outputting the target weather features corresponding to the checkpoint element features; wherein, the target model is trained using training data, which includes multiple training samples, including: checkpoint element features and weather features corresponding to the checkpoint element features.
[0055] The target model mentioned above can be a neural network model or a deep learning model, depending on the R&D requirements. The target model is obtained through training data, which is prepared in advance and contains a large number of level element features and the corresponding weather features for each level element feature.
[0056] In one specific embodiment, the target model may include a variational autoencoder; wherein the variational autoencoder includes an encoder and a decoder; the specific process of inputting the checkpoint element features into the pre-trained target model and outputting the target weather features corresponding to the checkpoint element features may include: inputting the checkpoint element features into the encoder of the variational autoencoder, encoding the checkpoint element features into latent variables through the encoder; inputting the latent variables into the decoder of the variational autoencoder, decoding the latent variables through the decoder to obtain the target weather features corresponding to the checkpoint element features.
[0057] In practice, training a variational autoencoder involves the following steps:
[0058] The first step is data preprocessing and feature extraction. A large number of level element features and corresponding weather features need to be prepared for training the variational autoencoder.
[0059] The second step is to train a variational autoencoder (VAE). This VAE uses features such as the density of moving components and track length in the game level as conditions (equivalent to the aforementioned level element features) and weather features as the target to train a generative model. The input to the VAE's decoder is a set of random noise signals, which are transformed into weather features through a multi-layer neural network. During training, the encoder encodes the level element features into latent variables, and the decoder decodes these latent variables into corresponding weather features.
[0060] The third step is to optimize the model. A suitable loss function, such as mean squared error or cross-entropy loss, is set to minimize the gap between the generated weather features and the weather features in the training data, while simultaneously maximizing the quality and similarity of the generated weather features.
[0061] The fourth step is to evaluate and test the model. Typically, dozens of examples are selected both within and outside the training data. The trained variational autoencoder is used to generate corresponding weather features. The generated weather features are then manually evaluated and compared with the original data to determine whether they meet the actual usage requirements.
[0062] After the variational autoencoder is trained, the level element features corresponding to the target game level can be obtained. These features are then input into the trained autoencoder to generate weather features that match the target game level's level element features. The parameters related to the skybox and ambient light associated with these weather features are then applied to the level editor to generate weather change effects for the target game level based on the target weather features when the target game level is run using the level data.
[0063] For example, during the time interval t1 to t2 of level A, the game extracts the level element features and inputs them into the target model. The target model learns and calculates the attitude angle of the skybox, the color and brightness of the six faces of the skybox, and the weather features such as the type, color, intensity, and position of N ambient light sources during the time interval t1 to t2. These weather features are then applied to game level A, ultimately forming the overall weather effect of game level A.
[0064] In an optional embodiment, level feature elements are extracted to generate game scene content that matches and corresponds to the game level for the player. In addition to the weather (skybox and ambient light) changes detailed in this invention, particle effects in the environment (such as flying birds, falling leaves, etc.) can also be generated. The motion trajectory, speed and density parameters of the particle effects are adjusted and combined with the skybox and ambient light to achieve higher quality effects.
[0065] The present invention has the following advantages:
[0066] (1) Adapt to different game levels: This function can automatically generate different weather change effects according to the characteristics of different game levels, adapt to different game scenarios, and make the game closer to the expectations and needs of the level creators and trial players.
[0067] (2) Improve production efficiency: This solution can automatically generate weather change effects without manual production, which can improve production efficiency and reduce production time and workload.
[0068] (3) Improve the game experience: Weather change effects can increase the variety and diversity of game scenes, improve the player's game experience, and increase the game's playability and fun.
[0069] (4) Increase realism: Weather change effects can increase the realism of the game scene, allowing players to be more immersed in the game and improve the visual effects and expressiveness of the game.
[0070] Corresponding to the above method embodiments, this invention also provides a device for generating weather effects in games, such as... Figure 3 As shown, the device includes:
[0071] The feature determination module 30 is used to: acquire level data of the target game level, and determine the level element features of the target game level based on the level data; wherein, the level element features include: the features of the level elements of the target game level indicated by the level data.
[0072] Feature matching module 31 is used to determine target weather features that match the features of the checkpoint elements.
[0073] The feature storage module 32 is used to associate and save the target weather features with the checkpoint data.
[0074] The feature application module 33 is used to generate the weather change effect of the target game level based on the target weather features when running the target game level based on the level data.
[0075] The weather effect generation device in the aforementioned game first acquires the level data of the target game level and determines the level element characteristics based on the level data. Then, it determines the target weather features that match the level element characteristics. Next, it associates and saves the target weather features with the level data. When the target game level is run based on the level data, the weather change effects of the target game level are generated according to the target weather features. In this method, the corresponding target weather features can be automatically matched based on the level element characteristics of the target game level, thus obtaining weather change effects that fit the characteristics of the target game level. Therefore, this method can not only automatically generate different weather change effects according to the characteristics of different game levels, adapting to different game scenarios, but also eliminates the need to manually create weather change effects for game levels, improving the efficiency of weather effect production and reducing production time and workload.
[0076] Specifically, the aforementioned target game level contains multiple level elements, which include: motion components set in the target game level and level configuration parameters of the target game level; wherein, the level data includes: component configuration parameters of motion components set in the target game level and level configuration parameters of the target game level.
[0077] Furthermore, the feature matching module 31 is used to: determine the target weather feature that matches the level element feature corresponding to the current level element for each level element's level element feature; the feature application module 33 is used to: determine the target weather feature corresponding to the first level element corresponding to the position of the virtual object in the target game level when running the target game level based on the level data; combine the target weather features corresponding to the first level element to obtain combined weather features, and update the weather effect in the target game level based on the combined weather features.
[0078] In a specific implementation, the feature matching module 31 is further used to: input the checkpoint element features into the pre-trained target model and output the target weather features corresponding to the checkpoint element features; wherein, the target model is obtained by training data, the training data includes multiple training samples, the training samples include: checkpoint element features, and weather features corresponding to the checkpoint element features.
[0079] In an optional embodiment, the target model includes a variational autoencoder; wherein the variational autoencoder includes an encoder and a decoder; the feature matching module 31 is used to: input the checkpoint element features into the encoder of the variational autoencoder, and encode the checkpoint element features into latent variables through the encoder; input the latent variables into the decoder of the variational autoencoder, and decode the latent variables through the decoder to obtain the target weather features corresponding to the checkpoint element features.
[0080] In practice, the aforementioned target weather characteristics include at least one of the following: skybox color, skybox brightness, skybox attitude, ambient light type, ambient light color, ambient light intensity, ambient light position, and ambient light direction.
[0081] Furthermore, the aforementioned feature determination module 30 is used to: respond to a trigger operation on a specified control and obtain the level data of the target game level; wherein, the specified control is used to: configure the weather change effect of the target game level according to the level data of the target game level.
[0082] The weather effect generation device in the game provided in this embodiment of the invention has the same implementation principle and the same technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0083] This invention also provides an electronic device, such as... Figure 4 As shown, the electronic device includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the method for generating weather effects in the game described above.
[0084] Specifically, the method for generating weather effects in the above game includes: acquiring level data of the target game level, and determining the level element features of the target game level based on the level data; wherein, the level element features include: the features of the level elements of the target game level indicated by the level data; determining the target weather features that match the level element features; associating and saving the target weather features with the level data; and generating the weather change effects of the target game level based on the target weather features when running the target game level based on the level data.
[0085] In the above-mentioned method for generating weather effects in the game, the corresponding target weather features can be automatically matched according to the level element features of the target game level. Thus, based on the target weather features, weather change effects that fit the characteristics of the target game level can be obtained. Therefore, this method can not only automatically generate different weather change effects according to the characteristics of different game levels and adapt to different game scenarios, but also eliminates the need to manually create weather change effects for game levels, thereby improving the efficiency of weather effect production and reducing production time and workload.
[0086] In an optional embodiment, the target game level includes multiple level elements, which include: motion components set in the target game level and level configuration parameters of the target game level; wherein, the level data includes: component configuration parameters of the motion components set in the target game level and level configuration parameters of the target game level.
[0087] In an optional embodiment, the step of determining the target weather feature that matches the level element feature includes: for each level element corresponding to a level element feature, determining the target weather feature that matches the level element feature corresponding to the current level element; the step of generating the weather change effect of the target game level based on the target weather feature when running the target game level based on the level data includes: when running the target game level based on the level data, determining the target weather feature corresponding to the first level element corresponding to the position of the virtual object in the target game level; combining the target weather features corresponding to the first level element to obtain a combined weather feature, and updating the weather effect in the target game level based on the combined weather feature.
[0088] In an optional embodiment, the step of determining the target weather feature that matches the checkpoint element feature includes: inputting the checkpoint element feature into a pre-trained target model and outputting the target weather feature corresponding to the checkpoint element feature; wherein, the target model is trained using training data, and the training data includes multiple training samples, which include: checkpoint element feature and weather feature corresponding to the checkpoint element feature.
[0089] In an optional embodiment, the target model includes a variational autoencoder; wherein the variational autoencoder includes an encoder and a decoder; the step of inputting the checkpoint element features into the pre-trained target model and outputting the target weather features corresponding to the checkpoint element features includes: inputting the checkpoint element features into the encoder of the variational autoencoder, encoding the checkpoint element features into latent variables through the encoder; inputting the latent variables into the decoder of the variational autoencoder, decoding the latent variables through the decoder to obtain the target weather features corresponding to the checkpoint element features.
[0090] In an optional embodiment, the target weather features include at least one of the following: skybox color, skybox brightness, skybox orientation, ambient light type, ambient light color, ambient light intensity, ambient light position, and ambient light direction.
[0091] In an optional embodiment, the step of obtaining the level data of the target game level includes: responding to a trigger operation on a specified control to obtain the level data of the target game level; wherein the specified control is used to: configure the weather change effect of the target game level according to the level data of the target game level.
[0092] Furthermore, Figure 4 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0093] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0094] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. Processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0095] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the method for generating weather effects in the game described above. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0096] Specifically, the method for generating weather effects in the above game includes: acquiring level data of the target game level, and determining the level element features of the target game level based on the level data; wherein, the level element features include: the features of the level elements of the target game level indicated by the level data; determining the target weather features that match the level element features; associating and saving the target weather features with the level data; and generating the weather change effects of the target game level based on the target weather features when running the target game level based on the level data.
[0097] In the above-mentioned method for generating weather effects in the game, the corresponding target weather features can be automatically matched according to the level element features of the target game level. Thus, based on the target weather features, weather change effects that fit the characteristics of the target game level can be obtained. Therefore, this method can not only automatically generate different weather change effects according to the characteristics of different game levels and adapt to different game scenarios, but also eliminates the need to manually create weather change effects for game levels, thereby improving the efficiency of weather effect production and reducing production time and workload.
[0098] In an optional embodiment, the target game level includes multiple level elements, which include: motion components set in the target game level and level configuration parameters of the target game level; wherein, the level data includes: component configuration parameters of the motion components set in the target game level and level configuration parameters of the target game level.
[0099] In an optional embodiment, the step of determining the target weather feature that matches the level element feature includes: for each level element corresponding to a level element feature, determining the target weather feature that matches the level element feature corresponding to the current level element; the step of generating the weather change effect of the target game level based on the target weather feature when running the target game level based on the level data includes: when running the target game level based on the level data, determining the target weather feature corresponding to the first level element corresponding to the position of the virtual object in the target game level; combining the target weather features corresponding to the first level element to obtain a combined weather feature, and updating the weather effect in the target game level based on the combined weather feature.
[0100] In an optional embodiment, the step of determining the target weather feature that matches the checkpoint element feature includes: inputting the checkpoint element feature into a pre-trained target model and outputting the target weather feature corresponding to the checkpoint element feature; wherein, the target model is trained using training data, and the training data includes multiple training samples, which include: checkpoint element feature and weather feature corresponding to the checkpoint element feature.
[0101] In an optional embodiment, the target model includes a variational autoencoder; wherein the variational autoencoder includes an encoder and a decoder; the step of inputting the checkpoint element features into the pre-trained target model and outputting the target weather features corresponding to the checkpoint element features includes: inputting the checkpoint element features into the encoder of the variational autoencoder, encoding the checkpoint element features into latent variables through the encoder; inputting the latent variables into the decoder of the variational autoencoder, decoding the latent variables through the decoder to obtain the target weather features corresponding to the checkpoint element features.
[0102] In an optional embodiment, the target weather features include at least one of the following: skybox color, skybox brightness, skybox orientation, ambient light type, ambient light color, ambient light intensity, ambient light position, and ambient light direction.
[0103] In an optional embodiment, the step of obtaining the level data of the target game level includes: responding to a trigger operation on a specified control to obtain the level data of the target game level; wherein the specified control is used to: configure the weather change effect of the target game level according to the level data of the target game level.
[0104] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0105] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0106] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for generating weather effects in a game, characterized in that, The method includes: The process involves acquiring level data for a target game level and determining level element features based on the level data. The level element features include: characteristics of the level elements in the target game level as indicated by the level data. The target game level contains multiple level elements, each including: motion components set in the target game level and level configuration parameters of the target game level. The level data includes: component configuration parameters of the motion components set in the target game level and level configuration parameters of the target game level. Determine the target weather features that match the characteristics of the checkpoint elements; The target weather characteristics are associated with and saved with the checkpoint data; When running the target game level based on the level data, the weather change effect of the target game level is generated according to the target weather characteristics; The step of determining the target weather feature that matches the checkpoint element feature includes: inputting the checkpoint element feature into a pre-trained target model and outputting the target weather feature corresponding to the checkpoint element feature; wherein, the target model is obtained by training data, the training data includes multiple training samples, and the training samples include: checkpoint element feature and weather feature corresponding to the checkpoint element feature.
2. The method according to claim 1, characterized in that, The step of determining the target weather feature that matches the checkpoint element feature includes: For each of the aforementioned checkpoint elements, determine the target weather feature that matches the checkpoint element feature corresponding to the current checkpoint element; The step of generating weather change effects for the target game level based on the target weather characteristics when running the target game level based on the level data includes: When running the target game level based on the level data, determine the target weather feature corresponding to the first level element that corresponds to the location of the virtual object in the target game level; Combine the target weather features corresponding to the elements of the first level to obtain combined weather features, and update the weather effects in the target game level based on the combined weather features.
3. The method according to claim 1, characterized in that, The target model includes a variational autoencoder; wherein the variational autoencoder includes an encoder and a decoder; The step of inputting the checkpoint element features into a pre-trained target model and outputting the target weather features corresponding to the checkpoint element features includes: The level element features are input into the encoder of the variational autoencoder, and the level element features are encoded into latent variables by the encoder. The latent variables are input into the decoder of the variational autoencoder, and the latent variables are decoded by the decoder to obtain the target weather features corresponding to the checkpoint element features.
4. The method according to claim 1, characterized in that, The target weather features include at least one of the following: skybox color, skybox brightness, skybox orientation, ambient light type, ambient light color, ambient light intensity, ambient light position, and ambient light direction.
5. The method according to claim 1, characterized in that, The step of obtaining the level data of the target game level includes: In response to a trigger operation on a specified control, the system obtains the level data of the target game level; wherein the specified control is used to: configure the weather change effects of the target game level based on the level data of the target game level.
6. A device for generating weather effects in a game, characterized in that, The device includes: A feature determination module is used to: acquire level data of a target game level, and determine level element features of the target game level based on the level data; wherein, the level element features include: features of the level elements of the target game level indicated by the level data; the target game level contains multiple level elements, and the level elements include: motion components set in the target game level and level configuration parameters of the target game level; the level data includes: component configuration parameters of the motion components set in the target game level and level configuration parameters of the target game level; The feature matching module is used to determine the target weather features that match the features of the checkpoint elements; The feature storage module is used to associate and store the target weather features with the checkpoint data; The feature application module is used to generate the weather change effect of the target game level according to the target weather features when running the target game level based on the level data; The feature matching module is further configured to: input the checkpoint element features into a pre-trained target model and output the target weather features corresponding to the checkpoint element features; wherein the target model is trained using training data, the training data including multiple training samples, the training samples including: checkpoint element features and weather features corresponding to the checkpoint element features.
7. An electronic device, characterized in that, The system includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method for generating weather effects in a game as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for generating weather effects in a game as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Virtual game loading method and device, storage medium and electronic device
CN111744180A
Display control method and device of control, electronic equipment and storage medium
CN115888089A