CN106600708B - A kind of processing method and system of map - Google Patents

A kind of processing method and system of map Download PDF

Info

Publication number
CN106600708B
CN106600708B CN201611161335.7A CN201611161335A CN106600708B CN 106600708 B CN106600708 B CN 106600708B CN 201611161335 A CN201611161335 A CN 201611161335A CN 106600708 B CN106600708 B CN 106600708B
Authority
CN
China
Prior art keywords
map
compressed data
block
data
difference
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
CN201611161335.7A
Other languages
Chinese (zh)
Other versions
CN106600708A (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.)
Beijing Kingsoft Software Co Ltd
Beijing Jinshan Digital Entertainment Technology Co Ltd
Original Assignee
Beijing Kingsoft Software Co Ltd
Beijing Jinshan Digital Entertainment 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 Beijing Kingsoft Software Co Ltd, Beijing Jinshan Digital Entertainment Technology Co Ltd filed Critical Beijing Kingsoft Software Co Ltd
Priority to CN201611161335.7A priority Critical patent/CN106600708B/en
Publication of CN106600708A publication Critical patent/CN106600708A/en
Application granted granted Critical
Publication of CN106600708B publication Critical patent/CN106600708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/003Navigation within 3D models or images
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/32Image data format

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Remote Sensing (AREA)
  • General Business, Economics & Management (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Instructional Devices (AREA)

Abstract

The invention discloses a kind of processing methods of map, comprising: and map is divided at least two map blocks, determines the difference landform for being different from other map blocks in each map block, and, the identical landform that multiple map blocks are possessed;By cartographic information storage into the map file created for the map;Wherein, the cartographic information includes: the mark of the map, the mark of each map block, the difference compressed data of landform, the data length and storage address of each difference compressed data, the identical compressed data for the identical landform that multiple map blocks are possessed are distinguished in each map block, with, the data length and storage address of each identical compressed data can reduce the memory space of map while not reducing the display precision of earth's surface in map.The present invention also provides a kind of processing systems of map.

Description

A kind of processing method and system of map
Technical field
The present invention relates to technical field of data processing more particularly to the processing methods and system of a kind of map.
Background technique
Player carries out game in game process actually on map, and map is the scene of game. Map outdoor for three-dimensional (3D), its main feature is that unobscured, in order to sufficiently protrude this feature, current 3D game is adopted The outdoor terrain of map is indicated with the mode of height map, and height map is stored in the form of map file.It is high Degree figure is actually a two-dimensional array, and height map is used when creating map landform, is because landform is actually one The different grid of series of height, the index value of each element can be used to position unused grid in such array, every in array The value that a element is stored is exactly the height of grid.
When storing map outside the room 3D, height map used in map determines the big of scene of game It is small, therefore also determine the occupied storage size of height map stored in the form of map file.With outdoor game The area of figure is increasing, so that the size of height map is also increasing, therefore, after height map is stored into map file, It results in that map file is excessively huge, occupies excessive memory space.
In the prior art, it generallys use floating number and carrys out storing highly value, but use this storage method, a map A large amount of memory space will be occupied.In order to solve the defect, method used at present is the accurate of reduction storing highly diagram data Degree does not use floating number storing highly value, but uses 1 byte storing highly value.But using reduction height value precision Method, although memory space when can reduce storage map to a certain extent, reduces height value precision also just The display precision of earth's surface in map is reduced, the visual effect of game can be reduced in this way, so that game player is not felt by 3D game bring visual impact, reduces the entertainment of game.
Summary of the invention
In view of this, the main purpose of the embodiment of the present invention is to provide the processing method and system of a kind of map, The memory space of map can be reduced while not reducing the display precision of earth's surface in map.
To achieve the above object, the embodiment of the invention provides a kind of processing methods of map, comprising:
Map is divided at least two map blocks, determines the difference for being different from other map blocks in each map block Landform, and, the identical landform that multiple map blocks are possessed;
By cartographic information storage into the map file created for the map;
Wherein, the cartographic information includes: the mark of the map, the mark of each map block, each map block The difference compressed data of middle difference landform, the data length and storage address of each difference compressed data, multiple map blocks The identical compressed data of the identical landform possessed, and, the data length and storage address of each identical compressed data.
Optionally, the difference compressed data and/or identical compressed data are compressed to obtain using Zlib compression algorithm.
Optionally, the method also includes:
When the display for receiving map is requested, the map block range for needing map to be shown is determined;
According to the mark of the map from reading each map within the scope of the map block in corresponding map file The difference compressed data and/or identical compressed data of block;
The difference compressed data and/or identical compressed data that read are decompressed, and according to the data after decompression into Row map picture is shown.
Optionally, the method also includes:
The map block range for needing map to be shown is predefined, according to the mark of the map from corresponding The difference compressed data and/or identical compressed data of each map block within the scope of the map block are read in map file, and will The difference compressed data and/or identical compressed data of reading are cached in memory;
It is each within the scope of the map block from being read in the memory when the display for receiving the map is requested The difference compressed data and/or identical compressed data of map block;
The difference compressed data and/or identical compressed data that read are decompressed, and according to the data after decompression into Row map picture is shown.
Optionally, the method also includes:
Establish the corresponding relationship between the mark of each map block and the mark of adjacent map block;
Correspondingly, the determining map block range for needing map to be shown, comprising:
According to the current coordinate position in map of game role, the current map where the coordinate position is determined Block;
According to the corresponding relationship, all adjacent maps on the current position segment periphery in map display area are determined Block;
The current position segment and all adjacent map blocks are determined as to need map block range to be shown.
Optionally, described to be compressed from the difference for reading each map block within the scope of the map block in corresponding map file Data and/or identical compressed data, comprising:
According to the mark of each map block in the map block range, read in each map block from the map file The corresponding storage address of compressed data and data length are distinguished, and/or, the corresponding storage address of identical compressed data and data are long Degree;
According to the storage address and data length, the difference compression number of each map block is obtained from the map file According to and/or identical compressed data.
Optionally, it is compressed in the difference compressed data or the identical compressed data using Zlib compression algorithm In the case of, the described pair of difference compressed data read and/or identical compressed data decompress, comprising:
Using Zlib decompression algorithm, the difference compressed data and/or identical compressed data that read are decompressed.
The embodiment of the invention also provides a kind of processing systems of map, comprising:
Topography determination unit is determined and is distinguished in each map block for map to be divided at least two map blocks In the difference landform of other map blocks, and, the identical landform that multiple map blocks are possessed;
Information memory cell, for storing cartographic information into the map file created for the map;Wherein, The cartographic information includes: the mark of the map, the mark of each map block, and the area of landform is distinguished in each map block Other compressed data, the data length and storage address of each difference compressed data, multiple map blocks are possessed in the same manner The identical compressed data of shape, and, the data length and storage address of each identical compressed data.
Optionally, the system also includes:
Range determination unit, for when the display for receiving the map is requested, determining to need game to be shown The map block range of map;
Data-reading unit, for reading the range from corresponding map file according to the mark of the map The difference compressed data and/or identical compressed data of each map block within the scope of the map block that determination unit determines;
Picture display unit, difference compressed data and/or identical compression for being read to the data-reading unit Data are decompressed, and are carried out map picture according to the data after decompression and shown;
Alternatively, the system also includes:
Range determination unit, for predefining the map block range for needing the map to be shown;
Data-reading unit, for reading the range from corresponding map file according to the mark of the map The difference compressed data and/or identical compressed data of each map block within the scope of the map block that determination unit determines;
Data buffer storage unit, difference compressed data and/or identical compression number for reading the data-reading unit According to being cached in memory;
Data extracting unit, for reading institute from the memory when the display for receiving the map is requested State difference compressed data and/or identical pressure that data buffer storage unit is buffered in each map block within the scope of the map block of the memory Contracting data;
Picture display unit, difference compressed data and/or identical compression for being read to the data extracting unit Data are decompressed, and are carried out map picture according to the data after decompression and shown.
Optionally, the system also includes:
Relationship establishes unit, and the mark for establishing each map block is corresponding between the mark of adjacent map block to close System;
Correspondingly, the range determination unit, comprising:
Current map determining module, for determining according to the current coordinate position in the map of game role Current position segment where the coordinate position;
Adjacent map determining module, for determining the current position in map display area according to the corresponding relationship All adjacent map blocks on the current position segment periphery that figure determining module determines;
Body of a map or chart determining module, for by the current map determining module determine current position segment with it is described adjacent All adjacent map blocks that map determining module determines are determined as needing map block range to be shown.
Map is resolved into map block by the processing method and system of map provided in an embodiment of the present invention, and To compression storage is carried out after each map block number, the memory space of map can be reduced in this way, in the number of segment over the ground When according to carrying out compression storage, the difference terrain data in each map block, the phase having jointly for multiple map blocks are only stored Portion is only stored with terrain data, can be further reduced the memory space of map in this way.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is the flow diagram of the processing method of map provided in an embodiment of the present invention;
Fig. 2 is the landform schematic diagram of map block A provided in an embodiment of the present invention;
Fig. 3 is map file structural schematic diagram provided in an embodiment of the present invention;
Fig. 4 is one of map block number schematic diagram provided in an embodiment of the present invention;
Fig. 5 is the two of map block number schematic diagram provided in an embodiment of the present invention;
Fig. 6 is map display area schematic diagram provided in an embodiment of the present invention;
Fig. 7 is the composition schematic diagram of the processing system of map provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
In order to reduce the memory space of map, map can be divided into multiple map blocks, by compressively The map datum of segment reduces memory space, in order to further decrease memory space, can also only store in each map block Difference landform compressed data, identical landform jointly owned for multiple map blocks can only store a identical landform Compressed data.
It is the flow diagram of the processing method of map provided in an embodiment of the present invention, this method packet referring to Fig. 1 It includes:
Step 101: map being divided at least two map blocks, determines and is different from other maps in each map block The difference landform of block, and, the identical landform that multiple map blocks are possessed.
In embodiments of the present invention, map resolves into the map block of multiple default sizes, and by these map blocks Topography comparison is carried out, to find the identical landform having jointly with other map blocks from each map block, to obtain each Difference landform in map block in addition to common landform.
For example, it is assumed that map block A, map block B and map block C are the map blocks in map, it is with map block A Example, determines the difference landform in map block A, there are three situations:
If there are one or more shaped areas identical with other map blocks in the first situation, map block A, than Such as, the landform schematic diagram of map block A shown in Figure 2, map block A and map block B all have one piece of identical shaped area 1, map block A and map block C all have one piece of identical shaped area 2, if removing shaped area 1 and morphologic region in map block A Shaped area 3 other than domain 2 is unique in map, then it is assumed that the difference of other map blocks is different from map block A Landform, that is, shaped area 3.
If second situation, map block A are identical with the landform of certain other map block, for example, map block A and map The landform of block B and/or map block C are identical, then it is assumed that the difference landform in other map blocks is not different in map block A.
If the third situation, map block A and the landform of other all map blocks are entirely different, i.e. the landform of map block A It is unique in map, then it is assumed that the difference landform that other map blocks are different from map block A is entire map block A。
Step 102: by cartographic information storage into the map file created for the map.
The cartographic information may include: the mark of the map, the mark of each map block, in each map block Distinguish the difference compressed data of landform, the data length and storage address of each difference compressed data, multiple map block institutes The identical compressed data of the identical landform possessed, and, the data length and storage address of each identical compressed data.
Wherein, after the difference compressed data refers to that the terrain data to the difference landform in a map block compresses Obtained data, the identical compressed data refer to that the terrain data of the identical landform possessed multiple map blocks is pressed The data obtained after contracting.For example, the corresponding difference compressed data of map block A is to shaped area 3 in the first above-mentioned situation Terrain data compressed after obtained data, map block A and the common corresponding identical compressed data of map block B are over the ground The common corresponding identical compression number of the data that the terrain data in shape region 1 obtains after being compressed, map block A and map block C According to being the data obtained after being compressed to the terrain data of shaped area 2;In above-mentioned second situation, map block A does not have Corresponding difference compressed data, when map block A is identical with the landform of map block B, map block A and map block B are jointly right The identical compressed data of one answered is the number obtained after the terrain data of the entire landform of segment A or map block B over the ground is compressed According in the third above-mentioned situation, map block A does not have corresponding identical compressed data, the corresponding difference compressed data of map block A It is the data obtained after the terrain data of the entire landform of segment A over the ground is compressed.
To realize step 102, need in advance to carry out the terrain data of the difference landform in each map block of map Compression, compresses the terrain data for the identical landform that map blocks multiple in map are possessed, can specifically use Zlib (the function library that Zlib is to provide data compression) compression algorithm corresponding difference terrain data of segment and/or identical over the ground Terrain data is compressed, that is, the difference compressed data and/or identical compressed data are compressed using Zlib compression algorithm It arrives.
Specifically, for the difference landform in each map block, the terrain data point of landform will be distinguished in each map block It is not compressed, and the corresponding map block of compressed terrain data is associated or is mapped, that is, a difference landform Compressed data uniquely corresponds to the map block for possessing the difference landform in map.Specifically, keyword and key can be passed through The mode of value Key-Value is associated with, and using the mark of map block as Key, the corresponding Value of the Key is then in the map block Distinguish the compressed data of landform;The association of the two can also be realized using Excel table.
For the identical landform that multiple map blocks are possessed, an identical landform can be co-owned with several map blocks, Its several map block co-owns another identical landform, this two groups of map blocks for respectively possessing different identical landform can be All different map blocks is (for example, map block A and map block B possess an identical shaped area 1, map block C and map block D possesses an identical shaped area 2, and the composition of this two groups of map blocks is entirely different), respectively possess this of different identical landform Two groups of map blocks are also possible to the identical map block in part (for example, map block A and map block B possess an identical morphologic region Domain 1, map block A, map block C possess an identical shaped area 2, and the component part of this two groups of map blocks is different), respectively gather around This two groups of map blocks of different identical landform can also be whole identical map blocks (for example, map block A and map block B are gathered around There are an identical shaped area 1, map block A, map block B also to possess an identical shaped area 2, this two groups of map blocks Composition is all identical).The terrain data for the identical landform that multiple map blocks are possessed is compressed, and by compressed landform Also corresponding map block is associated or maps data, i.e., the compressed data of one identical landform, which corresponds in map, to be owned Map block with the identical landform.Specifically, can also be associated with by way of key value Key-Value keyword, with The mark of map block is then the compressed data of the identical landform in the map block as Key, the corresponding Value of the Key;It can also be with The association of the two is realized using Excel table.
As it can be seen that a unique mark is arranged as each map block by being encoded for each map block in map Know, can make the identical compressed data of each map block and/or difference compressed data that there is unique identification, so as to base area The mark of segment finds the compressed data of the difference landform that the map block is included and/or identical landform in map file.
In embodiments of the present invention, a map file is specially created for a map, for storing the game The cartographic information of figure, wherein referring to map file structural schematic diagram as shown in Figure 3, which includes file head region With data block region.
For the file head region in map file, file header therein is substantially a record sheet, is worked as recording The identification information of preceding map and all map block messages, each map block message may include: the mark of map block, Data length and the difference compressed data the depositing within the data block of the corresponding difference compressed data of landform are distinguished in map block Storage space set, and/or map block in the corresponding identical compressed data of identical landform data length and the identical compressed data exist Storage location in data block.Wherein, the storage location specifically can be the storage address of a beginning, according to the beginning Storage address and the data length can find the difference compressed data and/or identical compressed data of the map block.
For the data block region in map file, the compressed data for the difference landform for being included by each map block is stored To the data block of map file, and the compressed data of the co-owned identical landform of multiple map blocks is also stored to ground picture and text The data block of part.For example, can store map block 1 in data block to map block when map is broken down into N number of map block The compressed data of most N number of difference landform in N, when segment progress topography comparison obtains M identical shaped areas over the ground, number According to can store M compressed data of the identical shaped area 1 to identical shaped area M in block.
Map is resolved into map block by the processing method of map provided in an embodiment of the present invention, and to each Compression storage is carried out after map block number, can reduce the memory space of map in this way, is carried out in the data of segment over the ground When compression storage, the difference terrain data in each map block, identical landform jointly owned for multiple map blocks are only stored Data only store portion, can be further reduced the memory space of map in this way.
In order to more easily understand step 101 and step 102, it is exemplified below:
The map block that the map for being 1024*1024 meters for A1, size is decomposed into 64 16*16 meters is numbered by one, And each map block number consecutively, such as map block number schematic diagram shown in Figure 4 are given, map A1 is decomposed into 64 16*16 meters of map block, segment is numbered line by line over the ground, and the number of map block is followed successively by 1-64, in addition, over the ground segment into Row number can also use the coding method of two-dimensional array as shown in Figure 5, using more intuitive clear, the ground of this method for numbering serial Positional relationship between the position and map block of segment can directly be found out by number.Certainly it can also be compiled using other Number mode, the embodiment of the present invention do not enumerate its numbering, i.e., the present invention not over the ground the numbering of segment into Row limits.
Zlib compression algorithm is respectively adopted in 64 16*16 meters of map block and carries out difference terrain data and in the same manner figurate number According to compression, and compressed data are stored into the data block portions into map file.It is understood that the present invention uses Diagram data is compressed zlib compression algorithm over the ground, be because map in earth's surface information data be largely rule and have Sequence, the characteristics of just meeting zlib algorithm, therefore map file can be reduced using zlib compression algorithm to the greatest extent Size can also take other compression algorithms certainly in compression process, and it is not limited by the embodiments of the present invention.
By the identification information of the identification information A1 of map and each map block (such as using modes such as Fig. 4 or Fig. 5 Obtained number) it is stored in the file header of map file, meanwhile, for having the map block of difference landform, by the difference landform Terrain data is compressed after obtaining difference compressed data, by the data length of the difference compressed data and storage address deposit ground The terrain data of the identical landform compress by the file header of map file for the identical landform that multiple map blocks possess To after identical compressed data, the data length of the identical compressed data and storage address are also stored in the file header of map file.
Above content describes the date storage method of map, and further, the embodiment of the present invention also describes trip Play map picture display process need to obtain map datum from map file in order to show map, due to The mark and the associated compression data of each map block that each map is had recorded during storage map datum, so that needing The Map Compression data of needs can be quickly and effectively searched out from map file and are drawn when reading Map Compression data System, the visual effect of high quality can be provided for player, improves the entertainment of game.
The embodiment of the present invention may be selected one of following two embodiment and carry out map denotation.
In a kind of wherein embodiment, it can specifically include:
Step A1: when the display for receiving map is requested, the map block model for needing map to be shown is determined It encloses.
When player enters a new map or when game role moves on map using game role, The game picture for needing to update display, when needing to update game picture, system will trigger the display request of map, this When need the coordinate position current according to game role, calculate the map block range where going game role, the map block It is generally in the range of the map area that the map display area of game display devices is included.
Step A2: every within the scope of the map block from being read in corresponding map file according to the mark of the map The difference compressed data and/or identical compressed data of one map block.
In some embodiments, step A2 can specifically include: according to each map block in the map block range Mark distinguishes the corresponding storage address of compressed data and data length from reading in the map file in each map block, and/ Or, the corresponding storage address of identical compressed data and data length;According to the storage address and data length, from the map The difference compressed data and/or identical compressed data of each map block are obtained in file.
In this embodiment, according to the coordinate position of game role, the map that player is currently located is calculated, Further according to the mark of going game map, the corresponding map file of going game map is loaded, then obtains institute from map file The mark for stating each map block within the scope of map block is searched accordingly from map file according to the mark of each map block The related data of segment, to search the compressed data for the difference landform for obtaining each map block and/or the compression number of identical landform According to the storage location and data length in map file data block, finally from each difference compressed data of storage or identical compression The compressed data with corresponding data length is taken out at the storage location of data.
Specifically, when searching the related data of corresponding map block from map file according to the mark of each map block, It can be from the mark for finding each map block within the scope of map block in map file, when the map block has identical landform and difference When landform, using the mark of the map block, the compressed data and distinctively of identical landform can be matched to from map file Then the compressed data of the map block can be obtained in the two combination by the compressed data of shape;When the map block is entirely distinctively When shape, using the mark of the map block, the compressed data of difference landform can be matched to from map file;When the map block is complete When portion is identical landform, using the mark of the map block, the compressed data of identical landform can be matched to from map file.
Step A3: decompressing the difference compressed data and/or identical compressed data that read, and according to decompression after Data carry out map picture and show.
The difference compressed data of each map block taken out from map file and/or identical compressed data are decompressed Contracting, and using the drafting of the data progress map picture after decompression, the picture drawn out is shown in the map of game display devices In display area.
In another embodiment, it can specifically include:
Step B1: the map block range for needing map to be shown is predefined.
Before player enters a new map using game role or when game role is enterprising in map Before one moved further, coordinate position that can be current previously according to game role calculates the map where going game role Block range, the map block are generally in the range of the map area that the map display area of game display devices is included.
Step B2: every within the scope of the map block from being read in corresponding map file according to the mark of the map The difference compressed data and/or identical compressed data of one map block, and by the difference compressed data of reading and/or identical compression number According to being cached in memory.
In some embodiments, step B2 can specifically include: according to each map block in the map block range Mark distinguishes the corresponding storage address of compressed data and data length from reading in the map file in each map block, and/ Or, the corresponding storage address of identical compressed data and data length;According to the storage address and data length, from the map Obtain the difference compressed data and/or identical compressed data of each map block in file, and by the difference compressed data of reading and/ Or identical compressed data is cached in memory.
In this embodiment, according to the coordinate position of game role, the map that player is currently located is calculated, Further according to the mark of going game map, the corresponding map file of going game map is loaded, then obtains institute from map file The mark for stating each map block within the scope of map block is searched accordingly from map file according to the mark of each map block The related data of segment, to search the compressed data for the difference landform for obtaining each map block and/or the compression number of identical landform According to the storage location and data length in map file data block, finally from each difference compressed data of storage or identical compression The compressed data with corresponding data length is taken out at the storage location of data, and by the difference compressed data and/or phase of reading It is cached in memory with compressed data, evidence of directly fetching from memory when to need.
Specifically, when searching the related data of corresponding map block from map file according to the mark of each map block, It can be from the mark for finding each map block within the scope of map block in map file, when the map block has identical landform and difference When landform, using the mark of the map block, the compressed data and distinctively of identical landform can be matched to from map file Then the compressed data of the map block can be obtained in the two combination by the compressed data of shape;When the map block is entirely distinctively When shape, using the mark of the map block, the compressed data of difference landform can be matched to from map file;When the map block is complete When portion is identical landform, using the mark of the map block, the compressed data of identical landform can be matched to from map file.
Step B2: when the display for receiving the map is requested, the map block model is read from the memory Enclose the difference compressed data and/or identical compressed data of interior each map block.
When player enters a new map or when game role moves on map using game role, The game picture for needing to update display, when needing to update game picture, system will trigger the display request of map, this When can directly from memory take out map block within the scope of each map block difference compressed data and/or identical compressed data.It can With understanding, buffered compressed data is directly taken out from memory, than taking data cached speed from map file Fastly, it can be further ensured that the display fluency of game picture in this way.
Step B3: decompressing the difference compressed data and/or identical compressed data that read, and according to decompression after Data carry out map picture and show.
The difference compressed data of each map block taken out from map file and/or identical compressed data are decompressed Contracting, and using the drafting of the data progress map picture after decompression, the picture drawn out is shown in the map of game display devices In display area.
Further, after step 102 further include: establish each map block mark and the mark of adjacent map block it Between corresponding relationship.By taking Fig. 4 as an example, for example, for be identified as 1 map block, adjacent map block is to be identified as 2,9 and respectively 10 corresponding 3 map blocks establish the corresponding relationship between mark 1 and mark 2,9 and 10, for another example, for being identified as 11 Map block, adjacent map block are to be identified as corresponding 8 map blocks in 2,3,4,10,12,18,19 and 20 respectively, establish mark Corresponding relationship between 11 and mark 2,3,4,10,12,18,19 and 20.
Based on the foundation of above-mentioned corresponding relationship, map to be shown is needed when determining using above-mentioned steps A1 or step B1 Map block range when, can specifically include: according to the current coordinate position in map of game role, determining the seat Current position segment where cursor position;According to the corresponding relationship, the current position segment week in map display area is determined All adjacent map blocks on side;The current position segment and all adjacent map blocks are determined as to need map block to be shown Range.
When determining the map block range, find first game role be located at map which map block it is i.e. current Map block is determined by the mark of current position segment and identifies the mark with corresponding relationship with it, these identify corresponding map Block is the adjacent map block of current position segment, further, by the mark of adjacent map block therein can also determine with The adjacent map block mark has the mark of corresponding relationship, and it is the adjacent of the adjacent map block that these, which identify corresponding map block, Map block, and so on, each map in the segment peripheral extent of current position can be gradually found centered on the segment of current position Block, the display specification of display area according to the map, obtaining be capable of outline map display area from circumferentially segment includes working as Map block range including preceding map block.
For example, when using map block identification means shown in Fig. 4, it is assumed that the current coordinate in map of certain player Position is (15*40), and the coordinate position is calculated positioned at the map block A for being identified as 11 according to coordinate position (15*40).Assuming that It is the scene areas of 2*2 map block composition that map display area is corresponding, then to be identified as 11 map block A as base Standard chooses adjacent map block from its periphery, for example the map block range chosen includes the map for being identified as 10,11,18,19 Block.If map display area is the scene areas for needing to show more map block, to be identified as 11 map block A as base Standard chooses map block from the periphery map block A, these map blocks not only include the adjacent map block B of map block A, further include adjacent The adjacent map block C of map block B can be according to specific position of the player in map denotation picture specifically when choosing map block It sets and is chosen, for example, map display area schematic diagram shown in Figure 6, circle represents the game role of player in figure, In the map block A for being identified as 11, find first each map blocks with mark 11 with corresponding relationship mark 2,3,4, 10,12,18,19 and 20, it then finds the mark 1 with mark 2 with corresponding relationship, find with mark 10 with corresponding relationship Mark 9 finds marks 17 with mark 18 with corresponding relationship, and the corresponding chart portfolio block of all these marks is determining Map block range.
In addition, the feelings for using Zlib compression algorithm to compress in the difference compressed data or the identical compressed data Under condition, correspondingly, when the compressed data that a pair using above two embodiment is read is decompressed (step A3 or step When B3), Zlib decompression algorithm is specifically used, the difference compressed data and/or identical compressed data that read are decompressed.
It is the composition schematic diagram of the processing system of map provided in an embodiment of the present invention, the system packet referring to Fig. 7 It includes:
Topography determination unit 701 determines area in each map block for map to be divided at least two map blocks Not in the difference landform of other map blocks, and, the identical landform that multiple map blocks are possessed;
Information memory cell 702, for storing cartographic information into the map file created for the map;Its In, the cartographic information includes: the mark of the map, the mark of each map block, distinguishes landform in each map block Difference compressed data, it is each it is described difference compressed data data length and storage address, the phase that multiple map blocks are possessed With the identical compressed data of landform, and, the data length and storage address of each identical compressed data.Specifically, described Difference compressed data and/or identical compressed data are compressed to obtain using Zlib compression algorithm.
In one embodiment, the difference compressed data and/or the identical compressed data are calculated using Zlib compression Method is compressed to obtain.
In one embodiment, the system also includes:
Range determination unit, for when the display for receiving the map is requested, determining to need game to be shown The map block range of map;
Data-reading unit, for reading the range from corresponding map file according to the mark of the map The difference compressed data and/or identical compressed data of each map block within the scope of the map block that determination unit determines;
Picture display unit, difference compressed data and/or identical compression for being read to the data-reading unit Data are decompressed, and are carried out map picture according to the data after decompression and shown;
In another embodiment, the system also includes:
Range determination unit, for predefining the map block range for needing the map to be shown;
Data-reading unit, for reading the range from corresponding map file according to the mark of the map The difference compressed data and/or identical compressed data of each map block within the scope of the map block that determination unit determines;
Data buffer storage unit, difference compressed data and/or identical compression number for reading the data-reading unit According to being cached in memory;
Data extracting unit, for reading institute from the memory when the display for receiving the map is requested State difference compressed data and/or identical pressure that data buffer storage unit is buffered in each map block within the scope of the map block of the memory Contracting data;
Picture display unit, difference compressed data and/or identical compression for being read to the data extracting unit Data are decompressed, and are carried out map picture according to the data after decompression and shown.
In one embodiment, the system also includes: relationship establishes unit, for establishing the mark of each map block Corresponding relationship between the mark of adjacent map block;
Correspondingly, the range determination unit, comprising:
Current map determining module, for determining according to the current coordinate position in the map of game role Current position segment where the coordinate position;
Adjacent map determining module, for determining the current position in map display area according to the corresponding relationship All adjacent map blocks on the current position segment periphery that figure determining module determines;
Body of a map or chart determining module, for by the current map determining module determine current position segment with it is described adjacent All adjacent map blocks that map determining module determines are determined as needing map block range to be shown.
In one embodiment, the data-reading unit, comprising:
Information reading module is stored, for the mark according to each map block in the map block range, from the map It is read in file and distinguishes the corresponding storage address of compressed data and data length in each map block, and/or, identical compressed data Corresponding storage address and data length;
Compressed data read module, the storage address and data for being read according to the storage information reading module are long Degree, obtains the difference compressed data and/or identical compressed data of each map block from the map file.
In one embodiment, Zlib compression algorithm is used in the difference compressed data or the identical compressed data In the case that compression obtains, the picture display unit, comprising:
Data decompression module, for using Zlib decompression algorithm, to the difference compressed data and/or identical pressure read Contracting data are decompressed;
Picture display module is shown for carrying out map picture according to the data after data decompression module decompression.
As seen through the above description of the embodiments, those skilled in the art can be understood that above-mentioned implementation All or part of the steps in example method can be realized by means of software and necessary general hardware platform.Based on such Understand, substantially the part that contributes to existing technology can be in the form of software products in other words for technical solution of the present invention It embodies, which can store in storage medium, such as ROM/RAM, magnetic disk, CD, including several Instruction is used so that a computer equipment (can be the network communications such as personal computer, server, or Media Gateway Equipment, etc.) execute method described in certain parts of each embodiment of the present invention or embodiment.
It should be noted that for the system disclosed in the embodiment, since it is corresponded to the methods disclosed in the examples, So being described relatively simple, reference may be made to the description of the method.It should also be noted that, term " includes ", " packet Containing " or any other variant thereof is intended to cover non-exclusive inclusion, so that including the process of a series of elements, side Method, article or equipment not only include those elements, but also including other elements that are not explicitly listed, or further include For elements inherent to such a process, method, article, or device.In the absence of more restrictions, by sentence " including one It is a ... " limit element, it is not excluded that there is also in addition in the process, method, article or apparatus that includes the element Identical element.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (7)

1. a kind of processing method of map characterized by comprising
Map is divided at least two map blocks, these map blocks are subjected to topography comparison, are determined in each map block It is different from the difference landform of other map blocks, and, the identical landform that multiple map blocks are possessed;Wherein, the difference landform is Unique existing shaped area in the map, the identical landform be present in the map block with one or more The identical shaped area of other map blocks;
By cartographic information storage into the map file created for the map;
Wherein, the cartographic information includes: the mark of the map, the mark of each map block, area in each map block The difference compressed data of other landform, the data length and storage address of each difference compressed data, multiple map blocks are gathered around The identical compressed data for the identical landform having, and, the data length and storage address of each identical compressed data;
The method also includes:
When the display request for receiving the map, the map block range for needing map to be shown is determined;According to institute The mark for stating map compresses number from the difference for reading each map block within the scope of the map block in corresponding map file According to and/or identical compressed data;The difference compressed data and/or identical compressed data that read are decompressed, and according to solution Data after pressure carry out map picture and show;
Alternatively, predefine the map block range for needing the map to be shown, according to the mark of the map from Read in corresponding map file each map block within the scope of the map block difference compressed data and/or identical compression number According to, and the difference compressed data of reading and/or identical compressed data are cached in memory;When receiving the map When display request, from the difference compressed data that reads each map block within the scope of the map block in the memory and/or identical Compressed data;The difference compressed data and/or identical compressed data that read are decompressed, and according to the data after decompression into Row map picture is shown.
2. the method according to claim 1, wherein the difference compressed data and/or the identical compression number It compresses to obtain according to using Zlib compression algorithm.
3. the method according to claim 1, wherein the method also includes:
Establish the corresponding relationship between the mark of each map block and the mark of adjacent map block;
Correspondingly, the determining map block range for needing the map to be shown, comprising:
According to the current coordinate position in the map of game role, the current map where the coordinate position is determined Block;
According to the corresponding relationship, all adjacent map blocks on the current position segment periphery in map display area are determined;
The current position segment and all adjacent map blocks are determined as to need map block range to be shown.
4. the method according to claim 1, wherein described read the map block from corresponding map file The difference compressed data and/or identical compressed data of each map block in range, comprising:
According to the mark of each map block in the map block range, distinguished from being read in each map block in the map file The corresponding storage address of compressed data and data length, and/or, the corresponding storage address of identical compressed data and data length;
According to the storage address and data length, the difference compressed data of each map block is obtained from the map file And/or identical compressed data.
5. the method according to claim 1, wherein in the difference compressed data or the identical compressed data It is compressed in the case where obtaining using Zlib compression algorithm, the described pair of difference compressed data and/or identical compressed data read It is decompressed, comprising:
Using Zlib decompression algorithm, the difference compressed data and/or identical compressed data that read are decompressed.
6. a kind of processing system of map characterized by comprising
These map blocks are carried out topography comparison for map to be divided at least two map blocks by topography determination unit, Determine the difference landform that other map blocks are different from each map block, and, the identical landform that multiple map blocks are possessed;Its In, the difference landform is that unique existing shaped area, the identical landform are in the map block in the map Existing shaped area identical with one or more of the other map block;
Information memory cell, for storing cartographic information into the map file created for the map;Wherein, described Cartographic information includes: the mark of the map, the mark of each map block, and the difference pressure of landform is distinguished in each map block Contracting data, the data length and storage address of each difference compressed data, the identical landform that multiple map blocks are possessed Identical compressed data, and, the data length and storage address of each identical compressed data;
The system also includes:
Range determination unit, for when the display for receiving the map is requested, determining to need map to be shown Map block range;
Data-reading unit reads the range for the mark according to the map from corresponding map file and determines The difference compressed data and/or identical compressed data of each map block within the scope of the map block that unit determines;
Picture display unit, difference compressed data and/or identical compressed data for being read to the data-reading unit It is decompressed, and carries out map picture according to the data after decompression and show;
Alternatively, the system also includes:
Range determination unit, for predefining the map block range for needing the map to be shown;
Data-reading unit reads the range for the mark according to the map from corresponding map file and determines The difference compressed data and/or identical compressed data of each map block within the scope of the map block that unit determines;
Data buffer storage unit, difference compressed data and/or identical compressed data for reading the data-reading unit are delayed It is stored in memory;
Data extracting unit, for reading the number from the memory when the display for receiving the map is requested According to cache unit be buffered in each map block within the scope of the map block of the memory difference compressed data and/or identical compression number According to;
Picture display unit, difference compressed data and/or identical compressed data for being read to the data extracting unit It is decompressed, and carries out map picture according to the data after decompression and show.
7. system according to claim 6, which is characterized in that the system also includes:
Relationship establishes unit, the corresponding relationship for establishing between the mark of each map block and the mark of adjacent map block;
Correspondingly, the range determination unit, comprising:
Current map determining module, described in determining according to the current coordinate position in the map of game role Current position segment where coordinate position;
Adjacent map determining module, for determining that the current map in map display area is true according to the corresponding relationship All adjacent map blocks on the current position segment periphery that cover half block determines;
Body of a map or chart determining module, current position segment and the adjacent map for determining the current map determining module All adjacent map blocks that determining module determines are determined as needing map block range to be shown.
CN201611161335.7A 2016-12-15 2016-12-15 A kind of processing method and system of map Active CN106600708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611161335.7A CN106600708B (en) 2016-12-15 2016-12-15 A kind of processing method and system of map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611161335.7A CN106600708B (en) 2016-12-15 2016-12-15 A kind of processing method and system of map

Publications (2)

Publication Number Publication Date
CN106600708A CN106600708A (en) 2017-04-26
CN106600708B true CN106600708B (en) 2019-01-08

Family

ID=58801616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611161335.7A Active CN106600708B (en) 2016-12-15 2016-12-15 A kind of processing method and system of map

Country Status (1)

Country Link
CN (1) CN106600708B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108597027B (en) * 2018-04-09 2022-04-15 腾讯科技(上海)有限公司 Method and device for accessing graphic data
CN109045696A (en) * 2018-07-24 2018-12-21 合肥爱玩动漫有限公司 A kind of closed map Research on Automatic Filling
CN109885068B (en) * 2019-03-30 2021-12-24 骞一凡 Robot traveling control method and system
CN110523082B (en) * 2019-08-30 2020-10-09 腾讯科技(深圳)有限公司 Virtual road calculation method, device, equipment and medium based on virtual environment
CN111773687A (en) * 2020-06-30 2020-10-16 完美世界(北京)软件科技发展有限公司 Map way finding method and device, storage medium and electronic device
CN111957051A (en) * 2020-09-01 2020-11-20 网易(杭州)网络有限公司 Resource storage method and device
CN113018866A (en) * 2021-03-31 2021-06-25 完美世界(北京)软件科技发展有限公司 Map resource loading method and device, storage medium and electronic device
CN113509722B (en) * 2021-07-13 2022-09-23 上海哔哩哔哩科技有限公司 Data processing method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100595758C (en) * 2006-11-27 2010-03-24 北京金山软件有限公司 Storing method and system of playing map and obtaining method and system of playing map
CN101261740B (en) * 2008-03-27 2012-01-04 于培宁 Processing method of an image storage
CN102855262B (en) * 2011-07-01 2015-07-08 阿里巴巴集团控股有限公司 Method and device for processing flash data
CN104142926A (en) * 2013-05-06 2014-11-12 北京四维图新科技股份有限公司 Method and device for processing electronic map

Also Published As

Publication number Publication date
CN106600708A (en) 2017-04-26

Similar Documents

Publication Publication Date Title
CN106600708B (en) A kind of processing method and system of map
CN100595758C (en) Storing method and system of playing map and obtaining method and system of playing map
EP2209074A1 (en) Data storage processing method, data searching method and devices thereof
CN111179394A (en) Point cloud scene rendering method, device and equipment
US8649427B2 (en) Image processor, image generator and computer program
CN103049355B (en) Method and equipment for database system recovery
CN106874348A (en) File is stored and the method for indexing means, device and reading file
CN108492338B (en) Compression method and device for animation file, storage medium and electronic device
JPS63111551A (en) Memorizing and addressing system for data parcel and apparatus for executing the same
CN102841907A (en) Methods for processing data compression and decompression
CN106648939A (en) Method and equipment for inter-process resource sharing
CN105957149A (en) Urban three-dimensional model data preprocessing method suitable for high-efficiency rendering
CN105959814A (en) Scene-recognition-based video bullet screen display method and display apparatus thereof
CN104168435A (en) Method and system for batched mergence and playing of audio files
CN107451271A (en) A kind of Hash table processing method, device, equipment and storage medium
CN107170038A (en) A kind of method and device for generating indoor map
CN114067060A (en) Dense point cloud rapid generation method for three-dimensional modeling
CN105354297B (en) The method and system of data storage in a kind of database
CN104238960A (en) Hard disk formatting method, block data storage method based on hard disk and block data storage device based on hard disk
CN111382220A (en) POI data dividing method and device
CN105740374A (en) Distributed memory based three-dimensional platform data fuzzy query method
CN109446827A (en) Data encryption/decryption method and system
CN106649341B (en) Data processing method and device
CN109074654A (en) It is connected to area detecting method, circuit, equipment, computer readable storage medium
CN103440254A (en) Method, device and system of map display

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