Fog effect control method, device, electronic device and storage medium

By using the combination of area infographics and fog maps in the game, the problem of fog map occupies memory is solved, and efficient fog effect control is achieved. It is suitable for any shape game area, improving game performance.

CN115487503BActive Publication Date: 2025-08-22NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110673475.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-17
Publication Date
2025-08-22
Estimated Expiration
2041-06-17

AI Technical Summary

Technical Problem

The prior art requires a large amount of memory to generate fog maps, resulting in game performance loss, especially in open large world games, and it is difficult to effectively control the fog effect of irregularly shaped game areas.

Method used

The combination of area infographics and fog maps is adopted. The area infographics are generated before the game is run. The fog map is maintained during the operation. The fog effect is added or removed by obtaining the target pixel value. It is suitable for game areas of any shape.

Benefits of technology

It reduces memory usage, improves game performance, and can effectively control the fog effect of any shape game area. It does not require complex algorithms and is suitable for cloud games and local terminal devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115487503B_ABST
    Figure CN115487503B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a fog effect control method, device, electronic device, and storage medium, including: obtaining a region information map and a fog map; the region information map is a map pre-generated before the game is run that covers the game scene; the fog map is a map maintained during the game; in the region information map, obtaining a target pixel value of a target pixel that matches a pixel in the graphical user interface; the target pixel value is a target region identifier; obtaining the pixel value of the pixel corresponding to the target region identifier from the fog map, so as to add a fog effect to the game area corresponding to the target region identifier according to the pixel value. In the embodiment of the present invention, the size of the fog map does not need to match the game scene, so that recording the game area to which the fog effect needs to be added by the fog map does not require a large amount of memory, thereby ensuring the performance of the game.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a fog effect control method, a fog effect control device, an electronic device, and a storage medium. Background Art

[0002] Many games currently on the market feature foggy areas, which are areas within the game scene that are shrouded in fog. A common way to create this effect is by darkening the areas the player hasn't explored, preventing the player from observing the terrain or virtual characters. Specifically, foggy areas are often used in games to facilitate exploratory gameplay. Areas the player has explored are free of fog, while areas the player hasn't explored are covered with fog. This provides players with a different exploration method and enhances their gaming experience.

[0003] Traditionally, a common method for controlling foggy areas involves generating a fog map during game play. Specifically, during game play, a map is generated that records the areas explored by the player, known as the fog map. This map identifies areas within the game scene that are foggy. The fog effect can then be displayed using methods such as blackening the colors of the areas recorded in the fog map.

[0004] However, maintaining a fog map while the game is running usually comes at the cost of performance loss. This is because the fog map requires a certain amount of memory, and the size of the fog map needs to match the game scene. This is especially true for open world games. Since the game scene is very large, if a fog map with a matching size is generated, the memory occupied will also be larger, which will reduce the game performance. Summary of the Invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a fog effect control method and a corresponding fog effect control device, electronic device, and storage medium that overcome the above problems or at least partially solve the above problems.

[0006] To address the above-mentioned issues, an embodiment of the present invention discloses a method for controlling a fog effect. A terminal device provides a graphical user interface (GUI), wherein the graphical user interface displays part or all of a game scene. The game scene includes a game area, and each game area has a corresponding area identifier. The method includes:

[0007] Obtaining a region information map and a fog map; the region information map is a map pre-generated before the game is run that covers the game scene, and the pixel values ​​of the pixels in the region information map are the region identifiers; the fog map is a map maintained during the game, and the pixels in the fog map correspond to the region identifiers, and the pixel values ​​of the pixels in the fog map are used to indicate whether a fog effect is added;

[0008] In the region information map, a target pixel value of a target pixel matching a pixel in the graphical user interface is obtained; the target pixel value is a target region identifier;

[0009] The pixel values ​​of the pixels corresponding to the target area identifier are obtained from the fog map, so as to add a fog effect to the game area corresponding to the target area identifier according to the pixel values.

[0010] Optionally, pixels in the region information map have corresponding world coordinates, and obtaining a target pixel value of a target pixel matching a pixel in the graphical user interface in the region information map includes:

[0011] Determining world coordinates corresponding to pixels in the graphical user interface;

[0012] Determine the pixel corresponding to the world coordinates in the region information image as the target pixel;

