The application discloses a split application of China patent application with the application number 202011362509.2, the application name of map generation method, device, computer equipment and computer readable storage medium, which is filed by China patent office on the first 11 and 27 days 2020.
Disclosure of Invention
In view of this, the present application provides a map generating method, apparatus, computer device and computer readable storage medium, and aims to solve the problems that a large amount of manpower and material resources are required for generating multiple maps for each gate, and a large amount of maps cause an excessive volume of a game installation package, resulting in excessive cost of generating the maps, and wasting a large amount of storage resources.
According to a first aspect of the present application, there is provided a map generation method comprising:
When the request for generating the map is detected, determining a starting three-dimensional land block according to the set target generation style;
Determining a selected initial extension channel on the initial three-dimensional plot, and inquiring at least one spliced three-dimensional plot based on the initial extension channel, wherein the at least one spliced three-dimensional plot accords with the target generation style and has a connectable extension channel matched with the initial extension channel;
establishing a connection relation between the initial extension channel and the connectable extension channel, and splicing the initial three-dimensional land block and the at least one spliced three-dimensional land block;
determining a splicing position generated by splicing the initial three-dimensional land block and the at least one spliced three-dimensional land block, and counting splicing parameters of the splicing position, wherein the splicing parameters at least comprise land block thickness differences and land block gap data;
And adjusting the two three-dimensional plots to be adjusted at the joint in the vertical direction according to the plot thickness difference, and adjusting the two three-dimensional plots to be adjusted in the horizontal direction according to the plot gap data to generate a target map.
In another embodiment, the determining the starting three-dimensional plot according to the set target generation style includes:
determining the target generation style set when a map is requested to be generated, and acquiring a plurality of preset three-dimensional plots corresponding to the target generation style;
Determining a selected preset three-dimensional land block from the plurality of preset three-dimensional land blocks;
Setting the map attribute of the selected preset three-dimensional land block as a starting attribute, and taking the preset three-dimensional land block after setting as the starting three-dimensional land block.
In another embodiment, the querying at least one stitchable three-dimensional plot based on the initial extension channel comprises:
Acquiring at least one candidate preset three-dimensional block from a plurality of preset three-dimensional blocks corresponding to the target generation style, wherein the at least one candidate preset three-dimensional block is a preset three-dimensional block except the initial three-dimensional block in the plurality of preset three-dimensional blocks;
Determining a starting channel type of the starting extension channel;
For each candidate preset three-dimensional plot in the at least one candidate preset three-dimensional plot, inquiring a channel type corresponding to an extension channel included in the candidate preset three-dimensional plot;
When the candidate preset three-dimensional land parcels are determined to comprise connectable extension channels with the channel types consistent with the initial channel types by inquiry, taking the candidate preset three-dimensional land parcels as the spliced three-dimensional land parcels, and continuing to inquire the at least one candidate preset three-dimensional land parcels until the at least one candidate preset three-dimensional land parcels are all inquired, so that the at least one spliced three-dimensional land parcels are obtained;
And when the query determines that the candidate preset three-dimensional land block does not comprise the connectable extension channel with the channel type consistent with the initial channel type, skipping the candidate preset three-dimensional land block, and continuing to query the at least one candidate preset three-dimensional land block until the at least one candidate preset three-dimensional land block is queried completely, so as to obtain the at least one spliced three-dimensional land block.
In another embodiment, the establishing a connection between the initial extension channel and the connectable extension channel, and splicing the initial three-dimensional plot and the at least one spliceable three-dimensional plot, includes:
Detecting a triggering operation, and determining a target spliced three-dimensional land block selected by the triggering operation from the at least one spliced three-dimensional land block;
Determining connectable extension channels with the channel types consistent with the initial extension channels in the target spliced three-dimensional land parcels;
moving the target spliced three-dimensional land block, communicating the connectable extension channel with the initial extension channel, and controlling the target spliced three-dimensional land block to be spliced with the initial three-dimensional land block;
And continuing to detect the next triggering operation and executing the splicing of the three-dimensional block which is selected by the next triggering operation until the triggering operation which is detected to occur sets the map attribute of the selected three-dimensional block which can be spliced as the termination attribute.
In another embodiment, the moving the target tileable three-dimensional plot, communicating the connectable extension channel with the starting extension channel, and after controlling the target tileable three-dimensional plot to be spliced with the starting three-dimensional plot, the method further comprises:
detecting whether an overlapping part exists after the target spliced three-dimensional land block and the initial three-dimensional land block are spliced;
when the existence of the overlapped part is detected, generating and displaying a manufacturing failure prompt;
And when the overlapping part is detected to be not present, continuing to detect the next triggering operation, executing the splicing of the three-dimensional land block which is selected by the next triggering operation, and detecting whether the overlapping part is present after the splicing is completed.
In another embodiment, the method further comprises:
Generating a map navigation grid of the target map, determining at least one module joint in the map navigation network, and performing activation communication on the at least one module joint, wherein the at least one module joint is generated by splicing three-dimensional plots;
performing illumination treatment on the map navigation grid, and adding illumination in the map navigation grid;
and displaying the added map navigation grid.
In another embodiment, the performing the illumination processing on the map navigation grid, adding illumination in the map navigation grid, includes:
Performing illumination treatment on the at least one module spliced position in the map navigation network based on a point light mode, and adding illumination to the at least one module spliced position;
and acquiring preset illumination information for a module central area in the map navigation grid, rendering the module central area by adopting the preset illumination information, and adding illumination for the module central area, wherein the module central area is the central area of the initial three-dimensional land block and the at least one spliced three-dimensional land block.
In another embodiment, the adjusting the two three-dimensional plots to be adjusted at the spliced position according to the plot thickness difference in the vertical direction includes:
Determining a first three-dimensional land block to be adjusted and a second three-dimensional land block to be adjusted in the two three-dimensional land blocks to be adjusted, reducing the land block thickness of the first three-dimensional land block to be adjusted by adopting the land block thickness difference, controlling the land block surfaces of the first three-dimensional land block to be adjusted and the second three-dimensional land block to be positioned on the same horizontal plane, or,
Increasing the land thickness of the second three-dimensional land to be adjusted by adopting the land thickness difference, and controlling the land surfaces of the first three-dimensional land to be adjusted and the second three-dimensional land to be adjusted to be in the same horizontal plane;
the thickness of the first to-be-adjusted three-dimensional land is larger than that of the second to-be-adjusted three-dimensional land.
In another embodiment, the adjusting the two three-dimensional plots to be adjusted according to the plot clearance data in a horizontal direction includes:
when the block gap data indicates that a third to-be-adjusted three-dimensional block with a curved boundary exists in the two to-be-adjusted three-dimensional blocks, stretching the boundary of the third to-be-adjusted three-dimensional block, controlling the boundary of the third to-be-adjusted three-dimensional block to be matched with the boundary of a fourth to-be-adjusted three-dimensional block, wherein the fourth to-be-adjusted three-dimensional block is another to-be-adjusted three-dimensional block except the third to-be-adjusted three-dimensional block in the two to-be-adjusted three-dimensional blocks, and/or,
Determining the gap distance indicated by the land parcel gap data, and controlling the third to-be-adjusted three-dimensional land parcel to extend to the fourth to-be-adjusted three-dimensional land parcel by the length indicated by the gap distance or controlling the fourth to-be-adjusted three-dimensional land parcel to extend to the third to-be-adjusted three-dimensional land parcel by the length indicated by the gap distance.
According to a second aspect of the present application, there is provided a map generation apparatus comprising:
The determining module is used for determining an initial three-dimensional land block according to the set target generation style when the request for generating the map is detected;
The query module is used for determining a selected initial extension channel on the initial three-dimensional plot, and querying at least one spliced three-dimensional plot based on the initial extension channel, wherein the at least one spliced three-dimensional plot accords with the target generation style and has a connectable extension channel matched with the initial extension channel;
the splicing module is used for establishing a connection relation between the initial extending channel and the connectable extending channel and splicing the initial three-dimensional land block with the at least one spliced three-dimensional land block;
the statistics module is used for determining a splicing position generated by splicing the initial three-dimensional land parcels and the at least one spliced three-dimensional land parcels, and counting splicing parameters of the splicing position, wherein the splicing parameters at least comprise land parcels thickness difference and land parcels gap data;
and the adjustment module is used for adjusting the two three-dimensional plots to be adjusted at the joint in the vertical direction according to the plot thickness difference, and adjusting the two three-dimensional plots to be adjusted in the horizontal direction according to the plot clearance data to generate a target map.
In another embodiment, the determining module includes:
the acquisition unit is used for determining the target generation style set when the map generation is requested and acquiring a plurality of preset three-dimensional plots corresponding to the target generation style;
the determining unit is used for determining the selected preset three-dimensional land block from the plurality of preset three-dimensional land blocks;
The setting unit is used for setting the map attribute of the selected preset three-dimensional land block as a starting attribute and taking the preset three-dimensional land block after setting as the starting three-dimensional land block.
In another embodiment, the query module includes:
the acquisition unit is used for acquiring at least one candidate preset three-dimensional block from a plurality of preset three-dimensional blocks corresponding to the target generation style, wherein the at least one candidate preset three-dimensional block is a preset three-dimensional block except the initial three-dimensional block in the plurality of preset three-dimensional blocks;
a first determining unit configured to determine a start channel type of the start extension channel;
The inquiring unit is used for inquiring the channel type corresponding to the extension channel included in the candidate preset three-dimensional block for each candidate preset three-dimensional block in the at least one candidate preset three-dimensional block;
the second determining unit is used for taking the candidate preset three-dimensional block as the spliced three-dimensional block when the candidate preset three-dimensional block is determined to comprise a connectable extension channel with the channel type consistent with the initial channel type by inquiry, and continuing to inquire the at least one candidate preset three-dimensional block until the at least one candidate preset three-dimensional block is inquired completely, so as to obtain the at least one spliced three-dimensional block;
And the query unit is further configured to skip the candidate preset three-dimensional plot when the query determines that the candidate preset three-dimensional plot does not include a connectable extension channel with a channel type consistent with the initial channel type, and continue to query the at least one candidate preset three-dimensional plot until the at least one candidate preset three-dimensional plot is queried completely, so as to obtain the at least one spliced three-dimensional plot.
In another embodiment, the splice module includes:
The first detection unit is used for detecting triggering operation and determining a target spliced three-dimensional land block selected by the triggering operation from the at least one spliced three-dimensional land block;
the determining unit is used for determining a connectable extension channel with the channel type consistent with the initial extension channel in the target spliced three-dimensional land block;
the control unit is used for moving the target spliced three-dimensional land block, communicating the connectable extension channel with the initial extension channel and controlling the target spliced three-dimensional land block to be spliced with the initial three-dimensional land block;
The first detection unit is further configured to continue detecting a next triggering operation and performing stitching of the three-dimensional parcel selected by the next triggering operation until the occurrence of the triggering operation is detected, where the map attribute of the selected three-dimensional parcel is set as a termination attribute.
In another embodiment, the splicing module further comprises:
The second detection unit is used for detecting whether an overlapping part exists after the target spliced three-dimensional land block is spliced with the initial three-dimensional land block;
the generating unit is used for generating and displaying a production failure prompt when the existence of the overlapped part is detected;
And the second detection unit is further used for continuously detecting the next triggering operation when the non-overlapped part is detected, executing the splicing of the three-dimensional land blocks which are selected by the next triggering operation, and detecting whether the overlapped part exists after the splicing is completed.
In another embodiment, the apparatus further comprises:
The generation module is used for generating a map navigation grid of the target map, determining at least one module splicing position in the map navigation network, and activating and communicating the at least one module splicing position, wherein the at least one module splicing position is generated by splicing three-dimensional plots;
the processing module is used for carrying out illumination processing on the map navigation grid, and increasing illumination in the map navigation grid;
and the display module is used for displaying the added map navigation grid.
In another embodiment, the processing module is configured to perform illumination processing on the at least one module splicing position in the map navigation network based on a point light mode, add illumination to the at least one module splicing position, acquire preset illumination information for a module center region in the map navigation grid, render the module center region with the preset illumination information, add illumination to the module center region, and the module center region is a center region of the starting three-dimensional plot and the at least one spliceable three-dimensional plot.
In another embodiment, the adjustment module is configured to determine a first three-dimensional plot to be adjusted and a second three-dimensional plot to be adjusted in the two three-dimensional plots to be adjusted, reduce a plot thickness of the first three-dimensional plot to be adjusted by using the plot thickness difference, and control a plot surface of the first three-dimensional plot to be adjusted and a plot surface of the second three-dimensional plot to be adjusted to be in a same horizontal plane, or increase a plot thickness of the second three-dimensional plot to be adjusted by using the plot thickness difference, and control a plot surface of the first three-dimensional plot to be adjusted and a plot surface of the second three-dimensional plot to be adjusted to be in a same horizontal plane, where the plot thickness of the first three-dimensional plot to be adjusted is greater than the plot thickness of the second three-dimensional plot to be adjusted.
In another embodiment, the adjustment module is configured to stretch a boundary of a third to-be-adjusted three-dimensional block, when the block gap data indicates that the third to-be-adjusted three-dimensional block with a curved boundary exists in the two to-be-adjusted three-dimensional blocks, control the boundary of the third to-be-adjusted three-dimensional block to match with a boundary of a fourth to-be-adjusted three-dimensional block, where the fourth to-be-adjusted three-dimensional block is another to-be-adjusted three-dimensional block other than the third to-be-adjusted three-dimensional block in the two to-be-adjusted three-dimensional blocks, and/or determine a gap distance indicated by the block gap data, control the third to-be-adjusted three-dimensional block to extend the length indicated by the gap distance to the fourth to-be-adjusted three-dimensional block or control the fourth to-be-adjusted three-dimensional block to extend the length indicated by the gap distance to the third to-be-adjusted three-dimensional block.
According to a third aspect of the present application there is provided a computer device comprising a memory storing a computer program and a processor implementing the steps of the method of the first aspect described above when the computer program is executed by the processor
According to a fourth aspect of the present application there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method of the first aspect described above.
By means of the technical scheme, the map generation method, the map generation device, the computer equipment and the computer readable storage medium are used for determining the initial three-dimensional block according to the input target generation style when a request for map generation is detected, selecting the available spliced three-dimensional block according to the initial extension channel of the initial three-dimensional block, connecting the connectable extension channels of the same channel type of different spliced three-dimensional blocks, realizing the splicing of the three-dimensional blocks, adjusting the splicing position generated by the splicing, generating a target map, and combining a large number of different maps under the condition of a small number of three-dimensional block resources by adopting the scheme of modularly processing the map, thereby reducing the map generation cost, saving the development period and avoiding occupying a large number of storage resources.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
The embodiment of the application provides a map generation method, as shown in fig. 1, which comprises the following steps:
101. when the request for map generation is detected, determining a starting three-dimensional land block according to the set target generation style.
102. And determining the selected initial extension channel on the initial three-dimensional land block, inquiring at least one spliced three-dimensional land block based on the initial extension channel, wherein the at least one spliced three-dimensional land block accords with the target generation style and has a connectable extension channel matched with the initial extension channel.
103. And establishing a connection relation between the initial extension channel and the connectable extension channel, and splicing the initial three-dimensional land block and at least one spliced three-dimensional land block.
104. Determining a splicing position generated by splicing the initial three-dimensional land block and at least one spliced three-dimensional land block, and counting splicing parameters of the splicing position, wherein the splicing parameters at least comprise land block thickness differences and land block gap data.
105. And adjusting the two three-dimensional plots to be adjusted at the joint according to the difference of the thicknesses of the plots in the vertical direction, and adjusting the two three-dimensional plots to be adjusted in the horizontal direction according to the gap data of the plots to generate a target map.
According to the method provided by the embodiment of the application, when the request for generating the map is detected, the initial three-dimensional land block is determined according to the input target generation style, the available spliced three-dimensional land block is selected according to the initial extension channel of the initial three-dimensional land block, the connectable extension channels of the same channel type of different spliced three-dimensional land blocks are connected, the splicing of the three-dimensional land blocks is realized, the splicing position generated by the splicing is adjusted, the target map is generated, a large number of complete maps are not required to be manufactured by developers, a large number of different maps can be combined under the condition of a small number of three-dimensional land block resources by adopting the scheme of modularly processing the maps, the map manufacturing cost is reduced, the development period is saved, and a large number of storage resources are avoided.
The embodiment of the application provides a map generation method, as shown in fig. 2A, which comprises the following steps:
201. when the request for map generation is detected, determining a starting three-dimensional land block according to the set target generation style.
In many games on the market at present, a large number of scene maps are often required to be used as carriers for carrying the game play methods in the level of the same chapter, and a developer usually makes a plurality of complete maps based on a certain set generation style to recycle the maps or adopts a purely random mode to select the map of each level. The applicant has appreciated that the creation of multiple maps to avoid monotonicity of the checkpoints can result in the checkpoint being too costly to map, and the large amount of map data can make the game installation package too bulky. The map of each level is selected in a purely random manner and is generally applied to 2D (2-dimensional) games, and considering that 3D (3-dimensional) games are mostly body-tracking lenses, immersion type game experience is more focused, and the system has more complex environments. If a purely random mode is adopted for the 3D game, the problems that the visual field of the 3D game is blocked, the light source is difficult to control, the aesthetic feeling of the game scene is lost and the like are caused. In addition, for games running on mobile devices such as mobile phones and tablet boards, the route and interest of the level are very important parts, and the level needs to be planned and designed in the game making stage, but the planning and design cannot be performed in a purely random manner, so that it is difficult to generate a map with clear route and strong interest. Therefore, the invention provides a map generation method, a plurality of incomplete preset three-dimensional plots with different generation styles are preset, and one or more connectable extension channels are arranged in each preset three-dimensional plot. When a request for generating a map is detected, a usable spliced three-dimensional land block is selected according to an input generation style, and the same channel type of the different spliced three-dimensional land blocks is connected according to the channel type, so that the spliced three-dimensional land block can be spliced to generate a checkpoint map, a developer does not need to manufacture a large number of finished maps, a large number of different maps can be combined under the condition of a small number of three-dimensional land block resources by adopting a scheme of modularly processing the maps, the map manufacturing cost is reduced, the development period is saved, the boring feeling caused by repeated maps is avoided, the game novelty is improved, the game playability is improved, and the method is more suitable for games running in mobile equipment.
In order to realize the technical scheme of the application, a developer can set a plurality of preset three-dimensional plots in a development tool in advance, and set the preset three-dimensional plots into different generation styles, namely Style (Style). The Style of the preset three-dimensional land block under the same Style is unified, and the view, the route and the layout in the same module are controllable and idealizable by using a modularized map. For example, referring to FIG. 2B, three preset three-dimensional plots ①、② and ③ may be included under Style 1. And three preset three-dimensional plots ④、⑤ and ⑥ may be included under Style 2. When the request for map generation is detected, a target generation style set at the time of the request for map generation is acquired, and based on the target generation style, which preset three-dimensional land is to be used as the initial three-dimensional land is determined. First, a target generation style set when a map generation request is made is determined, and a plurality of preset three-dimensional plots corresponding to the target generation style are acquired. Since which style of map is desired to be generated has been set when a map generation request is made, and the preset three-dimensional plots of other styles are not consistent with the original purpose of the map generation request, it is necessary to acquire a plurality of preset three-dimensional plots corresponding to the target generation style, and to determine the selected preset three-dimensional plots among the plurality of preset three-dimensional plots. Since only one preset three-dimensional plot is selected when the map generation process is not started, the preset three-dimensional plot currently selected can be used as a starting point of splicing, the map attribute of the preset three-dimensional plot selected is set as a starting attribute, and the preset three-dimensional plot after setting is used as the starting three-dimensional plot.
It should be noted that, the process of stitching the preset three-dimensional land to generate the map may be performed during the game making stage, so that a developer does not need to prepare a large number of complete maps. Or can also be executed in the running process of the game, so that a large number of maps in different modes can be generated only by carrying the preset three-dimensional plots in the installation package of the game, thereby reducing the pressure of developers and reducing the volume of the installation package of the game. The application does not specifically limit when the splicing of the preset three-dimensional land is performed.
202. And determining the selected initial extension channel on the initial three-dimensional land block, and inquiring at least one spliced three-dimensional land block based on the initial extension channel.
In the embodiment of the application, each preset three-dimensional land block is actually provided with 1 or more defined extension channels, the channel type of each extension channel, namely PathType (path type), is different, and only two identical PathType are allowed to be spliced, so that the splicing sense of the generated target map is reduced. With continued reference to FIG. 2B, for three predetermined three-dimensional plots under Style1, one extension channel is provided in ①, pathType is PATHTYPEA, one extension channel is provided in ②, pathType is PATHTYPEA, and two extension channels are provided in ③, pathType of each extension channel being PATHTYPEA. For three preset three-dimensional plots under Style2, three extension channels are arranged in ④, the PathType of the extension channels are PATHTYPEA and PathTypeB respectively, two extension channels are arranged in ⑤, the PathType of the extension channels are PATHTYPEA and PathTypeB respectively, and two extension channels are arranged in ⑥, and the PathType of the extension channels are PATHTYPEA and PathTypeB respectively. Therefore, the selected extension channel needs to be determined on the determined initial three-dimensional land block as an initial extension channel, the initial extension channel is started, and the next spliced preset three-dimensional land block is determined according to the channel type of the initial extension channel, so that the preset three-dimensional land block is spliced, and finally the target map is obtained.
Since only two extension channels of the same channel type can be spliced, the preset three-dimensional land block without the extension channel of the same channel type as the initial extension channel is not considered, at least one spliceable three-dimensional land block is queried based on the initial extension channel, so that the at least one spliceable three-dimensional land block accords with the target generation style and a connectable extension channel matched with the initial extension channel exists. Specifically, when searching at least one three-dimensional block capable of being spliced, firstly, at least one candidate preset three-dimensional block is obtained from a plurality of preset three-dimensional blocks corresponding to a target generation style, and the at least one candidate preset three-dimensional block is a preset three-dimensional block except for a starting three-dimensional block in the plurality of preset three-dimensional blocks. And then determining the initial channel type of the initial extension channel, and inquiring the channel type corresponding to the extension channel included in the candidate preset three-dimensional plots for each candidate preset three-dimensional plot in at least one candidate preset three-dimensional plot. On the one hand, when the query determines that the candidate preset three-dimensional land block comprises the connectable extending channel with the channel type consistent with the initial channel type, the candidate preset three-dimensional land block is indicated to be spliced with the initial three-dimensional land block and can be used as an option for subsequent splicing, so that the candidate preset three-dimensional land block is used as the spliced three-dimensional land block, and the query is continuously performed on at least one candidate preset three-dimensional land block until the query of at least one candidate preset three-dimensional land block is completed, and at least one spliced three-dimensional land block can be obtained. And on the other hand, when the query determines that the candidate preset three-dimensional land block does not comprise the connectable extending channel with the channel type consistent with the initial channel type, the candidate preset three-dimensional land block is skipped in the map generation process, and the query is continuously performed on at least one candidate preset three-dimensional land block until the query of at least one candidate preset three-dimensional land block is completed, so that at least one spliced three-dimensional land block is obtained.
It should be noted that the process of querying at least one of the three-dimensional plots can also be completed by a development tool. When the initial extension channel is selected, the development tool activates the initial extension channel, and queries at least one spliced three-dimensional land block with the connectable extension channel matched with the initial extension channel to directly extract.
203. And establishing a connection relation between the initial extension channel and the connectable extension channel, and splicing the initial three-dimensional land block and at least one spliced three-dimensional land block.
In the embodiment of the application, after at least one three-dimensional block capable of being spliced is determined, a target three-dimensional block capable of being spliced selected by a triggering operation is determined in the at least one three-dimensional block capable of being spliced according to the triggering operation detected currently, a splicing process of the target three-dimensional block capable of being spliced is started, and the initial three-dimensional block and the target three-dimensional block capable of being spliced are magnetically spliced. When in splicing, a target connectable extension channel with the channel type consistent with that of the initial extension channel is determined in the target-spliced three-dimensional land block. And then, the target-spliced three-dimensional land block is moved, the target-connectable extension channel is communicated with the initial extension channel, and the target-spliced three-dimensional land block is controlled to be spliced with the initial three-dimensional land block, so that the magnetic force splicing of the initial three-dimensional land block and the target-spliced three-dimensional land block is completed. For example, referring to fig. 2C, if the same channel type between the starting three-dimensional plot and the target spliceable three-dimensional plot is PATHTYPEA, the starting extension channel indicated by PATHTYPEA in the starting three-dimensional plot is connected to the target connectible extension channel indicated by PATHTYPEA in the target spliceable three-dimensional plot, so as to obtain the splicing result shown in fig. 2C. And then, continuing to detect the next triggering operation and executing the splicing of the three-dimensional block which is selected by the next triggering operation, namely continuing to splice the three-dimensional block which is selected later until the triggering operation which is detected to occur sets the map attribute of the selected three-dimensional block which is spliced as a termination attribute.
In the practical application process, sometimes, more than one connectable extension channel with the same channel type as the initial extension channel may exist in some preset three-dimensional plots, and at this time, the application supports the rotation replacement of the preset three-dimensional plots, and the desired connectable extension channel can be selected for splicing.
In addition, in the present application, the map attributes include a "start attribute" and a "end attribute", the preset three-dimensional plot whose map attribute is set to the "start attribute" is a start three-dimensional plot, the preset three-dimensional plot whose map attribute is set to the "end attribute" is an end three-dimensional plot, and when both map attributes are defined, it is indicated that the stitching of the three-dimensional plots has been completed.
It should be noted that, after the three-dimensional plot is spliced, because there is a situation that there is likely to be an overlap between the spliced three-dimensional plots, for example, referring to fig. 2D, an overlap occurs between the preset three-dimensional plot ① and the preset three-dimensional plot ② in fig. 2D, and the overlapped portion is a diagonal filling portion, where the situation does not conform to the standard of map making, and the map generation cannot be applied, so when the target spliceable three-dimensional plot and the initial three-dimensional plot are spliced, it is necessary to detect whether there is an overlap portion after the target spliceable three-dimensional plot and the initial three-dimensional plot are spliced. When the existence of the overlapped part is detected, a production failure reminder is generated and displayed. And when no overlapping part is detected, continuing to detect the next triggering operation, executing the splicing of the three-dimensional land block which is selected by the next triggering operation, and detecting whether the overlapping part exists after the splicing is completed. The detection process is to complete the splicing of the three-dimensional land parcels once and detect whether the parcels overlap once, so that the follow-up ineffective splicing work can be avoided. In the practical application process, whether the overlapped part exists or not can also be detected after the whole splicing process is finished, and if the overlapped part exists, a manufacturing failure prompt is generated and displayed. And if there is no overlapping portion, the splicing operation is ended, thereby reducing the number of times of detecting the overlapping. The timing of detecting whether or not overlapping occurs is not particularly limited in the present application.
204. Determining a splicing position generated by splicing the initial three-dimensional land block and at least one spliced three-dimensional land block, and counting splicing parameters of the splicing position.
In the embodiment of the application, because the three-dimensional land parcels are actually used for indicating the land and are three-dimensional, the three-dimensional land parcels have a three-dimensional boundary, and gaps or height differences are likely to occur when parcels are spliced, the splice positions generated by splicing the initial three-dimensional land parcels and at least one spliced three-dimensional land parcels are required to be determined, the splicing parameters of the splice positions are counted, and then the three-dimensional land parcels to be spliced are adjusted according to the splicing parameters, so that splicing marks among the three-dimensional land parcels are difficult to perceive, and the attractive and natural target map generated by splicing is ensured. The splicing parameters at least comprise land thickness differences and land gap data. The land block thickness difference is used for indicating the height difference between two three-dimensional land blocks, and can be used for subsequent adjustment operation of the height of the three-dimensional land blocks, so that the extinction operation of the land blocks is realized, and the spliced part is leveled. The plot gap data is used for indicating how large the gap is between two three-dimensional plots, and can be used for extending the three-dimensional plots subsequently to realize the growth operation of the plots.
205. And adjusting the two three-dimensional plots to be adjusted at the joint according to the difference of the thicknesses of the plots in the vertical direction, and adjusting the two three-dimensional plots to be adjusted in the horizontal direction according to the gap data of the plots to generate a target map.
In the embodiment of the application, after the splicing parameters are determined, two three-dimensional plots to be adjusted at the splicing position are adjusted according to the splicing parameters. The thickness difference of the plots in the splicing parameters can be used for adjusting the two three-dimensional plots to be adjusted in the vertical direction, and specifically, the first three-dimensional plot to be adjusted and the second three-dimensional plot to be adjusted can be determined in the two three-dimensional plots to be adjusted, wherein the thickness of the plots of the first three-dimensional plot to be adjusted is larger than that of the plots of the second three-dimensional plot to be adjusted. And reducing the land block thickness of the first three-dimensional land block to be adjusted by adopting the land block thickness difference, and controlling the land block surfaces of the first three-dimensional land block to be adjusted and the second three-dimensional land block to be adjusted to be in the same horizontal plane. Or increasing the land thickness of the second three-dimensional land to be adjusted by adopting the land thickness difference, and controlling the land surfaces of the first three-dimensional land to be adjusted and the second three-dimensional land to be adjusted to be in the same horizontal plane. This process is also known as the three-dimensional plot extinction operation.
The plot gap data in the splicing parameters can be used for adjusting the two three-dimensional plots to be adjusted in the horizontal direction, and particularly when the plot gap data indicates that a third three-dimensional plot to be adjusted with a curved boundary exists in the two three-dimensional plots to be adjusted, the boundary of the third plot to be adjusted is stretched, and the boundary of the third plot to be adjusted is controlled to be matched with the boundary of the fourth three-dimensional plot to be adjusted. The fourth three-dimensional land block to be adjusted is another three-dimensional land block to be adjusted except the third three-dimensional land block to be adjusted in the two three-dimensional land blocks to be adjusted, namely, the three-dimensional land block is stretched, the boundary of the three-dimensional land block is bent, the gap at the spliced position is eliminated, the two three-dimensional land blocks are matched, and the process is the bending operation of the three-dimensional land block. Or the gap distance indicated by the block gap data can be determined, and the length of the third to-be-adjusted three-dimensional block extending gap distance indication to the fourth to-be-adjusted three-dimensional block or the length of the fourth to-be-adjusted three-dimensional block extending gap distance indication to the third to-be-adjusted three-dimensional block is controlled. The three-dimensional land block growth is controlled, so that two three-dimensional land blocks are connected, gaps at the spliced positions disappear, the two three-dimensional land blocks are matched, and the process is the growth operation of the three-dimensional land block. In addition, in order to enable the generated map to be closer to a real scene, a plurality of growing points capable of protruding are arranged on the upper surface and the lower surface of the three-dimensional land, and an outline curve of the growing points is preset. When the three-dimensional land is adjusted, the growth points are controlled to make the growth of the protrusions according to the set profile curve, and the process also belongs to the growth operation of the three-dimensional land. For example, a three-dimensional plot deployed with a bridge may generate ice cones or stones protruding below the bridge through these growth points.
206. And generating a map navigation grid of the target map, determining at least one module splicing position in the map navigation network, and activating and communicating the at least one module splicing position.
In the embodiment of the application, the currently generated target map is in a modularized splicing mode, and the mode of drawing the walking surface is different from that of the traditional complete map, so that the map navigation grid of the target map needs to be dynamically generated based on a program in a development tool, and the game character can walk and seek in the target map more smoothly. Further, the extending channel of each preset three-dimensional land block is in a closed state by default and needs to be activated to enable the character to normally pass, so that after the map navigation grid of the target map is generated, at least one module splicing position is determined in the map navigation network, and at least one module splicing position is activated and communicated. The at least one module splicing position is generated by splicing three-dimensional plots, namely the connecting position of the extension channel and the extension channel, and the attribute of the extension channel is set to be in an activated state when the module is activated.
207. And carrying out illumination treatment on the map navigation grids, adding illumination into the map navigation grids, and displaying the added map navigation grids.
In the embodiment of the application, as the target map is generated in a splicing way, a splicing part exists between the modules, and in order to ensure that the splicing part has no seamless feel, the map navigation grid is subjected to illumination treatment in a combined light way, illumination is added in the map navigation grid, and the added map navigation grid is displayed. Specifically, for at least one module splice in the map navigation network, performing illumination treatment on the at least one module splice based on the point light mode, and adding illumination for the at least one module splice. It should be noted that the specific parameters of the spot light mode may be determined according to the channel types of the two extension channels at the splicing position of the modules. And for a module central area in the map navigation grid, acquiring preset illumination information, rendering the module central area by adopting the preset illumination information, and adding illumination for the module central area, wherein the module central area is a central area of a starting three-dimensional land block and at least one spliced three-dimensional land block. In the development tool, the baking treatment scheme of the development tool can be directly adopted for the central area of the module to carry out treatment, so that the aesthetic effect in the scene of the map navigation grid is ensured.
In summary, the map generation method of the present application includes the following steps:
Referring to fig. 2E, a target generation style is set, a starting three-dimensional plot is selected according to the target generation style, a starting extension channel is selected on the starting three-dimensional plot, and stitching is performed in the direction indicated by the starting extension channel. And then, displaying all the spliced three-dimensional plots with the same channel type as the initial extension channel, determining the selected spliced three-dimensional plots, and splicing the initial three-dimensional plots with the spliced three-dimensional plots. Detecting whether overlapping occurs or not, reminding if overlapping occurs, and continuing the splicing operation of other selected three-dimensional plots until detecting that the map attribute of the three-dimensional plots can be spliced is set as the termination attribute. At this time, if no overlap occurs, the splice generated by the splice is adjusted to obtain the target map, and the map navigation grid of the target map is generated and the map data is derived.
According to the method provided by the embodiment of the application, when the request for generating the map is detected, the initial three-dimensional land block is determined according to the input target generation style, the available spliced three-dimensional land block is selected according to the initial extension channel of the initial three-dimensional land block, the connectable extension channels of the same channel type of different spliced three-dimensional land blocks are connected, the splicing of the three-dimensional land blocks is realized, the splicing position generated by the splicing is adjusted, the target map is generated, a large number of complete maps are not required to be manufactured by developers, a large number of different maps can be combined under the condition of a small number of three-dimensional land block resources by adopting the scheme of modularly processing the maps, the map manufacturing cost is reduced, the development period is saved, and a large number of storage resources are avoided.
Further, as a specific implementation of the method shown in fig. 1, an embodiment of the present application provides a map generating apparatus, as shown in fig. 3A, where the apparatus includes a determining module 301, a querying module 302, a stitching module 303, a statistics module 304, and an adjusting module 305.
The determining module 301 is configured to determine, when a request for map generation is detected, a starting three-dimensional plot according to a set target generation style;
the query module 302 is configured to determine a selected initial extension channel on the initial three-dimensional plot, query at least one combinable three-dimensional plot based on the initial extension channel, where the at least one combinable three-dimensional plot conforms to the target generation style and has a connectable extension channel matched with the initial extension channel;
The splicing module 303 is configured to establish a connection relationship between the initial extension channel and the connectable extension channel, and splice the initial three-dimensional plot and the at least one spliceable three-dimensional plot;
The statistics module 304 is configured to determine a splice generated by splicing the initial three-dimensional plot and the at least one three-dimensional plot, and count splice parameters of the splice, where the splice parameters at least include a plot thickness difference and plot gap data;
The adjustment module 305 is configured to adjust two three-dimensional plots to be adjusted, which generate the spliced portion, in a vertical direction according to the plot thickness difference, and adjust the two three-dimensional plots to be adjusted in a horizontal direction according to the plot gap data, so as to generate a target map.
In a specific application scenario, as shown in fig. 3B, the determining module 301 includes an acquiring unit 3011, a determining unit 3012, and a setting unit 3013.
The acquiring unit 3011 is configured to determine the target generation style set when a map generation is requested, and acquire a plurality of preset three-dimensional plots corresponding to the target generation style;
The determining unit 3012 is configured to determine a selected preset three-dimensional plot from the plurality of preset three-dimensional plots;
The setting unit 3013 is configured to set a map attribute of the selected preset three-dimensional block as a start attribute, and set the preset three-dimensional block as the start three-dimensional block.
In a specific application scenario, as shown in fig. 3C, the query module 302 includes an acquisition unit 3021, a first determination unit 3022, a query unit 3023, and a second determination unit 3024.
The obtaining unit 3021 is configured to obtain at least one candidate preset three-dimensional block from a plurality of preset three-dimensional blocks corresponding to the target generation style, where the at least one candidate preset three-dimensional block is a preset three-dimensional block other than the initial three-dimensional block from the plurality of preset three-dimensional blocks;
The first determining unit 3022 is configured to determine a start channel type of the start extension channel;
The querying unit 3023 is configured to query, for each candidate preset three-dimensional plot of the at least one candidate preset three-dimensional plot, a channel type corresponding to an extension channel included in the candidate preset three-dimensional plot;
The second determining unit 3024 is configured to, when the query determines that the candidate preset three-dimensional plot includes a connectable extension channel having a channel type consistent with the initial channel type, use the candidate preset three-dimensional plot as the three-dimensional plot capable of being spliced, continue querying the at least one candidate preset three-dimensional plot until the at least one candidate preset three-dimensional plot is queried, and obtain the at least one three-dimensional plot capable of being spliced;
The query unit 3023 is further configured to skip the candidate preset three-dimensional plot when the query determines that the candidate preset three-dimensional plot does not include a connectable extension channel having a channel type consistent with the initial channel type, and continue to query the at least one candidate preset three-dimensional plot until the at least one candidate preset three-dimensional plot is queried, so as to obtain the at least one foldable three-dimensional plot.
In a specific application scenario, as shown in fig. 3D, the splicing module 303 includes a first detecting unit 3031, a determining unit 3032 and a control unit 3033.
The first detecting unit 3031 is configured to detect a triggering operation, and determine a target foldable three-dimensional plot selected by the triggering operation in the at least one foldable three-dimensional plot;
The determining unit 3032 is configured to determine, in the target three-dimensional block that can be spliced, a connectable extension channel with a channel type consistent with the initial extension channel;
The control unit 3033 is configured to move the target spliceable three-dimensional plot, communicate the connectable extension channel with the initial extension channel, and control the target spliceable three-dimensional plot to splice with the initial three-dimensional plot;
The first detecting unit 3031 is further configured to continue detecting a next triggering operation and performing stitching of the three-dimensional parcel selected by the next triggering operation until the triggering operation is detected to set the map attribute of the selected three-dimensional parcel as the termination attribute.
In a specific application scenario, as shown in fig. 3E, the splicing module 303 further includes a second detecting unit 3034 and a generating unit 3035.
The second detecting unit 3034 is configured to detect whether an overlapping portion exists after the target spliceable three-dimensional plot and the initial three-dimensional plot are spliced;
the generating unit 3035 is configured to generate and display a production failure reminder when detecting that an overlapping portion exists;
The second detecting unit 3034 is further configured to, when detecting that no overlapping portion exists, continue to detect a next triggering operation, execute the splicing of the three-dimensional block that is selected by the next triggering operation, and detect whether the overlapping portion exists after the splicing is completed.
In a specific application scenario, as shown in fig. 3F, the apparatus further includes a generating module 306, a processing module 307, and a displaying module 308.
The generating module 306 is configured to generate a map navigation grid of the target map, determine at least one module splice in the map navigation network, and perform activation communication on the at least one module splice, where the at least one module splice is generated by splicing three-dimensional plots;
The processing module 307 is configured to perform illumination processing on the map navigation grid, and add illumination to the map navigation grid;
The display module 308 is configured to display the map navigation grid after the map navigation grid is added.
In a specific application scenario, the processing module 307 is configured to perform illumination processing on the at least one module splicing position in the map navigation network based on a point light mode, increase illumination for the at least one module splicing position, acquire preset illumination information for a module center region in the map navigation grid, render the module center region with the preset illumination information, increase illumination for the module center region, and the module center region is a center region of the starting three-dimensional plot and the at least one spliceable three-dimensional plot.
In a specific application scenario, the adjustment module 305 is configured to determine a first three-dimensional plot to be adjusted and a second three-dimensional plot to be adjusted in the two three-dimensional plots to be adjusted, reduce the plot thickness of the first three-dimensional plot to be adjusted by using the plot thickness difference, and control the plot surfaces of the first three-dimensional plot to be adjusted and the second three-dimensional plot to be adjusted to be in the same horizontal plane, or increase the plot thickness of the second three-dimensional plot to be adjusted by using the plot thickness difference, and control the plot surfaces of the first three-dimensional plot to be adjusted and the second three-dimensional plot to be in the same horizontal plane, where the plot thickness of the first three-dimensional plot to be adjusted is greater than the plot thickness of the second three-dimensional plot to be adjusted.
In a specific application scenario, the adjustment module 305 is configured to stretch a boundary of a third to-be-adjusted three-dimensional block, when the block gap data indicates that the third to-be-adjusted three-dimensional block with a curved boundary exists in the two to-be-adjusted three-dimensional blocks, control the boundary of the third to-be-adjusted three-dimensional block to match with a boundary of a fourth to-be-adjusted three-dimensional block, where the fourth to-be-adjusted three-dimensional block is another to-be-adjusted three-dimensional block other than the third to-be-adjusted three-dimensional block in the two to-be-adjusted three-dimensional blocks, and/or determine a gap distance indicated by the block gap data, and control the third to-be-adjusted three-dimensional block to extend to the fourth to-be-adjusted three-dimensional block by the length indicated by the gap distance or control the fourth to-be-adjusted three-dimensional block to extend to the third to-be-adjusted three-dimensional block by the length indicated by the gap distance.
When the device provided by the embodiment of the application detects that a map is generated, the initial three-dimensional land block is determined according to the input target generation style, the available spliced three-dimensional land block is selected according to the initial extension channel of the initial three-dimensional land block, the connectable extension channels of the same channel type of different spliced three-dimensional land blocks are connected, the splicing of the three-dimensional land blocks is realized, the splicing position generated by the splicing is adjusted, the target map is generated, a large number of complete maps are not required to be manufactured by developers, a large number of different maps can be combined under the condition of a small number of three-dimensional land block resources by adopting the scheme of modularly processing the maps, the map manufacturing cost is reduced, the development period is saved, and a large number of storage resources are avoided.
It should be noted that, for other corresponding descriptions of each functional unit related to the map generating apparatus provided by the embodiment of the present application, reference may be made to corresponding descriptions in fig. 1 and fig. 2A, and no further description is given here.
In an exemplary embodiment, referring to fig. 4, there is further provided a device 400 including a communication bus, a processor, a memory, and a communication interface, and may further include an input-output interface, and a display device, wherein the functional units may communicate with each other via the bus. The memory stores a computer program, and a processor executes the program stored in the memory to perform the map generation method in the above embodiment.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the map generation method.
From the above description of the embodiments, it will be clear to those skilled in the art that the present application may be implemented in hardware, or may be implemented by means of software plus necessary general hardware platforms. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective implementation scenario of the present application.
Those skilled in the art will appreciate that the drawing is merely a schematic illustration of a preferred implementation scenario and that the modules or flows in the drawing are not necessarily required to practice the application.
Those skilled in the art will appreciate that modules in an apparatus in an implementation scenario may be distributed in an apparatus in an implementation scenario according to an implementation scenario description, or that corresponding changes may be located in one or more apparatuses different from the implementation scenario. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above-mentioned inventive sequence numbers are merely for description and do not represent advantages or disadvantages of the implementation scenario.
The foregoing disclosure is merely illustrative of some embodiments of the application, and the application is not limited thereto, as modifications may be made by those skilled in the art without departing from the scope of the application.