CN109718550B - Drawing method and terminal for multi-object-block splicing body in game map - Google Patents

Drawing method and terminal for multi-object-block splicing body in game map Download PDF

Info

Publication number
CN109718550B
CN109718550B CN201811640173.4A CN201811640173A CN109718550B CN 109718550 B CN109718550 B CN 109718550B CN 201811640173 A CN201811640173 A CN 201811640173A CN 109718550 B CN109718550 B CN 109718550B
Authority
CN
China
Prior art keywords
block
object block
point
blocks
splicing
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
CN201811640173.4A
Other languages
Chinese (zh)
Other versions
CN109718550A (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.)
Fujian Tianqing Online Interactive Technology Co Ltd
Original Assignee
Fujian Tianqing Online Interactive Technology 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 Fujian Tianqing Online Interactive Technology Co Ltd filed Critical Fujian Tianqing Online Interactive Technology Co Ltd
Priority to CN201811640173.4A priority Critical patent/CN109718550B/en
Publication of CN109718550A publication Critical patent/CN109718550A/en
Application granted granted Critical
Publication of CN109718550B publication Critical patent/CN109718550B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a drawing method and a terminal of a multi-object-block spliced body in a game map, wherein a generated object-block resource set comprising various types of object blocks is led in, a starting point and an ending point of the multi-object-block spliced body to be drawn are received, matched object blocks are extracted from the object-block resource set and filled between the starting point and the ending point for splicing, the spliced object blocks are recombined and adjusted, and the multi-object-block spliced body is drawn.

Description

