CN109771951B - Game map generation method, device, storage medium and electronic equipment - Google Patents

Game map generation method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN109771951B
CN109771951B CN201910113161.4A CN201910113161A CN109771951B CN 109771951 B CN109771951 B CN 109771951B CN 201910113161 A CN201910113161 A CN 201910113161A CN 109771951 B CN109771951 B CN 109771951B
Authority
CN
China
Prior art keywords
game
map
game scene
color
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910113161.4A
Other languages
Chinese (zh)
Other versions
CN109771951A (en
Inventor
王少标
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201910113161.4A priority Critical patent/CN109771951B/en
Publication of CN109771951A publication Critical patent/CN109771951A/en
Application granted granted Critical
Publication of CN109771951B publication Critical patent/CN109771951B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a method and a device for generating a game map, a storage medium and electronic equipment. The generation method of the game map comprises the following steps: responding to an instruction for generating a game map, and acquiring a game scene corresponding to the instruction; setting a target model in the game scene as a corresponding color according to a preset mapping relation between the model type and the color; aerial photography is carried out on the game scene with the set color, and an initial bitmap is generated; and obtaining a map corresponding to the game scene according to the initial bitmap. The method and the device can automatically generate the corresponding game map based on the game scene corresponding to the command for generating the game map, so that the game scene created by the player has the corresponding map, the player can conveniently and quickly know the game scene, and the game experience of the player is improved.

Description

Game map generation method, device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a game map, a storage medium, and an electronic device.
Background
With the development of computer science technology and network game technology, it is very common for users to play games through intelligent terminal devices, and in order to show the distribution of various sites in the game world in the game, so that players can more intuitively know the situation of the game scene and provide reference for the players to play games, displaying a small map corresponding to the game scene in the game has become one of the problems that can not be ignored in the game.
In the related art, a map in a game is generated by an art designer according to a game scene through offline editing in advance, and according to the game scene where a player is currently located, a system automatically loads a map which is made by the art designer in advance for the player to refer to. However, for a game scene created by a player, the system cannot provide a map, which may affect the game competition state of the player to some extent and reduce the game experience of the player.
Therefore, it is desirable to provide a new method of game map generation.
It is to be noted that the information invented in the above background section is only for enhancing the understanding of the background of the present invention, and therefore, may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The invention aims to provide a method, a device, a storage medium and electronic equipment for generating a game map, and further solves the problems that the game map generated by means of off-line editing in advance by an artist in a game cannot be generated by a system due to the fact that the game map corresponding to a game scene created by a player is generated, game competition experience of the player is reduced, game participation enthusiasm is reduced and the like at least to a certain extent.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to an aspect of the present invention, there is provided a method of game map generation, the method comprising: responding to an instruction for generating a game map, and acquiring a game scene corresponding to the instruction; setting a target model in the game scene as a corresponding color according to a preset mapping relation between the model type and the color; aerial photography is carried out on the game scene with the set color, and an initial bitmap is generated; and obtaining a map corresponding to the game scene according to the initial bitmap.
In an exemplary embodiment of the present invention, the obtaining a map corresponding to the game scene according to the initial bitmap includes: and generating a background map, and rendering the initial bitmap on the background map to obtain a map corresponding to the game scene.
In an exemplary embodiment of the present invention, the generating an initial bitmap by taking an aerial photo of the game scene after setting the color includes: dividing the game scene into a plurality of sub-scenes; and respectively carrying out aerial photography on the plurality of sub-scenes to obtain a plurality of initial sub-bitmaps, wherein the initial bitmaps comprise the plurality of initial sub-bitmaps.
In an exemplary embodiment of the present invention, the generating a background map and rendering the initial bitmap on the background map to obtain a map corresponding to the game scene includes: generating a plurality of background maps; rendering a plurality of initial sub-bitmaps in the initial bitmap on the plurality of background maps respectively; and merging the rendered multiple background maps to obtain a map corresponding to the game scene.
In an exemplary embodiment of the present invention, setting the object model in the game scene to a corresponding color according to a preset mapping relationship between a model type and a color includes: when a target model in the game scene is an obstacle model, setting the obstacle model to be a preset first color; and when the target model in the game scene is a terrain model, setting the color of a point in the terrain model according to the normal vector of each point of the terrain model.
In an exemplary embodiment of the present invention, the setting the color of the point in the terrain model according to the normal vector of each point of the terrain model includes: judging whether an included angle between a normal vector of any point of the terrain model and a horizontal plane of the game scene is larger than a preset value or not, and setting the color of the point in the terrain model according to a judgment result; if the included angle between the normal vector of the point in the terrain model and the horizontal plane of the game scene is larger than the preset value, setting the point in the terrain model as the preset first color; and if the included angle between the normal vector of any point of the terrain model and the horizontal plane of the game scene is smaller than or equal to the preset value, setting the point in the terrain model as a preset second color.
In an exemplary embodiment of the present invention, after the generating the initial bitmap, the method further includes: and carrying out image denoising processing on the initial bitmap.
In an exemplary embodiment of the present invention, the performing an image denoising process on the initial bitmap includes: and carrying out local amplification processing on the region where the preset first color is located in the initial bitmap.
In an exemplary embodiment of the present invention, before rendering the initial bitmap on the background map, the method further includes: and carrying out downsampling processing on the initial bitmap.
In an exemplary embodiment of the invention, the rendering the initial bitmap on the background map to obtain a map corresponding to the game scene includes: rendering a preset bottom plate on the background map; rendering the initial bitmap on the preset bottom plate to obtain a map corresponding to the game scene.
According to an aspect of the present invention, there is provided a game map generation apparatus including: the acquisition module is used for responding to an instruction for generating a game map and acquiring a game scene corresponding to the instruction; the color setting module is used for setting a target model in the game scene into a corresponding color according to a preset mapping relation between model types and colors; the bitmap generation module is used for aerial photography of the game scene with the set color to generate an initial bitmap; and the map generation module is used for obtaining a map corresponding to the game scene according to the initial bitmap.
According to an aspect of the present invention, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements a method of game map generation as described in any one of the above.
According to an aspect of the present invention, there is provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any of the above-described methods of game map generation via execution of the executable instructions.
The method for generating the game map in the exemplary embodiment of the invention automatically generates the map corresponding to the game scene after acquiring the instruction for generating the game map. On one hand, the map corresponding to the game scene is automatically generated without depending on the game map which is edited by an art designer in an off-line manner in advance, so that the game scene is simplified, and a player can conveniently check the game scene; on the other hand, for the game scene created by the player, the process that the player edits the map according to the game scene is omitted, the game burden of the player is reduced, and the game participation enthusiasm of the player is increased to a certain extent; meanwhile, other players can quickly know the game scene through automatic generation of the game map, and the game experience of the players is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 schematically illustrates a flow chart of a method of game map generation in an exemplary embodiment of the invention;
FIG. 2 schematically illustrates a flow chart of setting object models in a game scene to corresponding colors according to an exemplary embodiment of the present invention;
FIG. 3 schematically illustrates a flow chart for setting the color of points in a terrain model according to an exemplary embodiment of the present invention;
FIG. 4 schematically illustrates a game scene and a preset aerial shape in accordance with an exemplary embodiment of the present invention;
FIG. 5 schematically illustrates a flow chart for rendering an initial bitmap on a background map to obtain a map corresponding to a game scene in an exemplary embodiment of the invention;
FIG. 6 schematically illustrates a map interface corresponding to a game scenario in accordance with an exemplary embodiment of the present invention;
FIG. 7 schematically shows a structural diagram of a game map generation apparatus according to an exemplary embodiment of the present invention;
FIG. 8 schematically illustrates a schematic diagram of a storage medium according to an exemplary embodiment of the present invention; and
fig. 9 schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
Exemplary embodiments will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus their detailed description will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known structures, methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in the form of software, or in one or more software-hardened modules, or in different networks and/or processor devices and/or microcontroller devices.
In the related art in the field, when a game is run, a system loads a map generated by off-line editing by an art designer according to a game scene in advance, namely, a game map displayed in the game completely depends on the map edited by the art designer off-line in advance.
Accordingly, the method for generating a game map in the related art has the following disadvantages: for the game scenes created by the player, the system does not have a map edited in advance for the player to refer to. On one hand, if the player edits the map according to the game scene created by the player, the creation burden of the player is increased, and the creation desire of the player is limited to a certain extent; on the other hand, for other players, when trying to play the game scene, if no game map is taken as a reference, the game scene is not easily known by other players, and the game competition experience and the trial play enthusiasm of the players are reduced.
Based on this, in an exemplary embodiment of the present invention, a method for generating a game map is provided, which is suitable for a terminal device with an interactive interface, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like. Fig. 1 illustrates a flowchart of a method of game map generation according to an exemplary embodiment of the present invention, which may include the steps of, as shown in fig. 1:
step S110: responding to an instruction for generating a game map, and acquiring a game scene corresponding to the instruction;
step S120: setting a target model in the game scene as a corresponding color according to a preset mapping relation between the model type and the color;
step S130: aerial photography is carried out on the game scene with the set color, and an initial bitmap is generated;
step S140: and obtaining a map corresponding to the game scene according to the initial bitmap.
According to the method for generating the game map in the exemplary embodiment of the invention, on one hand, the map corresponding to the game scene is automatically generated without depending on the game map which is edited by an art designer in an offline manner in advance, so that the game scene is simplified, and a player can conveniently check the game scene; on the other hand, for the game scene edited by the player, the process that the player edits the map according to the game scene is omitted, the game burden of the player is reduced, and the game participation enthusiasm of the player is increased to a certain extent; meanwhile, other players can quickly know the game scene through automatic generation of the game map, and the game experience of the players is improved.
A method of game map generation in an exemplary embodiment of the present invention will be further described below.
In step S110, in response to an instruction to generate a game map, a game scene corresponding to the instruction is acquired.
In an exemplary embodiment of the present invention, an instruction for generating a game map is first obtained, and a game scene corresponding to the instruction is obtained, where the instruction for generating the game map may be an instruction sent by a player, or may be an instruction automatically generated after the player finishes editing the game scene. The instruction is an instruction for generating a map corresponding to a game scene newly created by the player; the generated map may be a complete map corresponding to the game scene edited by the player, or may also be a map corresponding to a part of the game scene edited by the player, which is not specifically limited in the present invention. The player can generate the game map by clicking a button, a menu, or the like for generating the game map on the game interface of the terminal device.
In step S120, the target model in the game scene is set to a corresponding color according to a preset mapping relationship between model types and colors.
In an exemplary embodiment of the present invention, the types of models in the game scene include an obstacle model, a terrain model, a combat unit model, and the like. The obstacle model is a model which can not pass through a moving object (such as a game character controlled by a player) in a game, for example, the game character can not pass through a closed wall, and the wall is the obstacle model; terrain models include two forms: one is a road model or a mountain model on which a player can walk; the other is a model which is limited and can not be passed by the player, such as a severe hill or cliff which is limited by the player in the game. The target models comprise obstacle models and terrain models in the game scene, and the target models in the game scene can be set to be corresponding colors according to the preset mapping relation between the model types and the colors, so that different visual effects are generated among different target models. Specifically, fig. 2 shows a flowchart for setting an object model in a game scene to a corresponding color, and as shown in fig. 2, the process may specifically include the following steps:
in step S210, when the target model in the game scene is an obstacle model, the obstacle model is set to a preset first color.
In an exemplary embodiment of the present invention, the obstacle model is set to a preset first color, which may be black, so as to distinguish the obstacle model from other models in the generated map, and black as the obstacle model also conforms to the visual recognition of the player. Of course, the preset first color may also be other colors, such as white, gray, etc., and the present invention is not limited thereto.
In step S220, when the target model in the game scene is a terrain model, setting the color of a point in the terrain model according to the normal vector of each point of the terrain model.
In an exemplary embodiment of the present invention, in order to distinguish two forms of terrain models, colors of points in the terrain model are set according to a difference of normal vectors of each point of the terrain model. In particular, fig. 3 shows a flow chart for setting the color of a point in a terrain model, as shown in fig. 3, the process comprising the steps of:
in step S310, it is determined whether an included angle between a normal vector of any point of the terrain model and a horizontal plane of the game scene is greater than a preset value, and a color of the point in the terrain model is set according to a determination result.
In an exemplary embodiment of the present invention, the normal vector of the midpoint of the terrain model refers to a vector corresponding to a normal of the midpoint of the terrain model, and may be obtained by performing weighted average on normal vectors of all adjacent surfaces passing through the point, for example, a triangular mesh is used in the surface three-dimensional model, and for the normal vector of the point in the surface three-dimensional model, a weighted average value of normal vectors of all adjacent triangular surfaces passing through the point may be obtained. The surface three-dimensional model may also use a square grid, etc., but the method of obtaining the normal vectors of the points is the same as the above method, and the present invention includes, but is not limited to, the above method of obtaining the normal vectors of the points in the terrain model. It should be noted that the range of the included angle between the normal vector of any point in the terrain model and the horizontal plane where the game scene is located is [0, 90], the unit is an angle system, in this range, the acquired included angle between the normal vector of the point in the terrain model and the horizontal plane where the game scene is located is compared with a preset value, and the color of the point in the terrain model is determined according to the comparison result.
In step S320, if an included angle between a normal vector of a point in the terrain model and a horizontal plane of the game scene is greater than the preset value, setting the point in the terrain model as the preset first color.
In an exemplary embodiment of the present invention, the preset threshold may be selected according to actual situations, and may be 70, 75, 80, and the like, which is not specifically limited by the present invention. If the included angle between the normal vector of the point in the terrain model and the horizontal plane of the game scene is larger than the preset value, it indicates that the terrain model corresponding to the point is steeper, and the limit effect on the moving object in the game may be generated, so the color corresponding to the point is set to be the preset first color, that is, the color corresponding to the obstacle model in step S210 is the same.
In step S330, if an included angle between a normal vector of any point of the terrain model and a horizontal plane of the game scene is less than or equal to the preset value, setting the point in the terrain model as a preset second color.
In an exemplary embodiment of the present invention, if an included angle between a normal vector of a point in the terrain model and a horizontal plane of the game scene is less than or equal to a preset value, it indicates that the terrain model corresponding to the point is relatively gentle, and may not have a restriction effect on a moving object in the game, so that the color corresponding to the point is set to be a preset second color. It should be noted that, in order to distinguish the colors corresponding to the two different terrain models, the preset second color may be selected to be different from the preset first color, for example, when the preset first color is black, the preset second color may be selected to be white, and of course, other colors may also be selected according to the actual situation in the game.
Furthermore, in the exemplary embodiment of the present invention, it is also possible to set the color of the point in the terrain model according to a dot product of a normal vector of the point in the terrain model and a preset vector. The preset vector may be a normal vector of a horizontal plane where the game scene is located, and the direction is upward, for example, (0, 1, 0). Specifically, a dot product of a normal vector of each point in the terrain model and a preset vector may be obtained first; then, obtaining an absolute value of the dot product, and comparing the absolute value with a preset threshold value; and finally, setting the color of the point in the terrain model according to the comparison result. The preset threshold may be 0.7 or 0.75, and the selection of the preset threshold may also be adjusted according to the actual situation, which is not particularly limited in the present invention. For example, if the normal vector of a point in a terrain model is (0.2, 0.8, 0.3), the dot product of the predetermined vector (0, 1, 0) and the normal vector (0.2, 0.8, 0.3) of the point is obtained, and the absolute value of the dot product is 0.8. Further, if the obtained absolute value is greater than the preset threshold, it indicates that the point in the terrain model is closer to the direction of the preset vector, that is, the terrain model corresponding to the point is steeper, and the form of the terrain model corresponding to the point is a model which plays a limiting role for the player and cannot be passed by the player, the color corresponding to the point is set to be the preset first color; similarly, if the absolute value of the obtained dot product is smaller than the preset threshold, it indicates that the dot in the terrain model is farther away from the direction of the preset vector, that is, the corresponding terrain model is flatter in the form of a road model or a mountain model, etc. on which the player can walk, and the color corresponding to the dot is set to the preset second color. In order to distinguish the colors corresponding to the two different terrain models, the preset second color may also be selected to be different from the preset first color, and the specific color setting is the same as the color of the terrain model, which is not described in detail herein.
It should be noted that the two methods for setting colors of the terrain models in step S330 are both intended to distinguish two different forms of terrain models, and those skilled in the art may select other methods to distinguish different forms of terrain models according to actual needs.
In step S130, the game scene with the set color is aerial-photographed, and an initial bitmap is generated.
In an exemplary embodiment of the present invention, an initial bitmap corresponding to a game scene after setting colors may be generated by aerial photography of the game scene, and when an object model in the game scene is set to be only black or white, the generated initial bitmap is a black-and-white bitmap, the black-and-white bitmap refers to a bitmap pattern in which pixels in an image are represented by only two colors, and the data structure is simple, which is convenient for spatial analysis, surface simulation, and the like.
In order to avoid using a larger background map when rendering images, a block aerial photography mode can be adopted. Specifically, a game scene is divided into a plurality of sub-scenes; and then, respectively carrying out aerial photography on the plurality of sub-scenes to obtain a plurality of initial sub-bitmaps, wherein the finally generated initial bitmaps comprise the plurality of initial sub-bitmaps.
Specifically, the boundary size of the game scene may be acquired first; and then determining the segmentation number of the game scene according to the boundary size of the game scene and the preset aerial photography size. Wherein, if the game scene is rectangular, the corresponding selected shape is a preset aerial shape of the rectangle, fig. 4 shows schematic diagrams of the game scene and the preset aerial shape, and as shown in fig. 4, the boundary dimension of the game scene (left in fig. 4) includes a first dimension (a)1B1Edge) and a second dimension (A)1D1Side), the boundary dimension of the preset aerial shape (right in fig. 4) comprises a third dimension (a)2B2Edge) and a fourth dimension (A)2D2An edge). The process of determining the number of segments of a game scene is further described with reference to FIG. 4: firstly, comparing the first size with the third size, and rounding up the comparison result to obtain a first segmentation value; for example, when the first size is 16 and the third size is 5, the first division value is 4(16 ÷ 5 ═ 3.2); then, the second size is compared with the fourth size, and the result of the comparison is rounded upwards to obtain a second segmentation value; finally, willThe first division value and the second division value are multiplied, and the number of the game scenes divided into the sub-scenes is determined according to the multiplication result. For example, if the first division value is 4 and the second division value is 4, the number of divisions of the game scene is determined to be 16(4 × 4 — 16).
It should be noted that fig. 4 is only a simple example of the game scene and the preset aerial shape, and the game scene and the preset aerial shape may be other shapes and sizes, but the method for determining the division number of the game scene is the same, and the present invention includes, but is not limited to, the types and sizes of the game scene and the preset aerial shape.
After the division number of the game scene is determined, the game scene is divided into a plurality of sub-scenes with the division number, and aerial photography is carried out on the sub-scenes respectively to obtain a plurality of initial sub-bitmaps. In order to provide photo-level reality and reduce the amount of computation, the consumption of a Central Processing Unit (CPU) is reduced, and a map can be quickly rendered on a screen to ensure that a player has a smooth game experience, and the sub-scenes are selected to be respectively aerial-photographed to obtain a plurality of initial sub-bitmaps. The camera during aerial photography may adopt a front view projection mode, and may also select another aerial photography mode according to actual needs, for example, a perspective projection mode, and the like, which is not specifically limited in the present invention.
It should be noted that the finally obtained initial bitmap includes the multiple initial sub-bitmaps, and after the initial bitmap is generated, image denoising processing may also be performed on the initial bitmap, for example, local amplification processing is performed on an area where a preset first color is located in the initial bitmap, so that the edges of the areas are smoother, and the visual effect is improved.
In step S140, a map corresponding to the game scene is obtained according to the initial bitmap.
In an exemplary embodiment of the present invention, a map corresponding to a game scene may be obtained by generating a background map and rendering the generated initial bitmap on the background map. FIG. 5 shows a flowchart for rendering an initial bitmap on a background map to obtain a map corresponding to a game scene, as shown in FIG. 5, the process comprising the steps of:
in step S510, a plurality of background maps are generated;
the size of the background map can be determined according to the size corresponding to the sub-scenes, and can be selected according to the actual situation.
In step S520, a plurality of initial sub-bitmaps in the initial bitmap are rendered on the plurality of background maps, respectively.
In an exemplary embodiment of the present invention, before rendering the initial sub-bitmap on the plurality of background maps, the initial sub-bitmap may be subjected to down-sampling, which is also referred to as reducing an image, and is a method for generating a thumbnail of a corresponding image in order to fit the image to the size of a display area. In particular, different levels of down-sampling may be selected depending on the resolution of the initial sub-bitmap, for example: for the initial sub-bitmap with a larger resolution, the down-sampling resolution can be set to 512 × 512; for the initial sub-bitmap with a smaller resolution, the down-sampling resolution can be set to 256 × 256, and the present invention includes, but is not limited to, the down-sampling levels described above. In addition, the down-sampling method of the initial bitmap may be a nearest neighbor interpolation algorithm, a bilinear interpolation algorithm, and the like, which is not specifically required by the present invention.
In step S530, the rendered multiple background maps are merged to obtain a map corresponding to the game scene.
In an exemplary embodiment of the invention, according to the position sequence corresponding to each initial sub-bitmap obtained by aerial photography, a plurality of rendered background maps corresponding to the initial sub-bitmaps are spliced to synthesize a map corresponding to a game scene. Specifically, a preset bottom plate is rendered on a background map; and then rendering the initial bitmap on a preset bottom plate to obtain a map corresponding to the game scene. The preset bottom plate is a preset UI (User Interface) bottom plate, and the bottom plate is a bottom plate with a preset size in a preset bottom plate library and can be selected according to actual conditions.
In addition, as shown in step S120, the models in the game scene further include a combat unit model, and the combat unit model may be rendered on the initial bitmap to obtain a map corresponding to the game scene, where the process may specifically include the following steps: firstly, acquiring position information of a combat unit model in a game scene; then, mapping the position information on the initial bitmap to determine a target position on the initial bitmap; and finally, rendering the icon corresponding to the fighting unit model on the initial bitmap according to the target position. For example, if the game scene is a rectangle, correspondingly, the initial bitmap corresponding to the game scene is also a rectangle, wherein four corner points in the game scene rectangle correspond to four corner points in the initial bitmap, and the target position of the combat unit model in the game scene in the initial bitmap can be obtained according to the corresponding relationship between the four corner points in the game scene and the initial bitmap, that is, the position information of the combat model in the game scene is mapped on the initial bitmap through the mapping relationship between the game scene rectangle and the initial bitmap rectangle, so as to determine a target position.
In summary, the process of obtaining the map corresponding to the game scene is similar to the result of overlaying the mixed pictures, wherein the background map is arranged on the bottom layer; then, rendering a preset bottom plate on the background map, wherein the initial bitmap is rendered on the preset bottom plate; finally, an icon of the combat unit model is rendered on the initial bitmap to obtain a map corresponding to the game scene. Fig. 6 is a schematic diagram of a map interface corresponding to a game scene, and as shown in fig. 6, for a game scene created by a player, the map can clearly and quickly understand the game scene, so as to improve the game competition experience of other players; meanwhile, the process that the player edits the map according to the game scene is reduced, and the game burden of the player is reduced.
Further, in an exemplary embodiment of the present invention, there is also provided an apparatus for game map generation, which, referring to fig. 7, may include an obtaining module 710, a color setting module 720, a bitmap generation module 730, and a map generation module 740.
An obtaining module 710, configured to, in response to an instruction for generating a game map, obtain a game scene corresponding to the instruction;
a color setting module 720, configured to set a target model in the game scene to a corresponding color according to a preset mapping relationship between a model type and a color;
the bitmap generation module 730 is used for aerial photography of the game scene with the set color to generate an initial bitmap;
and the map generating module 740 is configured to obtain a map corresponding to the game scene according to the initial bitmap.
The specific details of each module/unit in the above-mentioned apparatus have been described in detail in the embodiments of the method section, and thus are not described again.
In addition, in an exemplary embodiment of the present invention, there is also provided a computer storage medium capable of implementing the above method. On which a program product capable of implementing the above-described method of the present specification is stored. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when said program product is run on the terminal device.
Referring to fig. 8, a program product 800 for implementing the above method according to an exemplary embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In addition, in an exemplary embodiment of the present invention, an electronic device capable of implementing the above method is also provided. As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 900 according to such an embodiment of the invention is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 9, the electronic device 900 is embodied in the form of a general purpose computing device. Components of electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), and a display unit 940.
Wherein the storage unit stores program code that is executable by the processing unit 910 to cause the processing unit 910 to perform steps according to various exemplary embodiments of the present invention described in the above section "exemplary methods" of the present specification.
The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM)9201 and/or a cache memory unit 9202, and may further include a read only memory unit (ROM) 9203.
Storage unit 920 may also include a program/utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 930 can be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 900 may also communicate with one or more external devices 1000 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 900, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 900 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interface 950. Also, the electronic device 900 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 960. As shown, the network adapter 960 communicates with the other modules of the electronic device 900 via the bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiment of the present invention.
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is only limited by the appended claims.

