CN117282100A - Map design method and related equipment - Google Patents

Map design method and related equipment Download PDF

Info

Publication number
CN117282100A
CN117282100A CN202311327539.3A CN202311327539A CN117282100A CN 117282100 A CN117282100 A CN 117282100A CN 202311327539 A CN202311327539 A CN 202311327539A CN 117282100 A CN117282100 A CN 117282100A
Authority
CN
China
Prior art keywords
map
layer
area
image block
geographic coordinates
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.)
Pending
Application number
CN202311327539.3A
Other languages
Chinese (zh)
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.)
Tencent Music Entertainment Technology Shenzhen Co Ltd
Original Assignee
Tencent Music Entertainment Technology Shenzhen 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 Tencent Music Entertainment Technology Shenzhen Co Ltd filed Critical Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority to CN202311327539.3A priority Critical patent/CN117282100A/en
Publication of CN117282100A publication Critical patent/CN117282100A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/50Controlling the output signals based on the game progress
    • A63F13/53Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
    • A63F13/537Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
    • A63F13/5378Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen for displaying an additional top view, e.g. radar screens or maps
    • 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/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • A63F13/525Changing parameters of virtual cameras
    • A63F13/5255Changing parameters of virtual cameras according to dedicated instructions from a player, e.g. using a secondary joystick to rotate the camera around a player's character
    • 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/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/30Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device
    • A63F2300/303Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device for displaying additional data, e.g. simulating a Head Up Display
    • A63F2300/307Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device for displaying additional data, e.g. simulating a Head Up Display for displaying an additional window with a view from the top of the game field, e.g. radar screen
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/6009Methods for processing data by generating or executing the game program for importing or creating game content, e.g. authoring tools during game development, adapting content to different platforms, use of a scripting language to create content
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • A63F2300/6661Methods for processing data by generating or executing the game program for rendering three dimensional images for changing the position of the virtual camera
    • A63F2300/6676Methods for processing data by generating or executing the game program for rendering three dimensional images for changing the position of the virtual camera by dedicated player input

Abstract

The application discloses a map design method and related equipment, wherein the method comprises the following steps: partitioning the layers in each layer of the initial map to obtain a plurality of blocks of each layer; for each image block, calculating geographic coordinates allocated to the image block according to layer position information and layer position information of the image block, wherein the layer position refers to the position of the image block in the layer; and loading and rendering geographic coordinates and graphic element arrangement information contained in the target tile region to display the proportional map conforming to the definition of the map display request. The adoption of hierarchical and chunked concepts to maintain an initial map facilitates the initial map to be presented and processed in a more fine-grained manner in the form of tile formations, rather than being limited in size as is conventional, without supporting freely scaled presentations. The method and the device support infinitely expanding the visual range of the map, and simultaneously reduce the operation pressure and resource loss caused by transmitting and processing a large amount of map data.

Description