[0013] Obtain a pixel value corresponding to the target pixel as the target pixel value.

[0014] Optionally, the pixel value includes a first pixel value, which is used to represent the addition of a fog effect. Adding a fog effect to the game area corresponding to the target area identifier based on the pixel value includes: when the pixel value is the first pixel value, adding a fog effect to the pixel in the graphical user interface.

[0015] Optionally, the pixel value further includes a second pixel value, and the second pixel value is used to represent that no fog effect is added.

[0016] Optionally, after obtaining the pixel value of the pixel corresponding to the target area identifier from the fog map to add a fog effect to the game area corresponding to the target area identifier based on the pixel value, the method further includes: determining the area identifier of the game area that the player has explored as the explored area identifier; if in the fog map, the pixel value of the pixel corresponding to the explored area identifier is a first pixel value, then modifying the first pixel value to a second pixel value.

[0017] Optionally, the game area is an area of ​​any shape in the game scene, and the any shape includes an irregular shape.

[0018] An embodiment of the present invention further discloses a fog effect control device, which provides a graphical user interface through a terminal device, wherein the graphical user interface displays part or all of a game scene, wherein the game scene includes a game area, and the game area has a corresponding area identifier. The device includes:

[0019] An acquisition module is configured to acquire a region information map and a fog map; the region information map is a map pre-generated before the game is run that covers the game scene, and the pixel values ​​of pixels in the region information map are the region identifiers; the fog map is a map maintained during the game, and the pixels in the fog map correspond to the region identifiers, and the pixel values ​​of the pixels in the fog map are used to indicate whether a fog effect is added;

[0020] A determination module is configured to obtain, in the region information map, a target pixel value of a target pixel that matches a pixel in the graphical user interface; the target pixel value is a target region identifier.

[0021] An adding module is used to obtain pixel values ​​of pixels corresponding to the target area identifier from the fog map, so as to add a fog effect to the game area corresponding to the target area identifier according to the pixel values.

[0022] Optionally, the pixels in the area information map have corresponding world coordinates, and the determination module is used to determine the world coordinates corresponding to the pixels in the graphical user interface; determine the pixels corresponding to the world coordinates in the area information map as target pixels; and obtain the pixel value corresponding to the target pixel as the target pixel value.

[0023] Optionally, the pixel value includes a first pixel value, and the first pixel value is used to represent adding a fog effect. The adding module is used to add a fog effect to the pixel in the graphical user interface when the pixel value is the first pixel value.

[0024] Optionally, the pixel value further includes a second pixel value, and the second pixel value is used to represent that no fog effect is added.

[0025] Optionally, the device also includes: a modification module, used to determine the area identifier of the game area that the player has explored as the explored area identifier; if in the fog map, the pixel value of the pixel corresponding to the explored area identifier is a first pixel value, then the first pixel value is modified to a second pixel value.

[0026] Optionally, the game area is an area of ​​any shape in the game scene, and the any shape includes an irregular shape.

[0027] An embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the steps of the fog effect control method described above are implemented.

[0028] An embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the fog effect control method described above are implemented.

[0029] The embodiments of the present invention include the following advantages:

[0030] In an embodiment of the present invention, a region information map and a fog map are obtained, wherein the pixel values ​​of the pixels of the region information map are region identifiers corresponding to the game area in the game scene, the pixels in the fog map correspond to the region identifiers, and the pixel values ​​of the pixels in the fog map are used to indicate whether to add a fog effect. Then, a target pixel value of a target pixel that matches a pixel in a graphical user interface is determined from the region information map, the target pixel value being the target region identifier. Finally, the pixel value of the pixel corresponding to the target region identifier is obtained from the fog map, thereby adding a fog effect to the target area corresponding to the target region identifier based on the pixel value. The region information map of the embodiment of the present invention is pre-generated before the game is run, and the fog map is maintained during the game. The size of the fog map does not need to match the game scene. Therefore, recording the game area to which a fog effect is to be added using the fog map does not require a large amount of memory, thereby ensuring the performance of the game. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a schematic diagram of the game area;

[0032] Figure 2 This is a flowchart of a fog effect control method embodiment of the present invention;

[0033] Figure 3 is a schematic diagram of a regional information map of the present invention;

[0034] Figure 4 is a schematic diagram of a fog map of the present invention;

[0035] Figure 5 This is a flow chart of fog effect control implementation of the present invention;

[0036] Figure 6 It is a structural block diagram of an embodiment of a fog effect control device of the present invention. DETAILED DESCRIPTION

[0037] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0038] Currently, the most common method for controlling fog effects is to generate a fog map while the game is running. The size of the fog map needs to match the size of the game scene. Therefore, using fog maps has certain defects and limitations. Specifically:

[0039] The drawback is that maintaining a fog map while the game is running comes at the cost of performance and can easily cause lag. This is because fog maps take up a certain amount of memory. Especially in open-world games, where the game scenes are very large, generating a fog map of that size also requires a considerable amount of memory. Furthermore, recording the player's explored areas usually requires a certain amount of computational effort, and the larger the fog map, the greater the computational effort.

[0040] The limitation is that in the currently popular SLG (Simulation Game), the fog effect is usually not determined by the player's explored trajectory, but by the game area in the game. For example, if the fog effect is turned on in the game scene, there are game areas A and B. If the player's explored trajectory includes game area A but not game area B, the fog effect will be turned off in the entire game area A. Figure 1 If the game area where the fog effect needs to be turned on is some irregular polygons, then when it is necessary to use a fog map to control the generation of the fog effect in such an irregular game area, it is difficult to find an algorithm to obtain the area of ​​the irregular polygons, or the algorithm to obtain the area of ​​the irregular polygons will be quite complicated.

[0041] To address these issues, embodiments of the present invention provide a method for controlling fog effects. This method eliminates the need for complex algorithms or expensive fog maps. Instead, it utilizes fog maps smaller than the game scene, resulting in minimal performance and adaptability to irregularly shaped game areas. Furthermore, the fog maps of the present invention can also record areas that players have explored. However, since the fog maps are smaller, they don't require extensive computational effort.

[0042] The fog effect control method in the embodiment of the present invention can be run on a terminal device or a server. The terminal device can be a local terminal device. When the fog effect control method is run on a server, it can be a cloud game.

[0043] In an optional embodiment, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the operating entity of the game program and the entity presenting the game screen are separated. The storage and operation of the fog effect control method are completed on the cloud gaming server. The cloud gaming client is used to receive and send data and present the game screen. For example, the cloud gaming client can be a display device with data transmission function close to the user side, such as a mobile terminal, TV, computer, PDA, etc.; but the terminal device for processing game data is the cloud gaming server in the cloud. When playing the game, the player operates the cloud gaming client to send operation instructions to the cloud gaming server. The cloud gaming server runs the game according to the operation instructions, encodes and compresses the game screen and other data, and returns it to the cloud gaming client through the network. Finally, the cloud gaming client decodes and outputs the game screen.

[0044] In an optional embodiment, the terminal device may be a local terminal device. The local terminal device stores the game program and is used to present the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), that is, conventionally downloading and installing the game program through an electronic device and running it. The local terminal device may provide the GUI to the player in a variety of ways, for example, it may be rendered and displayed on the terminal's display screen, or provided to the player through holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen being used to present the GUI, the GUI including the game screen, and the processor being used to run the game, generate the GUI, and control the display of the GUI on the display screen.

[0045] Reference Figure 2 , showing a step flow chart of an embodiment of a fog effect control method of the present invention, a graphical user interface is provided through a terminal device, and the graphical user interface displays part or all of a game scene, wherein the game scene includes a game area, and the game area has a corresponding area identifier.

[0046] In which, a game application is run on a terminal device, and a graphical user interface is rendered on a touch display of the terminal device. The content displayed by the graphical user interface at least partially includes a part or all of the game scene. The specific shape of the game scene can be a square or other shapes (for example, a circle, etc.).

[0047] The game scene includes at least one virtual character, which can be a virtual character controlled by a player through a mobile terminal and can be presented through a graphical user interface. The content presented can include all or part of the virtual character. For example, in a third-person perspective game, the content presented by the graphical user interface can include all of the virtual character, or in a first-person perspective game, the content presented by the graphical user interface can include part or part of the virtual character. The virtual character can be a virtual character controlled by the player in the game, or a non-practicing character (NPC) pre-set by the game developer in a specific game scene.

[0048] The game scene can be divided into multiple game areas, each of which can be of any shape. Each game area has a corresponding area identifier (ID), which is used to uniquely identify the corresponding game area in the game scene. The ID can be a number, such as 01, 02, 03, etc. In the game, players can control the game virtual character and explore the various game areas in the game scene to obtain rewards. The rewards can be successful levels, points, props, etc.

[0049] In an embodiment of the present invention, the fog effect control method may include the following steps:

[0050] Step 201: Obtain a regional information map and a fog map.

[0051] The region information map is a map pre-generated before the game is launched that covers the game scene. The pixel values ​​of the pixels in the region information map serve as the region identifiers. Specifically, before the game is launched, a region information map is pre-generated based on the distribution of all game areas in the game scene. This region information map covers the entire game scene. The size of the region information map can be consistent with the size of the game scene, and the number of pixels in both can be the same.

[0052] It should be noted that the regional information map is generated offline during the game development process and does not require memory during game runtime, so it will not affect the performance of the game, such as causing lag.

[0053] As a specific example, see Figure 3 , shown is a schematic diagram of a region information map of the present invention, wherein 01, 02, and 03 are region identifiers of three game regions, respectively, and each box represents a pixel. Each pixel in the region information map stores a region identifier corresponding to the game region in the game scene.

[0054] Among them, the fog map is a map maintained during the running of the game, and the pixels in the fog map correspond to the area identifiers. The pixel values ​​of the pixels in the fog map are used to represent whether to add a fog effect, so the size of the fog map is smaller than the size of the area information map. Specifically, the fog map is generated according to the game area, and the size of the fog map does not need to match the game scene. Its size only needs to be able to contain the area identifiers of all game areas. In other words, the size of the fog map can be determined by the number of game areas. For example, assuming that the number of game areas is 3, then only a map with 3 pixels is needed. It can be seen that the size of the fog map is very small compared to the size of the game scene, so it does not need to occupy too much memory, and the impact on the performance of the game is very small. Reference Figure 4 , shown is a schematic diagram of a fog map of the present invention, wherein each box represents a pixel, each pixel corresponds to a game area identifier, and each pixel in the fog map stores a pixel value, which is used to indicate whether a fog identifier is added to the game area corresponding to the area identifier.

[0055] Step 202: In the region information map, obtain a target pixel value of a target pixel that matches a pixel in the graphical user interface; the target pixel value is a target region identifier.

[0056] Specifically, there may be a plurality of pixels corresponding to the graphical user interface. In an embodiment of the present invention, a target pixel matching the pixel in the graphical user interface is determined from the region information map, and the region identifier corresponding to the target pixel is the target region identifier.

[0057] Step 203: Obtain pixel values ​​of pixels corresponding to the target area identifier from the fog map, so as to add a fog effect to the game area corresponding to the target area identifier according to the pixel values.

[0058] Specifically, after determining the target area identifier corresponding to the target pixel that matches the pixel in the graphical user interface, the pixel value of the pixel corresponding to the target area identifier can be obtained from the fog map, thereby adding a fog effect to the game area corresponding to the target area identifier according to the pixel value to form a fog area.

[0059] In the above-mentioned fog effect control method, a region information map and a fog map are obtained, wherein the pixel values ​​of the pixels of the region information map are the region identifiers corresponding to the game areas in the game scene, the pixels in the fog map correspond to the region identifiers, and the pixel values ​​of the pixels in the fog map are used to indicate whether to add a fog effect. Then, the target pixel values ​​of the target pixels that match the pixels in the graphical user interface are determined from the region information map, and the target pixel values ​​are the target region identifiers. Finally, the pixel values ​​of the pixels corresponding to the target region identifiers are obtained from the fog map, thereby adding a fog effect to the target area corresponding to the target region identifier based on the pixel values. The region information map of the embodiment of the present invention is pre-generated before the game is run, and the fog map is maintained during the game. The size of the fog map does not need to match the game scene. Therefore, recording the game area to which the fog effect is to be added by the fog map does not require a large amount of memory, thereby ensuring the performance of the game.

[0060] In an exemplary embodiment, the pixels in the region information map have corresponding world coordinates, and step 202 of obtaining, in the region information map, a target pixel value of a target pixel that matches a pixel in the graphical user interface includes:

[0061] Determining world coordinates corresponding to pixels in the graphical user interface;

[0062] Determine the pixel corresponding to the world coordinates in the region information image as the target pixel;

[0063] Obtain a pixel value corresponding to the target pixel as the target pixel value.

[0064] The world coordinates are coordinates in the world coordinate system. Pixels in the region information map have corresponding world coordinates in the world coordinate system, and pixels in the graphical user interface also have corresponding world coordinates in the world coordinate system. Specifically, the world coordinates corresponding to the pixel in the graphical user interface are determined, and then, based on the world coordinates, the corresponding pixel in the region information map can be determined as the target pixel, and the pixel value of the target pixel is used as the target pixel value.

[0065] In the above exemplary embodiment, by matching the pixels in the region information map and the pixels in the graphical user interface using the world coordinates on the same world coordinate system, the target pixels that match the pixels in the graphical user interface can be quickly determined from the region information map, and then the target region identifier can be determined based on the target pixel value of the target pixel to determine the game area corresponding to the pixel in the graphical user interface, which is used for subsequent determination of whether a fog effect needs to be added based on the fog map. The implementation is simple and does not require too much memory.

[0066] In an exemplary embodiment, the pixel value includes a first pixel value, and the first pixel value is used to represent adding a fog effect. The step 203 of adding a fog effect to the game area corresponding to the target area identifier according to the pixel value includes:

[0067] When the pixel value is the first pixel value, a fog effect is added to the pixel in the graphical user interface.

[0068] The pixel values ​​of the pixels in the fog map are used to indicate whether to add a fog effect. Specifically, after determining the target area identifier, the pixel values ​​of the pixels corresponding to the target area identifier are obtained from the fog map, and then the pixel values ​​are used to determine whether to add a fog effect to the game area in the graphical user interface.

[0069] The pixel value may include a first pixel value and a second pixel value, the first pixel value being used to represent the addition of a fog effect, and the second pixel value being used to represent the non-addition of a fog effect. Specifically, if the pixel value corresponding to the target area identifier in the fog map is the first pixel value, it is necessary to add a fog effect to the game area corresponding to the target area identifier in the graphical user interface. Of course, when the distribution of game areas in the game is more complex, such as with multi-layer distributions such as countries, provinces, and cities, each pixel of the fog map can also be expanded to decide whether to add a fog effect by bit.

[0070] In the above exemplary embodiment, whether to add a fog effect to the game area in the graphical user interface is determined based on the pixel values ​​of the pixels in the fog map. Since the size of the fog map is not large, determining whether to add a fog effect based on the fog map does not require excessive computing resources.

[0071] In an exemplary embodiment, after obtaining pixel values ​​of pixels corresponding to the target area identifier from the fog map in step 203, and adding a fog effect to the game area corresponding to the target area identifier according to the pixel values, the method may further include the following steps:

[0072] Determine the area identifier of the game area that the player has explored as the explored area identifier;

[0073] If, in the fog map, the pixel value of the pixel corresponding to the explored area identifier is a first pixel value, the first pixel value is modified to a second pixel value.

[0074] Specifically, in the game scene, the terrain or virtual character in the game area with the fog effect added is not visible, which means it has not been explored. In the game area without the fog effect added, the terrain or virtual character is visible, which means it has been explored.

[0075] During game play, embodiments of the present invention can determine in real time the trajectory of a player-controlled game character in a game scene. If the trajectory passes through a game area with a fog effect, the area identifier corresponding to the game area can be obtained as an explored area identifier. The pixel value of the pixel corresponding to the explored area identifier in the fog map can then be modified so that the pixel value represents a pixel value with a fog effect added, for example, the pixel value can be modified from a first pixel value to a second pixel value. As a specific example, assuming that a pixel value of 1 is used to represent the addition of a fog effect and a pixel value of 0 is used to represent the absence of a fog effect, the pixel value of the pixel corresponding to the explored area identifier in the fog map will be modified from 1 to 0.

[0076] In the above exemplary embodiment, the game area with fog effect that the player has explored can also be recorded in the fog map. Since the size of the fog map is very small, recording the game area that the player has explored in the fog map does not require too many computing resources.

[0077] In an exemplary embodiment, the game area is an area of ​​any shape in the game scene, and the any shape includes an irregular shape.

[0078] In an embodiment of the present invention, the game area can be of any shape, including regular shapes (such as squares, rectangles), and irregular shapes (irregular polygons). Since the embodiment of the present invention determines the corresponding target area identifier from the area information map based on pixels, and then determines the pixel value from the fog map and the target area identifier to add a fog effect to the pixels in the graphical user interface, no matter what shape the game area is, game developers will have more freedom in the game development process, and can thus develop more game play methods.

[0079] In order to enable those skilled in the art to better understand the embodiments of the present invention, the following uses specific examples for illustration. Figure 5 , shown is a flowchart of a fog effect control implementation of the present invention, which specifically includes the following steps:

[0080] Step 501: Sort all irregularly distributed game areas in the game scene and determine the area identifier of each game. This step is performed during the game development process, and the step numbers are only for ease of description.

[0081] Step 502: When the game is running, a minimalist fog map is maintained. Each pixel corresponds to an irregular game area. The pixel value of each pixel determines whether the corresponding game area is added with a fog effect.

[0082] Step 503: Generate an offline regional information map of the entire game scene. The image format is: the regional identifier of the game area where the world coordinates corresponding to each pixel are located. This step is performed during the game development process, and the step numbers are only for ease of description.

[0083] Step 504: World coordinates are obtained pixel by pixel during the post-processing phase. Post-processing refers to the reprocessing of the game's rendered frames. Adding fog effects to the game area to create foggy areas is typically done during the post-processing phase, processing the rendered frames pixel by pixel. Areas not explored by the player are fogged, while areas explored by the player are not.

[0084] Step 505: Utilize the world coordinate sampling region information map of the pixel in the graphical user interface to obtain the target region identifier where the pixel is located.

[0085] Step 506: Sample the fog map using the target area identifier to determine whether to add a fog effect to the post-processed pixels; if the fog effect needs to be added, execute step 507; if not, execute step 508;

[0086] Step 507: Add a fog effect to the pixels in the fog, such as blackening the color.

[0087] Step 508: Do not process the pixels in the fog, that is, do not add a fog effect to the pixels in the fog.

[0088] By applying the embodiments of the present invention, for game areas of any shape, including irregular game areas, only one offline generated area information map and one minimalist fog map are needed to achieve it, without occupying too much memory and computing resources, thereby ensuring the performance of the game.

[0089] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0090] Reference Figure 6 , shows a structural block diagram of an embodiment of a fog effect control device of the present invention. A graphical user interface is provided by a terminal device. The graphical user interface displays part or all of a game scene. The game scene includes a game area, and the game area has a corresponding area identifier. The device may include the following modules:

[0091] Acquisition module 601 is used to acquire a region information map and a fog map; the region information map is a map pre-generated before the game is run that covers the game scene, and the pixel values ​​of the pixels in the region information map are the region identifiers; the fog map is a map maintained during the game, and the pixels in the fog map correspond to the region identifiers, and the pixel values ​​of the pixels in the fog map are used to indicate whether a fog effect is added;

[0092] A determination module 602 is configured to obtain, in the region information map, a target pixel value of a target pixel that matches a pixel in the graphical user interface; the target pixel value is a target region identifier;

[0093] The adding module 603 is configured to obtain pixel values ​​of pixels corresponding to the target area identifier from the fog map, so as to add a fog effect to the game area corresponding to the target area identifier according to the pixel values.

[0094] In an exemplary embodiment, the pixels in the area information map have corresponding world coordinates, and the determination module 602 is used to determine the world coordinates corresponding to the pixels in the graphical user interface; determine the pixels corresponding to the world coordinates in the area information map as target pixels; and obtain the pixel value corresponding to the target pixel as the target pixel value.

[0095] In an exemplary embodiment, the pixel value includes a first pixel value, and the first pixel value is used to represent adding a fog effect. The adding module 603 is used to add a fog effect to the pixel in the graphical user interface when the pixel value is the first pixel value.

[0096] In an exemplary embodiment, the pixel value further includes a second pixel value, and the second pixel value is used to represent that no fog effect is added.

[0097] In an exemplary embodiment, the device also includes: a modification module for determining the area identifier of the game area that the player has explored as an explored area identifier; if in the fog map, the pixel value of the pixel corresponding to the explored area identifier is a first pixel value, then the first pixel value is modified to a second pixel value.

[0098] In an exemplary embodiment, the game area is an area of ​​any shape in the game scene, and the any shape includes an irregular shape.

[0099] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0100] An embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the steps described in the above embodiment of the fog effect control method are implemented.

[0101] An embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps described in the above embodiment of the fog effect control method are implemented.

[0102] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0103] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0104] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0105] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0107] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0108] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0109] The above is a detailed introduction to a fog effect control method, a fog effect control device, an electronic device and a storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A fog effect control method, characterized in that: Providing a graphical user interface through a terminal device, wherein the graphical user interface displays part or all of a game scene, wherein the game scene includes a game area, and the game area has a corresponding area identifier, wherein the method includes: Obtaining a region information map and a fog map; the region information map is a map pre-generated before the game is run that covers the game scene, and the pixel values ​​of the pixels in the region information map are the region identifiers; the fog map is a map maintained during the game, and the pixels in the fog map correspond to the region identifiers. The pixel values ​​of the pixels in the fog map are used to indicate whether a fog effect is added, and the size of the fog map is determined by the number of game areas; In the region information map, a target pixel value of a target pixel matching a pixel in the graphical user interface is obtained; the target pixel value is a target region identifier; The pixel values ​​of the pixels corresponding to the target area identifier are obtained from the fog map, so as to add a fog effect to the game area corresponding to the target area identifier according to the pixel values.

2. The method according to claim 1, characterized in that The pixels in the region information map have corresponding world coordinates, and obtaining a target pixel value of a target pixel matching a pixel in the graphical user interface in the region information map includes: Determining world coordinates corresponding to pixels in the graphical user interface; Determine the pixel corresponding to the world coordinates in the region information image as the target pixel; Obtain a pixel value corresponding to the target pixel as the target pixel value.

3. The method according to claim 1, characterized in that The pixel value includes a first pixel value, and the first pixel value is used to represent adding a fog effect. Adding the fog effect to the game area corresponding to the target area identifier according to the pixel value includes: When the pixel value is the first pixel value, a fog effect is added to the pixel in the graphical user interface.

4. The method according to claim 3, characterized in that The pixel value also includes a second pixel value, and the second pixel value is used to represent that no fog effect is added.

5. The method according to claim 4, characterized in that After acquiring pixel values ​​of pixels corresponding to the target area identifier from the fog map, and adding a fog effect to the game area corresponding to the target area identifier according to the pixel values, the method further includes: Determine the area identifier of the game area that the player has explored as the explored area identifier; If, in the fog map, the pixel value of the pixel corresponding to the explored area identifier is a first pixel value, the first pixel value is modified to a second pixel value.

6. The method according to claim 1, characterized in that The game area is an area of ​​any shape in the game scene, and the any shape includes an irregular shape.

7. A fog effect control device, characterized in that: A graphical user interface is provided through a terminal device, wherein the graphical user interface displays part or all of a game scene, wherein the game scene includes a game area, and the game area has a corresponding area identifier, and the apparatus includes: An acquisition module is configured to acquire a region information map and a fog map; the region information map is a map pre-generated before the game is run that covers the game scene, and the pixel values ​​of pixels in the region information map are the region identifiers; the fog map is a map maintained during the game, and the pixels in the fog map correspond to the region identifiers. The pixel values ​​of the pixels in the fog map are used to indicate whether a fog effect is added, and the size of the fog map is determined by the number of game areas; A determination module, configured to obtain, in the region information map, a target pixel value of a target pixel that matches a pixel in the graphical user interface; the target pixel value is a target region identifier; An adding module is used to obtain pixel values ​​of pixels corresponding to the target area identifier from the fog map, so as to add a fog effect to the game area corresponding to the target area identifier according to the pixel values.

8. The device according to claim 7, characterized in that The pixels in the area information map have corresponding world coordinates, and the determination module is used to determine the world coordinates corresponding to the pixels in the graphical user interface; determine the pixels corresponding to the world coordinates in the area information map as target pixels; and obtain the pixel value corresponding to the target pixel as the target pixel value.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the fog effect control method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the fog effect control method according to any one of claims 1 to 6 are implemented.