Game map data update display method and device, electronic equipment and medium

CN116271842BActive Publication Date: 2026-04-14珠海剑心互动娱乐有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-17
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

但空闲格子数少时则浪费内存,而且多了容器操作可能效率更低

Benefits of technology

[0006]本发明实施例的主要目的在于提出一种游戏地图数据更新展示方法、装置、电子设备及介质,降低了地图数据管理消耗。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116271842B_ABST
    Figure CN116271842B_ABST
Patent Text Reader

Abstract

The application provides a game map data update display method and device, electronic equipment and medium. The game map data update display method comprises the following steps: performing regional division on a target map scene according to a game map data display request, obtaining a plurality of regions, and setting an index identifier for each region; detecting the regions of the target map scene, and if there is a game element change, determining a first index range and a second index range according to the index identifiers before and after the update, wherein the first index range and the second index range are respectively used to represent the active regions before and after the update; comparing the first index range and the second index range, updating the second index range according to the comparison result, and obtaining a third index range. The application has the beneficial effects of reducing the consumption of map data management and improving the data operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer game technology, and in particular to a method, apparatus, electronic device, and medium for updating and displaying game map data. Background Technology

[0002] Map data management is one of the core aspects of Mmorgp games. All players and game elements move around on the game map, and how to better manage map data is a major pain point in game performance.

[0003] A common map data management pattern in MMORPGs is to divide a map into multiple equally sized regions, and then manage game elements such as NPCs and ammunition within each region. The main game loop needs to traverse the map's regions and then update (activate) child game elements within each region. If there are many maps, and each map is large—for example, the main game loop might need to traverse over 50,000 regions per frame—even just checking whether a region needs updating during traversal takes considerable time. To optimize this, i.e., how to reduce the number of regions traversed, a common approach is to add a map (an associative container storing key-value pairs and mappings) to manage the regions that need updating, and then directly traverse this map during the game loop.

[0004] When there are many regions that need to be updated, i.e., most of the map contains active game elements, adding another data container (map) to store region pointers or index numbers will result in significant memory waste and little actual efficiency improvement. This is because locating the required region through the map also incurs some extra overhead, and adding a map management layer leads to more modifications to existing logic.

[0005] like Figure 1 As shown, each grid cell represents a region, and the green stars indicate the player's actual activity area. The original approach involves traversing 7*4 grid cells, which is significantly inefficient when there are many empty cells. A common optimization approach is to use an additional container to store the green star cells, such as an unordered map or a map. The traversal cost depends on the container's data structure implementation. However, this wastes memory when there are few empty cells, and using more containers may further reduce efficiency. Summary of the Invention

[0006] The main objective of this invention is to provide a method, device, electronic device, and medium for updating and displaying game map data, thereby reducing the overhead of map data management.

[0007] One aspect of the present invention provides a method for updating and displaying game map data, characterized in that it includes:

[0008] Based on the game map data update and display request, the target map scene is divided into regions to obtain multiple regions, and an index identifier is set for each region;

[0009] The target map scene area is detected. If there are changes in game elements, the first index range and the second index range are determined according to the index identifiers before and after the update. The first index range and the second index range are used to represent the activity area before and after the update, respectively.

[0010] By comparing the first index range and the second index range, and updating the second index range based on the comparison result, a third index range is obtained.

[0011] According to the game map data update and display method, the index identifier is identified by the location of the target map scene on a planar map.

[0012] According to the game map data update and display method, the changes in game elements include at least one of the changes caused by external operation requests and changes in in-game settings.

[0013] According to the game map data update and display method, the target map scene area is detected. If there are changes in game elements, a first index range and a second index range are determined based on the index identifiers before and after the update, including:

[0014] The first index range and the second index range are determined based on the location identifier of the active region existing in the index range, and the first index range and the second index range share the same data container.

[0015] According to the game map data update and display method, the first index range and the second index range are compared, and the second index range is updated based on the comparison result to obtain the third index range, including:

[0016] The maximum and minimum values ​​of the position identifiers in the first index range and the second index range are compared respectively;

[0017] If both the x-axis and y-axis values ​​in the first index range are greater than the second index range, then no update is performed;

[0018] If at least one of the x-axis value and y-axis value in the first index range is less than the second index range, then it is updated to the difference between the first index range and the second index range.

[0019] The method for updating and displaying game map data includes:

[0020] When the first index range does not change, the first index range is reduced to the initial value or remains unchanged, wherein the initial value is a custom-set area.

[0021] The method for updating and displaying game map data includes:

[0022] Game element change types: A set of corresponding data is assigned and managed for each type of game element change.

[0023] Another aspect of the invention provides a game map data update and display device, comprising:

[0024] The first module is used to divide the target map scene into regions based on the game map data display request, obtain multiple regions, and set an index identifier for each region;

[0025] The second module is used to detect the area of ​​the target map scene. If there are changes in game elements, the first index range and the second index range are determined according to the index identifiers before and after the update. The first index range and the second index range are used to represent the activity area before the update and the current activity area, respectively.

[0026] The third module is used to compare the first index range and the second index range, and update the second index range based on the comparison result to obtain the third index range.

[0027] Another aspect of the present invention provides an electronic device, including a processor and a memory;

[0028] The memory is used to store programs;

[0029] The processor executes the program to implement the game map data update and display method described above.

[0030] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the methods described above.

[0031] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0032] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0033] Figure 1 This is a schematic diagram illustrating the existing methods for updating and displaying game map data.

[0034] Figure 2 This is a schematic diagram of a game map data update and display method according to an embodiment of the present invention.

[0035] Figure 3 This is a schematic diagram of the index range determination process according to an embodiment of the present invention.

[0036] Figure 4 This is a schematic diagram of the process of updating according to the index range in an embodiment of the present invention.

[0037] Figure 5a and Figure 5b These are schematic diagrams illustrating the index range update according to an embodiment of the present invention.

[0038] Figure 6 This is a schematic diagram of a device for updating and displaying game map data according to an embodiment of the present invention. Detailed Implementation

[0039] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings. Throughout the description, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions. In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no specific meaning in themselves. Therefore, "module," "part," or "unit" can be used interchangeably. Terms such as "first," "second," etc., are used only to distinguish technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the sequential relationship of the indicated technical features. In the following description, the consecutive reference numerals for method steps are for ease of review and understanding. Adjusting the implementation order of steps, in conjunction with the overall technical solution of the present invention and the logical relationship between the various steps, will not affect the technical effect achieved by the technical solution of the present invention. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0040] Terminology Explanation:

[0041] Mmorpg: A massively multiplayer online role-playing game;

[0042] Region: A fixed-size, equally divided area (grid) on a map;

[0043] NPC: Non-player controlled character.

[0044] refer to Figure 2 ,in Figure 2 This is a method for updating and displaying game map data according to an embodiment of the present invention, which includes, but is not limited to, steps S100 to S300:

[0045] S100 divides the target map scene into multiple regions based on the game map data display request, and sets an index identifier for each region.

[0046] In some embodiments, the index identifier is a location identifier on a planar map of the target map scene. For example, each region has an index subscript xy on the map, and the map adds four member variables corresponding to the minimum and maximum index subscripts xy of the range to be traversed, where xy can be coordinates used to represent the location of the region on the target map.

[0047] S200, detect the area of ​​the target map scene. If there are changes in game elements, determine the first index range and the second index range based on the index identifiers before and after the update. The first index range and the second index range are used to represent the activity area before and after the update, respectively.

[0048] In some embodiments, changes to game elements include at least one of changes caused by external operation requests and changes to in-game settings.

[0049] In some embodiments, reference Figure 3 This includes, but is not limited to, step S210:

[0050] S210, the first index range and the second index range are determined according to the location identifier of the active area existing in the index range, and the first index range and the second index range share the same data container.