Claims (13)

1. A method of game map generation, comprising:
responding to an instruction for generating a game map, and acquiring a game scene corresponding to the instruction;
setting a target model in the game scene as a corresponding color according to a preset mapping relation between the model type and the color;
aerial photography is carried out on the game scene with the set color, and an initial bitmap is generated;
and obtaining a map corresponding to the game scene according to the initial bitmap.
2. The method for generating the game map according to claim 1, wherein the obtaining the map corresponding to the game scene according to the initial bitmap comprises:
and generating a background map, and rendering the initial bitmap on the background map to obtain a map corresponding to the game scene.
3. The method for generating a game map according to claim 2, wherein the aerial photographing of the game scene with the set color to generate an initial bitmap comprises:
dividing the game scene into a plurality of sub-scenes;
and respectively carrying out aerial photography on the plurality of sub-scenes to obtain a plurality of initial sub-bitmaps, wherein the initial bitmaps comprise the plurality of initial sub-bitmaps.
4. The method of claim 3, wherein the generating a background map and rendering the initial bitmap on the background map to obtain a map corresponding to the game scene comprises:
generating a plurality of background maps;
rendering a plurality of initial sub-bitmaps in the initial bitmap on the plurality of background maps respectively;
and merging the rendered multiple background maps to obtain a map corresponding to the game scene.
5. The method for generating the game map according to claim 1 or 2, wherein the setting of the target model in the game scene to a corresponding color according to a preset mapping relationship between the model type and the color comprises:
when a target model in the game scene is an obstacle model, setting the obstacle model to be a preset first color;
and when the target model in the game scene is a terrain model, setting the color of a point in the terrain model according to the normal vector of each point of the terrain model.
6. The method of claim 5, wherein the setting the color of the points in the terrain model according to the normal vector of each point in the terrain model comprises:
judging whether an included angle between a normal vector of any point of the terrain model and a horizontal plane of the game scene is larger than a preset value or not, and setting the color of the point in the terrain model according to a judgment result;
if the included angle between the normal vector of the point in the terrain model and the horizontal plane of the game scene is larger than the preset value, setting the point in the terrain model as the preset first color;
and if the included angle between the normal vector of any point of the terrain model and the horizontal plane of the game scene is smaller than or equal to the preset value, setting the point in the terrain model as a preset second color.
7. The method of game map generation of claim 6, after generating the initial bitmap, further comprising:
and carrying out image denoising processing on the initial bitmap.
8. The method of game map generation of claim 7, wherein the image denoising of the initial bitmap comprises:
and carrying out local amplification processing on the region where the preset first color is located in the initial bitmap.
9. The method of game map generation of claim 2, wherein prior to rendering the initial bitmap on the background map, further comprising:
and carrying out downsampling processing on the initial bitmap.
10. The method of claim 2, wherein the rendering the initial bitmap on the background map resulting in a map corresponding to the game scene comprises:
rendering a preset bottom plate on the background map;
rendering the initial bitmap on the preset bottom plate to obtain a map corresponding to the game scene.
11. An apparatus for game map generation, comprising:
the acquisition module is used for responding to an instruction for generating a game map and acquiring a game scene corresponding to the instruction;
the color setting module is used for setting a target model in the game scene into a corresponding color according to a preset mapping relation between model types and colors;
the bitmap generation module is used for aerial photography of the game scene with the set color to generate an initial bitmap;
and the map generation module is used for obtaining a map corresponding to the game scene according to the initial bitmap.
12. A storage medium having stored thereon a computer program which, when executed by a processor, implements a method of game map generation according to any one of claims 1 to 10.
13. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of game map generation of any of claims 1 to 10 via execution of the executable instructions.
CN201910113161.4A 2019-02-13 2019-02-13 Game map generation method, device, storage medium and electronic equipment Active CN109771951B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910113161.4A CN109771951B (en) 2019-02-13 2019-02-13 Game map generation method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910113161.4A CN109771951B (en) 2019-02-13 2019-02-13 Game map generation method, device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109771951A CN109771951A (en) 2019-05-21
CN109771951B true CN109771951B (en) 2022-04-29