Drawing method and terminal for multi-object-block splicing body in game map
Technical Field
The invention relates to the technical field of game map drawing, in particular to a drawing method and a terminal for a multi-object-block splicing body in a game map.
Background
The game map is an indispensable part in a game, in the process of editing the game map, an editor often needs to put and operate each object or local objects, but aiming at some multi-object splicing bodies (such as cliff, high platform and the like), in order to ensure the diversity of the multi-object splicing bodies in the game map, the editor needs to repeatedly splice and adjust the multiple object blocks, so that the efficiency is low, and the process is complicated.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method and the terminal for drawing the multi-object-block spliced body in the game map are provided, so that a developer can draw the multi-object-block spliced body conveniently when the game map is manufactured, and the working efficiency is improved.
In order to solve the technical problems, the invention adopts a technical scheme that:
a method for drawing a multi-object-block splicing body in a game map comprises the following steps:
s1, generating a block resource set, wherein the block resource set comprises various types of blocks for generating the multi-block splicing body;
s2, importing the block resource set, and receiving a starting point and an end point of a multi-block splicing body to be drawn;
and S3, extracting matched blocks from the block resource set, filling the matched blocks between the starting point and the end point, splicing, recombining and adjusting the spliced blocks, and drawing the multi-block spliced body.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a terminal for drawing a multi-object splicing body in a game map comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the following steps:
s1, generating a block resource set, wherein the block resource set comprises various types of blocks for generating the multi-block splicing body;
s2, importing the block resource set, and receiving a starting point and an end point of a multi-block splicing body to be drawn;
and S3, extracting matched blocks from the block resource set, filling the matched blocks between the starting point and the end point, splicing, recombining and adjusting the spliced blocks, and drawing the multi-block spliced body.
The invention has the beneficial effects that: the method comprises the steps of receiving a starting point and an end point of a multi-object-block spliced body to be drawn by leading in a generated object-block resource set comprising various types of object blocks, extracting matched object blocks from the object-block resource set, filling the matched object blocks between the starting point and the end point, splicing, recombining and adjusting the spliced object blocks, drawing the multi-object-block spliced body, enabling developers to draw the multi-object-block spliced body conveniently when a game map is manufactured, being simple, convenient and quick, ensuring the diversity of the multi-object-block spliced body in the map, improving the working efficiency, being applicable to drawing objects formed by splicing various multi-object blocks, and being wide in application range.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for drawing a mosaic of multiple objects in a game map according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a drawing terminal of a multi-object tile mosaic in a game map according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating steps of a method for drawing cliff walls in a game map according to an embodiment of the invention;
description of reference numerals:
1. a terminal for drawing a multi-object-block splicing body in a game map; 2. a memory; 3. a processor.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
The most key concept of the invention is that the generated block resource set comprising various types of blocks is imported, matched blocks are extracted from the block resource set and filled between the starting point and the end point of the multi-block splicing body for splicing, and the spliced blocks are recombined and adjusted.
Referring to fig. 1, a method for drawing a multi-object tile mosaic in a game map includes the steps of:
s1, generating a block resource set, wherein the block resource set comprises various types of blocks for generating the multi-block splicing body;
s2, importing the block resource set, and receiving a starting point and an end point of a multi-block splicing body to be drawn;
and S3, extracting matched blocks from the block resource set, filling the matched blocks between the starting point and the end point, splicing, recombining and adjusting the spliced blocks, and drawing the multi-block spliced body.
From the above description, the beneficial effects of the present invention are: the method comprises the steps of receiving a starting point and an end point of a multi-object-block spliced body to be drawn by leading in a generated object-block resource set comprising various types of object blocks, extracting matched object blocks from the object-block resource set, filling the matched object blocks between the starting point and the end point, splicing, recombining and adjusting the spliced object blocks, drawing the multi-object-block spliced body, enabling developers to draw the multi-object-block spliced body conveniently when a game map is manufactured, being simple, convenient and quick, ensuring the diversity of the multi-object-block spliced body in the map, improving the working efficiency, being applicable to drawing objects formed by splicing various multi-object blocks, and being wide in application range.
Further, the step S1 further includes:
generating a configuration file of each block in the block resource set, wherein the configuration file comprises the type of the block;
the step S2 further includes: importing a configuration file of each block in the block resource set;
the step S3 of extracting and splicing the matched chunks from the chunk resource set between the starting point and the ending point includes:
and extracting matched blocks from the block resource set according to the configuration file, filling the matched blocks between the starting point and the ending point, and splicing.
According to the description, the type of each object block can be known through the configuration file of the object block, the object blocks are conveniently matched during subsequent splicing, and convenience is improved.
Further, the configuration file further comprises a connection point of the object block and a floating range of the connection point;
the steps between S2 and S3 further include:
determining offset coordinates and direction data of each object block according to the connection point of the object block in the configuration file of each object block, wherein the offset coordinates comprise transverse offset coordinates and longitudinal offset coordinates;
the splicing in the step S3 includes transverse splicing and longitudinal splicing;
the transverse splicing comprises:
s301, judging the direction of the current longitudinal traveling path according to the difference value of the longitudinal coordinates of the starting point and the ending point;
s302, selecting the object block of which the direction data meets the direction of the current longitudinal traveling path from the object block resource set;
s303, adding the transverse offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
s304, accumulating the abscissa of the starting point with the offset coordinate, judging whether the accumulated abscissa of the starting point is greater than or equal to the abscissa of the ending point, and if not, returning to the step S301;
the longitudinal splicing comprises:
s305, judging the direction of the current transverse traveling path according to the transverse coordinate difference value of the starting point and the ending point;
s306, selecting the object block of which the direction data meets the direction of the current transverse traveling path from the object block resource set;
s307, adding the longitudinal offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
and S308, accumulating the vertical coordinate of the starting point with the offset coordinate, judging whether the accumulated vertical coordinate of the starting point is greater than or equal to the vertical coordinate of the ending point, and if not, returning to the step S305.
According to the description, the connection points of the object blocks are spliced transversely or longitudinally, the next piece of object blocks is spliced after the current piece of object blocks is spliced, the spliced bodies of the object blocks can be drawn quickly and conveniently, and the efficiency is improved.
Further, the step S3 of recombining and adjusting the spliced object blocks to render the multi-object-block spliced body includes:
randomly disturbing the distribution of all the spliced object blocks between the starting point and the ending point, judging whether a second object block which does not meet the requirement of the direction of the connecting point of the first object block exists or not, wherein the first object block is the last object block of the second object block during splicing, and if not, finishing the drawing of the multi-object-block spliced body;
if yes, judging whether a third object block meeting the requirement of the direction of the connecting point of the first object block exists in the subsequent object blocks spliced with the second object block, if yes, exchanging the positions of the second object block and the third object block, if not, emptying all spliced object blocks, and returning to the step S301.
According to the description, the distribution of all the spliced object blocks between the starting point and the ending point is randomly disturbed and then recombined, so that the diversity of the multi-object-block spliced body can be ensured, the workload of developers is reduced, and the problem of the penetration of the multi-object-block spliced body can be solved by detecting whether the object blocks meet the direction requirement of the connecting point or not and adjusting the object blocks when the object blocks do not meet the direction requirement of the connecting point.
Furthermore, two connecting points are arranged on each object block;
determining the offset coordinate and the direction data of the object block according to the connection point of the object block in the configuration file of each object block comprises:
determining direction data of the connecting points of the object block according to the trend of the connecting line of the two connecting points of the object block;
determining the transverse offset coordinate of the connecting point of the object block according to the difference value of the transverse coordinates of the two connecting points of the object block resource;
and determining the longitudinal offset coordinate of the connecting point of the object block according to the difference value of the two connecting points of the object block resource on the longitudinal coordinate.
It can be known from the above description that the offset coordinate and the direction data of the connection point of each object block are determined through the two connection points of each object block, so that matching and accumulation are conveniently carried out when the object blocks are spliced, and the accuracy in splicing the object blocks can be improved.
Referring to fig. 2, a terminal for drawing a multi-object tile mosaic in a game map includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
s1, generating a block resource set, wherein the block resource set comprises various types of blocks for generating the multi-block splicing body;
s2, importing the block resource set, and receiving a starting point and an end point of a multi-block splicing body to be drawn;
and S3, extracting matched blocks from the block resource set, filling the matched blocks between the starting point and the end point, splicing, recombining and adjusting the spliced blocks, and drawing the multi-block spliced body.
From the above description, the beneficial effects of the present invention are: the method comprises the steps of receiving a starting point and an end point of a multi-object-block spliced body to be drawn by leading in a generated object-block resource set comprising various types of object blocks, extracting matched object blocks from the object-block resource set, filling the matched object blocks between the starting point and the end point, splicing, recombining and adjusting the spliced object blocks, drawing the multi-object-block spliced body, enabling developers to draw the multi-object-block spliced body conveniently when a game map is manufactured, being simple, convenient and quick, ensuring the diversity of the multi-object-block spliced body in the map, improving the working efficiency, being applicable to drawing objects formed by splicing various multi-object blocks, and being wide in application range.
Further, the step S1 further includes:
generating a configuration file of each block in the block resource set, wherein the configuration file comprises the type of the block;
the step S2 further includes: importing a configuration file of each block in the block resource set;
the step S3 of extracting and splicing the matched chunks from the chunk resource set between the starting point and the ending point includes:
and extracting matched blocks from the block resource set according to the configuration file, filling the matched blocks between the starting point and the ending point, and splicing.
According to the description, the type of each object block can be known through the configuration file of the object block, the object blocks are conveniently matched during subsequent splicing, and convenience is improved.
Further, the configuration file further comprises a connection point of the object block and a floating range of the connection point;
the steps between S2 and S3 further include:
determining offset coordinates and direction data of each object block according to the connection point of the object block in the configuration file of each object block, wherein the offset coordinates comprise transverse offset coordinates and longitudinal offset coordinates;
the splicing in the step S3 includes transverse splicing and longitudinal splicing;
the transverse splicing comprises:
s301, judging the direction of the current longitudinal traveling path according to the difference value of the longitudinal coordinates of the starting point and the ending point;
s302, selecting the object block of which the direction data meets the direction of the current longitudinal traveling path from the object block resource set;
s303, adding the transverse offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
s304, accumulating the abscissa of the starting point with the offset coordinate, judging whether the accumulated abscissa of the starting point is greater than or equal to the abscissa of the ending point, and if not, returning to the step S301;
the longitudinal splicing comprises:
s305, judging the direction of the current transverse traveling path according to the transverse coordinate difference value of the starting point and the ending point;
s306, selecting the object block of which the direction data meets the direction of the current transverse traveling path from the object block resource set;
s307, adding the longitudinal offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
and S308, accumulating the vertical coordinate of the starting point with the offset coordinate, judging whether the accumulated vertical coordinate of the starting point is greater than or equal to the vertical coordinate of the ending point, and if not, returning to the step S305.
According to the description, the connection points of the object blocks are spliced transversely or longitudinally, the next piece of object blocks is spliced after the current piece of object blocks is spliced, the spliced bodies of the object blocks can be drawn quickly and conveniently, and the efficiency is improved.
Further, the step S3 of recombining and adjusting the spliced object blocks to render the multi-object-block spliced body includes:
randomly disturbing the distribution of all the spliced object blocks between the starting point and the ending point, judging whether a second object block which does not meet the requirement of the direction of the connecting point of the first object block exists or not, wherein the first object block is the last object block of the second object block during splicing, and if not, finishing the drawing of the multi-object-block spliced body;
if yes, judging whether a third object block meeting the requirement of the direction of the connecting point of the first object block exists in the subsequent object blocks spliced with the second object block, if yes, exchanging the positions of the second object block and the third object block, if not, emptying all spliced object blocks, and returning to the step S301.
According to the description, the distribution of all the spliced object blocks between the starting point and the ending point is randomly disturbed and then recombined, so that the diversity of the multi-object-block spliced body can be ensured, the workload of developers is reduced, and the problem of the penetration of the multi-object-block spliced body can be solved by detecting whether the object blocks meet the direction requirement of the connecting point or not and adjusting the object blocks when the object blocks do not meet the direction requirement of the connecting point.
Furthermore, two connecting points are arranged on each object block;
determining the offset coordinate and the direction data of the object block according to the connection point of the object block in the configuration file of each object block comprises:
determining direction data of the connecting points of the object block according to the trend of the connecting line of the two connecting points of the object block;
determining the transverse offset coordinate of the connecting point of the object block according to the difference value of the transverse coordinates of the two connecting points of the object block resource;
and determining the longitudinal offset coordinate of the connecting point of the object block according to the difference value of the two connecting points of the object block resource on the longitudinal coordinate.
It can be known from the above description that the offset coordinate and the direction data of the connection point of each object block are determined through the two connection points of each object block, so that matching and accumulation are conveniently carried out when the object blocks are spliced, and the accuracy in splicing the object blocks can be improved.
Example one
Referring to fig. 1, a method for drawing a multi-object tile mosaic in a game map includes the steps of:
s1, generating a block resource set, wherein the block resource set comprises various types of blocks for generating the multi-block splicing body;
specifically, a configuration file of each object block in the object block resource set is generated, where the configuration file includes the type of the object block, a connection point of the object block, a floating range of the connection point, and whether the object block is a special block, and after the configuration file of each object block in the object block resource set is set, the object block resource set and the configuration file thereof can be stored in a file, and the object block resource set can be reused as an object resource;
wherein there are two connection points for each object block, and there may be a certain floating range for the connection points, the floating range being based on the pixel offset range centered on the connection points;
specifically, when the art resources of the object block are manufactured, the positions suitable for setting the connection points need to be fuzzified, so that the connection points of the object block can be spliced or partially fused with other similar resources;
setting a connection point for the art resource of each object block through a configuration tool, and recording the center coordinate and the floating range of the connection point in the configuration file as the rule of the connection point, wherein the specific format is [ X-axis coordinate of the center of the connection point, Y-axis coordinate of the center of the connection point, width of the connection point range and height of the connection point range ];
the connection point is the position of a certain pixel of the object art resource;
the type of the object block can be set according to specific conditions;
s2, importing the block resource set, and receiving a starting point and an end point of a multi-block splicing body to be drawn;
specifically, the configuration file of each block in the block resource set is imported while the block resource set is imported;
reading the block resource set into a memory to generate a set of resource container data;
preprocessing in a memory, and determining offset coordinates and direction data of each object block according to a connection point of the object block in a configuration file of the object block, wherein the offset coordinates comprise transverse offset coordinates and longitudinal offset coordinates;
determining direction data of the connecting points of the object block according to the trend of the connecting line of the two connecting points of the object block;
determining the transverse offset coordinate of the connecting point of the object block according to the difference value of the transverse coordinates of the two connecting points of the object block resource;
determining a longitudinal offset coordinate of the connecting point of the object block according to a difference value of the two connecting points of the object block resource on a longitudinal coordinate;
specifically, a trend is determined according to the type of the object block, for example, when the multi-object-block connector is a cliff wall, the cliff object block tends to be connected left and right, two connection points of the cliff object block are obtained, the two connection points are distinguished left and right in the X-axis direction, an initial direction is preset, for example, the direction is uniform to the right, and then the lateral offset coordinate of the cliff object block is a difference value obtained by subtracting the lateral coordinate of the left connection point from the lateral coordinate of the right connection point;
storing the offset coordinates and the directional data of the block connection point in the resource container;
receiving a starting point of a developer on a map for drawing the multi-object splicing point, receiving a point in a mouse moving state as an end point, and circularly drawing;
and S3, extracting matched blocks from the block resource set, filling the matched blocks between the starting point and the end point, splicing, recombining and adjusting the spliced blocks, and drawing the multi-block spliced body.
Specifically, matching blocks are extracted from the block resource set according to the configuration file and filled between the starting point and the ending point for splicing, so that a system flow of single-object placement with low efficiency can be replaced;
performing stepping point splicing according to the starting point and the end point, wherein the splicing comprises transverse splicing and longitudinal splicing;
the transverse splicing comprises:
s301, judging the direction of the current longitudinal traveling path according to the difference value of the longitudinal coordinates of the starting point and the ending point;
s302, selecting the object block of which the direction data meets the direction of the current longitudinal traveling path from the object block resource set;
s303, adding the transverse offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
s304, accumulating the abscissa of the starting point with the offset coordinate, judging whether the accumulated abscissa of the starting point is greater than or equal to the abscissa of the ending point, and if not, returning to the step S301;
specifically, setting the starting point as a current point posCur, poscur.x as an abscissa of the starting point, poscur.y as an ordinate of the starting point, an ending point as posEnd, posend.x as an abscissa of the ending point, and posend.y as an ordinate of the ending point;
judging the direction of the currently required path according to the difference value Height between the posEnd.Y and the posCur.Y;
acquiring the object block meeting the current traveling direction condition from the resource container, and resetting the transverse offset coordinate of the object block connection point once, wherein the reset transverse offset coordinate is the transverse offset coordinate of the current object block plus the floating range of the object block connection point;
accumulating or subtracting the transverse offset coordinate of the object block and the transverse coordinate of the starting point according to the direction of the X axis, so that the posCur is closer to the posEnd.X in the direction of the X axis until the posCur reaches the posEnd.X in the direction of the X axis;
the object block resource set also comprises an object block of a type of universal block, wherein the object block of the type of universal block is a smaller object block, and the used scene and logic are the same as those of a common object block, so that the pos end point is not exceeded as much as possible and the pos end point is reached perfectly;
the longitudinal splicing comprises:
s305, judging the direction of the current transverse traveling path according to the transverse coordinate difference value of the starting point and the ending point;
s306, selecting the object block of which the direction data meets the direction of the current transverse traveling path from the object block resource set;
s307, adding the longitudinal offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
s308, accumulating the vertical coordinate of the starting point with the offset coordinate, judging whether the accumulated vertical coordinate of the starting point is larger than or equal to the vertical coordinate of the ending point, and if not, returning to the step S305;
randomly disturbing the distribution of all the spliced object blocks between the starting point and the ending point;
detecting and adjusting randomly distributed object blocks, and mainly processing some special blocks;
judging whether a second object block which does not meet the requirement of the direction of the connecting point of the first object block exists or not, wherein the first object block is the last object block of the second object block during splicing, and if not, finishing the drawing of the multi-object-block spliced body;
if yes, judging whether a third object block meeting the requirement of the direction of the connecting point of the first object block exists in the subsequent object blocks spliced with the second object block, if yes, exchanging the positions of the second object block and the third object block, if not, emptying all spliced object blocks, and returning to the step S301.
Example two
Referring to fig. 3, when the multi-object tile splicing body is a cliff wall, applying the method of the first embodiment to a specific scenario:
s1, generating cliff block resource sets, wherein the cliff block resource sets comprise various types of cliff blocks for generating the cliffs;
specifically, when the art is used for manufacturing resources, the positions suitable for setting the connection points are fuzzified, and the connection points of the object block can be spliced or partially fused with other similar resources;
processing cliff block resources, setting connection points of art resources of each cliff block through a configuration tool, and recording center coordinates and a floating range of the connection points in the configuration file as rules of the connection points, wherein the specific formats are [ X-axis coordinates of the center of the connection points, Y-axis coordinates of the center of the connection points, connection point range width and connection point range height ];
configuring cliff block resources, generating a configuration file of each cliff block in the cliff block resource set, wherein the configuration file comprises the type of the cliff block, a connection point of the cliff block, a floating range of the connection point and whether the cliff block is a special block, and after the configuration file of each cliff block in the cliff block resource set is set, the cliff block resource set and the configuration file thereof can be stored in the file, and the cliff block resource set can be repeatedly used as object resources;
the types of cliff blocks include an upper cliff, a lower cliff, a left corner, a right corner, a finishing block and the like, and the types can be further classified, for example, the corners are further classified into inner corners, outer corners and longitudinal stretching corners;
the longitudinal stretching corner is an aggregation of the left/right cliff wall and the upper and lower corners, is essentially the same as a common corner, is used for connecting the upper cliff and the lower cliff, and can enable the corners connecting the upper cliff and the lower cliff to be more diversified and enrich picture effects through the stretching effect of the longitudinal stretching corner;
s2, importing the cliff block resource set, and receiving a starting point and an end point of a cliff to be drawn;
specifically, the cliff block resource set and the corresponding configuration file are loaded;
reading the cliff block resource set into a memory to generate a set of resource container data;
and S3, extracting matched cliff blocks from the cliff block resource set, filling the matched cliff blocks between the starting point and the ending point, splicing, recombining and adjusting the spliced cliff blocks, and drawing the cliff.
Specifically, as with the specific steps of the first embodiment, the cliff block is filled between the starting point and the ending point and is spliced;
the object blocks with the type of corners can change the global direction and the acquisition states of the object blocks with the type of the upper cliff and the object blocks with the type of the lower cliff in the resource container, so that the effect of switching the use of the upper cliff and the lower cliff is achieved, and the use scene and logic of the object blocks are the same as those of the common object blocks;
the randomly shuffled and recombined cliff blocks are adjusted and corrected, in particular, the next connecting point of one of the cliff blocks between the starting point and the ending point, which is a special block, is allowed to be connected with the cliff block in a specific direction only, the special cliff block has a special attribute mark in the configuration file of the special cliff block, for this special property it must be ensured that the next piece to which the piece is connected must have the same tendency as the piece, which, taking the example above for a cliff, is an upward tendency if there is a piece under a known path, the next cliff piece to which it is connected must also be in an upward trend, if the next cliff piece is in a downward trend, the contents displayed by the cliff block part may be covered, which is easy to cause the threading, and at this time, the cliff block meeting the upward trend in the subsequent cliff block needs to be exchanged to complete the drawing of the cliff; and if no cliff block meeting the condition is found after traversing the subsequent cliff blocks, clearing all cliff blocks between the starting point and the ending point, and splicing again.
EXAMPLE III
Referring to fig. 2, a terminal 1 for drawing a multi-object tile mosaic in a game map includes a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3, where the processor 3 implements the steps in the first embodiment when executing the computer program.
In summary, according to the method and the terminal for drawing the multi-block mosaic in the game map provided by the invention, the starting point and the ending point of the multi-block mosaic to be drawn are received by importing the generated block resource set including various types of blocks and the configuration file of each block in the block resource set, the matched blocks are extracted from the block resource set according to the configuration file and filled between the starting point and the ending point for mosaic, the mosaic blocks are randomly disordered, then the blocks are recombined and adjusted to draw the multi-block mosaic, so that a developer can draw the multi-block mosaic conveniently when the game map is manufactured, the method and the terminal are simple, convenient and quick, the diversity of the multi-block mosaic in the map is ensured, the workload of the developer is reduced, the problem of the multi-block crossing is avoided, the mosaic working efficiency is improved, and the method and the terminal can be applied to draw objects formed by splicing various types of multi-blocks, the application range is wide.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (6)

1. A method for drawing a multi-object-block splicing body in a game map is characterized by comprising the following steps:
s1, generating a block resource set, wherein the block resource set comprises various types of blocks for generating the multi-block splicing body;
s2, importing the block resource set, and receiving a starting point and an end point of a multi-block splicing body to be drawn;
s3, extracting matched blocks from the block resource set, filling the matched blocks between the starting point and the end point, splicing, recombining and adjusting the spliced blocks, and drawing the multi-block spliced body;
the step S1 further includes:
generating a configuration file of each block in the block resource set, wherein the configuration file comprises the type of the block;
the step S2 further includes: importing a configuration file of each block in the block resource set;
the step S3 of extracting and splicing the matched chunks from the chunk resource set between the starting point and the ending point includes:
extracting matched blocks from the block resource set according to the configuration file, filling the matched blocks between the starting point and the ending point, and splicing;
the configuration file further comprises connection points of the object blocks and floating ranges of the connection points;
the steps between S2 and S3 further include:
determining offset coordinates and direction data of each object block according to the connection point of the object block in the configuration file of each object block, wherein the offset coordinates comprise transverse offset coordinates and longitudinal offset coordinates;
the splicing in the step S3 includes transverse splicing and longitudinal splicing;
the transverse splicing comprises:
s301, judging the direction of the current longitudinal traveling path according to the difference value of the longitudinal coordinates of the starting point and the ending point;
s302, selecting the object block of which the direction data meets the direction of the current longitudinal traveling path from the object block resource set;
s303, adding the transverse offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
s304, accumulating the abscissa of the starting point with the offset coordinate, judging whether the accumulated abscissa of the starting point is greater than or equal to the abscissa of the ending point, and if not, returning to the step S301;
the longitudinal splicing comprises:
s305, judging the direction of the current transverse traveling path according to the transverse coordinate difference value of the starting point and the ending point;
s306, selecting the object block of which the direction data meets the direction of the current transverse traveling path from the object block resource set;
s307, adding the longitudinal offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
and S308, accumulating the vertical coordinate of the starting point with the offset coordinate, judging whether the accumulated vertical coordinate of the starting point is greater than or equal to the vertical coordinate of the ending point, and if not, returning to the step S305.
2. The method for drawing the multi-block mosaic in the game map according to claim 1, wherein the step S3 of recombining and adjusting the mosaic blocks comprises:
randomly disturbing the distribution of all the spliced object blocks between the starting point and the ending point, judging whether a second object block which does not meet the requirement of the direction of the connecting point of the first object block exists or not, wherein the first object block is the last object block of the second object block during splicing, and if not, finishing the drawing of the multi-object-block spliced body;
if yes, judging whether a third object block meeting the requirement of the direction of the connecting point of the first object block exists in the subsequent object blocks spliced with the second object block, if yes, exchanging the positions of the second object block and the third object block, if not, emptying all spliced object blocks, and returning to the step S301.
3. The method for drawing the multi-block mosaic in the game map according to claim 1, wherein there are two connection points for each block;
determining the offset coordinate and the direction data of the object block according to the connection point of the object block in the configuration file of each object block comprises:
determining direction data of the connecting points of the object block according to the trend of the connecting line of the two connecting points of the object block;
determining the transverse offset coordinate of the connecting point of the object block according to the difference value of the transverse coordinates of the two connecting points of the object block resource;
and determining the longitudinal offset coordinate of the connecting point of the object block according to the difference value of the two connecting points of the object block resource on the longitudinal coordinate.
4. A terminal for drawing a multi-object splicing body in a game map comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, and is characterized in that the processor executes the computer program to realize the following steps:
s1, generating a block resource set, wherein the block resource set comprises various types of blocks for generating the multi-block splicing body;
s2, importing the block resource set, and receiving a starting point and an end point of a multi-block splicing body to be drawn;
s3, extracting matched blocks from the block resource set, filling the matched blocks between the starting point and the end point, splicing, recombining and adjusting the spliced blocks, and drawing the multi-block spliced body;
the step S1 further includes:
generating a configuration file of each block in the block resource set, wherein the configuration file comprises the type of the block;
the step S2 further includes: importing a configuration file of each block in the block resource set;
the step S3 of extracting and splicing the matched chunks from the chunk resource set between the starting point and the ending point includes:
extracting matched blocks from the block resource set according to the configuration file, filling the matched blocks between the starting point and the ending point, and splicing;
the configuration file further comprises connection points of the object blocks and floating ranges of the connection points;
the steps between S2 and S3 further include:
determining offset coordinates and direction data of each object block according to the connection point of the object block in the configuration file of each object block, wherein the offset coordinates comprise transverse offset coordinates and longitudinal offset coordinates;
the splicing in the step S3 includes transverse splicing and longitudinal splicing;
the transverse splicing comprises:
s301, judging the direction of the current longitudinal traveling path according to the difference value of the longitudinal coordinates of the starting point and the ending point;
s302, selecting the object block of which the direction data meets the direction of the current longitudinal traveling path from the object block resource set;
s303, adding the transverse offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
s304, accumulating the abscissa of the starting point with the offset coordinate, judging whether the accumulated abscissa of the starting point is greater than or equal to the abscissa of the ending point, and if not, returning to the step S301;
the longitudinal splicing comprises:
s305, judging the direction of the current transverse traveling path according to the transverse coordinate difference value of the starting point and the ending point;
s306, selecting the object block of which the direction data meets the direction of the current transverse traveling path from the object block resource set;
s307, adding the longitudinal offset coordinate of the object block to the floating range of the object block connecting point to obtain the offset coordinate of the object block;
and S308, accumulating the vertical coordinate of the starting point with the offset coordinate, judging whether the accumulated vertical coordinate of the starting point is greater than or equal to the vertical coordinate of the ending point, and if not, returning to the step S305.
5. The terminal for drawing the multi-block mosaic in the game map of claim 4, wherein the step S3 is to reorganize and adjust the mosaic blocks, and the drawing the multi-block mosaic comprises:
randomly disturbing the distribution of all the spliced object blocks between the starting point and the ending point, judging whether a second object block which does not meet the requirement of the direction of the connecting point of the first object block exists or not, wherein the first object block is the last object block of the second object block during splicing, and if not, finishing the drawing of the multi-object-block spliced body;
if yes, judging whether a third object block meeting the requirement of the direction of the connecting point of the first object block exists in the subsequent object blocks spliced with the second object block, if yes, exchanging the positions of the second object block and the third object block, if not, emptying all spliced object blocks, and returning to the step S301.
6. The terminal for drawing the multi-block mosaic in the game map according to claim 4, wherein there are two connection points for each block;
determining the offset coordinate and the direction data of the object block according to the connection point of the object block in the configuration file of each object block comprises:
determining direction data of the connecting points of the object block according to the trend of the connecting line of the two connecting points of the object block;
determining the transverse offset coordinate of the connecting point of the object block according to the difference value of the transverse coordinates of the two connecting points of the object block resource;
and determining the longitudinal offset coordinate of the connecting point of the object block according to the difference value of the two connecting points of the object block resource on the longitudinal coordinate.
CN201811640173.4A 2018-12-29 2018-12-29 Drawing method and terminal for multi-object-block splicing body in game map Active CN109718550B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811640173.4A CN109718550B (en) 2018-12-29 2018-12-29 Drawing method and terminal for multi-object-block splicing body in game map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811640173.4A CN109718550B (en) 2018-12-29 2018-12-29 Drawing method and terminal for multi-object-block splicing body in game map

Publications (2)

Publication Number Publication Date
CN109718550A CN109718550A (en) 2019-05-07
CN109718550B true CN109718550B (en) 2022-04-12

Family

ID=66297994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811640173.4A Active CN109718550B (en) 2018-12-29 2018-12-29 Drawing method and terminal for multi-object-block splicing body in game map

Country Status (1)

Country Link
CN (1) CN109718550B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110772790B (en) * 2019-10-23 2023-02-10 福建天晴在线互动科技有限公司 Method and system for resetting strange area of game map brush

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102194043A (en) * 2010-03-15 2011-09-21 北京乐升科技有限公司 Method for generating map image and virtual map as well as virtual map generator
CN106110655A (en) * 2016-06-22 2016-11-16 广州多益网络股份有限公司 One drawing generating method randomly and client, service end and system
CN107126702A (en) * 2017-04-20 2017-09-05 杭州游聚信息技术有限公司 A kind of generation method of 3D game Random map
KR101931644B1 (en) * 2017-09-29 2018-12-21 (주)가치교육컨설팅 Gentrification educational board game set

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102194043A (en) * 2010-03-15 2011-09-21 北京乐升科技有限公司 Method for generating map image and virtual map as well as virtual map generator
CN106110655A (en) * 2016-06-22 2016-11-16 广州多益网络股份有限公司 One drawing generating method randomly and client, service end and system
CN107126702A (en) * 2017-04-20 2017-09-05 杭州游聚信息技术有限公司 A kind of generation method of 3D game Random map
KR101931644B1 (en) * 2017-09-29 2018-12-21 (주)가치교육컨설팅 Gentrification educational board game set

Also Published As

Publication number Publication date
CN109718550A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
US9959685B2 (en) Method and system for selectively blending buildings to improve route visibility in a 3D navigation system
CN110088563B (en) Image depth calculation method, image processing device and three-dimensional measurement system
CN101727580A (en) Image processing apparatus, electronic medium, and image processing method
CN106934842B (en) Method and device for identifying closed area
CN109718550B (en) Drawing method and terminal for multi-object-block splicing body in game map
CN108564604B (en) Binocular vision stereo matching method and device based on plane constraint and triangulation
KR20180122737A (en) Road name display method, apparatus and storage medium
CN104915053A (en) Position determining method and device for interface controls
CN115014328A (en) Dynamic loading method, device, equipment and medium for grid map
EP4152205A1 (en) Data point identification method, identification device, and computer readable storage medium
US11100361B1 (en) Method and apparatus for processing feature point matching result
CN108053751B (en) Method and device for drawing direction arrow on electronic map navigation route
CN110717207A (en) Labeling method, system and storage medium for pipeline design
CN115100316A (en) Method and device for generating virtual lane line
CN104461577A (en) Flow chart display method based on HTML5 graph drawing program
CN115641436A (en) Region segmentation method and device and robot device
CN113239905B (en) Lane line simplification method and device, electronic equipment and storage medium
CN112001987B (en) Polygonal clipping method and device, electronic equipment and storage medium
CN114674340A (en) Map data processing method and device, electronic equipment and storage medium
JPH01134672A (en) Divided image processing system
CN111524446B (en) Data processing method and device, electronic equipment and readable storage medium
CN102881001A (en) Device and method for converting color image into grey scale image
CN104809430A (en) Palm region recognition method and device
CN113362421B (en) Drawing method and device of diversion area in map and electronic equipment
CN111028264A (en) Rotation robust three-dimensional object detection optimization method and device

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