A game map block loading method, device and equipment and a storage medium

CN115421807BActive Publication Date: 2026-09-15GUANGZHOU YANLI NETWORK TECH CO LTD +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211000660.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2026-09-15
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

[0005]但是,上述这两种现行的方案存在以下问题:做法一:无法做到预加载地图分块

Benefits of technology

[0034] Compared with the prior art, the game map chunk loading method, apparatus, device and storage medium provided by the embodiments of the present invention preloads the map chunks required for the next game map operation at the end of the current game map operation, avoiding stuttering and frame drops in the display interface, and ensuring that the display interface does not go black when it moves to the boundary of the map chunk; furthermore, by loading only the map chunks adjacent to the quadrant area to which the center point of the display interface belongs, it is not necessary to load nine map chunks at once, saving memory, greatly reducing the number of system read and write operations, and improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421807B_ABST
    Figure CN115421807B_ABST
Patent Text Reader

Abstract

The application discloses a game map block loading method and device, equipment and a storage medium, the method comprises the following steps: obtaining the position of the center point of the display interface on the game map at the end of each game map moving operation; obtaining the map block where the position is located, and performing quadrant division on the map block; wherein the map block is a subgraph of the game map; judging the quadrant region where the position is located, and loading the map block adjacent to the quadrant region. The embodiment of the application can pre-load the required map block after the next movement, without loading nine map blocks, saving memory, and greatly reducing the number of system read and write operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for loading game maps in chunks. Background Technology

[0002] With the development of the internet and the gaming industry, online games are becoming increasingly popular. Most online games require maps. As the most basic carrier, the entire game map must be loaded every time the game starts. As the map expands and grows, performance consumption and memory usage increase exponentially. Therefore, optimizing the map for memory and performance is essential.

[0003] To reduce the memory footprint of maps, their data files are typically segmented into chunks, ensuring that each chunk is larger than the display screen's size. When loading the map, only the chunk corresponding to the current display screen needs to be loaded. While loading only the current map chunk is sufficient when the display screen is stationary, efficiently, automatically, and recognizablely loading the map to be displayed when the screen moves has become a hot research topic.

[0004] There are currently two common approaches: Approach 1: Determine the positions of the four vertices of the currently displayed interface on the game map and load the map chunk file containing each vertex; Approach 2: Using the map chunk containing the center point of the displayed interface as the center grid, load nine map chunk files in a 3x3 grid shape.

[0005] However, the two existing solutions mentioned above have the following problems: Solution 1: It cannot preload map tiles. This solution can only load the next map tile by judging the conditions when moving to the boundary of a map tile in real time. When encountering the intersection of map tiles or moving quickly in the display interface, it will cause a large amount of data to be loaded at the same time, resulting in the inability to load map data in time, and eventually causing lag, black screen and other phenomena. Solution 2: Loading too many map tiles does not achieve the maximum memory saving, and frequent read and write operations are required, resulting in high performance consumption. If the map tile is too large, the memory saving space is negligible; if the map tile is too small, the performance consumption is too high, which is not worthwhile; even if the optimal tile size is found, it is still necessary to keep loading the memory of nine map tiles, and at least 3 to 5 system read and write operations are required when moving. Summary of the Invention

[0006] The purpose of this invention is to provide a method, apparatus, device, and storage medium for loading game map chunks, which can preload the map chunks required for the next game map movement operation, without having to load nine map chunks, thus saving memory and greatly reducing the number of system read and write operations.

[0007] To achieve the above objectives, embodiments of the present invention provide a method for loading game map chunks, including:

[0008] At the end of each game map movement operation, obtain the position of the center point of the display interface on the game map;

[0009] Obtain the map tile where the location is located, and divide the map tile into quadrants; wherein, the map tile is a sub-map of the game map;

[0010] Determine the quadrant region where the location is located, and load the map tiles adjacent to the quadrant region.

[0011] As an improvement to the above scheme, the map tiles are obtained through the following steps:

[0012] The game map is cut into several map blocks of the same size; wherein, the length H of the map block satisfies the following relationship: H / 2 is greater than the length of the display interface, and H / 2 is greater than the preset maximum screen movement distance in a single operation; the width W of the map block satisfies the following relationship: W / 2 is greater than the width of the display interface, and W / 2 is greater than the preset maximum screen movement distance in a single operation.

[0013] As an improvement to the above solution, the game map chunk loading method further includes:

[0014] At the end of each game map movement operation, the map tile currently displayed on the display interface is cached in the cache.

[0015] Then, loading the map tiles adjacent to the quadrant region further includes:

[0016] When it is determined that the cache contains map tiles adjacent to the quadrant region, the remaining map tiles adjacent to the quadrant region are loaded.

[0017] As an improvement to the above solution, the position of the center point of the display interface on the game map is obtained through the following steps:

[0018] A first planar rectangular coordinate system is established with the upper left corner of the game map as the first origin, the ray that passes through the first origin and extends to the right as the X-axis, and the ray that passes through the first origin and extends downward as the Y-axis.

[0019] Based on the first planar rectangular coordinate system, the coordinates of the center point of the display interface on the center point of the game map are obtained.

[0020] As an improvement to the above solution, the map tile where the location is located is obtained through the following steps;

[0021] The X-axis coordinate of the center point is divided by the width of the map tile, and the Y-axis coordinate of the center point is divided by the length of the map tile to obtain the tile coordinates of the map tile where the center point is located; wherein, the tile coordinates of the map tile in the nth row and mth column are represented as (n-1, m-1).

[0022] Based on the block coordinates, obtain the map block where the center point coordinates are located.

[0023] As an improvement to the above scheme, the quadrant division of the map tiles includes:

[0024] A second Cartesian coordinate system is established using any vertex of the map segment as the second origin;

[0025] Based on the second Cartesian coordinate system, the map is divided into four quadrant regions.

[0026] As an improvement to the above solution, the quadrant region where the location is situated is determined through the following steps:

[0027] Based on the preset quadrant determination rules corresponding to the first plane rectangular coordinate system, the quadrant region where the position is located is determined according to the coordinates of the center point and the block coordinates.

[0028] To achieve the above objectives, embodiments of the present invention also provide a game map chunk loading device, including a controller, wherein the controller is configured to:

[0029] At the end of each game map movement operation, obtain the position of the center point of the display interface on the game map;

[0030] Obtain the map tile where the location is located, and divide the map tile into quadrants; wherein, the map tile is a sub-map of the game map;

[0031] Determine the quadrant region where the location is located, and load the map tiles adjacent to the quadrant region.

[0032] To achieve the above objectives, embodiments of the present invention also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the above-described game map chunk loading method when executing the computer program.

[0033] To achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the above-described game map chunk loading method.

[0034] Compared with the prior art, the game map chunk loading method, apparatus, device and storage medium provided by the embodiments of the present invention preloads the map chunks required for the next game map operation at the end of the current game map operation, avoiding stuttering and frame drops in the display interface, and ensuring that the display interface does not go black when it moves to the boundary of the map chunk; furthermore, by loading only the map chunks adjacent to the quadrant area to which the center point of the display interface belongs, it is not necessary to load nine map chunks at once, saving memory, greatly reducing the number of system read and write operations, and improving efficiency. Attached Figure Description

[0035] Figure 1 This is a flowchart of a game map chunk loading method provided in an embodiment of the present invention;

[0036] Figure 2 This is a schematic diagram of the game map presented on the display interface according to an embodiment of the present invention;

[0037] Figure 3 This is a schematic diagram of the block coordinates of the map segmentation provided in the embodiment of the present invention;

[0038] Figure 4 This is a schematic diagram of quadrant division provided in an embodiment of the present invention;

[0039] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0041] See Figure 1 , Figure 1 This is a flowchart of a game map chunk loading method provided by an embodiment of the present invention. The game map chunk loading method includes:

[0042] S1. At the end of each game map movement operation, obtain the position of the center point of the display interface on the game map;

[0043] S2. Obtain the map segment where the location is located, and divide the map segment into quadrants; wherein, the map segment is a sub-map of the game map;

[0044] S3. Determine the quadrant region where the location is located, and load the map tiles adjacent to the quadrant region.

[0045] It is understood that the display interface refers to the screen interface of the electronic device used by the user when logging into the game.