Family

ID=66503474

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910113161.4A Active CN109771951B (en) 2019-02-13 2019-02-13 Game map generation method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109771951B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110420460B (en) * 2019-08-05 2020-07-17 苏州亿歌网络科技有限公司 Method and device for editing functional nodes in game scene
CN111803952A (en) * 2019-11-21 2020-10-23 厦门雅基软件有限公司 Topographic map editing method and device, electronic equipment and computer readable medium
CN111135574B (en) * 2019-12-25 2023-04-07 网易(杭州)网络有限公司 Game scene generation method and device, computer readable medium and electronic equipment
CN111124582B (en) * 2019-12-26 2023-04-07 珠海金山数字网络科技有限公司 Icon calling method and device
CN111617467A (en) * 2020-04-30 2020-09-04 珠海网易达电子科技发展有限公司 Method, apparatus, electronic device, and computer storage medium for generating map
CN112704874B (en) * 2020-12-21 2023-09-22 北京信息科技大学 Method and device for automatically generating Gotty scene in 3D game
CN112675534A (en) * 2020-12-22 2021-04-20 北京像素软件科技股份有限公司 Data processing method and device, server and storage medium
CN112717385B (en) * 2021-01-20 2022-04-22 上海莉莉丝网络科技有限公司 Attribution control method, system and computer readable storage medium of map pixels in game map
CN113476848B (en) * 2021-07-08 2023-11-17 网易(杭州)网络有限公司 Tree chain map generation method and device, storage medium and electronic equipment
CN114053708B (en) * 2021-11-12 2022-12-16 北京冰封互娱科技有限公司 Map generation method and device, computer equipment and computer readable storage medium
CN114418005B (en) * 2022-01-21 2022-09-20 杭州碧游信息技术有限公司 Game map automatic generation method, device, medium and equipment based on GAN network

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101904530B1 (en) * 2016-11-29 2018-10-05 주식회사 패튼코 Method for providing and displaying a game map
JP6854133B2 (en) * 2017-01-10 2021-04-07 任天堂株式会社 Information processing programs, information processing methods, information processing systems, and information processing equipment
CN107219975A (en) * 2017-05-26 2017-09-29 合肥泽诺信息科技有限公司 A kind of method and apparatus of editable scene of game
CN108446310B (en) * 2018-02-05 2021-12-10 阿里巴巴(中国)有限公司 Virtual street view map generation method and device and client device
CN108568112A (en) * 2018-04-20 2018-09-25 网易(杭州)网络有限公司 A kind of generation method of scene of game, device and electronic equipment