[0051] In some embodiments, each time a region needs to be updated, the current minimum and maximum region index subscripts x and y can be determined by using the first index range and the second index range.

[0052] S300: Compare the first index range and the second index range. Based on the comparison result, update the second index range to obtain the third index range.

[0053] In some embodiments, reference Figure 4 The flowchart illustrates the update process based on the index range, including but not limited to steps S310 to S320:

[0054] S310, compare the maximum and minimum values ​​of the position identifiers of the first index range and the second index range respectively;

[0055] S320, if both the x-axis value and y-axis value of the first index range are greater than the second index range, then no update is performed; if at least one of the x-axis value and y-axis value of the first index range is less than the second index range, then the update is the difference between the first index range and the second index range.

[0056] In some embodiments, reference Figure 5a and Figure 5b These are schematic diagrams illustrating the index range update process according to an embodiment of the present invention. Each region has an index subscript x and y in the map. The map adds four member variables corresponding to the minimum and maximum index subscripts x and y of the range to be traversed. Each time a region needs to be updated, the current minimum and maximum region index subscripts x and y are checked and updated. Since the minimum and maximum index subscript range corresponds to a continuous rectangular range, the regions within this index subscript range can be directly traversed in the main loop. If no regions within the range need to be updated, the minimum and maximum index subscripts x and y are reset to their initial values. This process is repeated to continuously update the range of actually active regions.

[0057] The optimization scheme updates the minimum traversal range of the map by comparing the current cell index with the range index each time an element changes. The subsequent main game loop only traverses the 3*2 cells of the green area in the diagram below. Because the player's actual activity area also has a continuous characteristic, this scheme can be used to reduce the traversal range.

[0058] refer to Figure 5b When players or other elements continue to move to other regions, such as the star in the image below, the corresponding index range is updated to the green rectangular area shown in the image below.

[0059] Compared to the conventional approach of adding data containers to manage data, this solution only requires adding a few int variables to achieve effective optimization. In addition to optimizing the region traversal of the game map, for any range-type data using continuous arrays, such as n-dimensional arrays, where the data has continuous usage characteristics, it is necessary to add 2*n variables to record the actual activity range of each dimension array. When there is no actual activity data in a dimension array, it can be shrunk and reset to the center point, the last activity point, or a configured initial value. In this way, when the data is updated later, the range can be continuously compared and a range stretching update can be performed.

[0060] The technical solution of this invention, when maintaining and updating a multidimensional array, updates its boundary range when the active data is continuous, and then updates the multidimensional array based on the boundary range. Especially in game map scenarios, when managed across multiple grids, programs easily overlook the fact that the number of grids in multi-map situations can be on the order of magnitude. The data management method of this invention can simply and effectively improve operational efficiency.

[0061] refer to Figure 6 ,in Figure 6 This is a schematic diagram of a device for updating and displaying game map data according to an embodiment of the present invention. The device includes a first module 601, a second module 602, and a third module 603.

[0062] The system comprises three modules: a first module, a second module, and a third module. The first module is used to divide the target map scene into multiple regions based on the game map data display request, and to set an index identifier for each region. The second module is used to detect the regions of the target map scene. If there are changes in game elements, the first index range and the second index range are determined based on the index identifiers before and after the update. The first index range and the second index range are used to represent the active areas before and after the update, respectively. The third module is used to compare the first index range and the second index range, and to update the second index range based on the comparison result, thus obtaining the third index range.