Map design method and related equipment
Technical Field
The embodiment of the application relates to the technical field of Internet, in particular to a map design method and related equipment.
Background
In recent years, the application and demand of the map in the electronic interface are becoming wider and wider, for example, the position of a character of a friend or foe can be known through the map, a movement track can be planned, a virtual game scene can be built, and the like.
The map is currently designed in the market in such a way that the size of the map is set in advance on a tile (tile) editor, and a developer or artist imports the set drawing content into the map item of the editor, and then adjusts the node configuration in the tile map to display the map in use.
In the actual game process, players often need to scale the generated game map so as to adapt to the interface operation requirements of different scenes. However, the map produced in the above manner is fixed in size, and does not support dynamic zooming in or out of the map, which cannot meet the requirement of the player for zooming the map at any time. In this regard, it is necessary to provide an effective solution.
Disclosure of Invention
The embodiment of the application provides a map design method and related equipment, which are used for meeting the dynamic zoom requirement of a user on a map.
A first aspect of an embodiment of the present application provides a map design method, including:
partitioning the layers in each layer of the initial map to obtain a plurality of blocks of each layer; the graphic layer is associated with arrangement information corresponding to the occupation graphic elements according to a preset graphic element distribution rule, and the graphic elements comprise at least one graphic element of a user icon, a plant icon and a building icon;
for each image block, calculating geographic coordinates allocated to the image block according to layer position information and layer position information of the image block, wherein the layer position refers to the position of the image block in the layer;
determining a target block area pointed by a map display request, and loading and rendering the geographic coordinates and the graphic element arrangement information contained in the target block area to display a proportional map conforming to the definition of the map display request; the scale map is in a scale relationship with a view area between the initial maps.
Optionally, the initial map supports newly added tiles to make up a large map.
A second aspect of an embodiment of the present application provides an electronic device, including:
a central processing unit, a memory and an input/output interface;
the memory is a short-term memory or a persistent memory;
the central processor is configured to communicate with the memory and to execute instruction operations in the memory to perform the method described in the first aspect of the embodiments of the present application or any particular implementation of the first aspect.
A third aspect of the embodiments provides a computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform a method as described in the first aspect of the embodiments or any particular implementation of the first aspect of the application.
A fourth aspect of the embodiments provides a computer program product comprising instructions or a computer program which, when run on a computer, causes the computer to perform the method as described in the first aspect of the embodiments or any particular implementation of the first aspect of the application.
From the above technical solutions, the embodiments of the present application have at least the following advantages:
the adoption of hierarchical and chunked concepts to maintain an initial map facilitates the initial map to be presented and processed in a more fine-grained manner in the form of tile formations, rather than being limited in size as is conventional, without supporting freely scaled presentations. Wherein the geographical coordinates and the primitive arrangement information contained in the target tile region are loaded and rendered in face of a request to zoom in on the map to reveal the local primitive, so that the required scale map can be shown, the method and the system can meet the requirement of infinitely expanding the map, namely, support the visual range of the infinitely expanding map, and simultaneously reduce the operation pressure and resource loss caused by transmitting and processing a large amount of map data.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
It should be noted that, although the steps in the flowcharts (if any) according to the embodiments are drawn in sequence according to the arrow, the steps are not strictly limited to the order shown in the text, and may be executed in other orders. Moreover, at least some of the steps in the flowcharts in accordance with the embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of the steps or stages in other steps or other steps.
FIG. 1 is a schematic diagram of a system architecture of a map design method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a map design method according to an embodiment of the present application;
FIG. 3 is a schematic illustration of a map according to an embodiment of the present application;
FIG. 4 is another flow chart of a map design method according to an embodiment of the present disclosure;
FIG. 5 is another flow chart of a map design method according to an embodiment of the present disclosure;
FIG. 6 is another flow chart of a map design method according to an embodiment of the present disclosure;
FIG. 7 is another schematic illustration of a map according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to the accompanying drawings, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the following description, reference is made to "one embodiment" or "one specific example" and the like, which describe a subset of all possible embodiments, but it is to be understood that "one embodiment" or "one specific example" may be the same subset or a different subset of all possible embodiments and may be combined with each other without conflict. In the following description, the term plurality refers to at least two. Some value as referred to herein reaches a threshold (if any), and in some specific examples, may include the former being greater than the latter; if any reference is made to "any" or "at least one" or the like, that particular reference may be made to any one of the examples listed or any combination between those examples.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Referring to fig. 1, fig. 1 shows a schematic view of an application environment suitable for use in an embodiment of the present application. The map design method provided in the embodiment of the present application may be applied to an interactive system 100 shown in fig. 1, where the interactive system 100 includes a terminal device 101 and a server 102, and the server 102 is communicatively connected to the terminal device 101, where the server 102 may be a conventional server or a cloud server, which is not limited herein. The terminal device 101 may be a variety of electronic devices having a display screen and supporting data input, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, wearable electronic devices, and the like; specifically, the data input may be based on a voice module provided on the terminal device 101 to input voice, a character input module to input characters, an image input module to input images, or the like, or may be based on a gesture recognition module provided on the terminal device 101, so that a user may implement interaction modes such as gesture input. The terminal device 101 may have a client application installed thereon, and the user may communicate with the server 102 based on the client application (e.g., APP, applet, etc.), or may also implement the aforementioned data input based on the client application. Similarly, the server 102 may be deployed with a server application, where the server application may implement the method in conjunction with the client application, for example, to perform a related process on a map operation request input by the client application, for example, to return a zoomed map to the terminal device 101 for presentation.
The method of the present application will be described in further detail below.
Referring to fig. 2 to 3, a first aspect of the present application provides a specific embodiment of a map design method, which includes the following operation steps:
21. and carrying out blocking processing on the layers in each level of the initial map to obtain a plurality of blocks of each layer.
The graphic layer is associated with arrangement information corresponding to the occupation graphic elements according to a preset graphic element distribution rule, and the graphic elements comprise at least one graphic element of a user icon, a plant icon and a building icon. As shown in fig. 3, the area included in the rectangular virtual frame may be regarded as a layer, and the layer may be divided into four tiles; the initial map can be further provided with a land or water path and other graphic elements, and the types and the number of the graphic elements which are resident in the map can be specifically set by the user requirements or game scenes.
As a possible implementation, the first layer centered in the initial map may be started, and more layers, such as the second layer, the third layer, etc., may be expanded outwards layer by layer, and each layer may be divided into a plurality of tiles with equal areas. It should be noted that in practical applications, multiple layers may be expanded from outside the center of the visual screen as a starting point, instead of expanding from outside the view angle of the center of the initial map, or multiple layers may be drawn from left to right or from top to bottom in a division manner, that is, the manner of layering the initial map is not limited. The areas of the tiles divided in the layer may be unequal.
22. The geographic coordinates assigned to each tile are calculated.
For each image block, according to the layer position information and the layer position information of the image block, the geographic coordinates allocated to the image block are calculated, and the layer position refers to the azimuth of the image block in the layer, such as the number of blocks (i.e. the number of blocks) in the first layer image layer. For example, the layer information includes a layer corresponding to the layer, such as the first layer, the second layer, and the like, and the geographic coordinates may specifically refer to position coordinates corresponding to a two-dimensional plane rectangular coordinate system or a three-dimensional stereoscopic coordinate system. The level position and the block position information related to the image block are converted into plane or three-dimensional coordinates so as to adapt to the processing configuration of the front end to the signal, thereby facilitating the successful display of the back end map content on the front end screen.
23. And rendering a proportional map requested to be displayed according to the geographic coordinates and the graphic element arrangement information contained in the graphic block.
Determining a target block area pointed by the map display request, and loading and rendering geographic coordinates and graphic element arrangement information contained in the target block area to display a proportional map conforming to the definition of the map display request; the scale map is in a proportional relationship to the view area between the initial maps.
In summary, embodiments of the present application maintain an initial map using the concept of hierarchy and partitioning, enabling the initial map to be presented and processed in a more fine-grained manner in the form of tile formations, rather than being limited in map size as is conventional, without supporting freely scaled presentations. Wherein, in the face of a request for enlarging a map to display local primitives, geographical coordinates and primitive arrangement information contained in a target tile region are loaded and rendered, so that a required scale map can be shown, the method can meet the requirement of infinitely expanding the map, and simultaneously reduce the operation pressure and resource loss caused by transmitting and processing a large amount of map data.
On the basis of the above illustration, some specific possible implementation examples will be provided below, and in practical applications, implementation contents between these examples may be implemented by combination as required according to the corresponding functional principles and application logic.
Referring to fig. 4 to 7, another embodiment of a map design method is provided, which includes the following steps:
40. and carrying out blocking processing on the layers in each level of the initial map to obtain a plurality of blocks of each layer.
In some specific examples, the process that the map layer associates the arrangement information corresponding to the occupied map element according to a preset primitive distribution rule includes: analyzing the types and the numbers of the primitives required by the primitive distribution rules to obtain the position nodes which are allowed to be occupied by each primitive, wherein each node only supports the arrangement of one primitive; and determining arrangement information of the occupation map elements in the layer nodes according to the initial occupation area of the map elements fed back by the map element distribution rule and the analyzed node positions. An initial positioning footprint may refer to a general orientation, such as the lower right corner or center, in which a primitive is initially predetermined.
In practical applications, the map of a large map scene should contain all the resident users, each user being marked by a house as a primitive. In addition, since the map needs to ensure certain randomness and aesthetic property, in the position distribution process, it is often required to randomly generate some primitives such as trees and spaces as decorations. Correspondingly, space occupation analysis can be performed on the primitives by using a hierarchical or block division concept, for example, the situation that the tree content in a block is more than the user (namely, a house icon in the drawing) in the face of the requirement of primitive distribution rule can be solved according to the requirement of the number of primitives, the probability distribution between the tree and the house is as 3:1, then three random integers from 1 to 3 are generated according to the probability, and space occupation spaces of the corresponding number, namely, nodes, are allocated for the integers; specifically, the position node with the value of 1 is only allocated to the user (i.e. the house in the figure), the position node with the value of 2 is allocated to the user and the tree, and the position node with the value of 3 is allocated to the user, the tree and other graphic elements, and one position is reserved and not used as a blank node (i.e. a null node).
In this embodiment of the present application, each node only supports arranging one primitive, that is, the occupation space between the primitives is a mutual exclusion relationship, for example, the distribution positions between the tree and the user are mutually exclusive, which is because it needs to ensure that the positions occupied by the primitives do not overlap and do not interfere with each other.
411. The tile information of the map is encoded and compressed.
In order to reduce the packet size of the back-end return map data and reduce the transmission pressure of the network packet volume, the map data can be compressed and optimized. Specifically, the geographic coordinates and the graphic element arrangement information contained in each graphic block in the initial map can be encoded according to the division form of the graphic blocks so as to obtain the map compressed data of each graphic block; the map compressed data is used for decoding and rendering the scale map. The map compressed data may be in the form of a string or vector, etc.
Referring to fig. 6, an exemplary map is divided into tiles with equal areas (e.g., tiles with 2=20×20) according to a fixed area size, and geographic information in each tile is encoded according to a certain rule, for example, tree is encoded as 3, house is encoded as 1, and no primitive is encoded as 0 (the corresponding occupied node can be regarded as an empty node). Traversing the whole image block according to a certain sequence by taking the left upper corner coordinate of the image block as a starting point in the coding mode, and coding the information of the whole image block into a string of character strings (such as 03010103 … 00); thus, the tile may be represented as a structure of an upper left corner coordinate and a string of characters, thereby completing the data compression of the tile data packet. For the front end, after the front end receives the structure (i.e. the upper left corner coordinates+a string of character strings) from the network, the front end learns the long phase of the block, such as the configuration in terms of distribution position, the number of types and positions of the contained primitives, and the like, and then analyzes the content of the tiles according to the coding rule to render, wherein the rendering has the effect of displaying the primitive data of different types in different behaviors (such as houses or trees) in the page, and in addition, the rendering restores the data cached (without coordinates) in the compression coding form into the data of the type with coordinates. In some examples, the coordinates of the upper left corner of a tile (which may be considered node coordinates) may be determined by the layer location and the layer coordinates where the tile is located.
Of course, the back-end may decode and render map data in a desired format to the front-end, so that the front-end can directly display the local or global map. In some examples, empty nodes may be filled with empty large blocks to reduce performance loss of node creation.
412. Compressing the map texture.
In practical application, an image has four channels of R (red), G (green), B (blue) and A (transparent); the transparent channel is an Alpha channel, which stores a value (0 represents transparent, 1 represents opaque), and externally appears as transparent, such as a black background represents transparent. Therefore, through analysis of the image layer, the processing of the compressed texture on the transparency channel in the image layer can be selectively optimized, namely the occupation of the transparency channel on the memory in the map is removed, so that the performance is further optimized. In a specific embodiment, for an area with transparency of a preset value in the initial map, transparency channel data of the area is removed.
For example, the transparency in a map image of a certain area can be scanned, and whether the image is 0 can be judged; when generating compressed texture, setting some parameters for an image with transparency of 0, and causing an operation tool to extract only three RGB channel data in the image so as to ensure that the generated texture data has no data of a channel with transparency.
42. The geographic coordinates assigned to each tile are calculated.
In some specific examples, the specific course of operation of step 42 may include: selecting a standby image block from at least one image layer, and generating corresponding numbers according to the area of the standby image block to form a number set of the standby image block, wherein the numbers are used for feeding back node distribution positions of the image blocks; for each image block, extracting any number from the number set without returning, and calculating geographic coordinates allocated to the image block according to image layer position information, layer position information and the extracted number corresponding to the image block; if the number of one number set is completely taken as empty, the number is taken from other non-empty number sets, and the layer information comprises the layer corresponding to the layer.
As shown in fig. 5, when setting the tile positions (distributing the geographic coordinates), the concept of the hierarchy can be maintained in the background service, for example, starting from the central area, more layers (layers) are expanded outwards layer by layer, each layer is divided into tiles (blocks) with equal size (for example, the length and the width are 20), and correspondingly, the x-th layer can be divided into 8x-4 blocks. Taking layer 2 as an example, the specific flow of assigning geographic coordinates to each tile in the layer may be as follows:
1) The distribution process starts from the first layer of the center, and after the distribution of the layer is finished, the distribution process is sequentially and outwards expanded to the next layer, namely, the distribution of geographic coordinates for the tiles of the next layer is continued.
2) When a layer is allocated, any one block is randomly selected from all blocks in the layer as a spare block, if the block is allocated for the first time (i.e. geographical coordinates are not allocated before), a corresponding number (e.g. 400 integers such as 0 to 399) is generated according to the area size (20×20=400) of the block, and the numbers can be written into a set of storage systems, so that the initialization of the block can be considered as being completed.
3) If the initialization of the block is completed, randomly extracting one or more integers from the existing number set of the block, and taking out the integers without returning to the original number set, converting out the geographic position coordinates (x, y) of the block in a two-dimensional or three-dimensional coordinate system according to the number index of the taken integers and the position of the block (such as the layer position information level and the layer position information cell) of the block, wherein the conversion formula can be (x, y) =f (level, cell, index), so that the one-time allocation process can be considered to be completed, and the geographic coordinates (x, y) allocated to the block can be obtained. The existing number set is understood to be the remaining number set formed by the fact that numbers in the original number set generated initially may be taken away by other blocks; of course, the original number set may be unchanged when it faces the block, i.e., the number is not taken away.
As a possible implementation manner, the process of extracting any number from the number set without replacing the number set and calculating the geographic coordinate allocated to the tile according to the layer position information, the layer position information and the taken number corresponding to the tile may specifically include: each block is marked from a non-empty number set generated by the block of the respective block, the same layer or different layers; starting with a first layer centered in the initial map, calculating the geographic coordinates allocated to each layer of image blocks layer by layer according to the image block position information corresponding to the image blocks, the intra-layer position information and the numbered image blocks.
For example, if the number of a number set is completely taken as empty, the number is taken from other non-empty number sets, for example, the number can be taken from the number set generated by other blocks in the same layer or different layers, that is, cross-layer number taking is supported to calculate the geographic coordinates of the layer of the block; this is because the number contained in the original number set of the tiles of the same area in each layer is the same, and the numbers in the sets can be completely identical, for example, all the numbers are 400 integers from 0 to 399; another reason is that these 400 integers can be regarded as a permutation number between 400 nodes in a block, which is used to distinguish the positional relationship between the nodes in finer granularity, that is, to indicate which positional node in the block, so as to facilitate the subsequent positioning of which node is allocated with a primitive. It will be appreciated that in scaling out the geographic coordinates (x, y), the primary or decisive role is that layer position and intra-layer position information, i.e., hierarchical and block-level position information, and the node numbering is secondary. Of course, the numbers in each number set may not be completely identical, and may be self-determined according to actual situations.
In practical application, position allocation may not be performed from the first layer, that is, the sequence of the geographical coordinates allocated between the image blocks of each layer may not be limited, for example, the coordinates may be allocated to the image blocks of the second layer first and then the coordinates may be allocated to the image blocks of the first layer, or may be performed simultaneously, which may be specific to the actual scene, and the sequence is not limited here.
4) If each block of the layer completes the allocation process, the layer is considered to be allocated, and the layer starts to be expanded to the next layer, for example, the processes 2 and 3 are repeated, and then each block of each layer is allocated to the geographic coordinates.
The above processes 1) to 4) promote the support of the zooming effect corresponding to the idea of layering and blocking, and can be used for displaying the scene on the map to a high degree. The processes 1) to 4) can use the distributed memory KV and Lua script to realize position allocation and ensure that the allocated positions are not overlapped.
43. And rendering a proportional map requested to be displayed according to the geographic coordinates and the graphic element arrangement information contained in the graphic block.
In some specific examples, the process of loading the geographic coordinates and primitive layout information contained in the target tile region (loading data) may include: 1. for the first map display request, determining a target block area as a local map in an initial view area in an initial map, and loading all geographic coordinates and graphic element arrangement information contained in the local map to render a proportional map showing graphic elements of the local map; the initial visual area refers to a preset envelope area around the center point of the screen view; 2. and for a view angle moving or scaling operation request which occurs on the basis of the first map display request, determining a new target block area pointed by the latest request, traversing whether a to-be-loaded area which is not loaded with data exists in the new target block area and a preset peripheral area thereof until all geographic coordinates and graphic element arrangement information which are required correspondingly are loaded and the to-be-loaded area does not exist, and transmitting all the loaded data to a rendering layer to show a new proportional map with the graphic elements of the new target block area.
Because of the huge map data, the map data can be loaded only in times according to the needs, so that the size and time of network data transmission are reduced. The map data may be preprocessed and preloaded by the following procedure, as shown in fig. 7.
1) When the map is first entered, data of a certain area (such as 50 x 50) near a center point (such as a screen view center point) is loaded so as to meet the requirement of first rendering and displaying the map.
2) Traversing the visual area: the loaded map data (including 0301 … coded strings) in the 1.5 times visual area (i.e. the initial visual area, or the target tile area and the preset peripheral area) is calculated, and is converted into a specific rendering data structure (such as tree and house …) and delivered to rendering layer logic, meanwhile, whether the unloaded area size exists in the visual area is calculated, if so, the process enters the process 3), and if not, the process enters the process 4).
3) Region data to be loaded in the viewable region is requested and then flow 2) is entered to render a map data representation of the corresponding type (which is a tree or house).
4) When the map is entered again, the process proceeds to the flow 2) after waiting for the user's viewing angle movement or zoom operation.
In some specific examples, by rendering 1.5 times the size of the user viewable area, nodes of the non-viewable area may be dynamically reclaimed to implement a node pool scheme suitable for map scenes, thereby reducing performance loss from continually removing (remove From Parent) information from the parent set. In contrast, the parent set not only contains massive node data, but also contains unnecessary data such as node time stamps, primitive time stamps and the like, so that a node pool needs to be built to take and put the node data in a targeted manner, and other unnecessary data redundancy or application performance loss is avoided. In particular, the process (rendering data) of rendering the geographic coordinates and the primitive arrangement information contained in the target tile region may include: taking the target block area and the area outside the preset peripheral area as a non-view area, and recovering node information of the non-view area to a node pool; if the view moving or scaling operation request occurs, updating the storage content of the node pool, wherein updating comprises extracting node information belonging to the new view area for loading and rendering corresponding graphic elements, and recovering the node information not belonging to the new view area to the node pool. Optionally, the radius of the envelope of the preset peripheral region may be greater than or equal to 0, and may be specific according to requirements.
For example, in the face of the operation of moving, zooming in or zooming out the map by the user, the node in the visible area changes along with the operation change, so from the aspect of performance loss, a scheme of recovering the node can be adopted, the recovering process is not to destroy the node and the information thereof, but to put the node in the node pool, and then when the newly added node is needed to be displayed in the visible area, the node information is taken out from the node pool to be displayed in a complementary rendering mode. In other words, the storage content of the node pool is updated when the map is moved or scaled, and the built node pool can be used for multiple operation requests so as to reflect the high utilization rate of the node pool in multiplexing.
The operations of steps 40, 42 to 43 are similar to those of steps 21 to 23, and detailed descriptions thereof are omitted. The order of execution of steps 411, 412 and 42 may not be limited, and may be performed simultaneously, as the case may be. In contrast to the illustration shown in fig. 2, the above-mentioned steps 411 and 412 are not necessarily performed in the implementation, and if two or more steps are added, these steps may be implemented in combination or separately, depending on the actual scenario.
It will be appreciated that the above description can be generalized to include all resident users in the map presentation of a large map scene, so that in order to provide high quality view, the following requirements may be placed on the background service design: the large-scale data storage is supported, and the storage magnitude is more than ten millions; at the minimum scaling, thousands of pieces of data need to be supported; as users grow, the map needs to expand outward from the central area and ensure that the locations between users do not overlap. In response to this requirement, the overall design architecture of the method can be divided into two parts of a writing map and a reading map, and the writing map part can be summarized as follows: a user initiates a resident request, allocates the user graphic element to a certain current level, allocates the user graphic element to a random graphic block of the current level, extracts graphic element information (such as graphic element type is "user") and position information (the position of the graphic layer where the graphic element is located and the position in the layer), stores map data such as the graphic element information and the position information (which can be compressed and recorded in a coding form), and then successfully writes the user into a map; the read map section can be summarized as: the user initiates a map display request-reads out the corresponding cache content according to the ID information of the required display tile-renders the cache content to show the required scale map.
The map main storage can select a MongoDB database to store user positions, randomly generated tree and other primitive information, and uses 2d-index of the MongoDB as a geographic position index to inquire out information near a target block area (such as a front screen view center point), wherein the information comprises primitive information (such as a primitive type is 'user' or 'tree') and position coordinate information (layer position and intra-layer position) near the center point, and if the map is a house, the map main storage also comprises user account and other information; this information is used to render map data for the front end to accurately show the map with primitives such as house, number, etc. Because the front map can be dragged, when the front is dragged to different positions (i.e. the target tile area is changed), the map information near the different positions needs to be displayed.
When the map is read, the map can be divided according to the layer and block concepts so as to convert the map into a block representation form with fine granularity, then the memory buffer and the distributed memory (KV) buffer can be read according to the IDs of the blocks, finally the main memory MongoDB is queried, and if the query finds that the block is already allocated, the background service can generate data buffers such as geographic coordinates, graphic element information and the like for the block and store the data buffers in the KV storage system in a compressed coding mode.
In summary, after defining the map generation rule (such as primitive distribution rule), the data of the map can be obtained through the corresponding algorithm operation. In the embodiment of the application, when a user views a map, the data transmission pressure can be greatly reduced and the network efficiency is improved by optimizing the volume of the network transmission packet and the compressed texture; the node pool multiplexing and local map rendering technology is adopted to further optimize the rendering performance, so that the requirements on the game map performance and functions are met. The method comprises the steps of supporting dynamic infinite expansion, contraction or movement of the map; compared with the defect that the tilemap can not dynamically expand and contract due to the fixed map size, only one type of image can be supported, and the image can not be dynamically combined or converted, the embodiment supports the combination or conversion of multiple types of images; in addition, the amount of manual work and time required for the implementation of the tilemap scheme can be reduced. Therefore, the embodiment of the application considers from the aspects of data division and rendering, supports infinite expansion and contraction of the map, and can customize some animation effects (such as newly increased class primitives) in the map; the data transmission efficiency can be remarkably improved, the network pressure is reduced, the map data capacity is supported to be rapidly expanded, and the rendering pressure is supported. Of course, a full virtual map scheme may also be used, with no local storage for the requested background data, thereby greatly reducing local storage pressure.
Referring to fig. 8, an electronic device 800 of an embodiment of the present application may include one or more Central Processing Units (CPUs) 801 and a memory 805, where the memory 805 stores one or more application programs or data.
Wherein the memory 805 may be volatile storage or persistent storage. The program stored in the memory 805 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Still further, the central processor 801 may be arranged to communicate with the memory 805 to execute a series of instruction operations in the memory 805 on the electronic device 800.
The electronic device 800 may also include one or more power supplies 802, one or more wired or wireless network interfaces 803, one or more input/output interfaces 804, and/or one or more operating systems, such as Windows ServerTM, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The cpu 801 may perform the operations performed by the foregoing first aspect or any specific method embodiment of the first aspect, which are not described herein.
A computer readable storage medium is provided comprising instructions which, when run on a computer, cause the computer to perform a method as described in the first aspect or any specific implementation of the first aspect.
A computer program product comprising instructions or a computer program is provided which, when run on a computer, causes the computer to perform the method as described above in the first aspect or any one of the specific implementations of the first aspect.
It should be understood that, in various embodiments of the present application, the sequence number of each step does not mean that the execution sequence of each step should be determined by the function and the internal logic, and should not limit the implementation process of the embodiments of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system (if any) and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, which are not described in detail herein.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system or apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all or part of the technical solution contributing to the prior art, or in the form of a software product, which is stored in a storage medium (computer program product) and includes several instructions for causing a computer device (which may be a personal computer, a service server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM, random access memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.

Claims (10)

1. A map design method, characterized by comprising:
partitioning the layers in each layer of the initial map to obtain a plurality of blocks of each layer; the graphic layer is associated with arrangement information corresponding to the occupation graphic elements according to a preset graphic element distribution rule, and the graphic elements comprise at least one graphic element of a user icon, a plant icon and a building icon;
for each image block, calculating geographic coordinates allocated to the image block according to layer position information and layer position information of the image block, wherein the layer position refers to the position of the image block in the layer;
determining a target block area pointed by a map display request, and loading and rendering the geographic coordinates and the graphic element arrangement information contained in the target block area to display a proportional map conforming to the definition of the map display request; the scale map is in a scale relationship with a view area between the initial maps.
2. The map design method according to claim 1, wherein for each of the tiles, calculating the geographic coordinates to which the tile is assigned according to the layer position information and the layer position information to which the tile is located includes:
selecting a standby image block from at least one image layer, and generating a corresponding number of numbers according to the area of the standby image block to form a number set of the standby image block, wherein the numbers are used for feeding back node distribution positions of the image blocks;
for each image block, extracting any number from the number set without returning, and calculating the geographic coordinates allocated to the image block according to the image layer position information, the intra-layer position information and the extracted number corresponding to the image block; and if the number of one number set is completely taken as null, taking the number from other non-null number sets, wherein the layer information comprises the layer corresponding to the layer.
3. The map design method according to claim 2, wherein the extracting an arbitrary number from the number set without being replaced, and calculating the geographic coordinates to which the tile is assigned according to the layer position information, and the taken number corresponding to the tile, includes:
each block takes a number from the non-empty number set generated by the block of the respective block, the same layer or different layers;
starting with a first layer centered in the initial map, calculating the geographic coordinates allocated to each layer of image blocks layer by layer according to the image layer position information corresponding to the image blocks, the intra-layer position information and the numbered image blocks.
4. The map design method according to claim 1, wherein the map layer is specifically composed of a plurality of nodes; the process that the map layer is associated with the arrangement information corresponding to the occupied map element according to the preset map element distribution rule comprises the following steps:
analyzing the primitive types and the primitive numbers required by the primitive distribution rules to obtain position nodes which are allowed to be occupied by each primitive, wherein each node only supports the arrangement of one primitive;
and determining arrangement information of the occupation map elements in the layer nodes according to the initial occupation area of the primitives fed back by the primitive distribution rules and the analyzed node positions.
5. The map design method of claim 1, wherein prior to loading and rendering the geographic coordinates and primitive layout information contained in the target tile region, the method further comprises:
according to the dividing form of the image blocks, the geographic coordinates and the graphic element arrangement information contained in each image block in the initial map are encoded to obtain map compressed data of each image block; the map compression data is used for decoding and rendering the scale map.
6. The map design method according to claim 1, wherein the process of loading the geographical coordinates and the primitive arrangement information contained in the target tile region includes:
for a first map display request, determining the target block area as a local map in an initial view area in the initial map, and loading all geographic coordinates and graphic element arrangement information contained in the local map to render a proportional map showing the graphic elements of the local map; the initial visual area refers to a preset envelope area around the center point of the screen view;
and for a view angle moving or zooming operation request which occurs on the basis of the map display request for the first time, determining a new target block area pointed by the latest request, traversing whether a to-be-loaded area without data exists in the new target block area and a preset peripheral area thereof until all geographic coordinates and graphic element arrangement information which are needed correspondingly are loaded, and after the to-be-loaded area does not exist, transmitting all the loaded data to a rendering layer to show a new proportional map.
7. The map design method according to claim 1, wherein the process of rendering the geographic coordinates and primitive arrangement information contained in the target tile region comprises:
taking the target block area and the area outside the preset peripheral area as a non-view area, and recovering node information of the non-view area to a node pool;
if the view moving or scaling operation request occurs, updating the storage content of the node pool, wherein the updating comprises extracting node information belonging to a new view area for loading and rendering corresponding graphic elements, and recovering the node information not belonging to the new view area to the node pool.
8. The map design method according to claim 1, wherein before displaying the scaled map conforming to the map display request definition, the method further comprises:
and removing transparency channel data of an area with the transparency of a preset value in the initial map.
9. An electronic device, comprising:
a central processing unit, a memory and an input/output interface;
the memory is a short-term memory or a persistent memory;
the central processor is configured to communicate with the memory and to execute instruction operations in the memory to perform the method of any of claims 1 to 8.
10. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 8.
CN202311327539.3A 2023-10-13 2023-10-13 Map design method and related equipment Pending CN117282100A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311327539.3A CN117282100A (en) 2023-10-13 2023-10-13 Map design method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311327539.3A CN117282100A (en) 2023-10-13 2023-10-13 Map design method and related equipment

Publications (1)

Publication Number Publication Date
CN117282100A true CN117282100A (en) 2023-12-26

Family

ID=89240721

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311327539.3A Pending CN117282100A (en) 2023-10-13 2023-10-13 Map design method and related equipment

Country Status (1)

Country Link
CN (1) CN117282100A (en)

Similar Documents

Publication Publication Date Title
CN109977192B (en) Unmanned aerial vehicle tile map rapid loading method, system, equipment and storage medium
US8798397B2 (en) System and method for converting source image data to tile data
CN110599490B (en) Remote sensing image data storage method and system
US10262392B2 (en) Distributed and parallelized visualization framework
CN108205960B (en) Method and device for rendering characters, electronic map making system and navigation system
CN110597900B (en) Method for generating vector slice by GDB data in real time according to needs
CN113628331B (en) Data organization and scheduling method for photogrammetry model in illusion engine
CN109859109B (en) Series scale PDF map seamless organization and display method
WO2012116160A1 (en) Map creation
CN101809625A (en) Geospatial data system for selectively retrieving and displaying geospatial texture data in successive additive layers of resolution and related methods
WO2023226371A1 (en) Target object interactive reproduction control method and apparatus, device and storage medium
CN111932668A (en) Three-dimensional visualization method, system, medium and electronic equipment for urban landscape model
US10013474B2 (en) System and method for hierarchical synchronization of a dataset of image tiles
CN101802875A (en) Geospatial data system for selectively retrieving and displaying geospatial texture data based upon user-selected point-of-view and related methods
CN112486987A (en) City inquiry method, device, equipment and storage medium based on longitude and latitude
JP4885558B2 (en) Entity lookup system
She et al. 3D building model simplification method considering both model mesh and building structure
CN117282100A (en) Map design method and related equipment
CN116737852A (en) Vector tile data-based vector drawing method and device and electronic equipment
CN115408382A (en) Vector space information gridding storage management method for large-scale satellite data
JP2023501640A (en) POINT CLOUD PROCESSING METHOD, COMPUTER SYSTEM, PROGRAM AND COMPUTER-READABLE STORAGE MEDIUM
Liu et al. An effective spherical panoramic LoD model for a mobile street view service
CN116883575B (en) Building group rendering method, device, computer equipment and storage medium
RU2720073C2 (en) Method and electronic device for creating index of segments of polygons
CN117808980A (en) Map grid picture generation method, system, equipment and storage medium

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