Also Published As

Publication number Publication date
CN109771951A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
CN109771951B (en) Game map generation method, device, storage medium and electronic equipment
US11210838B2 (en) Fusing, texturing, and rendering views of dynamic three-dimensional models
Siltanen Diminished reality for augmented reality interior design
US9330500B2 (en) Inserting objects into content
WO2015027953A1 (en) Method, apparatus and terminal device for dynamic image processing
US20190057532A1 (en) Realistic augmentation of images and videos with graphics
JP7432005B2 (en) Methods, devices, equipment and computer programs for converting two-dimensional images into three-dimensional images
JP2023029984A (en) Method, device, electronic apparatus, and readable storage medium for generating virtual image
CN112717414B (en) Game scene editing method and device, electronic equipment and storage medium
CN111406406A (en) Apparatus and method for dynamic range extension in virtual reality scenes
US20240087219A1 (en) Method and apparatus for generating lighting image, device, and medium
US11217002B2 (en) Method for efficiently computing and specifying level sets for use in computer simulations, computer graphics and other purposes
CN112494941A (en) Display control method and device of virtual object, storage medium and electronic equipment
CN110378948B (en) 3D model reconstruction method and device and electronic equipment
CN112070854A (en) Image generation method, device, equipment and storage medium
CN116958344A (en) Animation generation method and device for virtual image, computer equipment and storage medium
CN115933949A (en) Coordinate conversion method and device, electronic equipment and storage medium
JP2003168130A (en) System for previewing photorealistic rendering of synthetic scene in real-time
CN114913277A (en) Method, device, equipment and medium for three-dimensional interactive display of object
CN114119831A (en) Snow accumulation model rendering method and device, electronic equipment and readable medium
CN111563956A (en) Three-dimensional display method, device, equipment and medium for two-dimensional picture
CN117197319B (en) Image generation method, device, electronic equipment and storage medium
CN116962816B (en) Method and device for setting implantation identification, electronic equipment and storage medium
KR102056985B1 (en) Method and apparatus for virtual reality interaction
CN116808577A (en) Game map processing method and device, computer readable medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant