CN112206536B - Method and device for generating dynamic obstacle - Google Patents

Method and device for generating dynamic obstacle Download PDF

Info

Publication number
CN112206536B
CN112206536B CN202011120143.8A CN202011120143A CN112206536B CN 112206536 B CN112206536 B CN 112206536B CN 202011120143 A CN202011120143 A CN 202011120143A CN 112206536 B CN112206536 B CN 112206536B
Authority
CN
China
Prior art keywords
storage position
target obstacle
storage
obstacle information
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011120143.8A
Other languages
Chinese (zh)
Other versions
CN112206536A (en
Inventor
叶帆
怀宾
周轶骁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Xishanju Digital Technology Co ltd
Zhuhai Kingsoft Digital Network Technology Co Ltd
Original Assignee
Zhuhai Seasun Mobile Game Technology Co ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Seasun Mobile Game Technology Co ltd, Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Zhuhai Seasun Mobile Game Technology Co ltd
Priority to CN202011120143.8A priority Critical patent/CN112206536B/en
Publication of CN112206536A publication Critical patent/CN112206536A/en
Application granted granted Critical
Publication of CN112206536B publication Critical patent/CN112206536B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/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
    • A63F13/63Generating 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 by the player, e.g. authoring using a 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
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • 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/50Features 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 details of game servers
    • A63F2300/53Features 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 details of game servers details of basic data processing
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method and a device for generating dynamic barrier, wherein the method and the device are used for a server side and a client side, and for the server side, at least one piece of dynamic barrier information is stored in a first storage position in an index table form and is stored in a second storage position in a continuous array form, the method comprises the following steps: updating target obstacle information of the index table of the first storage position according to the updating command, and synchronizing the target obstacle information to the client; the continuous array of the second storage position is updated based on the updated target obstacle information, and the storage form of the second storage position is the continuous array, so that the query efficiency is high, the dynamic obstacle can be updated quickly, the calculation amount is reduced, and the practical effect is good.

Description

Method and device for generating dynamic obstacle
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a dynamic barrier, a computing device, and a computer-readable storage medium.
Background
In the game, there are some dynamic barriers which can be generated by the player, the barriers can be distinguished and effective according to the fighting relationship and the attribute of the player character, and the barriers can move at high speed. For example, a player character creating a wall in front of it may only block an enemy character, and teammates may pass through; or a dynamic ground surface capable of standing on the ground, only teammates formed by releasers can stand on the dynamic ground surface, and the dynamic ground surface can fall down after retreating; the device can also be a plane floating in the air and can be instantly pressed down, and the character which is put down when pressed down can be extruded.
These calculations are difficult in a large MMORPG game because a scene may have thousands of players at the same time, each player having to check various complex passing rules during the move. If the passing rule of each obstacle is dynamically changeable and the obstacle is detected by the server side to prevent cheating, the calculation consumption is very large.
In the prior art, one method is to delete old obstacles and regenerate new obstacles every time the obstacles are changed, and the obstacles are always static. However, when the obstacle can move, the method cannot be used, because the obstacle is required to be 'continuous' when being pressed down, a new obstacle is directly used, so that 'gaps' exist in the moving process, the 'missed fish' is not pressed down, frequent deletion and creation are also very high in consumption, and the actual use effect is poor.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for generating a dynamic barrier, a computing device, and a computer-readable storage medium, so as to solve technical defects in the prior art.
According to a first aspect of the embodiments of the present application, there is provided a method for generating a dynamic barrier, where the method is used for a server, at least one piece of dynamic barrier information is stored in a first storage location in the form of an index table and stored in a second storage location in the form of a continuous array, and the method includes:
according to the updating command, updating the target obstacle information of the index table of the first storage position, and synchronizing the target obstacle information to the client;
the continuous array of second storage locations is updated based on the updated target obstacle information.
Optionally, updating the target obstacle information of the index table of the first storage location according to the update command includes:
and determining target obstacle information which is updated according to the updating command, and updating the target obstacle information of the index table of the first storage position, wherein the target obstacle information comprises at least one of obstacle coordinates, passing rules, the friend-foe relationship of the role, the team relationship of the role and the added skill of the role.
Optionally, updating the continuous array of the second storage locations based on the updated target obstacle information includes:
the continuous array of second storage locations is updated in a later set number of game frames of the current game frame based on the updated target obstacle information.
Optionally, after the target obstacle information of the index table of the first storage location is updated, the method further includes:
setting a second storage location invalidation flag to invalidate the contiguous array of second storage locations;
and actively polling in each game frame to check whether a second storage position failure mark exists, and if so, updating the continuous array of the second storage position based on the updated target obstacle information.
Optionally, updating the continuous array of the second storage locations based on the updated target obstacle information includes:
and copying the updated index table of the first storage position to the second storage position so as to update the continuous array of the second storage position.
According to a second aspect of the embodiments of the present application, there is provided a method for generating a dynamic barrier, for a client, where at least one piece of dynamic barrier information is stored in a third storage location in the form of an index table and stored in a fourth storage location in the form of a continuous array, the method including:
and updating the target obstacle information of the local third storage position and the fourth storage position based on the received target obstacle information.
Optionally, updating the target obstacle information of the local third storage location and the local fourth storage location based on the received target obstacle information includes:
updating target obstacle information of the index table of the third storage position;
the sequential array of fourth storage locations is updated based on the updated target obstacle information.
Optionally, after the target obstacle information of the index table of the third storage location is updated, the method further includes:
setting a fourth storage location invalidation flag to invalidate the consecutive array of fourth storage locations;
and actively polling in each game frame to check whether a fourth storage position failure mark exists, and if so, updating a continuous array of the fourth storage position based on the updated target obstacle information.
Optionally, updating the continuous array of the fourth storage locations based on the updated target obstacle information includes:
copying the updated index table of the third storage location to the fourth storage location to update the continuous array of the fourth storage location.
According to a third aspect of the embodiments of the present application, there is provided a dynamic barrier generation apparatus, configured to be used in a server, where at least one piece of dynamic barrier information is stored in a first storage location in the form of an index table and stored in a second storage location in the form of a continuous array;
the device comprises:
the first updating module is configured to update the target obstacle information of the index table of the first storage position according to the updating command and synchronize the target obstacle information to the client;
a second update module configured to update the contiguous array of second storage locations based on the updated target obstacle information.
According to a fourth aspect of the embodiments of the present application, there is provided a dynamic barrier generation apparatus, for a client, where at least one piece of dynamic barrier information is stored in a third storage location in the form of an index table and stored in a fourth storage location in the form of a continuous array;
the device comprises:
and the third updating module is configured to update the target obstacle information of the third local storage position and the fourth local storage position based on the received target obstacle information.
According to a fifth aspect of embodiments of the present application, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the method for generating a dynamic barrier described above when executing the instructions.
According to a sixth aspect of embodiments of the present application, there is provided a computer-readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the above-mentioned method for generating a dynamic barrier.
According to the method and the device for generating the dynamic barrier, the target barrier information of the index table of the first storage position is updated on the server side according to the updating command, and the target barrier information is synchronized to the client; the continuous array of the second storage position is updated based on the updated target obstacle information, and the storage form of the second storage position is the continuous array, so that the query efficiency is high, the dynamic obstacle can be updated quickly, the calculation amount is reduced, and the practical effect is good.
In addition, the continuous array of the second storage position is updated based on the updated target obstacle information, and the server can determine the updated target obstacle information more quickly, so that the processor hits the continuous array when detecting obstacles, and performance degradation caused by cache miss is avoided. Because the storage form of the second storage position is a continuous array, the efficiency of traversing query is very fast, and the performance of high-frequency obstacle judgment can be greatly improved.
According to the method and the device for generating the dynamic barrier, on the client side, the target barrier information of the third storage position and the fourth storage position is updated on the basis of the received target barrier information; and the dynamic barrier is generated based on the updated dynamic barrier information so as to realize the update of the barrier, reduce the calculated amount and have better practical effect.
According to the dynamic obstacle generating method, updated target obstacle information is determined on the server side and is synchronized to the client side, and synchronous generation of the obstacle information is achieved without mutual notification between the client side and the server after the dynamic obstacle is generated.
Drawings
FIG. 1 is a schematic block diagram of a computing device according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a method for generating a dynamic barrier according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating a method for generating a dynamic barrier according to another embodiment of the present application;
FIG. 4 is a flow chart illustrating a method for generating a dynamic barrier according to another embodiment of the present application;
FIG. 5 is a schematic diagram of a dynamic barrier generation apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a dynamic barrier generation apparatus according to another embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present invention relate are explained.
MMORPG game: the online role playing network game is a massive multiplayer online role playing network game, and players play a fictional role in the game and control a plurality of activities of the role.
First/third storage location: the system is used for storing a real-time data summary index, and at least one piece of dynamic barrier information is stored in the first storage position or the third storage position in the form of an index table. The first storage position is located at the server side, and the third storage position is located at the client side. The first storage location and the third storage location refer not to spatial locations on hardware but to locations in software. The distribution of the at least one dynamic obstacle information is discontinuously linear in the first/third storage locations.
Second/fourth storage location: for storing cache data, at least one dynamic barrier information is stored in the second storage location or the fourth storage location in a continuous array. Wherein the second storage location is located at the server side and the fourth storage location is located at the client side. The second storage location and the fourth storage location refer not to spatial locations on hardware but to locations in software. The distribution of the at least one dynamic barrier information is continuous in the second/fourth storage location.
Dynamic disorder: the dynamic obstacle in the application has a wide meaning, and for example, the dynamic obstacle can block an enemy from advancing, such as an obstacle wall and a dynamic ground obstacle.
Dirty data: (Dirty Read) means that the data in the source system is not within a given range or meaningless for the actual service, or the data format is illegal, and there is irregular coding and ambiguous service logic in the source system.
In the present application, a method and an apparatus for generating a dynamic barrier, a computing device and a computer-readable storage medium are provided, which are described in detail in the following embodiments one by one.
Fig. 1 is a block diagram illustrating a configuration of a computing device 100 according to an embodiment of the present specification. The components of the computing device 100 include, but are not limited to, memory 110 and processor 120. The processor 120 is coupled to the memory 110 via a bus 130 and a database 150 is used to store data.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 140 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 100 and other components not shown in FIG. 1 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 1 is for purposes of example only and is not limiting as to the scope of the description. Those skilled in the art may add or replace other components as desired.
Computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
Wherein the processor 120 may perform the steps of the method shown in fig. 2. Fig. 2 is a schematic flow chart diagram illustrating a method for generating a dynamic barrier for a server, where at least one piece of dynamic barrier information is stored in a first storage location in the form of an index table and in a second storage location in the form of a continuous array according to an embodiment of the present application.
It should be noted that in this embodiment, the first storage location is used for storing the real-time data summary index, and the second storage location is used for storing the cache data.
The first storage location and the second storage location refer not to spatial locations on hardware but to locations in software. In the first storage location, the distribution of the at least one dynamic barrier information is discontinuous.
In the first storage location, the ID of the player character to which the dynamic obstacle information belongs or other ID that can be quickly indexed may be set as a key value for establishing the real-time data aggregation index. According to the key value, the position of certain dynamic barrier information in the memory can be inquired. Since the summarized data is stored according to the index, which is convenient for searching but has discontinuous memory and is not suitable for continuous traversal, a 'cache' is established to be suitable for traversal.
In addition, in the first storage location, the storage form of the dynamic barrier information may be a form that is convenient for searching, such as a dictionary (map).
In the second storage location, the distribution of the at least one dynamic barrier information is continuous to fit a continuous traversal. During obstacle detection a continuous array of second memory locations is used. When the CPU works, the data hit rate of hitting the continuous array of the block is very high, and the condition of cache miss (cache miss) hardly occurs. However, when the dynamic barrier information is updated, the dynamic barrier information of the first storage location is updated first, and then the update of the dynamic barrier information of the second storage location is completed based on the updated dynamic barrier information of the first storage location.
Specifically, the method of the present embodiment includes steps 201 to 202:
201. and updating the target obstacle information of the index table of the first storage position according to the updating command, and synchronizing the target obstacle information to the client.
Specifically, step 201 includes: and determining target obstacle information which is updated according to the updating command, and updating the target obstacle information of the index table of the first storage position, wherein the target obstacle information comprises at least one of obstacle coordinates, passing rules, the friend-foe relationship of the role, the team relationship of the role and the added skill of the role.
In one example scenario, the target obstacle information is shown in table 1.
TABLE 1
Obstacle identification Target obstacle information condition Obstacle identification Target obstacle information condition
A1 b11、b12、b13、b14 A5 b51、b52、b53、b54
A2 b21、b22、b23、b24 A6 b61、b62、b63、b64
A3 b31、b32、b33、b34 A7 b71、b72、b73、b74
A4 b41、b42、b43、b44 A8 b81、b82、b83、b84
For example, taking table 1 as an example, if the target obstacle information condition b24 is determined to be changed to b 24', the target obstacle information whose update has occurred is determined to be { a2| b21, b22, b23, b24 }.
Optionally, after step 201, the method further includes the following steps S211 to S212:
s211, setting a second storage position failure mark to enable the continuous array of the second storage position to fail.
It should be noted that the second storage location failure flag is indicative of a failure of the consecutive array, but the second storage location failure flag is not disposed on the consecutive array, and the second storage location failure flag and the consecutive array are independent of each other.
In this embodiment, the second storage location invalidation flag may be a dirty data flag, such that the contiguous array of second storage locations is invalidated.
S212, actively polling in each game frame to check whether a second storage position failure mark exists, and if so, updating the continuous array of the second storage position based on the updated target obstacle information.
Specifically, at the end of each game frame, it is checked whether there is a dirty data flag, and if so, the consecutive array representing the second storage location is automatically invalidated, and an updated index table is copied from the first storage location to the second storage location.
Through steps S211 to S212, it can be determined whether the continuous array of the second storage location needs to be updated, and then the subsequent step 202 is performed.
202. The continuous array of second storage locations is updated based on the updated target obstacle information.
Since the dynamic barrier information of the second storage location is stored in the form of a continuous array, in this embodiment, the processor hits the continuous array when performing barrier detection, thereby avoiding performance degradation caused by cache miss. Because the storage form of the second storage position is a continuous array, the efficiency of traversing query is very fast, and the performance of high-frequency obstacle judgment can be greatly improved.
It should be noted that, when data is called, the processor first searches the second storage location, and if the data cannot be found, the processor goes to the first storage location to obtain corresponding data, and stores the obtained data in the second storage location, which is generally referred to as cachemiss.
As can be seen from the above description, a processor loses several hundred times its performance once cachemiss occurs. Furthermore, the cache area (cache) of the processor is small, and if some large data is called continuously, the large data cannot be loaded in the second storage position completely, which causes the processor to trigger cachemiss every time the processor reads the data.
Taking the application of the embodiment to the MMOPRG game as an example, if data such as the friend-me relationship, the team relationship, and the like between characters are to be recalculated each time an obstacle is determined according to the prior art, data of a whole block of player characters, which are several megabits of data, is to be read again, which may cause a processor to trigger cachexis.
For one server, one server corresponds to several hundred client player characters, and the data of the player characters are recalculated every frame. Taking 300 players as an example, 9000 cachemisss per second for 30 frames per 1 second results in a significant occupation of processor performance and a reduction in processing efficiency.
Therefore, in this embodiment, the dynamic barrier information of the second storage location is generated into a data structure of a continuous array, and the data to be accessed is concentrated into a small continuous interval, so that frequent cachexia can be avoided, and the performance of the method is actually improved by several hundred times.
Specifically, step 202 specifically includes: the continuous array of second storage locations is updated in a later set number of game frames of the current game frame based on the updated target obstacle information.
The number of game frames delayed by the set number can be set according to actual requirements, for example, the delay is set to be 2 frames or 3 frames, and then the continuous array of the second storage position is updated.
Specifically, step 202 specifically includes: and copying the updated index table of the first storage position to the second storage position so as to update the continuous array of the second storage position.
In actual application, since the change frequency of the team information, friend or foe information, buff attribute information, and the like of the main character is not so high, these update operations occur at a low frequency, and the target obstacle information of the second storage location does not need to be updated most of the time.
Still in the above example, if the condition information b24 changes to b 24', the target obstacle information is determined to be { a2| b21, b22, b23, b24 }. The first target obstacle information { a2| b21, b22, b23, b24} of the first storage location is updated to { a2| b21, b22, b23, b 24' }. After updating the first target obstacle information of the first storage location to { a2| b21, b22, b23, b 24' }, the index table of the first storage location is copied to the second storage location to update the contiguous array of the second storage location.
Note that for a contiguous array of second storage locations, after setting the second storage location invalidation flag, it means that the contiguous array is all invalidated. The entire index table of the first storage location needs to be copied to the second storage location, rather than separately copying the updated target obstacle information to the second storage location, so that consistency of data of the first storage location and the second storage location can be ensured.
In the method for generating a dynamic barrier according to this embodiment, at a server side, target barrier information of an index table in a first storage location is updated according to an update command, and the target barrier information is synchronized to a client; the continuous array of the second storage position is updated based on the updated target obstacle information, and the storage form of the second storage position is the continuous array, so that the query efficiency is high, the dynamic obstacle can be updated quickly, the calculation amount is reduced, and the practical effect is good.
In addition, the continuous array of the second storage position is updated based on the updated target obstacle information, and the server can determine the updated target obstacle information more quickly, so that the processor hits the continuous array when detecting obstacles, and performance degradation caused by cache miss is avoided. Because the storage form of the second storage position is a continuous array, the efficiency of traversing query is very fast, and the performance of high-frequency obstacle judgment can be greatly improved.
The embodiment discloses a method for generating a dynamic barrier, which is used for a client. At least one dynamic barrier information is stored in the third storage location in the form of an index table and in the form of a continuous array in the fourth storage location.
The third storage position is used for storing the real-time data summary index, and the fourth storage position is used for storing the cache data.
The third storage location and the fourth storage location refer not to spatial locations on hardware but to locations in software. In the second storage location, the distribution of the at least one dynamic barrier information is discontinuous.
In the third storage location, the ID of the player character to which the dynamic obstacle information belongs or other ID that can be quickly indexed may be set as a key value for establishing the real-time data aggregation index. According to the key value, the position of certain dynamic barrier information in the memory can be inquired. Since the summarized data is stored according to the index, which is convenient for searching but has discontinuous memory and is not suitable for continuous traversal, a 'cache' is established to be suitable for traversal.
In addition, in the third storage location, the storage form of the dynamic barrier information may be a form that is convenient for searching, such as a dictionary (map).
In the fourth storage location, the distribution of the at least one dynamic barrier information is continuous to fit a continuous traversal. During obstacle detection a continuous array of fourth memory locations is used. When the CPU works, the data hit rate of hitting the continuous array of the block is very high, and the condition of cache miss (cache miss) hardly occurs. However, when the dynamic barrier information is updated, the dynamic barrier information of the third storage location is updated first, and then the update of the dynamic barrier information of the fourth storage location is completed based on the updated dynamic barrier information of the third storage location.
Referring to fig. 3, the following steps are included: and updating the target obstacle information of the local third storage position and the fourth storage position based on the received target obstacle information.
Specifically, the method comprises the following steps 301-302:
301. and updating the target obstacle information of the index table of the third storage position.
Specifically, for the update of the target obstacle information in the index table of the third storage location, refer to the update step of the index table of the first storage location in the foregoing embodiment, and are not described herein again.
After the target obstacle information in the index table of the third storage location is updated in step 301, the method further includes steps S311 to S312:
s311, setting a fourth storage position failure mark to enable the continuous array of the fourth storage position to fail.
It should be noted that the fourth storage location failure flag is indicative of a consecutive array failure, but the fourth storage location failure flag is not disposed on the consecutive array, and the fourth storage location failure flag and the consecutive array are independent of each other.
In this embodiment, the fourth storage location invalidation flag may be a dirty data flag, such that the contiguous array of fourth storage locations is invalidated.
S312, actively polling in each game frame to check whether a fourth storage position failure mark exists, and if yes, updating the continuous array of the fourth storage position based on the updated target obstacle information.
Specifically, at the end of each game frame, whether a dirty data mark exists is checked, if so, the continuous array representing the fourth storage position automatically fails, and the updated index table is copied to the fourth storage position again from the third storage position.
Through steps S311 to S312, it can be determined whether the continuous array of the second storage location needs to be updated, and then the subsequent step 302 is performed.
302. The continuous array of fourth storage locations is updated based on the updated target obstacle information.
Since the dynamic barrier information of the fourth storage location is stored in the form of a continuous array, in this embodiment, the processor hits the continuous array when performing the barrier detection, thereby avoiding the performance degradation caused by the cache miss. Because the storage form of the fourth storage position is a continuous array, the efficiency of traversal query is very fast, and the performance of high-frequency obstacle judgment can be greatly improved.
It should be noted that, when data is called, the processor first searches the fourth storage location, and if the data cannot be searched, the processor goes to the third storage location to obtain corresponding data, and stores the obtained data in the fourth storage location, which is generally referred to as cachemiss.
As can be seen from the above description, a processor loses several hundred times its performance once cachemiss occurs. Furthermore, the cache area (cache) of the processor is small, and if some large data is called continuously, the large data cannot be loaded in the fourth storage position completely, which causes the processor to trigger cachemiss every time the processor reads the data.
Taking the application of the embodiment to the MMOPRG game as an example, if data such as the friend-me relationship, the team relationship, and the like between characters are to be recalculated each time an obstacle is determined according to the prior art, data of a whole block of player characters, which are several megabits of data, is to be read again, which may cause a processor to trigger cachexis.
For one server, one server corresponds to several hundred client player characters, and the data of the player characters are recalculated every frame. Taking 300 players as an example, 9000 cachemisss per second for 30 frames per 1 second results in a significant occupation of processor performance and a reduction in processing efficiency.
Therefore, in this embodiment, the dynamic barrier information in the fourth storage location is generated into a data structure of a continuous array, and the data to be accessed is concentrated into a small continuous interval, so that frequent cachexia can be avoided, and the performance of the method is actually improved by several hundred times.
Specifically, step 302 specifically includes: updating the consecutive array of the fourth storage location in a later set number of game frames of the current game frame based on the updated target obstacle information.
The number of game frames delayed by the set number can be set according to actual requirements, for example, the delay is set to be 2 frames or 3 frames, and then the continuous array of the fourth storage position is updated.
Specifically, step 302 specifically includes: and copying the updated index table of the third storage position to the fourth storage position to update the continuous array of the fourth storage position.
Note that: for a contiguous array of fourth storage locations, after setting the fourth storage location invalidation flag, it means that the contiguous array is all invalidated. The entire index table of the third storage location needs to be copied to the fourth storage location instead of separately copying the updated target obstacle information to the fourth storage location, so that the consistency of the data of the third storage location and the fourth storage location can be ensured.
In the method for generating the dynamic barrier, at a client side, the target barrier information of a third local storage position and the target barrier information of a fourth local storage position are updated based on the received target barrier information; and the dynamic barrier is generated based on the updated dynamic barrier information so as to realize the update of the barrier, reduce the calculated amount and have better practical effect.
The application provides a dynamic barrier generation method, which is used for a server and a client, and referring to fig. 4, the method comprises the following steps 401 to 408:
401. according to the update command, the target obstacle information of the index table of the first storage location is updated, and the target obstacle information is synchronized to the client, and then step 402 and step 405 are executed.
Wherein the target obstacle information includes at least one of obstacle coordinates, a passing rule, a friend-foe relationship of a character, a team relationship of a character, and an added skill of a character.
402. Setting a second storage location invalidation flag to invalidate the contiguous array of second storage locations.
403. Actively polling in each game frame to check whether the second storage position failure mark exists, and if so, executing step 404.
404. And copying the updated index table of the first storage position to the second storage position so as to update the continuous array of the second storage position.
405. And updating the target obstacle information of the index table of the third storage position.
406. Setting a fourth storage location invalidation flag to invalidate the contiguous array of fourth storage locations.
407. The active polling in each game frame checks whether the fourth storage location invalidation flag is present, and if so, step 408 is performed.
408. And copying the updated index table of the third storage position to the fourth storage position to update the continuous array of the fourth storage position.
For a detailed explanation of steps 401 and 408, refer to the details of the foregoing embodiments, which are not repeated herein.
In the method for generating the dynamic barrier according to the embodiment, the updated target barrier information is determined on the server side and is synchronized to the client, and the synchronous generation of the barrier information is realized without mutual notification between the client and the server after the dynamic barrier is generated.
The embodiment also discloses a dynamic barrier generating device, which is used for a server, wherein at least one piece of dynamic barrier information is stored in a first storage position in the form of an index table and stored in a second storage position in the form of a continuous array;
referring to fig. 5, the apparatus includes:
a first updating module 501, configured to update target obstacle information of the index table of the first storage location according to the update command, and synchronize the target obstacle information to the client;
a second update module 502 configured to update the contiguous array of second storage locations based on the updated target obstacle information.
Optionally, the first updating module 501 is specifically configured to: and determining target obstacle information which is updated according to the updating command, and updating the target obstacle information of the index table of the first storage position, wherein the target obstacle information comprises at least one of obstacle coordinates, passing rules, the friend-foe relationship of the role, the team relationship of the role and the added skill of the role.
Optionally, the second updating module 502 is specifically configured to: the continuous array of second storage locations is updated in a later set number of game frames of the current game frame based on the updated target obstacle information.
Optionally, the apparatus further comprises:
a first setting module configured to set a second storage location invalidation flag to invalidate the consecutive array of second storage locations;
and the first polling module is configured to actively poll and check whether the second storage position failure mark exists in each game frame, and if so, the second updating module is executed.
Optionally, the second updating module 502 is specifically configured to: and copying the updated index table of the first storage position to the second storage position so as to update the continuous array of the second storage position.
In the apparatus for generating a dynamic barrier according to this embodiment, at the server side, the target barrier information in the index table of the first storage location is updated according to the update command, and the target barrier information is synchronized to the client; the continuous array of the second storage position is updated based on the updated target obstacle information, and the storage form of the second storage position is the continuous array, so that the query efficiency is high, the dynamic obstacle can be updated quickly, the calculation amount is reduced, and the practical effect is good.
The embodiment also discloses a dynamic barrier generating device, which is used for a client, wherein at least one piece of dynamic barrier information is stored in a third storage position in the form of an index table and is stored in a fourth storage position in the form of a continuous array;
the device comprises: and the third updating module is configured to update the target obstacle information of the third local storage position and the fourth local storage position based on the received target obstacle information.
Referring to fig. 6, the third update module includes:
a fourth updating unit 601 configured to update the target obstacle information of the index table of the third storage location;
a fifth updating unit 602 configured to update the consecutive array of the fourth storage locations based on the updated target obstacle information.
Optionally, the apparatus further comprises:
a second setting module configured to set a fourth storage location invalidation flag to invalidate the consecutive array of fourth storage locations;
and the second polling module is configured to actively poll and check whether the fourth storage position failure mark exists in each game frame, and if so, execute the fifth updating unit.
Optionally, the fifth updating unit 602 is specifically configured to: and copying the updated index table of the third storage position to the fourth storage position to update the continuous array of the fourth storage position.
The device for generating the dynamic barrier updates the target barrier information of the third storage position and the fourth storage position based on the received target barrier information at the client side; and the dynamic barrier is generated based on the updated dynamic barrier information so as to realize the update of the barrier, reduce the calculated amount and have better practical effect.
An embodiment of the present application further provides a computer readable storage medium, which stores computer instructions, and when the instructions are executed by a processor, the instructions implement the steps of the method for generating a dynamic barrier as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the method for generating a dynamic barrier belong to the same concept, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the method for generating a dynamic barrier.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (13)

1. The method for generating the dynamic barrier is characterized in that, when being used for a server, at least one piece of dynamic barrier information is stored in a first storage position in the form of an index table and stored in a second storage position in the form of a continuous array, the distribution of the at least one piece of dynamic barrier information in the first storage position is discontinuous linear distribution, and the distribution of the at least one piece of dynamic barrier information in the second storage position is continuous distribution;
the method comprises the following steps:
according to the updating command, updating target obstacle information of an index table of a first storage position, and synchronizing the target obstacle information to a client, wherein the first storage position is located in a server and used for storing a real-time data summary index;
updating a contiguous array of second storage locations based on the updated target obstacle information, wherein the second storage locations are located at a server for storing cached data.
2. The method of claim 1, wherein updating the target obstacle information of the index table of the first storage location in accordance with the update command comprises:
and determining target obstacle information which is updated according to the updating command, and updating the target obstacle information of the index table of the first storage position, wherein the target obstacle information comprises at least one of obstacle coordinates, passing rules, the friend-foe relationship of the role, the team relationship of the role and the added skill of the role.
3. The method of claim 1, wherein updating the contiguous array of second storage locations based on the updated target obstacle information comprises:
the continuous array of second storage locations is updated in a later set number of game frames of the current game frame based on the updated target obstacle information.
4. The method of claim 1, wherein updating the target obstacle information of the index table of the first storage location further comprises:
setting a second storage location invalidation flag to invalidate the contiguous array of second storage locations;
and actively polling in each game frame to check whether a second storage position failure mark exists, and if so, updating the continuous array of the second storage position based on the updated target obstacle information.
5. The method of claim 1 or 4, wherein updating the contiguous array of second storage locations based on the updated target obstacle information comprises:
and copying the updated index table of the first storage position to the second storage position so as to update the continuous array of the second storage position.
6. The method for generating the dynamic barrier is characterized in that, when being used for a client, at least one piece of dynamic barrier information is stored in a third storage position in the form of an index table and is stored in a fourth storage position in the form of a continuous array, the distribution of the at least one piece of dynamic barrier information in the third storage position is discontinuous linear distribution, and the distribution of the at least one piece of dynamic barrier information in the fourth storage position is continuous distribution;
the method comprises the following steps:
and updating the target obstacle information of a third local storage position and a fourth local storage position based on the received target obstacle information, wherein the third storage position is positioned at the client and used for storing the real-time data summary index, and the fourth storage position is positioned at the client and used for storing the cache data.
7. The method of claim 6, wherein updating the target obstacle information of the third and fourth local storage locations based on the received target obstacle information comprises:
updating target obstacle information of the index table of the third storage position;
the sequential array of fourth storage locations is updated based on the updated target obstacle information.
8. The method of claim 7, wherein updating the target obstacle information of the index table of the third storage location further comprises:
setting a fourth storage location invalidation flag to invalidate the contiguous array of fourth storage locations;
and actively polling in each game frame to check whether a fourth storage position failure mark exists, and if so, updating a continuous array of the fourth storage position based on the updated target obstacle information.
9. The method of claim 7 or 8, wherein updating the contiguous array of fourth storage locations based on the updated target obstacle information comprises:
and copying the updated index table of the third storage position to the fourth storage position to update the continuous array of the fourth storage position.
10. The device for generating the dynamic barrier is used for a server, and at least one piece of dynamic barrier information is stored in a first storage position in an index table form and is stored in a second storage position in a continuous array form, the distribution of the at least one piece of dynamic barrier information in the first storage position is in a discontinuous linear distribution, and the distribution of the at least one piece of dynamic barrier information in the second storage position is in a continuous distribution;
the device comprises:
the first updating module is configured to update target obstacle information of an index table of a first storage location according to an updating command, and synchronize the target obstacle information to a client, wherein the first storage location is located in a server and used for storing a real-time data summary index;
a second update module configured to update a contiguous array of second storage locations based on the updated target obstacle information, wherein the second storage locations are located at a server for storing cache data.
11. The device for generating the dynamic barrier is used for a client, and at least one piece of dynamic barrier information is stored in a third storage position in an index table form and is stored in a fourth storage position in a continuous array form, the distribution of the at least one piece of dynamic barrier information in the third storage position is in a discontinuous linear distribution, and the distribution of the at least one piece of dynamic barrier information in the fourth storage position is in a continuous distribution;
the device comprises:
the third updating module is configured to update the target obstacle information of a third local storage location and a fourth local storage location based on the received target obstacle information, wherein the third local storage location is located at the client and used for storing the real-time data summary index, and the fourth local storage location is located at the client and used for storing the cache data.
12. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any of claims 1-5 or 6-9 when executing the instructions.
13. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1-5 or 6-9.
CN202011120143.8A 2020-10-19 2020-10-19 Method and device for generating dynamic obstacle Active CN112206536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011120143.8A CN112206536B (en) 2020-10-19 2020-10-19 Method and device for generating dynamic obstacle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011120143.8A CN112206536B (en) 2020-10-19 2020-10-19 Method and device for generating dynamic obstacle

Publications (2)

Publication Number Publication Date
CN112206536A CN112206536A (en) 2021-01-12
CN112206536B true CN112206536B (en) 2022-08-05

Family

ID=74055855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011120143.8A Active CN112206536B (en) 2020-10-19 2020-10-19 Method and device for generating dynamic obstacle

Country Status (1)

Country Link
CN (1) CN112206536B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104606886A (en) * 2014-12-25 2015-05-13 珠海金山网络游戏科技有限公司 Distributed collision-free movement planning method
US10210167B1 (en) * 2012-05-07 2019-02-19 Amazon Technologies, Inc. Multi-level page caching for distributed object store
CN111177021A (en) * 2019-12-04 2020-05-19 东信和平科技股份有限公司 Java card fragment management method and storage device thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10210167B1 (en) * 2012-05-07 2019-02-19 Amazon Technologies, Inc. Multi-level page caching for distributed object store
CN104606886A (en) * 2014-12-25 2015-05-13 珠海金山网络游戏科技有限公司 Distributed collision-free movement planning method
CN111177021A (en) * 2019-12-04 2020-05-19 东信和平科技股份有限公司 Java card fragment management method and storage device thereof

Also Published As

Publication number Publication date
CN112206536A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
US11135515B2 (en) Information processing method and apparatus and server
WO2019148992A1 (en) Method and apparatus for processing virtual resources in game scene
KR101517927B1 (en) network game system without dynamic obstructions and processing method thereof
US10366304B2 (en) Localization and mapping method
US20180232257A1 (en) Task allocation method and task allocation apparatus for distributed data calculation
JP2021513404A (en) How to handle static components in the game scene, rendering methods and equipment
CN109831659B (en) VR video caching method and system
US10953326B2 (en) Method and apparatus
CN108053483A (en) A kind of Wei Nuotu three-dimensional grid reconstructing methods accelerated based on GPU
CN110543495A (en) cursor traversal storage method and device
US20150169611A1 (en) Systems and methods for dynamic visual search engine
CN107038017A (en) The method and apparatus that rendering data is obtained
CN112206536B (en) Method and device for generating dynamic obstacle
US20160171108A1 (en) Method and system for indexing and providing suggestions
CN109377552B (en) Image occlusion calculating method, device, calculating equipment and storage medium
EP3934262A1 (en) Character string display processing method and apparatus, terminal and storage medium
CN105512194A (en) Game scene management method and device
US20230281251A1 (en) Object management method and apparatus, device, storage medium, and system
Wu et al. A hybrid image retargeting approach via combining seam carving and grid warping
CN108205820B (en) Plane reconstruction method, fusion method, device, equipment and storage medium
CN112468522B (en) Graphics stream real-time increment updating method and device based on LRU cache mechanism
CN111542837A (en) Three-dimensional convolution neural network computing device and related product
CN113315914B (en) Panoramic video data processing method and device
CN112206514B (en) Game picture rendering method and device
WO2021237645A1 (en) Method and apparatus for updating mirroring, and electronic device 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
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Patentee after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Patentee after: Zhuhai Xishanju Digital Technology Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Patentee before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Patentee before: ZHUHAI SEASUN MOBILE GAME TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder