Method, device, storage medium and electronic device for switching weather types in games
By obtaining the physical parameter set and using virtual character locations to obtain target texture data, high-quality real-time switching of weather types in the game is achieved, solving the problem of single visual effects and inability to switch in real time in the existing technology, and improving the diversity of game scenes .
Patent Information
- Application Number
- CN202111607985.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-12-22
AI Technical Summary
The weather type switching method in existing games results in a single visual effect and cannot switch in real time based on the virtual character's location.
By obtaining the physical parameter set, the candidate texture data is determined, and the target texture data is obtained using the position and preset correspondence of the virtual characters in the game scene to obtain the target texture data, so as to achieve high-quality real-time switching of weather types.
It improves the diversity and real-time nature of weather type switching, solving the problem of single visual effects and inability to switch in real-time according to character position.
Smart Images

Figure CN114419214B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for switching weather types in a game. Background Art
[0002] In game development, in order to achieve the diversity of game scenes, it is usually necessary to design multiple weather types. The weather type switching method in the game scene will affect the game visual effects and the player's gaming experience. In this regard, technicians in this field continue to explore various high-quality weather type switching methods.
[0003] In the related methods, the method of switching weather types in the game is mainly: setting the preset parameters corresponding to each weather type in the game engine data table (including: lighting parameters, particle parameters, cloud parameters, etc.); switching the corresponding preset parameters according to the weather type corresponding to the game scene; based on the preset parameters after the switch, the visual effect of the weather type switch is displayed, that is, the lighting parameters, particle parameters, cloud parameters, etc. corresponding to the scene are refreshed. However, the defects of this method are: each weather type corresponds to a fixed preset parameter, resulting in a single visual effect of the weather type in the game scene; the switching of weather types is based on the needs of the game scene, and cannot be switched in real time according to the position of the virtual character.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, storage medium and electronic device for switching weather types in a game, so as to at least solve the technical problem that the processing method of switching weather types by switching preset parameters in the related method has a single visual effect and cannot be switched in real time according to the character's position.
[0006] According to one aspect of an embodiment of the present invention, a method for switching weather types in a game is provided, comprising:
[0007] Obtain a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene; determine candidate texture data based on the physical parameter set; utilize the current position of the virtual character in the game scene and a preset correspondence relationship to obtain target texture data corresponding to the current position from the candidate texture data, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located; and switch the current weather type presented in the game scene to the target weather type according to the target texture data.
[0008] Optionally, the physical parameter set includes: a first part of physical parameters and a second part of physical parameters, and determining the candidate texture data based on the physical parameter set includes: creating a first texture and a second texture, wherein the first texture and the second texture are locally pre-drawn textures, and the color channel of the first texture is used to record the first part of the physical parameters, and the color channel of the second texture is used to record the second part of the physical parameters; creating a third texture and a fourth texture, wherein the third texture and the fourth texture are textures drawn in a preset game engine; writing the first part of the physical parameters recorded by the color channel of the first texture into the corresponding color channel of the third texture, and writing the second part of the physical parameters recorded by the color channel of the second texture into the corresponding color channel of the fourth texture, to determine the candidate texture data.
[0009] Optionally, a first part of the physical parameters recorded in the color channel of the first texture is written into a corresponding color channel in the third texture, and a second part of the physical parameters recorded in the color channel of the second texture is written into a corresponding color channel in the fourth texture, and determining the candidate texture data includes: creating a first material instance and a second material instance based on the same parent material, wherein the mapping parameters of the first material instance are used to record texture data of the first texture, and the mapping parameters of the second material instance are used to record texture data of the second texture; writing the texture data recorded by the mapping parameters of the first material instance into the corresponding color channel in the third texture, and writing the texture data recorded by the mapping parameters of the second material instance into the corresponding color channel in the fourth texture.
[0010] Optionally, using the current position of the virtual character in the game scene and a preset correspondence relationship, obtaining target texture data corresponding to the current position from the candidate texture data includes: mapping the candidate texture data to the corresponding position in the game scene according to the preset correspondence relationship to obtain a mapping result; using the current position of the virtual character in the game scene and the mapping result, obtaining the target texture data corresponding to the current position from the candidate texture data.
[0011] Optionally, the method for switching weather types in the game also includes: creating a lighting parameter structure; creating a data table based on the lighting parameter structure, wherein the data table is used to configure corresponding lighting component data for different values of each physical parameter in the physical parameter set.
[0012] Optionally, switching the current weather type presented in the game scene to the target weather type according to the target texture data includes: determining the target physical parameters using the target texture data; obtaining the mixed lighting component data corresponding to the target physical parameters through a data table; and switching the current weather type presented in the game scene to the target weather type based on the mixed lighting component data.
[0013] Optionally, obtaining mixed lighting component data corresponding to the target physical parameters through a data table includes: searching for multiple lighting component data corresponding to the target physical parameters from the data table; and mixing the multiple lighting component data based on the values of the target physical parameters to obtain mixed lighting component data.
[0014] According to another aspect of an embodiment of the present invention, a device for switching weather types in a game is also provided, comprising:
[0015] The first acquisition module is used to acquire a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene; the determination module is used to determine the candidate texture data based on the physical parameter set; the second acquisition module is used to use the current position of the virtual character in the game scene and a preset correspondence relationship to acquire the target texture data corresponding to the current position from the candidate texture data, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located; the switching module is used to switch the current weather type presented in the game scene to the target weather type according to the target texture data.
[0016] Optionally, the physical parameter set includes: a first part of physical parameters and a second part of physical parameters, and the determination module is also used to: create a first texture and a second texture, wherein the first texture and the second texture are locally pre-drawn textures, and the color channel of the first texture is used to record the first part of the physical parameters, and the color channel of the second texture is used to record the second part of the physical parameters; create a third texture and a fourth texture, wherein the third texture and the fourth texture are textures drawn in a preset game engine; write the first part of the physical parameters recorded by the color channel of the first texture into the corresponding color channel of the third texture, and write the second part of the physical parameters recorded by the color channel of the second texture into the corresponding color channel of the fourth texture, to determine the candidate texture data.
[0017] Optionally, the determination module is further used to: create a first material instance and a second material instance based on the same parent material, wherein the mapping parameters of the first material instance are used to record texture data of the first texture, and the mapping parameters of the second material instance are used to record texture data of the second texture; write the texture data recorded by the mapping parameters of the first material instance into the corresponding color channel of the third texture, and write the texture data recorded by the mapping parameters of the second material instance into the corresponding color channel of the fourth texture.
[0018] Optionally, the second acquisition module is also used to: map the candidate texture data to the corresponding position in the game scene according to a preset correspondence to obtain a mapping result; and use the current position of the virtual character in the game scene and the mapping result to obtain the target texture data corresponding to the current position from the candidate texture data.
[0019] Optionally, the device for switching weather types in the game also includes: a creation module for creating a lighting parameter structure; creating a data table based on the lighting parameter structure, wherein the data table is used to configure corresponding lighting component data for different values of each physical parameter in the physical parameter set.
[0020] Optionally, the switching module is also used to: determine the target physical parameters using the target texture data; obtain the mixed lighting component data corresponding to the target physical parameters through the data table; and switch the current weather type presented in the game scene to the target weather type based on the mixed lighting component data.
[0021] Optionally, the switching module is further used to: search for multiple lighting component data corresponding to the target physical parameter from the data table; and perform mixing processing on the multiple lighting component data based on the value of the target physical parameter to obtain mixed lighting component data.
[0022] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above methods for switching weather types in a game when running.
[0023] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above methods for switching weather types in a game.
[0024] In at least some embodiments of the present invention, a physical parameter set is obtained in advance, wherein the physical parameter set is used to determine the weather type to be presented in the game scene, and a method for determining candidate texture data based on the physical parameter set is adopted. By utilizing the current position of the virtual character in the game scene and a preset correspondence, target texture data corresponding to the current position is obtained from the candidate texture data, wherein the preset correspondence is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located, and then the current weather type presented in the game scene is switched to the target weather type according to the target texture data, thereby achieving the purpose of high-quality real-time switching of weather types based on the physical parameter set and the virtual character position, thereby realizing the technical effect of improving the diversity and real-time performance of weather type switching, and then solving the technical problem that the processing method of switching weather types by switching preset parameters in the related method has a single visual effect and cannot switch in real time according to the character position. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for switching weather types in a game according to an embodiment of the present invention;
[0027] Figure 2 is a flow chart of a method for switching weather types in a game according to an embodiment of the present invention;
[0028] Figure 3 is a structural block diagram of a device for switching weather types in a game according to an embodiment of the present invention;
[0029] Figure 4 It is a structural block diagram of an optional device for switching weather types in a game according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] According to one embodiment of the present invention, an embodiment of a method for switching weather types in a game is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] In one embodiment of the present invention, the method for switching weather types in a game can be run on a terminal device or a server. The terminal device can be a local terminal device. When the method for switching weather types in a game is run 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 a client device.
[0034] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the method of switching weather types in the game are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0035] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0036] In a possible implementation, an embodiment of the present invention provides a method for switching weather types in a game, providing a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.
[0037] Taking a mobile terminal running in a local terminal device as an example, the mobile terminal can 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, referred to as MID), a PAD, a game console, and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for a method of switching weather types in a game according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions, an input and output device 108, and a display device 110. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0038] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for switching weather types in the game in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method for switching weather types in the above-mentioned game is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0039] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0040] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.
[0041] The display device 110 may be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.
[0042] In this embodiment, a method for switching weather types in a game running on the mobile terminal is provided. Figure 2 is a flow chart of a method for switching weather types in a game according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0043] Step S21, obtaining a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene;
[0044] The above physical parameter set may be a plurality of pre-set physical parameters, which may include: cloud cover intensity, ambient temperature, rain and snow weather intensity, wind strength, etc. The physical parameter set may be used to determine the weather type to be presented in the above game scene.
[0045] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. First, a physical parameter set Weather corresponding to the weather type of the game is created, and the physical parameter set Weather includes four basic physical parameters, namely: cloud cover intensity Coverage, ambient temperature Temperature, precipitation intensity WeatherIntensity and wind intensity WindIntensity. Then, according to the various weather types that may appear in the game, an initial value is assigned to each basic physical parameter in the physical parameter set.
[0046] Specifically, in the process of switching the weather from sunny to rainy in the game, create a physical parameter set Wearher_sunny corresponding to sunny days, including: cloud cover strength Coverage_s=c1, ambient temperature Temperature_s=t1, precipitation intensity WeatherIntensity_s=we1 and wind intensity WindIntensity_s=wi1; create a physical parameter set Wearher_rain corresponding to rainy days, including: cloud cover strength Coverage_r=c2, ambient temperature Temperature_r=t2, precipitation intensity WeatherIntensity_r=we2 and wind intensity WindIntensity_r=wi2;
[0047] Step S22, determining candidate texture data based on the physical parameter set;
[0048] The candidate texture data may be texture data corresponding to the weather type to be presented. The physical parameter set is obtained, and the candidate texture data may be determined based on the physical parameter set.
[0049] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. The sunny weather effect currently presented in the game scene is generated based on the physical parameter set Wearher_sunny corresponding to the sunny day. When the weather needs to be switched from sunny to rainy, the rainy texture data UV_rain (equivalent to the above-mentioned candidate texture data) corresponding to the game scene can be determined according to the physical parameter set Wearher_rain corresponding to the rainy day.
[0050] Step S23, using the current position of the virtual character in the game scene and a preset correspondence relationship, obtaining target texture data corresponding to the current position from the candidate texture data, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located;
[0051] The preset correspondence relationship can be used to describe the correspondence between the texture space and the world space, wherein the texture space is the space where the candidate texture data is located, and the world space is the space where the position data in the game scene is located. The current position of the virtual character in the game scene can be the position data in the game scene corresponding to the virtual character at the current moment.
[0052] Based on the current position of the virtual character in the game scene and the preset corresponding relationship, the target texture data corresponding to the current position can be obtained from the candidate texture data. The candidate texture data is texture data determined based on the preset physical parameter set, and the target texture data is texture data for presenting a target weather type, which can be a weather type after switching.
[0053] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. In order to improve the game experience of the player, it is necessary to generate a corresponding weather texture according to the position of the virtual character in the game scene. Based on the position coordinates Position of the virtual character in the world coordinate system in the game scene, according to the correspondence between the rainy texture data UV_rain (equivalent to the above-mentioned candidate texture data) and the world space, part of the rainy texture data (equivalent to the above-mentioned target texture data) can be selected from the rainy texture data UV_rain, which is recorded as UV_rain_p.
[0054] Step S24, switching the current weather type presented in the game scene to the target weather type according to the target texture data.
[0055] The current weather type is the weather type before switching corresponding to the current position of the virtual character, and the target weather type is the weather type after switching corresponding to the current position of the virtual character. Since the target texture data is the texture data for presenting the target weather type, the current weather type presented in the game scene can be switched to the target weather type according to the target texture data.
[0056] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. The sunny weather effect currently presented in the game scene corresponds to the texture data generated based on the physical parameter set Wearher_sunny. According to the partial rainy texture data UV_rain_p (equivalent to the above target texture data) obtained by the above operation, the sunny weather effect presented in the game scene can be switched to the rainy weather effect (equivalent to the above target weather type).
[0057] In at least some embodiments of the present invention, a physical parameter set is obtained in advance, wherein the physical parameter set is used to determine the weather type to be presented in the game scene, and a method for determining candidate texture data based on the physical parameter set is adopted. By utilizing the current position of the virtual character in the game scene and a preset correspondence, target texture data corresponding to the current position is obtained from the candidate texture data, wherein the preset correspondence is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located, and then the current weather type presented in the game scene is switched to the target weather type according to the target texture data, thereby achieving the purpose of high-quality real-time switching of weather types based on the physical parameter set and the virtual character position, thereby realizing the technical effect of improving the diversity and real-time performance of weather type switching, and then solving the technical problem that the processing method of switching weather types by switching preset parameters in the related method has a single visual effect and cannot switch in real time according to the character position.
[0058] Optionally, the physical parameter set includes: a first part of physical parameters and a second part of physical parameters. In step S22, determining the candidate texture data based on the physical parameter set may include the following execution steps:
[0059] Step S221, creating a first texture and a second texture, wherein the first texture and the second texture are locally pre-drawn textures, the color channel of the first texture is used to record the first part of the physical parameters, and the color channel of the second texture is used to record the second part of the physical parameters;
[0060] Step S222, creating a third texture and a fourth texture, wherein the third texture and the fourth texture are textures drawn in a preset game engine;
[0061] Step S223, writing the first part of the physical parameters recorded by the color channel of the first texture into the corresponding color channel of the third texture, and writing the second part of the physical parameters recorded by the color channel of the second texture into the corresponding color channel of the fourth texture, to determine candidate texture data.
[0062] The above-mentioned physical parameter set may be a plurality of pre-set physical parameters, and the physical parameter set may include: a first part of physical parameters and a second part of physical parameters. The first part of physical parameters may include a plurality of physical parameters, and the second part of physical parameters may include a plurality of physical parameters.
[0063] The first texture may be a texture pre-drawn locally, and the first texture may include a color channel, and the color channel of the first texture may be used to record the first part of the physical parameters. The second texture may be a texture pre-drawn locally, and the second texture may include a color channel, and the color channel of the second texture may be used to record the second part of the physical parameters. The third texture and the fourth texture may be textures drawn in a preset game engine, and the third texture and the fourth texture may include a color channel respectively, and the color channels of the third texture and the fourth texture are both empty when created.
[0064] The first texture, the second texture, the third texture and the fourth texture are created. The first part of the physical parameters recorded in the color channel of the first texture is written into the corresponding color channel of the third texture, and the second part of the physical parameters recorded in the color channel of the second texture is written into the corresponding color channel of the fourth texture, so that the third texture and the fourth texture after the parameters are written can be obtained. According to the third texture and the fourth texture after the parameters are written, the candidate texture data can be determined.
[0065] Optionally, in step S223, writing the first part of the physical parameters recorded by the color channel of the first texture into the corresponding color channel of the third texture, and writing the second part of the physical parameters recorded by the color channel of the second texture into the corresponding color channel of the fourth texture, and determining the candidate texture data may include the following execution steps:
[0066] Step S2231, creating a first material instance and a second material instance based on the same parent material, wherein the mapping parameters of the first material instance are used to record texture data of the first texture, and the mapping parameters of the second material instance are used to record texture data of the second texture;
[0067] Step S2232, write the texture data recorded by the mapping parameters of the first material instance into the corresponding color channel in the third texture, and write the texture data recorded by the mapping parameters of the second material instance into the corresponding color channel in the fourth texture.
[0068] The parent material may be material data for representing the visual effect of the weather type, and the same parent material is used to represent the same weather type. The first material instance and the second material instance may be created based on the same parent material, and the first material instance and the second material instance may include mapping parameters respectively, wherein the mapping parameters of the first material instance may be used to record the texture data of the first texture; and the mapping parameters of the second material instance may be used to record the texture data of the second texture.
[0069] Get the mapping parameters of the first material instance and the mapping parameters of the second material instance. Write the texture data recorded by the mapping parameters of the first material instance into the corresponding color channel of the third texture; write the texture data recorded by the mapping parameters of the second material instance into the corresponding color channel of the fourth texture. The third texture and the fourth texture may be textures drawn in a preset game engine, and the third texture and the fourth texture may include color channels respectively, and the color channels of the third texture and the fourth texture are both empty when they are created.
[0070] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. Two texture data files RenderTarget_A (equivalent to the above-mentioned first texture) and RenderTarget_B (equivalent to the above-mentioned second texture) are pre-drawn locally, and two texture data files RenderTarget_C (equivalent to the above-mentioned third texture) and RenderTarget_D (equivalent to the above-mentioned fourth texture) are created in the game engine. Each of the above-mentioned four texture data files includes the color channel corresponding to the texture data file (including: red channel, green channel, blue channel). The four basic physical parameters included in the physical parameter set Weather are divided into two parts, the first part includes: cloud occlusion intensity Coverage; the second part includes: precipitation intensity WeatherIntensity, wind intensity WindIntensity and ambient temperature Temperature.
[0071] In the process of switching the weather type to rainy day, the pre-drawn texture data file is used to record the physical parameter set corresponding to the rainy day. The correspondence between the texture data file and the physical parameter set is as follows: in the color channel of the local pre-drawn texture data file RenderTarget_A (equivalent to the above-mentioned first texture), the red channel is used to record the cloud occlusion intensity Coverage_r; in the color channel of the local pre-drawn texture data file RenderTarget_B (equivalent to the above-mentioned second texture), the red channel is used to record the precipitation intensity WeatherIntensity_r, the green channel is used to record the wind intensity WindIntensity_r, and the blue channel is used to record the ambient temperature Temperature_r.
[0072] The rainy day physical parameters recorded in the color channels corresponding to the above-mentioned local pre-drawn texture data files RenderTarget_A and RenderTarget_B are correspondingly written into the texture data files RenderTarget_C (equivalent to the above-mentioned third texture) and RenderTarget_D (equivalent to the above-mentioned fourth texture) drawn in the two preset game engines. The rainy day texture data UV_rain (equivalent to the above-mentioned candidate texture data) corresponding to the game scene can be obtained from the texture data files RenderTarget_C and RenderTarget_D drawn in the two preset game engines.
[0073] Specifically, the writing process of the texture data files RenderTarget_C and RenderTarget_D drawn in the above-mentioned preset game engine may include the following method steps:
[0074] In the first step, two material instances are created for the same parent material Brush, namely Brush_A (equivalent to the first material instance mentioned above) and Brush_B (equivalent to the second material instance mentioned above). The material instances Brush_A and Brush_B both include corresponding texture parameters, namely Tex_A and Tex_B.
[0075] In the second step, the local pre-drawn texture data file RenderTarget_A (equivalent to the above-mentioned first texture) is written into the mapping parameter Tex_A of the material instance Brush_A, and the local pre-drawn texture data file RenderTarget_B (equivalent to the above-mentioned second texture) is written into the mapping parameter Tex_B of the material instance Brush_B.
[0076] The third step is to write the texture data recorded in the mapping parameter Tex_A into the corresponding color channel of the texture data file RenderTarget_C (equivalent to the above-mentioned third texture) drawn in the preset game engine, and write the texture data recorded in the mapping parameter Tex_B into the corresponding color channel of the texture data file RenderTarget_D (equivalent to the above-mentioned fourth texture) drawn in the preset game engine.
[0077] Optionally, in step S23, using the current position of the virtual character in the game scene and a preset correspondence relationship, obtaining target texture data corresponding to the current position from the candidate texture data may include the following execution steps:
[0078] Step S231, mapping the candidate texture data to the corresponding position in the game scene according to the preset corresponding relationship to obtain a mapping result;
[0079] Step S232, using the current position of the virtual character in the game scene and the mapping result, obtaining the target texture data corresponding to the current position from the candidate texture data.
[0080] The candidate texture data may be texture data determined based on the physical parameter set, corresponding to the weather type to be presented. The preset correspondence may be used to describe the correspondence between the texture space and the world space, wherein the texture space is the space where the candidate texture data is located, and the world space is the space where the position data in the game scene is located. The candidate texture data may be mapped to the corresponding position in the game scene according to the preset correspondence, and a mapping result may be obtained.
[0081] The target texture data is texture data for presenting a target weather type, and the target weather type may be a switched weather type. By using the current position of the virtual character in the game scene and the mapping result, the target texture data corresponding to the current position may be obtained from the candidate texture data.
[0082] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. In order to improve the game experience of the player, it is necessary to generate corresponding weather textures according to the position of the virtual character in the game scene, which can be achieved by the following method steps:
[0083] The first step is to obtain the position coordinates Position of the virtual character in the game scene, which are in the world coordinate system.
[0084] The second step is to map the rainy day texture data UV_rain (equivalent to the above-mentioned candidate texture data) corresponding to the game scene to the world coordinate system to obtain the mapping result MPC_Weather_rain (equivalent to the above-mentioned preset corresponding relationship).
[0085] In the third step, according to the position coordinates Position obtained in the first step and the mapping result Map_rain obtained in the second step, a part of the rainy day texture data (equivalent to the above-mentioned target texture data) is selected from the rainy day texture data UV_rain, and recorded as UV_rain_p.
[0086] It should be noted that the above mapping result MPC_Weather_rain (equivalent to the above preset correspondence) can be a file type corresponding to the game engine, which is used to record global parameters related to weather types. By using this mapping result, it is easy to modify the corresponding parameters in the game logic code to affect the performance of weather types.
[0087] Optionally, the method for switching weather types in the above game may further include the following execution steps:
[0088] Step S25, creating a lighting parameter structure;
[0089] Step S26, creating a data table based on the illumination parameter structure, wherein the data table is used to configure corresponding illumination component data for different values of each physical parameter in the physical parameter set.
[0090] The above-mentioned illumination parameter structure may be structured data composed of multiple illumination parameters. The illumination parameter structure is created, and the above-mentioned data table may be created based on the illumination parameter structure. The data table may include multiple illumination component data, which may be used to configure the corresponding illumination component data for each physical parameter according to different values of the physical parameter in the above-mentioned physical parameter set.
[0091] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. Create a lighting parameter structure Struct_Lighting, and create a data table DataTable based on the lighting parameter structure Struct_Lighting. The data table DataTable records the lighting parameters corresponding to each of the four basic physical parameters included in the physical parameter set Weather when they take different values. For example, when the cloud occlusion intensity Coverage takes 0, a set of lighting parameters CoverageLow is recorded, and when Coverage takes 1, another set of lighting parameters CoverageHigh is recorded.
[0092] Optionally, in step S24, switching the current weather type presented in the game scene to the target weather type according to the target texture data may include the following execution steps:
[0093] Step S241, determining target physical parameters using target texture data;
[0094] Step S242, obtaining mixed lighting component data corresponding to the target physical parameters through a data table;
[0095] Step S243, switching the current weather type presented in the game scene to the target weather type based on the mixed lighting component data.
[0096] The target texture data is texture data for presenting a target weather type, and the target weather type may be a weather type after switching. The physical parameter set may include the target physical parameter. The target physical parameter may be determined using the target texture data.
[0097] The above data table can be created based on the above illumination parameter structure, and is used to configure corresponding illumination component data for different values of each physical parameter in the physical parameter set. The mixed illumination component data corresponding to the above target physical parameter can be obtained through the data table, and the mixed illumination component data can be obtained from multiple illumination component data.
[0098] Based on the above mixed lighting component data, the weather type presented in the game scene can be switched to the above target weather type, that is, the lighting component data corresponding to the current weather type in the game scene is replaced with the lighting component data corresponding to the target weather type.
[0099] Optionally, in step S242, obtaining the mixed illumination component data corresponding to the target physical parameter through the data table may include the following execution steps:
[0100] Step S2421, searching a data table for a plurality of illumination component data corresponding to the target physical parameters;
[0101] Step S2422, based on the value of the target physical parameter, multiple lighting component data are mixed to obtain mixed lighting component data.
[0102] The above data table is used to configure corresponding lighting component data for different values of each physical parameter in the physical parameter set. The physical parameter set may include the above target physical parameters. Therefore, the above multiple lighting component data corresponding to the target physical parameters can be found from the data table.
[0103] According to the values of the above-mentioned target physical parameters, the above-mentioned multiple lighting component data can be mixed and processed to obtain the above-mentioned mixed lighting component data, which can be used to switch the current weather type to the target weather type in the game scene.
[0104] For example, in the process of switching the weather from sunny to rainy in the game, the method provided by the embodiment of the present invention can be used. According to the partial rainy texture data UV_rain_p (equivalent to the above target texture data) obtained by the above operation, the physical parameter set Wearer_rain (equivalent to the above target physical parameter) corresponding to the rainy day can be determined, including: cloud cover intensity Coverage_r=c2, ambient temperature Temperature_r=t2, precipitation intensity WeatherIntensity_r=we2 and wind intensity WindIntensity_r=wi2.
[0105] The above data table DataTable records the corresponding lighting parameters when each of the four basic physical parameters included in the physical parameter set Weather takes different values. Obtaining the mixed lighting parameter Lighting_rain corresponding to a rainy day (equivalent to the above mixed lighting component data) from the data table DataTable may include the following method steps:
[0106] The first step is to obtain the lighting parameter Coverage_c2 according to the value c2 of the cloud occlusion intensity Coverage_r on rainy days.
[0107] The second step is to obtain the lighting parameter Temperature_t2 according to the value t2 of the ambient temperature Temperature_r on a rainy day.
[0108] The third step is to obtain the lighting parameter WeatherIntensity_we2 according to the value we2 of the rainy day precipitation intensity WeatherIntensity_r.
[0109] The fourth step is to obtain the lighting parameter WindIntensity_wi2 according to the value wi2 of the wind intensity WindIntensity_r on rainy days.
[0110] The fifth step is to perform a mixing operation based on the four lighting parameters Coverage_c2, Temperature_t2, WeatherIntensity_we2 and WindIntensity_wi2 corresponding to the above rainy day to obtain the rainy day mixed lighting parameter Lighting_rain.
[0111] According to the above-mentioned rainy day mixed lighting parameter Lighting_rain, the weather effect of the current position of the virtual character in the game scene can be switched from sunny day to rainy day.
[0112] Optionally, in actual applications, the cloud cover intensity in the data table can be set to 0, the precipitation intensity is set to 0, the ambient temperature is set to 0.5, and the wind intensity is set to 0 to present a sunny weather effect; the cloud cover intensity in the data table can be set to 0.6, the precipitation intensity is set to 0, the ambient temperature is set to 0.5, and the wind intensity is set to 0.5 to present a cloudy weather effect; the cloud cover intensity in the data table can be set to 0.9, the precipitation intensity is set to 1, the ambient temperature is set to 0.5, and the wind intensity is set to 0.5 to present a rainy weather effect; the cloud cover intensity in the data table can be set to 0.9, the precipitation intensity is set to 1, the ambient temperature is set to 0, and the wind intensity is set to 0.5 to present a snowy weather effect.
[0113] It is easy to notice that, unlike the processing method in the related art where the scene needs to control the weather type switching separately, the method for switching weather types in the game provided by the embodiment of the present invention can automatically switch the weather type of the current position of the virtual character in the game scene by changing the values of multiple parameters in the preset physical parameter set. Therefore, the method can increase the richness of weather type changes in the game scene, and has practical application significance in game development and design.
[0114] 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 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 invention, 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 / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling 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 invention.
[0115] In this embodiment, a device for switching weather types in a game is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0116] Figure 3is a structural block diagram of a device for switching weather types in a game according to an embodiment of the present invention. Figure 3 As shown, the device includes: a first acquisition module 31, used to acquire a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene; a determination module 32, used to determine candidate texture data based on the physical parameter set; a second acquisition module 33, used to use the current position of the virtual character in the game scene and a preset correspondence relationship to acquire target texture data corresponding to the current position from the candidate texture data, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located; a switching module 34, used to switch the current weather type presented in the game scene to the target weather type according to the target texture data.
[0117] Optionally, the physical parameter set includes: a first part of physical parameters and a second part of physical parameters, and the determination module 32 is also used to: create a first texture and a second texture, wherein the first texture and the second texture are locally pre-drawn textures, and the color channel of the first texture is used to record the first part of the physical parameters, and the color channel of the second texture is used to record the second part of the physical parameters; create a third texture and a fourth texture, wherein the third texture and the fourth texture are textures drawn in a preset game engine; write the first part of the physical parameters recorded by the color channel of the first texture into the corresponding color channel of the third texture, and write the second part of the physical parameters recorded by the color channel of the second texture into the corresponding color channel of the fourth texture, to determine the candidate texture data.
[0118] Optionally, the determination module 32 is further used to: create a first material instance and a second material instance based on the same parent material, wherein the mapping parameters of the first material instance are used to record texture data of the first texture, and the mapping parameters of the second material instance are used to record texture data of the second texture; write the texture data recorded by the mapping parameters of the first material instance into a corresponding color channel in the third texture, and write the texture data recorded by the mapping parameters of the second material instance into a corresponding color channel in the fourth texture.
[0119] Optionally, the second acquisition module 33 is also used to: map the candidate texture data to the corresponding position in the game scene according to a preset correspondence to obtain a mapping result; and use the current position of the virtual character in the game scene and the mapping result to obtain the target texture data corresponding to the current position from the candidate texture data.
[0120] Optionally, Figure 4 is a structural block diagram of an optional device for switching weather types in a game according to an embodiment of the present invention. Figure 4 As shown, the device includes Figure 3In addition to all the modules shown, it also includes: a creation module 35 for creating a lighting parameter structure; creating a data table based on the lighting parameter structure, wherein the data table is used to configure corresponding lighting component data for different values of each physical parameter in the physical parameter set.
[0121] Optionally, the switching module 34 is also used to: determine the target physical parameters using the target texture data; obtain the mixed lighting component data corresponding to the target physical parameters through the data table; and switch the current weather type presented in the game scene to the target weather type based on the mixed lighting component data.
[0122] Optionally, the switching module 34 is further used to: search for multiple illumination component data corresponding to the target physical parameter from the data table; and perform mixing processing on the multiple illumination component data based on the value of the target physical parameter to obtain mixed illumination component data.
[0123] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0124] An embodiment of the present invention further provides a non-volatile storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0125] Optionally, in this embodiment, the non-volatile storage medium may be configured to store a computer program for performing the following steps:
[0126] S1, obtaining a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene;
[0127] S2, determining candidate texture data based on the physical parameter set;
[0128] S3, using the current position of the virtual character in the game scene and a preset correspondence relationship, obtaining target texture data corresponding to the current position from the candidate texture data, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located;
[0129] S4, switching the current weather type presented in the game scene to the target weather type according to the target texture data.
[0130] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0131] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0132] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0133] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0134] S1, obtaining a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene;
[0135] S2, determining candidate texture data based on the physical parameter set;
[0136] S3, using the current position of the virtual character in the game scene and a preset correspondence relationship, obtaining target texture data corresponding to the current position from the candidate texture data, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located;
[0137] S4, switching the current weather type presented in the game scene to the target weather type according to the target texture data.
[0138] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0139] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0140] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0141] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation, such as 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.
[0142] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0143] In addition, each functional unit in each embodiment of the present invention 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.
[0144] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0145] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for switching weather types in a game, characterized in that: include: Acquire a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene, and the physical parameter set includes: a first part of physical parameters and a second part of physical parameters; Creating a first texture and a second texture, wherein the first texture and the second texture are locally pre-drawn textures, a color channel of the first texture is used to record the first part of the physical parameters, and a color channel of the second texture is used to record the second part of the physical parameters; Creating a third texture and a fourth texture, wherein the third texture and the fourth texture are textures drawn in a preset game engine; Writing the first part of the physical parameters recorded by the color channel of the first texture into the corresponding color channel of the third texture, and writing the second part of the physical parameters recorded by the color channel of the second texture into the corresponding color channel of the fourth texture, to determine candidate texture data; Using the current position of the virtual character in the game scene and a preset correspondence relationship, obtaining target texture data corresponding to the current position from the candidate texture data, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located; The current weather type presented in the game scene is switched to the target weather type according to the target texture data.
2. The method according to claim 1, characterized in that Writing the first part of the physical parameters recorded in the color channel of the first texture into the corresponding color channel of the third texture, and writing the second part of the physical parameters recorded in the color channel of the second texture into the corresponding color channel of the fourth texture, and determining the candidate texture data includes: Creating a first material instance and a second material instance based on the same parent material, wherein a mapping parameter of the first material instance is used to record texture data of the first texture, and a mapping parameter of the second material instance is used to record texture data of the second texture; The texture data recorded by the mapping parameters of the first material instance is written into the corresponding color channel of the third texture, and the texture data recorded by the mapping parameters of the second material instance is written into the corresponding color channel of the fourth texture.
3. The method according to claim 1, characterized in that Using the current position of the virtual character in the game scene and the preset corresponding relationship, acquiring the target texture data corresponding to the current position from the candidate texture data includes: Mapping the candidate texture data to corresponding positions in the game scene according to the preset corresponding relationship to obtain a mapping result; The target texture data corresponding to the current position is acquired from the candidate texture data by utilizing the current position of the virtual character in the game scene and the mapping result.
4. The method according to claim 1, characterized in that: The method further comprises: Create a lighting parameter structure; A data table is created based on the illumination parameter structure, wherein the data table is used to respectively configure corresponding illumination component data for different values of each physical parameter in the physical parameter set.
5. The method according to claim 4, characterized in that Switching the current weather type presented in the game scene to the target weather type according to the target texture data includes: Determining target physical parameters using the target texture data; Acquire the mixed illumination component data corresponding to the target physical parameter through the data table; The current weather type presented in the game scene is switched to the target weather type based on the mixed lighting component data.
6. The method according to claim 5, characterized in that Acquiring the mixed illumination component data corresponding to the target physical parameter through the data table includes: Searching for a plurality of illumination component data corresponding to the target physical parameter from the data table; Based on the value of the target physical parameter, the plurality of illumination component data are mixed to obtain the mixed illumination component data.
7. A device for switching weather types in a game, characterized in that: include: A first acquisition module is used to acquire a physical parameter set, wherein the physical parameter set is used to determine the weather type to be presented in the game scene, and the physical parameter set includes: a first part of physical parameters and a second part of physical parameters; A determination module, used to create a first texture and a second texture, create a third texture and a fourth texture, write the first part of the physical parameters recorded by the color channel of the first texture into the corresponding color channel of the third texture, and write the second part of the physical parameters recorded by the color channel of the second texture into the corresponding color channel of the fourth texture, and determine candidate texture data, wherein the first texture and the second texture are locally pre-drawn textures, the color channel of the first texture is used to record the first part of the physical parameters, the color channel of the second texture is used to record the second part of the physical parameters, and the third texture and the fourth texture are textures drawn in a preset game engine; A second acquisition module is used to acquire target texture data corresponding to the current position from the candidate texture data by using the current position of the virtual character in the game scene and a preset correspondence relationship, wherein the preset correspondence relationship is used to describe the correspondence between the texture space where the candidate texture data is located and the world space where the position data in the game scene is located; A switching module is used to switch the current weather type presented in the game scene to the target weather type according to the target texture data.
8. A non-volatile storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method for switching weather types in a game as described in any one of claims 1 to 6 when running.
9. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the method for switching weather types in a game as described in any one of claims 1 to 6.
