Weather control method and device in game scene, electronic equipment and storage medium
By acquiring the player's location coordinates in the game and dynamically determining the weather level, generating appropriate weather effects and performing smooth transitions, the problem of the single spatial dimension of the weather system in existing technologies is solved, realizing cross-scale adaptive weather control and enhancing the realism and immersion of the game environment.
Patent Information
- Application Number
- CN202511477430.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2025-11-25
AI Technical Summary
Existing game weather systems are mainly limited to the surface level, which cannot meet the environmental expression needs of complex scenes in cosmic background and star system simulations, and lacks deep spatial semantic understanding and context awareness capabilities.
By obtaining the player's location coordinates in the game scene, the target weather level is dynamically determined based on the spatial region to which the location belongs, including regional weather, surface weather, atmospheric weather, stellar weather, and cosmic weather. Weather effects are generated in a random or configuration file-driven manner, and a smooth transition mechanism with overlapping decay and growth curves is used when switching levels.
It achieves cross-scale, adaptive, and highly realistic dynamic weather control, significantly improving the realism and interactive experience of game scenes, and solving the problem of the single spatial dimension of traditional weather systems.
Smart Images

Figure CN121003801A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game technology, and more specifically, to a weather control method, device, electronic device, and storage medium in a game scene. Background Technology
[0002] As an important component in building a realistic virtual world, the weather system not only affects visual presentation but also involves multiple dimensions such as lighting calculation, physical interaction, sound effect linkage, and character behavior response. It is a key technology module for improving user experience.
[0003] Currently, in mainstream 3D rendering engines and massively multiplayer online games, weather systems are generally limited to the surface level, mainly simulating and rendering near-surface meteorological phenomena such as rain, snow, fog, and wind. These systems are usually based on time-driven or fixed event-triggered mechanisms, controlling weather switching through preset animation sequences or simple random logic, lacking deep spatial semantic understanding and context awareness capabilities.
[0004] However, with the rise of interstellar exploration games, space sandbox simulators, and high-precision digital earth systems, the user's activity space has expanded from the surface of a single planet to the scale of a star system and even the universe. In this context, relying solely on surface weather is no longer sufficient to meet the environmental representation needs of complex scenarios. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a weather control method, device, electronic device, and storage medium in a game scene to at least partially improve the above-mentioned problems.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, embodiments of the present invention provide a weather control method in a game scene, comprising: Obtain the coordinates of the player's position in the game scene; Based on the spatial region to which the location coordinates belong, the target weather level is determined from multiple preset weather levels; Weather effects are generated based on the weather generation mechanism of the target weather level.
[0007] Optionally, the multiple preset weather levels include regional weather, surface weather, atmospheric weather, stellar weather, and cosmic weather.
[0008] Optionally, the step of determining the target weather level from multiple preset weather levels based on the spatial region to which the location coordinates belong includes: Determine whether the location coordinates are within a specific area; If the location is a specific area, the target weather level is determined to be the weather of that area. If not in a specific area, determine whether the location coordinates are on a planet; If the location is on a planet, determine whether the stated location coordinates are within the planet's region. If the location is within a planetary region, the target weather level is determined to be the surface weather described above. If not located in a planetary region, determine the target weather level as the atmospheric weather described above; If not on a planet, determine whether the stated location coordinates are within a star system; If located within a star system, determine the target weather level as the stellar weather; If not located within a star system, the target weather level is determined to be the aforementioned cosmic weather.
[0009] Optionally, the step of generating weather effects according to the weather generation mechanism of the target weather level includes: Determine the random number seed based on the current time; Based on the random number seed and the predefined weather type probability weight, the weather type of the target weather level is randomly generated; Based on the weather type, its corresponding weather state parameters are randomly generated; A weather effect is generated based on the weather type and the weather state parameters.
[0010] Optionally, the step of generating weather effects according to the weather generation mechanism of the target weather level includes: Read the preset weather data for the target weather level from the preset weather configuration file; Based on the preset weather data, the corresponding weather effects are directly generated and loaded; the weather effects generated by the weather configuration file have the highest priority and will override any current weather effects.
[0011] Optionally, the method further includes: Monitor changes in the coordinates of the players in the game; When a change in the weather level of the coordinate location is detected, the current weather effect is stopped and a new weather effect is loaded.
[0012] Optionally, the step of stopping the current weather effect and loading a new weather effect includes: The intensity parameter of the current weather effect is gradually reduced to zero according to the first attenuation curve; Meanwhile, the intensity parameter of the new weather effect gradually increases to the target value according to the second growth curve; the first decay curve and the second growth curve partially overlap in time to achieve a smooth switching of weather effects.
[0013] Secondly, embodiments of the present invention provide a weather control device for a game scene, comprising: The location acquisition unit is used to acquire the coordinates of the player's position in the game scene; The weather level determination unit is used to determine the target weather level from multiple preset weather levels based on the spatial region to which the location coordinates belong; The weather effect generation unit is used to generate weather effects according to the weather generation mechanism of the target weather level.
[0014] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the method described in any of the above-mentioned embodiments.
[0015] Fourthly, embodiments of the present invention provide a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any of the preceding claims.
[0016] The present invention provides a weather control method, device, electronic device and storage medium in a game scene. By using a hierarchical weather decision-making mechanism based on location coordinates, it effectively overcomes the problem of the single spatial dimension of traditional game weather systems, realizes cross-scale, adaptive and highly realistic dynamic weather control, and enhances the realism and interactive experience of the game scene.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic structural block diagram of an electronic device provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a weather control method in a game scene provided by an embodiment of the present invention; Figure 3 A flowchart illustrating step S220 provided in an embodiment of the present invention; Figure 4 A flowchart illustrating step S230 provided in an embodiment of the present invention; Figure 5 Another flowchart illustrating step S230 provided in an embodiment of the present invention; Figure 6 This is another flowchart illustrating a weather control method in a game scene provided by an embodiment of the present invention; Figure 7 A flowchart illustrating step S250 provided in an embodiment of the present invention; Figure 8 This is a schematic structural block diagram of a weather control device in a game scene provided by an embodiment of the present invention.
[0020] Icons: 100 - Electronic device; 101 - Memory; 102 - Communication interface; 103 - Processor; 104 - Communication bus; 300 - Weather control device in the game scene; 310 - Location acquisition unit; 320 - Weather level determination unit; 330 - Weather effect generation unit. Detailed Implementation
[0021] 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.
[0022] 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.
[0023] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0025] Existing weather systems are primarily limited to the Earth's surface, such as rain, snow, fog, and wind, lacking simulation of weather in space and at the stellar level. However, in games with a cosmic setting, stellar system simulation, or interstellar travel, weather effects come not only from the Earth's surface but are also influenced by stellar activity (such as stellar radiation and light intensity) and the space environment (such as solar radiation and geomagnetic storms). Furthermore, the environmental impact varies depending on the player's location. Therefore, selecting appropriate weather based on the environment and changing weather information according to location information becomes particularly important.
[0026] Based on the above, embodiments of the present invention provide a weather control method, device, electronic device, and storage medium in a game scene. By obtaining the player's position coordinates in the game scene and dynamically determining the target weather level based on the spatial area where the player is located, it can break through the limitations of traditional surface weather and realize multi-level weather control from the surface to the atmosphere, star system, and even the universe, significantly improving the realism of the game environment.
[0027] To implement the process steps and functions of the various examples of this invention, please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic structural block diagram of an electronic device provided in an embodiment of the present invention. The electronic device 100 includes a memory 101 and a processor 103, which are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 104 or signal lines. The memory 101 can be used to store software programs and modules, and the processor 103 executes the software programs and modules stored in the memory 101, thereby performing various functional applications and data processing.
[0028] Electronic device 100 can be, but is not limited to, a personal computer (PC), a server, a distributed computer, etc. It is understood that electronic device 100 is not limited to a physical server, but can also be a virtual machine on a physical server, a virtual machine built on a cloud platform, or any other computer that can provide the same functionality as the server or virtual machine. The operating system of electronic device 100 can be, but is not limited to, Windows, Linux, etc.
[0029] The memory 101 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0030] The communication connection between the electronic device 100 and external devices is achieved through at least one communication interface 102 (which can be wired or wireless).
[0031] Processor 103 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of this embodiment can be completed by integrated logic circuits in the hardware of processor 103 or by instructions in software form. Processor 103 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may 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.
[0032] Understandable. Figure 1 The structure shown is for illustrative purposes only; the electronic device 100 may also include components that are more advanced than those shown. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0033] The following is an exemplary description of the weather control method in a game scene provided by this invention. See also... Figure 2 The subject executing this method can be one of the above. Figure 1 The electronic device 100 shown, the method includes as follows Figure 2 The following steps are described: S210: Obtain the coordinates of the player's position in the game scene.
[0034] S220: Determine the target weather level from multiple preset weather levels based on the spatial region to which the location coordinates belong.
[0035] S230: Generate weather effects based on the weather generation mechanism of the target weather level.
[0036] During gameplay, the game continuously acquires the player's position coordinates in the three-dimensional virtual space. These coordinates are typically maintained by the game engine and represented as three-dimensional Cartesian coordinates (x, y, z), dynamically updating as the player moves. Position coordinates can be obtained by listening to position messages reported by the client or by reading them directly from the game logic module.
[0037] In one alternative embodiment, location coordinates can be acquired periodically, and the sampling frequency can be adjusted according to network latency, computing load, and weather switching sensitivity requirements, for example, once every 50 milliseconds.
[0038] Based on the obtained location coordinates, the spatial region type is analyzed, and combined with pre-defined weather level classification rules, a target weather level suitable for the current player's location is determined from multiple preset weather levels. These weather levels are divided according to spatial scale and environmental characteristics to characterize meteorological patterns across different geographical or cosmic ranges.
[0039] After determining the target weather level, the corresponding weather generation mechanism is invoked to generate appropriate weather effects. Weather effects include, but are not limited to, visual effects, sound effects, lighting changes, and physical parameters, ultimately presenting an immersive weather experience that matches the player's spatial environment.
[0040] This method establishes a hierarchical weather decision-making mechanism based on the player's location coordinates. It dynamically determines the target weather level from multiple preset weather levels according to the spatial region of the player's location and generates corresponding weather effects accordingly. This overcomes the technical bottleneck of traditional game weather systems, which are limited to surface or globally unified control. It effectively solves the problem of the single spatial dimension of weather representation in existing technologies, achieving adaptive weather control across different spatial scales. It can provide highly realistic meteorological effects that match the environment in complex virtual scenes, significantly enhancing the immersion of the game world.
[0041] Optionally, multiple preset weather levels may include regional weather, surface weather, atmospheric weather, stellar weather, and cosmic weather, each corresponding to meteorological manifestations and influencing mechanisms at different spatial scales.
[0042] Regional Weather: Localized weather effects customized for specific artificially defined game areas (such as cities, dungeons, battlefields, etc.), such as magical fog, localized acid rain, etc.
[0043] Surface weather: refers to common natural meteorological phenomena on the surface of a planet, such as rainfall, snowfall, fog, and wind.
[0044] Atmospheric weather: Applicable to high-altitude regions within a planet's atmosphere but not on the Earth's surface, such as upper-level storms and stratospheric lightning.
[0045] Stellar weather: describes the environmental conditions within a star system affected by stellar activity, such as stellar flares, sunspots, and stellar storms.
[0046] Cosmic weather: encompasses background environmental effects in the vast space between stars and even galaxies, such as cosmic radiation bursts, meteor showers, and interstellar dust storms.
[0047] In one alternative implementation, see [link to implementation details]. Figure 3 Step S220 may further include the following steps: S221: Determine whether the location coordinates are within a specific area.
[0048] A specific area is a localized spatial range with independent environmental settings pre-configured by the game designer, such as a city, a dungeon map, a battlefield, or a story trigger area. Whether a location belongs to this special area is determined by comparing its coordinates to any preset geographical boundary. If the determination is yes, step S222 is executed; otherwise, step S223 is executed.
[0049] S222: If located in a specific area, determine the target weather level as regional weather.
[0050] When a player is located within the aforementioned specific area, the "Regional Weather" tier is activated. This tier allows for customized weather effects for that area and takes precedence over other global weather rules.
[0051] S223: If not in a specific area, determine whether the location coordinates are on a planet.
[0052] Determine whether the player's location coordinates are within the gravitational or atmospheric influence of a planet (e.g., within a certain radius of the planet's center). This determination can be made by querying the celestial database within the scene to confirm whether the player is currently active on a particular planet.
[0053] If yes, continue to step S224; otherwise, proceed to step S227.
[0054] S224: If on a planet, determine whether the location coordinates are within the planet's region.
[0055] Here, "planetary region" refers to a spatial layer close to the Earth's surface and suitable for ground interaction, which can be defined as within a certain altitude of the planet's surface (e.g., 0-10 kilometers). By calculating the vertical distance between the coordinates and the planet's surface, it is determined whether the player is within the range where surface weather can be perceived.
[0056] If the judgment result is yes, then proceed to step S225; otherwise, proceed to step S226.
[0057] S225: If located in a planetary region, determine the target weather level as surface weather.
[0058] At this point, the player is on the ground, and traditional surface weather systems are used, such as rain, snow, fog, and wind. The rendering and physical feedback are driven by the surface weather generation mechanism.
[0059] S226: If not located in a planetary region, determine the target weather level as atmospheric weather.
[0060] This applies to aircraft or spacecraft navigating in the upper atmosphere, corresponding to the unique environmental effects of the upper atmosphere, which differ from regular weather on the Earth's surface.
[0061] S227: If not on a planet, determine whether the location coordinates are within a star system.
[0062] If the player is not within the influence range of any planet, the system proceeds to a cosmic-scale assessment. This checks whether the player's location coordinates fall within the gravitational dominance of a star (i.e., the Hill sphere of that star system), such as the solar system. A quick search can be performed using a celestial topology database.
[0063] If the judgment result is yes, then proceed to step S228; otherwise, proceed to step S229.
[0064] S228: If located in a star system, determine the target weather level as stellar weather.
[0065] At this weather level, weather effects primarily reflect changes in the space environment caused by stellar activity, such as stellar flares, sunspots, and stellar storms, which affect game mechanics such as spaceship shields and communication modules.
[0066] S229: If not located in a star system, determine the target weather level as cosmic weather.
[0067] When players are in the vast void between stars or galaxies, the "Cosmic Weather" level is activated to simulate the effects of the cosmic background environment, such as cosmic radiation bursts, meteor showers, and interstellar dust storms.
[0068] The above-mentioned hierarchical determination logic adopts a tree-like priority structure to ensure that each spatial location is uniquely mapped to a weather level with the highest priority, thus avoiding rendering chaos or performance loss caused by multiple weather layers overlapping.
[0069] Step S230, based on the determined target weather level, calls the corresponding weather generation strategy to generate the final visual, auditory, and physical weather effects presented to the user.
[0070] In an alternative implementation, step S230 can be achieved through a probabilistic generation mode based on random decision-making to enhance the naturalness and unpredictability of weather changes in the game environment, thereby improving the player's immersion and dynamic experience during exploration. See also Figure 4 Step S230 may include the following steps: S231: Determine the random number seed based on the current time.
[0071] Obtain the timestamp of the current running moment (e.g., system time in milliseconds) and use it as the initial input value to generate a random number seed. Using a time-dependent seed ensures that the generated results have good random distribution characteristics.
[0072] S232: Based on the random number seed and the predefined weather type probability weight, randomly generate the weather type for the target weather level.
[0073] The system reads the weather type probability weight table corresponding to the current target weather level. This table is pre-configured by the game designers to define the frequency of occurrence of each possible weather type. For example, under the "Surface Weather" level, sunny days account for 60%, light rain for 25%, storms for 10%, and dust storms for 5%; under the "Stellar Weather" level, stellar flares account for 60%, sunspots for 20%, and stellar storms for 10%.
[0074] Weighted random sampling is performed based on the random number seed, and the weather type that is effective this time is selected from the weather type probability weight table, thereby achieving a unity of statistical regularity and local randomness that conforms to the design intent.
[0075] S233: Randomly generate the corresponding weather state parameters based on the weather type.
[0076] Each weather type is associated with a set of adjustable state parameters. For example, "rain" weather corresponds to rainfall intensity (0.3–1.0), cloud density (medium to high), wind speed (8–15 m / s), visibility attenuation coefficient, etc.; "aurora" weather involves visual parameters such as light band brightness, color change rate, and coverage angle.
[0077] Within the parameter range corresponding to the weather type, the system uses a random algorithm to generate specific values again, so that the same weather type presents subtle differences at different times, avoiding a sense of repetition.
[0078] S234: Generate weather effects based on weather type and weather state parameters.
[0079] Based on the aforementioned results, relevant modules of the game engine (such as particle systems, lighting renderers, sound managers, and physics simulators) are invoked to instantiate and load complete weather effects. The final weather effects will be highly matched with the current spatial environment and possess natural fluctuation characteristics, significantly enhancing the vividness and realism of the virtual world.
[0080] In another alternative implementation, step S230 can also be implemented using a deterministic loading mode based on a preset configuration file. See [link to relevant documentation]. Figure 5 Step S230 may include the following steps: S231´: Read preset weather data for the target weather level from the preset weather configuration file.
[0081] Based on the currently determined target weather level (such as surface weather, stellar weather, etc.), locate and load the matching weather configuration file. The weather configuration file can be a structured data file, such as stored in JSON, XML, YAML or other parsable formats, which contains explicitly specified weather types, various state parameters (such as light intensity, particle density, sound gain, duration, etc.), activation conditions and priority indicators.
[0082] Configuration files can be pre-edited by game developers and deployed in a local resource directory or remote server, supporting differentiated configurations based on region, storyline, or event theme. For example, at the start of an epic boss battle, a combination of "storm cloud + lightning + strong wind" weather can be forcibly enabled through the configuration file to create a tense atmosphere.
[0083] S232´: Generate and load the corresponding weather effects directly based on preset weather data; the weather effects generated by the weather configuration file have the highest priority and will override any current weather effects.
[0084] The system parses the instructions in the configuration file, skips the random decision-making process, directly instantiates the specified weather type and its parameters, and immediately sends update commands to the rendering engine, audio system, and physics module to complete the loading and rendering of the new weather effects.
[0085] In particular, weather effects generated by this mode are given the highest priority and are enforced. They can interrupt and replace any form of weather currently in operation (including randomly generated or player-triggered weather) to ensure environmental consistency and visual impact for key game events.
[0086] To further enhance the continuity and immersion of the game environment, the weather control method provided in this embodiment of the invention also includes the ability to continuously perceive and respond to dynamic changes in the player's position, ensuring that weather effects are updated in a timely manner as the player moves through different spatial areas. See also Figure 6 The method may also include the following steps: S240: Monitor changes in the coordinates of game players.
[0087] During gameplay, the system continuously monitors whether the current player's position coordinates have changed. This monitoring can be achieved by registering movement event callbacks in the game engine, polling position data reported by the client, or subscribing to the character's movement status module. The monitoring frequency can be optimized according to performance requirements, such as checking once per frame.
[0088] S250: When a change in the weather level of the coordinate location is detected, the current weather effect is stopped and a new weather effect is loaded.
[0089] After obtaining the updated coordinates, the target weather level is determined. If the newly determined weather level is different from the currently effective weather level, it is determined that "the weather level has changed," and the weather switching process is triggered. At this time, the rendering and influence of the original weather effects are terminated, and the corresponding generation mechanism (such as random generation or configuration file loading) is called according to the new target weather level to create and enable weather performance adapted to the new spatial environment.
[0090] For example, when a player pilots a spacecraft to ascend from the Earth's surface into the upper atmosphere, the system switches the original "surface rain" weather to "high-altitude storm." When the spacecraft leaves the gravitational pull of a planet and enters interstellar space, "atmospheric weather" or "stellar weather" is gradually replaced by "cosmic weather."
[0091] To avoid visual abrupt changes or sensory jumps when switching between different weather levels, which could affect the user's immersive experience, this embodiment of the invention introduces a smooth switching mechanism based on hyperbolic cross transitions when performing weather change operations. In one optional implementation, see [link to implementation details]. Figure 7 S250 may include the following steps: S251: The intensity parameter of the current weather effect is gradually reduced to zero according to the first attenuation curve.
[0092] When a change in the target weather level is detected, the currently running weather effect is not immediately terminated; instead, its exit animation process is initiated. Specifically, the system selects one or more intensity parameters (such as particle density, light contrast, sound effect volume, etc.) that characterize the severity of the weather effect and gradually decays it according to a preset first decay curve.
[0093] The first decay curve can use linear decrease, exponential decay, or a custom easing function to achieve a natural fade-out effect. For example, the raindrop density in "rainy" weather can decrease uniformly from 1.0 to 0 within 2 seconds.
[0094] S252: At the same time, the intensity parameter of the new weather effect gradually increases to the target value according to the second growth curve; the first decay curve and the second growth curve partially overlap in time to achieve a smooth switching of weather effects.
[0095] As the old weather effect begins to fade, the initialization process for the new weather effect is initiated simultaneously, and its corresponding intensity parameter starts from zero and gradually increases to the preset target value along a preset second growth curve. This second growth curve can be configured according to the characteristics of the new weather type, such as using an S-shaped growth (sigmoid) to simulate the appearance of "aurora" from weak to strong, or using a rapid rising curve to create a sense of urgency for "thunderstorm".
[0096] Crucially, the first decay curve and the second growth curve partially overlap on the timeline, meaning that there is a period of coexistence between the old and new weather conditions. During this period, both weather conditions work together on the game scene, but their weights change dynamically. For example, the weight of the old weather condition linearly decreases from 100% to 0%, while the weight of the new weather condition increases from 0% to 100%, creating a visually seamless integration.
[0097] Through the above-mentioned coordinated control, a smooth transition between weather effects is ultimately achieved, avoiding discomfort caused by screen flickering, sound effect jumps, or sudden changes in physical parameters.
[0098] Furthermore, embodiments of the present invention also provide a weather control device for a game scene, see [link to relevant documentation]. Figure 8 The weather control device 300 in the game scene includes: The location acquisition unit 310 is used to acquire the position coordinates of the game player in the game scene.
[0099] The weather level determination unit 320 is used to determine the target weather level from multiple preset weather levels based on the spatial region to which the location coordinates belong.
[0100] The weather effect generation unit 330 is used to generate weather effects according to the weather generation mechanism of the target weather level.
[0101] In summary, the weather control method, device, electronic device, and storage medium provided by this invention for game scenes obtain the player's location coordinates and determine the target weather level from multiple preset weather levels based on the player's spatial region. It then dynamically generates appropriate weather effects using a combination of random generation or configuration file-driven methods. Furthermore, it employs a smooth transition mechanism with overlapping decay and growth curves during level switching, achieving cross-space, adaptive, and highly realistic dynamic weather control from the Earth's surface to the cosmic scale. This effectively overcomes the problems of traditional game weather systems, such as single spatial dimension, poor environmental adaptability, and abrupt transitions. It significantly improves the realism, continuity, and user immersion of virtual scenes, while also possessing good scalability and engineering practicality, providing an efficient and reliable environmental rendering solution for complex 3D game worlds and future high-dimensional interactive scenarios.
[0102] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0103] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0104] If the functionality is implemented as a software module 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 this 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 computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this 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] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0106] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A weather control method in a game scene, characterized in that, include: Obtain the coordinates of the player's position in the game scene; Based on the spatial region to which the location coordinates belong, the target weather level is determined from multiple preset weather levels; Weather effects are generated based on the weather generation mechanism of the target weather level.
2. The method according to claim 1, characterized in that, The preset weather levels include regional weather, surface weather, atmospheric weather, stellar weather, and cosmic weather.
3. The method according to claim 2, characterized in that, The step of determining the target weather level from multiple preset weather levels based on the spatial region to which the location coordinates belong includes: Determine whether the location coordinates are within a specific area; If the location is a specific area, the target weather level is determined to be the weather of that area. If not in a specific area, determine whether the location coordinates are on a planet; If the location is on a planet, determine whether the stated location coordinates are within the planet's region. If the location is within a planetary region, the target weather level is determined to be the surface weather described above. If not located in a planetary region, determine the target weather level as the atmospheric weather described above; If not on a planet, determine whether the stated location coordinates are within a star system; If located within a star system, determine the target weather level as the stellar weather; If not located within a star system, the target weather level is determined to be the aforementioned cosmic weather.
4. The method according to claim 1, characterized in that, The step of generating weather effects based on the weather generation mechanism of the target weather level includes: Determine the random number seed based on the current time; Based on the random number seed and the predefined weather type probability weight, the weather type of the target weather level is randomly generated; Based on the weather type, its corresponding weather state parameters are randomly generated; A weather effect is generated based on the weather type and the weather state parameters.
5. The method according to claim 1, characterized in that, The step of generating weather effects based on the weather generation mechanism of the target weather level includes: Read the preset weather data for the target weather level from the preset weather configuration file; Based on the preset weather data, the corresponding weather effects are directly generated and loaded; the weather effects generated by the weather configuration file have the highest priority and will override any current weather effects.
6. The method according to claim 1, characterized in that, The method further includes: Monitor changes in the coordinates of the players in the game; When a change in the weather level of the coordinate location is detected, the current weather effect is stopped and a new weather effect is loaded.
7. The method according to claim 6, characterized in that, The step of stopping the current weather effect and loading a new weather effect includes: The intensity parameter of the current weather effect is gradually reduced to zero according to the first attenuation curve; Meanwhile, the intensity parameter of the new weather effect gradually increases to the target value according to the second growth curve; the first decay curve and the second growth curve partially overlap in time to achieve a smooth switching of weather effects.
8. A weather control device for a game scene, characterized in that, include: The location acquisition unit is used to acquire the coordinates of the player's position in the game scene; The weather level determination unit is used to determine the target weather level from multiple preset weather levels based on the spatial region to which the location coordinates belong; The weather effect generation unit is used to generate weather effects according to the weather generation mechanism of the target weather level.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Integration of real-time data into gaming application
CN1494452A