[0063] Exemplarily, with the cooperation of the first and second modules in the device, the embodiment device can implement any of the aforementioned game map data update and display methods. Specifically, based on the game map data display request, the target map scene is divided into multiple regions, and an index identifier is set for each region. The regions of the target map scene are detected; if game elements have changed, a first index range and a second index range are determined based on the index identifiers before and after the update, where the first and second index ranges represent the active areas before and after the update, respectively. The first and second index ranges are compared, and based on the comparison result, the second index range is updated to obtain a third index range. When maintaining and updating a multidimensional array, if the characteristic of continuous active data is met, the boundary range is updated, and then the multidimensional array is updated again using the boundary range. Especially in game map scenes, when managed as multiple grids, the program easily overlooks that the number of grids in a multi-map scenario can be on the order of magnitude. The data management method described in this paper can simply and effectively improve operating efficiency.

[0064] This invention also provides an electronic device, which includes a processor and a memory;

[0065] The memory stores the program;

[0066] The processor executes the program to perform the aforementioned game map data update and display method; the electronic device has the function of carrying and running the interface switching software system provided in the embodiments of the present invention, such as a personal computer (PC), mobile phone, smartphone, personal digital assistant (PDA), wearable device, handheld computer (PPC), tablet computer, etc.

[0067] This invention also provides a computer-readable storage medium storing a program that is executed by a processor to implement the game map data update and display method described above.

[0068] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.

[0069] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned game map data update and display method.

[0070] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.

[0071] If the aforementioned functions 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, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0072] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0073] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0074] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0075] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0076] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

[0077] The above is a detailed description of the preferred embodiments of the present invention, but the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A method for updating and displaying game map data, characterized in that, include: Based on the game map data update and display request, the target map scene is divided into regions to obtain multiple regions, and an index identifier is set for each region; The target map scene area is detected. If there are changes in game elements, a first index range and a second index range are determined based on the index identifiers before and after the update. The first index range and the second index range are used to represent the activity area before and after the update, respectively. The index identifier is a position identifier on the planar map of the target map scene. The first index range and the second index range are compared, and the second index range is updated according to the comparison result to obtain the third index range; specifically, this includes comparing the maximum and minimum values ​​of the position identifiers of the first index range and the second index range respectively; If both the x-axis and y-axis values ​​of the first index range are greater than the second index range, then no update is performed; if at least one of the x-axis and y-axis values ​​of the first index range is less than the second index range, then the index is updated to the difference between the first index range and the second index range.

2. The game map data update and display method according to claim 1, characterized in that, The changes in game elements include at least one of the following: changes caused by external operation requests and changes in in-game settings.

3. The game map data update and display method according to claim 1, characterized in that, The detection of the target map scene area is performed. If there are changes in game elements, the first index range and the second index range are determined based on the index identifiers before and after the update, including: The first index range and the second index range are determined based on the location identifier of the active region existing in the index range, and the first index range and the second index range share the same data container.

4. The game map data update and display method according to claim 1, characterized in that, The method further includes: When the first index range does not change, the first index range is reduced to the initial value or remains unchanged, wherein the initial value is a custom-set area.

5. The game map data update and display method according to claim 1, characterized in that, The method further includes: Game element change types: A set of corresponding data is assigned and managed for each type of game element change.

6. A game map data update and display device, characterized in that, include: The first module is used to divide the target map scene into multiple regions based on the game map data update display request, and set an index identifier for each region. The second module is used to detect the area of ​​the target map scene. If there are changes in game elements, the first index range and the second index range are determined according to the index identifier before the update and the current index identifier. The first index range and the second index range are used to represent the activity area before the update and the current index range, respectively. The index identifier is a position identifier of the planar map of the target map scene. The third module is used to compare the first index range and the second index range, and update the second index range according to the comparison result to obtain the third index range; specifically, it includes comparing the maximum and minimum values ​​of the position identifiers of the first index range and the second index range respectively. If both the x-axis and y-axis values ​​of the first index range are greater than the second index range, then no update is performed; if at least one of the x-axis and y-axis values ​​of the first index range is less than the second index range, then the index is updated to the difference between the first index range and the second index range.

7. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the game map data update and display method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The storage medium stores a program, which is executed by a processor to implement the game map data update and display method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method and system for splitting dynamic area boundary in game map and computer readable storage medium

    CN112597258A