The production method of map image and virtual map and virtual map generator
Technical field
The present invention relates to a kind of production method of virtual map, particularly relate to a kind of production method that is applied in the virtual map of animation web game.
Background technology
Web game (Web Game) is meant a kind of client-side program that do not need to install, and the only recreation that need can carry out by the world-wide web browser, it has can be in any place, any time, carry out the advantage of recreation on any computer, therefore, at present increasing manufacturer endeavours exploitation and the design at web game.
But because web game must be supported the instant download of data, the volume of transmitted data of web game will inevitably be restricted under same hardware system, so employed virtual map in the web game now, its scale all can only maintain certain size, could satisfy the demand that per second produces the instant download of 24 picture frames (frame).
This shows that the production method of above-mentioned existing map image and virtual map and virtual map generator use in method and structure, obviously still have inconvenience and defective, and demand urgently further being improved.In order to solve the problem of above-mentioned existence, relevant manufacturer there's no one who doesn't or isn't seeks solution painstakingly, but do not see always that for a long time suitable design finished by development, and conventional method and product fail to address the above problem, this obviously is the problem that the anxious desire of relevant dealer solves.Therefore how to found a kind of new map image and the production method and the virtual map generator of virtual map, real one of the current important research and development problem that belongs to, also becoming the current industry utmost point needs improved target.
Summary of the invention
The objective of the invention is to, a kind of production method of virtual map is provided, it can only store the topographic base piece of fixed qty, and utilizes these topographic base pieces to pile up mutually and splice the virtual map that produces the arbitrary dimension size.
Another object of the present invention is to provide a kind of production method that constitutes the map image of virtual map.
A further object of the present invention is, a kind of virtual map generator that can produce the virtual map of arbitrary dimension size is provided.
The object of the invention to solve the technical problems realizes by the following technical solutions.The production method of a kind of map image that proposes according to the present invention, be to utilize a virtual map generator to carry out, this map image is in order to constitute a virtual map, and this production method comprises following steps: most topographic base pieces of representing different terrain respectively of planting of (A) purchasing; (B) select at least two topographic base pieces; And (C) the topographic base piece of selected taking-up is piled up mutually form this map image.
The object of the invention to solve the technical problems also can be applied to the following technical measures to achieve further.
Preferably, the production method of aforesaid map image, wherein this step (C) is the topographic base piece of selected taking-up to be piled up mutually with a definite sequence form this map image.
Preferably, the production method of aforesaid map image, wherein said topographic base piece is stored in the storage element of this virtual map generator.
Preferably, the production method of aforesaid map image, wherein this step (B) is according to map instruction, choose at least two pairs should the map instruction the topographic base piece.
Preferably, the production method of aforesaid map image, wherein this map instruction is sent by an electronic installation that carries out communication by network and this virtual map generator.
The object of the invention to solve the technical problems also realizes by the following technical solutions.The production method of a kind of virtual map that proposes according to the present invention, be to be applied in a virtual map generator and one and this virtual map generator electronic installation of carrying out communication by network, this production method comprises following steps: most topographic base pieces of representing different terrain respectively of planting of (A) purchasing; (B) make this virtual map generator choose at least two topographic base pieces; (C) make this virtual map generator that the topographic base piece of selected taking-up is piled up formation one map image mutually; And (D) make this electronic installation that a majority map image is spliced to form this virtual map.
The object of the invention to solve the technical problems also can be applied to the following technical measures to achieve further.
Preferably, the production method of aforesaid virtual map, wherein this step (C) is the topographic base piece of selected taking-up to be piled up mutually with a definite sequence form this map image.
Preferably, the production method of aforesaid virtual map, wherein this production method also comprises a step (E) that is positioned between this step (C) and the step (D), make this virtual map generator that a majority map image and the instruction of this map are sent to this electronic installation, and in this step (D), this electronic installation is according to this map instruction a majority map image to be spliced to form this virtual map.
Preferably, the production method of aforesaid virtual map, wherein said topographic base piece is stored in this virtual map generator.
Preferably, the production method of aforesaid virtual map, wherein this step (B) is according to map instruction, choose at least two pairs should the map instruction the topographic base piece.
Preferably, the production method of aforesaid virtual map, wherein this map instruction is sent by an electronic installation that carries out communication by network and this virtual map generator.
The object of the invention to solve the technical problems realizes in addition more by the following technical solutions.The production method of a kind of virtual map that proposes according to the present invention, be to be applied in a virtual map generator and one and this virtual map generator electronic installation of carrying out communication by network, this production method comprises following steps: most topographic base pieces of representing different terrain respectively of planting of (A) purchasing; (B) make this virtual map generator duplicate the shown current virtual map of this electronic installation, and produce a backup map relevant with this current virtual map; (C) make this virtual map generator calculate side-play amount between this backup map and this current virtual map; (D) make this virtual map generator according to this side-play amount, choose at least two topographic base piece that should side-play amount; (E) make this virtual map generator that the topographic base piece of selected taking-up is piled up formation one map image mutually; And (F) make this electronic installation with this backup map with should be current the virtual map zone and the most individual map images that repeat be spliced to form this virtual map.
The object of the invention to solve the technical problems also can be applied to the following technical measures to achieve further.
Preferably, the production method of aforesaid virtual map, wherein this step (C) is the position coordinates according to a virtual role in this current virtual map, to calculate the side-play amount between this backup map and this current virtual map.
Preferably, the production method of aforesaid virtual map, wherein this step (C) is to calculate X-axis side-play amount and the Y-axis side-play amount that is produced when this virtual role moves.
Preferably, the production method of aforesaid virtual map, wherein this step (E) is the topographic base piece of selected taking-up to be piled up mutually with a definite sequence form this map image.
Preferably, the production method of aforesaid virtual map, wherein this production method also comprises a step (G) that is positioned between this step (E) and the step (F), make this virtual map generator that a majority map image and the instruction of this map are sent to this electronic installation, and in this step (F), this electronic installation is to cooperate according to this map instruction to show that zone and most map images that the current virtual map of this backup map and this repeats form this virtual map.
Preferably, the production method of aforesaid virtual map, wherein said topographic base piece is stored in this virtual map generator.
The object of the invention to solve the technical problems also realizes in addition by the following technical solutions.A kind of virtual map generator according to the present invention's proposition, be to be applied in a game server, in order to produce at least two map images, this map image is in order to constitute a virtual map, this virtual map generator comprises: a storage element stores most topographic base pieces of representing different terrain respectively; One control module selects at least two topographic base pieces from this storage element; And one pile up the unit, the topographic base piece of the selected taking-up of this control module piled up mutually form a map image.
The object of the invention to solve the technical problems also can be applied to the following technical measures to achieve further.
Preferably, aforesaid virtual map generator, wherein this virtual map generator also comprises one in order to receive the receiving element of map instruction, this control module is the map instruction that receives according to this receiving element, from this storage element, select at least two pairs should the map instruction the topographic base piece.
Preferably, aforesaid virtual map generator, wherein this map instruction is sent by an electronic installation that carries out communication by network and this virtual map generator.
Preferably, aforesaid virtual map generator, wherein said topographic base piece is stored in this storage element with a numerical coding respectively.
Preferably, aforesaid virtual map generator, wherein this numerical coding has a relief representation sign indicating number and a performance serial number, and this relief representation sign indicating number shows the position of landform pattern in order to represent this topographic base piece, and this performance serial number is in order to the variable condition of expression landform pattern.
Preferably, aforesaid virtual map generator, wherein this stackable unit is the topographic base piece of selected taking-up to be piled up mutually with a definite sequence form this map image.
The present invention compared with prior art has tangible advantage and beneficial effect.By technique scheme, the production method of map image of the present invention and virtual map and virtual map generator have following advantage and beneficial effect at least: the present invention can only utilize the topographic base piece that stores fixed qty, and these topographic base pieces is piled up and splice the virtual map of generation arbitrary dimension size mutually.
In sum, the production method of virtual map of the present invention, be to use a virtual map generator and one and this virtual map generator electronic installation of carrying out communication by network, this production method is virtual map generator most topographic base pieces of representing different terrain respectively of planting of need purchasing at first, then choose at least two topographic base pieces, and the topographic base piece of selected taking-up piled up mutually form a map image, by electronic installation a majority map image is spliced to form this virtual map.So can only utilize the topographic base piece that stores fixed qty, and these topographic base pieces are piled up mutually, relend by electronic installation and splice these map images to produce the virtual map of arbitrary dimension size.The present invention has obvious improvement technically, has tangible good effect, really is a new and innovative, progressive, practical new design.
Above-mentioned explanation only is the general introduction of technical solution of the present invention, for can clearer understanding technological means of the present invention, and can be implemented according to the content of instructions, and for above-mentioned and other purposes, feature and advantage of the present invention can be become apparent, below especially exemplified by preferred embodiment, and conjunction with figs., be described in detail as follows.
Description of drawings
Fig. 1 is a circuit box synoptic diagram, and the preferred embodiment of virtual map generator of the present invention is described;
Fig. 2 is a circuit box synoptic diagram, and the internal circuit square of the virtual map generator of present embodiment is described;
Fig. 3 is a topographic base, and 16 kinds of landform variable condition of topographic base piece are described, wherein the topographic base piece is example with the meadow;
Fig. 4 is a topographic base, illustrates that there are four kinds of states that show the meadow in the lower right corner and the lower left corner in the topographic base piece;
Fig. 5 is a process flow diagram, and the production method of virtual map of the present invention is described, wherein virtual role enters a purpose area from present location;
Fig. 6 is a synoptic diagram, illustrates that four topographic base pieces pile up mutually;
Fig. 7 is a synoptic diagram, illustrates that four topographic base pieces pile up the formed map image in back mutually;
Fig. 8 is a synoptic diagram, illustrates that a plurality of map images splice the back mutually and form this virtual map;
Fig. 9 is a process flow diagram, and the production method of virtual map of the present invention is described, wherein virtual role moves in areal;
Figure 10 is a synoptic diagram, illustrates when virtual role is mobile in areal, and the virtual map after this moves is made of mutually an offset area map and a repeat region map.
Embodiment
The present invention is described in detail below in conjunction with drawings and Examples:
Consult Fig. 1 and Fig. 2, preferred embodiment for virtual map generator 100 of the present invention, this virtual map generator 100 is to be applied in a game server (server) 400, this game server 400 carries out data transmission by a network 300 and an electronic installation 200 that can supply the player to carry out animation web game (Flash Web Game), virtual map generator 100 is by piling up a majority topographic base piece mutually and splicing, to produce one for the employed virtual map of animation web game.
Virtual map generator 100 comprises a storage element 1, a receiving element 2, a control module 3, and piles up unit 4, a delivery unit 6 and a computing unit 7.
Store most kinds in the storage element 1 and represent the landform numbering of the topographic base piece and the corresponding various topographic base pieces of different terrain respectively, present embodiment will be an example with land (land), meadow (grass), sand ground (sand) and four kinds of topographic base pieces of water (water), but quantity and actual kind be not as limit, the landform numbering then is a numerical code of representing various topographic base pieces respectively, for example: 00 expression land, 01 expression meadow, 10 expression sand grounds, 11 expression water.And in the present embodiment, each topographic base piece all is to be stored in the storage element 1 with one 8 bit numerical coding, and as shown in Figure 3, wherein the coding rule of topographic base piece is as follows:
The numerical coding of topographic base piece has a relief representation sign indicating number and a performance serial number, this relief representation sign indicating number is preceding (the Most Significant Bit of four highest significant position units in the numerical coding, MSB), it represents respectively whether the upper left corner, the upper right corner, the lower left corner and the lower right corner of this topographic base piece have the landform of demonstration pattern, meadow (textured part) with Fig. 3 is an example, if the numerical coding of topographic base piece is 1000XXXX, there is the demonstration meadow in the upper left corner of then representing this topographic base piece, and remainder is all blank (transparent); If the numerical coding of topographic base piece is 0110XXXX, represent that then all there is the demonstration meadow in the upper right corner of this topographic base piece and the lower left corner.That is to say, the topographic base piece of present embodiment is divided into four parts, and each part utilizes a numerical coding to represent respectively, 1 this part of expression has the landform pattern, 0 expression blank (transparent), so each topographic base piece has 16 kinds of display modes (comprising numerical coding is the full space state of 0000XXXX), certainly, the bit number of relief representation sign indicating number is many more, and the shown landform picture that comes out of topographic base piece is just approaching more true.
The performance serial number is that (Least SignificantBit, LSB), it represents 16 (24) to plant different landform manifestation modes, makes that virtual map can be more natural when showing, can not produce identical sense in back four least significant bit (LSB) units in the numerical coding.Cooperating and consult Fig. 4, is example equally with the meadow, and wherein there are four kinds of states that show the meadow in the lower right corner and the lower left corner in 00110000,00110001, the 00110010 and 00110011 expression topographic base piece.Similarly, the bit number of performance serial number is many more, and the shown landform of coming out of topographic base piece changes just many more.
Consult Fig. 5, be the production method of the performed virtual map of virtual map generator 100, suppose that at first the player carries out account number at the animation web game of present embodiment and sets, and the player can play the part of or control a virtual role after logining recreation.
Step S1, when virtual role enters one during with the present diverse purpose of location scene area (for example: virtual role enters the Plain, wilderness from cities and towns) from present location, receiving element 2 can receive map instruction that should destination district (Plain, wilderness) and be sent to control module 3.In the present embodiment, the instruction of this map by the player click in the game picture the transmission media (for example: transmission gate) send, and be sent to the receiving element 2 of virtual map generator 100 by network 300 by electronic installation 200.
Step S2, control module 3 instruct according to the map, from storage element 1, choose a plurality of to should map the topographic base piece of instruction, and with the topographic base block transfer of selected taking-up to stackable unit 4.
As above-mentioned hypothesis, the player controls virtual role and enters the Plain, wilderness from cities and towns, if the Plain, wilderness is made up of land, meadow, sand ground and water, as shown in Figure 6, then control module 3 selects land 101, meadow 102, sand ground 103 and 104 4 kinds of topographic base pieces of water from storage element 1.And, control module 3 (for example: 0011XXXX) is selecting the relief representation sign indicating number topographic base piece corresponding with the map instruction, because each topographic base piece with identical landform indication code all has 16 (24) to plant different landform manifestation mode (promptly 00110000~00111111), therefore, control module 3 can picked at random go out wherein a kind of landform manifestation mode, just picked at random go out one group of performance serial number (for example: 00110101), and with the topographic base block transfer of selected taking-up to stackable unit 4.Certainly, the quantity of control module 3 selected taking-up topographic base pieces can change along with the map instruction.
Step S3, stackable unit 4 is piled up the map image 110 of formation just like Fig. 7 mutually with the topographic base piece of selected taking-up, and is temporarily stored in the working area 11 in the storage element 1.Because each landform all can exist the variation of physical features height, therefore, each topographic base piece piles up mutually according to certain sequence, so pile up the map image 110 that just can be comparatively true, and the stacking order of present embodiment is respectively from top to bottom: land 101, meadow 102, sand ground 103 and water 104.
Control module 3 continues according to the map, and instruction selects a plurality of topographic base pieces, stackable unit 4 is piled up the formation map image mutually with these topographic base pieces again, so repeat above-mentioned steps S2 and S 3, make to store most map images 110 in the working area 11.
Step S4, delivery unit 6 is sent to electronic installation 200 with these map images 110 and map instruction.
Step S5, electronic installation 200 instruct on the display (figure does not show) that these map images 110 is spliced to form a virtual map and is presented at electronic installation 200 according to the map, and the purpose zone that promptly virtual role entered (Plain, wilderness), as shown in Figure 8.
So, by single or most topographic base pieces being piled up mutually and splicing and the virtual map that produces, make the scale of virtual map to increase along with the needs of recreation, and because same topographic base piece can be repeated to use in same or different virtual maps, therefore in storage element 1, only need store the topographic base piece of fixed qty, and only need transmit the different map image of forming by the topographic base piece 110 and give electronic installation 200, make map image 110 quantity that are sent to electronic installation 200 to reduce relatively, and the unlikely network transmission efficiency that influences.
In addition, when virtual role that the player controlled is mobile in same area, most map scene is all identical, therefore in the case, electronic installation 200 is made and passed to needed map image 110 again when the virtual map generator 100 of present embodiment will only can move at virtual role, make electronic installation 200 that 110 splicings of new map image are formed new virtual map to virtual map originally, so can significantly improve the efficient that virtual map produces, make the volume of transmitted data between electronic installation 200 and the game server 400 can satisfy the specification demand that per second produces 24 picture frames (24fps, frames per second).Below will describe in detail with step S50~S55 of Fig. 2 and Fig. 9.
Step S50, when electronic installation 200 shows a current Figure 50 virtually, control module 3 can duplicate this current virtual map 50 and produce one with the onesize backup map 10 of current Figure 50 virtually, shown in solid line square among Figure 10, and backup map 10 is temporarily stored in working area 11 in the storage element 1.What specify is, in order to highlight the difference of " virtual map before virtual role moves " and " virtual map after virtual role moves ", so " virtual map before virtual role moves " is called current Figure 50 virtually.
Step S51, when virtual role was mobile in this area, the computing unit 7 in the virtual map generator 100 can calculate backup map 10 and current side-play amount between Figure 50 virtually, and this side-play amount is sent to control module 3.
Illustrate with Figure 10, computing unit 7 is that the position coordinates with virtual role is the reference point of calculating, but not as limit, that is to say that computing unit 7 is X-axis (transverse axis) and Y-axis (longitudinal axis) components that calculate between " position coordinates 70 before virtual role moves " and " position coordinates 60 after virtual role moves ", and this X-axis component and Y-axis component are sent to control module 3.
In addition, virtual map generator 100 carries out the drafting of virtual map with the frequency of 24fps (per second produces 24 picture frames), therefore, the computing unit 7 of present embodiment will carry out the calculating of side-play amount with identical frequency, can upgrade the position of virtual role synchronously when upgrading virtual map.
Step S52, control module 3 be according to received side-play amount (being X-axis component and Y-axis component), from storage element 1, choose a plurality of to topographic base piece that should side-play amount, and with the topographic base block transfer of selected taking-up to stackable unit 4.
Step S53, stackable unit 4 is piled up formation one map image 110 with the topographic base piece of selected taking-up mutually with a definite sequence, and is temporarily stored in the working area 11 in the storage element 1.What deserves to be mentioned is that map image 110 is to be stored in working storage different in the working area 11 (figure does not show) lining with backup map 10, can't override backup map 10.
Control module 3 continues to select one or more topographic base pieces according to side-play amount, stackable unit 4 again should (etc.) the topographic base piece piles up the formation map image mutually, so repeat above-mentioned steps S52 and S53, make to store most map images in the working area 11.
Step S54, delivery unit 6 is sent to electronic installation 200 with these map images 110 and map instruction.
Step S55, electronic installation 200 is with the zone 40 of backup map 10 with the current repetition of Figure 50 virtually, and be spliced to form Figure 20 virtually after virtual role moves according to the produced map image 110 of the side-play amount of virtual role, that is to say that the map image of producing again according to the side-play amount of virtual role 110 is to constitute an offset area ground Figure 30.
Afterwards, control module 3 can duplicate the Figure 20 virtually after virtual role moves again and produce another backup map 10 ', and it is temporarily stored in the working area 11 and covers backup map 10 originally, and cooperate stackable unit 4, computing unit 7 and delivery unit 6 repeated execution of steps S51~S55, so that the player constantly to be provided required virtual map when the control virtual role is mobile in areal.
In sum, virtual location generator 100 of the present invention utilizes the mode that the topographic base piece piles up mutually and forms most map images 110, send these map images 110 to electronic installation 200 again, make it splice these map images 110 to produce the required virtual map of animation web game, and, so can present the large-scale map and the unlikely network transmission efficiency that influences of arbitrary dimension at electronic installation 200 because identical map image 110 can be repeated to use.In addition, when virtual role is mobile in areal, virtual map generator 100 of the present invention also only need be drawn because of virtual role and move the offset area ground Figure 30 that produces, and the backup map 10 of generation is duplicated in cooperation in advance, Figure 20 virtually after can forming the role and moving is to improve the efficient that virtual map produces.
The above, it only is preferred embodiment of the present invention, be not that the present invention is done any pro forma restriction, though the present invention discloses as above with preferred embodiment, yet be not in order to limit the present invention, any those skilled in the art, in not breaking away from the technical solution of the present invention scope, when the technology contents that can utilize above-mentioned announcement is made a little change or is modified to the equivalent embodiment of equivalent variations, in every case be not break away from the technical solution of the present invention content, according to technical spirit of the present invention to any simple modification that above embodiment did, equivalent variations and modification all still belong in the scope of technical solution of the present invention.