[0046] It is understandable that, such as Figure 2 As shown, each square represents a map tile, and each number indicates the corresponding quadrant. In this embodiment of the invention, there are exactly three map tiles adjacent to each quadrant region. For example, when it is determined that the center point of the display interface is in the second quadrant, the three map tiles adjacent to the second quadrant are loaded. These adjacent map tiles are the three map tiles pointed to by the arrow. Therefore, this embodiment of the invention only needs to load the three map tiles adjacent to the quadrant region, eliminating the need to load nine map tiles at once, greatly saving memory and reducing the number of system read / write operations, and significantly improving efficiency. Moreover, by pre-loading the map tiles required for the next game map operation, stuttering and frame drops in the display interface are avoided, and it is ensured that the display interface does not go black when moving to the boundary of a map tile.

[0047] In an optional embodiment, the map tiles are obtained through the following steps:

[0048] The game map is cut into several map blocks of the same size; wherein, the length H of the map block satisfies the following relationship: H / 2 is greater than the length of the display interface, and H / 2 is greater than the preset maximum screen movement distance in a single operation; the width W of the map block satisfies the following relationship: W / 2 is greater than the width of the display interface, and W / 2 is greater than the preset maximum screen movement distance in a single operation.

[0049] It is understandable that the maximum screen movement distance in a single instance is the maximum distance that the game map displayed on the screen can be moved in a single instance.

[0050] It is worth noting that when the length H of the map tile satisfies the following relationship: H / 2 is greater than the length of the display interface and H / 2 is greater than the preset maximum single screen movement distance, and the width W of the map tile satisfies the following relationship: W / 2 is greater than the width of the display interface and W / 2 is greater than the preset maximum single screen movement distance, it can be ensured that there is enough data to support the display during the movement of the display interface, and there will be no data loss.

[0051] In yet another optional embodiment, the game map chunk loading method further includes:

[0052] At the end of each game map movement operation, the map tile currently displayed on the display interface is cached in the cache.

[0053] Then, loading the map tiles adjacent to the quadrant region further includes:

[0054] When it is determined that the cache contains map tiles adjacent to the quadrant region, the remaining map tiles adjacent to the quadrant region are loaded.

[0055] In this embodiment of the invention, the map tiles used in the current mobile game map operation are first cached in a cache, which can directly provide the required map tiles for the next mobile game map operation, reducing the number of maps loaded. Specifically, the map tiles displayed on the display interface at the end of the current mobile game map operation are cached in a cache. Then, when preloading the map for the next mobile game map operation (i.e., when executing step S3), it is determined whether the cache contains map tiles adjacent to the quadrant area. If so, the cached map tiles are used directly, while the remaining map tiles adjacent to the quadrant area are loaded. Thus, this embodiment of the invention, combined with the caching mechanism, can achieve the effect of refreshing the game map by loading only 0, 2, or 3 map tiles at a time, greatly improving efficiency.

[0056] In yet another alternative embodiment, the position of the center point of the display interface on the game map is obtained through the following steps:

[0057] A first planar rectangular coordinate system is established with the upper left corner of the game map as the first origin, the ray that passes through the first origin and extends to the right as the X-axis, and the ray that passes through the first origin and extends downward as the Y-axis.

[0058] Based on the first planar rectangular coordinate system, the coordinates of the center point of the display interface on the center point of the game map are obtained.

[0059] Specifically, the map tile where the location is located is obtained through the following steps;

[0060] The X-axis coordinate of the center point is divided by the width of the map tile, and the Y-axis coordinate of the center point is divided by the length of the map tile to obtain the tile coordinates of the map tile where the center point is located; wherein, the tile coordinates of the map tile in the nth row and mth column are represented as (n-1, m-1).

[0061] Based on the block coordinates, obtain the map block where the center point coordinates are located.

[0062] For example, such as Figure 3 As shown, a second Cartesian coordinate system is established with the upper left corner of the game map as the first origin, the ray extending to the right from the first origin as the X-axis, and the ray extending downward from the first origin as the Y-axis. The entire 200*200 game map is divided into 16 map blocks of L*L=50*50, and the block coordinates of the map blocks are marked. Among them, the block coordinates are marked according to the row and column number of the map block, and the block coordinates are marked as (n-1, m-1).

[0063] Understandably, the quotient operation refers to obtaining the quotient obtained by dividing the dividend by the divisor. Dividing the X-axis coordinate of the center point by the width of the map tile (50) yields the quotient X / L; dividing the Y-axis coordinate of the center point by the length of the map tile (50) yields the quotient Y / L. The quotient of X / L and the quotient of Y / L represent the tile coordinates of the map tile where the center point is located. For example, if the center point coordinates (X, Y) are (49, 50), then the quotient of 49 / 50 is 0, and the quotient of 50 / 50 is 1. Therefore, the tile coordinates of the map tile where the center point is located are (0, 1).

[0064] Specifically, the quadrant division of the map blocks includes:

[0065] A second Cartesian coordinate system is established using any vertex of the map segment as the second origin;

[0066] Based on the second Cartesian coordinate system, the map is divided into four quadrant regions.

[0067] Specifically, the quadrant region where the location is situated is determined through the following steps:

[0068] Based on the preset quadrant determination rules corresponding to the first plane rectangular coordinate system, the quadrant region where the position is located is determined according to the coordinates of the center point and the block coordinates.

[0069] For example, such as Figure 4 As shown, a Cartesian coordinate system is established with any vertex of a map tile as the origin and the ray extending from the origin to the side length of the map tile as the X-axis / Y-axis. There are eight possible Cartesian coordinate systems, corresponding to eight preset quadrant determination rules:

[0070] Where (X, Y) are the coordinates of the center point of the display interface, and (R, G) are the tile coordinates of the map tile coordinates, where R = n-1 and G = m-1;

[0071] The first type of rectangular coordinate system (top-left positive coordinate system): Taking the top-left corner of the map tile as the origin, the ray passing through that top-left corner and extending to the right as the X-axis, and the ray passing through that top-left corner and extending downwards as the Y-axis, the corresponding quadrant determination rules are as follows:

[0072] When X>(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0073] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0074] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the third quadrant;

[0075] When X > (R*L + L / 2) and Y > (G*L + L / 2), it is determined that the center point is located in the fourth quadrant.

[0076] The second type of rectangular coordinate system (top-left reverse coordinate system): Taking the top-left corner of the map tile as the origin, the ray passing through that top-left corner and extending downwards as the X-axis, and the ray passing through that top-left corner and extending to the right as the Y-axis, the corresponding quadrant determination rules are as follows:

[0077] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0078] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0079] When X > (R*L + L / 2) and Y ≤ (G*L + L / 2), it is determined that the center point is located in the third quadrant.

[0080] When X > (R*L + L / 2) and Y > (G*L + L / 2), it is determined that the center point is located in the fourth quadrant.

[0081] The third type of rectangular coordinate system (lower left positive coordinate system): Taking the lower left corner of the map tile as the origin, the ray passing through this lower left corner and extending to the right as the X-axis, and the ray passing through this lower left corner and extending upwards as the Y-axis, the corresponding quadrant determination rules are as follows:

[0082] When X>(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0083] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0084] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the third quadrant;

[0085] When X>(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the fourth quadrant.

[0086] The fourth type of rectangular coordinate system (lower left reverse coordinate system): Taking the lower left corner of the map tile as the origin, the ray passing through that lower left corner and extending upwards as the X-axis, and the ray passing through that lower left corner and extending to the right as the Y-axis, the corresponding quadrant determination rules are as follows:

[0087] When X>(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0088] When X>(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0089] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the third quadrant;

[0090] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the fourth quadrant.

[0091] The fifth type of rectangular coordinate system (upper right positive coordinate system): Taking the upper right corner of the map tile as the origin, the ray passing through that upper right corner and extending to the left as the X-axis, and the ray passing through that upper right corner and extending downwards as the Y-axis, the corresponding quadrant determination rules are as follows:

[0092] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0093] When X>(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0094] When X>(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the third quadrant;

[0095] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the fourth quadrant.

[0096] The sixth type of rectangular coordinate system (upper right reverse coordinate system): Taking the upper right corner of the map tile as the origin, the ray passing through that upper right corner and extending downwards as the X-axis, and the ray passing through that upper right corner and extending to the left as the Y-axis, the corresponding quadrant determination rules are as follows:

[0097] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0098] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0099] When X>(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the third quadrant;

[0100] When X>(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the fourth quadrant.

[0101] The seventh type of rectangular coordinate system (bottom-right positive coordinate system): Taking the bottom-right corner of the map tile as the origin, the ray passing through that bottom-right corner and extending to the left as the X-axis, and the ray passing through that bottom-right corner and extending upwards as the Y-axis, the corresponding quadrant determination rules are as follows:

[0102] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0103] When X>(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0104] When X>(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the third quadrant;

[0105] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the fourth quadrant.

[0106] The eighth type of rectangular coordinate system (lower right reverse coordinate system): Taking the lower right corner vertex of the map tile as the origin, the ray passing through that lower right corner vertex and extending upwards as the X-axis, and the ray passing through that lower right corner vertex and extending to the left as the Y-axis, the corresponding quadrant determination rules are as follows:

[0107] When X>(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the first quadrant;

[0108] When X>(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the second quadrant;

[0109] When X≤(R*L+L / 2) and Y>(G*L+L / 2), it is determined that the center point is located in the third quadrant;

[0110] When X≤(R*L+L / 2) and Y≤(G*L+L / 2), it is determined that the center point is located in the fourth quadrant.

[0111] The game map chunk loading method provided in this invention preloads the map chunks required for the next game map operation at the end of the current game map operation, avoiding stuttering and frame drops in the display interface, and ensuring that the display interface does not go black when it moves to the boundary of a map chunk. Furthermore, by loading only the map chunks adjacent to the quadrant area of ​​the center point of the display interface, it is not necessary to load nine map chunks at once, saving memory, greatly reducing the number of system read and write operations, and improving efficiency.

[0112] This invention provides a game map tile loading device, including a controller, which is configured to:

[0113] At the end of each game map movement operation, obtain the position of the center point of the display interface on the game map;

[0114] Obtain the map tile where the location is located, and divide the map tile into quadrants; wherein, the map tile is a sub-map of the game map;

[0115] Determine the quadrant region where the location is located, and load the map tiles adjacent to the quadrant region.

[0116] Preferably, the controller is also configured to:

[0117] The game map is cut into several map blocks of the same size; wherein, the length H of the map block satisfies the following relationship: H / 2 is greater than the length of the display interface, and H / 2 is greater than the preset maximum screen movement distance in a single operation; the width W of the map block satisfies the following relationship: W / 2 is greater than the width of the display interface, and W / 2 is greater than the preset maximum screen movement distance in a single operation.

[0118] Preferably, the controller is also configured to:

[0119] At the end of each mobile game map operation, the map tile currently displayed on the terminal screen is cached in the cache.

[0120] Then, loading the map tiles adjacent to the quadrant region further includes:

[0121] When it is determined that the cache contains map tiles adjacent to the quadrant region, the remaining map tiles adjacent to the quadrant region are loaded.

[0122] Preferably, the controller is also configured to:

[0123] A first planar rectangular coordinate system is established with the upper left corner of the game map as the first origin, the ray that passes through the first origin and extends to the right as the X-axis, and the ray that passes through the first origin and extends downward as the Y-axis.

[0124] Based on the first planar rectangular coordinate system, the coordinates of the center point of the display interface on the center point of the game map are obtained.

[0125] Preferably, the controller is also configured to:

[0126] The X-axis coordinate of the center point is divided by the width of the map tile, and the Y-axis coordinate of the center point is divided by the length of the map tile to obtain the tile coordinates of the map tile where the center point is located; wherein, the tile coordinates of the map tile in the nth row and mth column are represented as (n-1, m-1).

[0127] Based on the block coordinates, obtain the map block where the center point coordinates are located.

[0128] Preferably, the controller is also configured to:

[0129] A second Cartesian coordinate system is established using any vertex of the map segment as the second origin;

[0130] Based on the second Cartesian coordinate system, the map is divided into four quadrant regions.

[0131] Preferably, the controller is also configured to:

[0132] Based on the preset quadrant determination rules corresponding to the first plane rectangular coordinate system, the quadrant region where the position is located is determined according to the coordinates of the center point and the block coordinates.

[0133] The game map chunk loading device provided in this invention preloads the map chunks required for the next game map operation at the end of the current game map operation, avoiding stuttering and frame drops in the display interface. It also ensures that the display interface does not go black when it moves to the boundary of a map chunk. Furthermore, by loading only the map chunks adjacent to the quadrant area of ​​the center point of the display interface, it eliminates the need to load nine map chunks at once, saving memory, greatly reducing the number of system read and write operations, and improving efficiency.

[0134] This invention provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the above-described game map chunk loading method.

[0135] See Figure 5 , Figure 5 This is a structural block diagram of an electronic device 20 provided in an embodiment of the present invention. The electronic device 20 includes: a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above-described game map chunk loading method embodiment. Alternatively, when the processor 21 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments.

[0136] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device 20.

[0137] The electronic device 20 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The electronic device 20 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 20 and does not constitute a limitation on the electronic device 20. It may include more or fewer components than shown, or combine certain components, or different components. For example, the electronic device 20 may also include input / output devices, network access devices, buses, etc.

[0138] The processor 21 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The processor 21 is the control center of the electronic device 20, connecting all parts of the electronic device 20 via various interfaces and lines.

[0139] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the electronic device 20 by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0140] If the modules / units integrated in the electronic device 20 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0141] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0142] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for loading game maps in chunks, characterized in that, include: The game map is cut into several map tiles of the same size; wherein, the length H of the map tile satisfies the following relationship: H / 2 is greater than the length of the display interface, and H / 2 is greater than the preset maximum single screen movement distance; the width W of the map tile satisfies the following relationship: W / 2 is greater than the width of the display interface, and W / 2 is greater than the preset maximum single screen movement distance. At the end of each game map movement operation, obtain the position of the center point of the display interface on the game map; Obtain the map tile where the location is located, and divide the map tile where the location is located into quadrants; Determine the quadrant region where the location is located, and load the map tiles adjacent to the quadrant region.

2. The game map segmentation loading method as described in claim 1, characterized in that, The game map chunk loading method also includes: At the end of each game map movement operation, the map chunk currently displayed on the screen is cached in the cache. Then, loading the map tiles adjacent to the quadrant region further includes: When it is determined that the cache contains map tiles adjacent to the quadrant region, the remaining map tiles adjacent to the quadrant region are loaded.

3. The game map segmentation loading method as described in claim 1, characterized in that, To obtain the location of the center point of the displayed interface on the game map, follow these steps: A first planar rectangular coordinate system is established with the upper left corner of the game map as the first origin, the ray that passes through the first origin and extends to the right as the X-axis, and the ray that passes through the first origin and extends downward as the Y-axis. Based on the first Cartesian coordinate system, the coordinates of the center point of the display interface on the game map are obtained and recorded as the center point coordinates.

4. The game map segmentation loading method as described in claim 3, characterized in that, The map tile where the location is situated is obtained through the following steps; The X-axis coordinate of the center point is divided by the width of the map tile, and the Y-axis coordinate of the center point is divided by the length of the map tile to obtain the tile coordinates of the map tile where the center point is located; wherein, the tile coordinates of the map tile in the nth row and mth column are represented as (n-1, m-1). Based on the block coordinates, obtain the map block where the center point coordinates are located.

5. The game map segmentation loading method as described in claim 4, characterized in that, The quadrant division of the map tiles includes: A second Cartesian coordinate system is established using any vertex of the map segment as the second origin; Based on the second Cartesian coordinate system, the map is divided into four quadrant regions.

6. The game map segmentation loading method as described in claim 5, characterized in that, The quadrant region where the location is situated is determined by the following steps: Based on the preset quadrant determination rules corresponding to the first plane rectangular coordinate system, the quadrant region where the position is located is determined according to the coordinates of the center point and the block coordinates.

7. A game map segmentation loading device, characterized in that, Includes a controller, which is configured to: The game map is cut into several map tiles of the same size; wherein, the length H of the map tile satisfies the following relationship: H / 2 is greater than the length of the display interface, and H / 2 is greater than the preset maximum single screen movement distance; the width W of the map tile satisfies the following relationship: W / 2 is greater than the width of the display interface, and W / 2 is greater than the preset maximum single screen movement distance. At the end of each game map movement operation, obtain the position of the center point of the display interface on the game map; Obtain the map tile where the location is located, and divide the map tile where the location is located into quadrants; Determine the quadrant region where the location is located, and load the map tiles adjacent to the quadrant region.

8. An electronic device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the game map chunk loading method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the game map chunk loading method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Game map processing method, device, terminal equipment and storage medium

    CN110559665A

  • Map processing method and device

    CN111617484A