CN109675309B - Construction method and device of game scene - Google Patents
Construction method and device of game scene Download PDFInfo
- Publication number
- CN109675309B CN109675309B CN201910105721.1A CN201910105721A CN109675309B CN 109675309 B CN109675309 B CN 109675309B CN 201910105721 A CN201910105721 A CN 201910105721A CN 109675309 B CN109675309 B CN 109675309B
- Authority
- CN
- China
- Prior art keywords
- terrain
- grid
- game scene
- new
- screen
- 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
Links
Images
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/70—Game security or game management aspects
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features 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/50—Features 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/53—Features 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
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features 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/60—Methods for processing data by generating or executing the game program
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- General Business, Economics & Management (AREA)
- Processing Or Creating Images (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The embodiment of the invention provides a method and a device for constructing a game scene, wherein a software application is executed on a processor of an electronic device, and a graphical user interface is rendered on a screen of the electronic device, the graphical user interface comprises a part of the game scene, the game scene is divided into a plurality of terrain grids, and the method comprises the following steps: when entering a game scene, receiving a center grid coordinate and a terrain grid sent by a server; the terrain grids are terrain grids in a grid coordinate range calculated by the server according to the center grid coordinate and the screen size; loading the terrain grid within the screen to construct a game scene. In the embodiment of the invention, when a game scene is entered, the corresponding terrain grids in the server can be loaded according to different requirements so as to present different game scenes in the screen, thereby improving the game experience of players.
Description
Technical Field
The invention relates to the technical field of internet, in particular to a construction method of a game scene and a construction device of the game scene.
Background
The sand table game is composed of one or more map areas and usually comprises various elements such as actions, shooting, fighting, driving and the like, and the sand table game is characterized by large game map, strong interactivity, high degree of freedom, many random events and strong creativity.
In a sand table game, a complete map which is designed in advance is used as a game scene, but the method has the problem that the map which is designed in advance and drawn can only be loaded at one time or in batches to be used as the game scene, so that the game scene is fixed and unchangeable. If different game scenes need to be displayed, different maps need to be made as the game scenes, and the game scenes can not meet the requirements that the content of the game scenes is customized according to the playing method and can be changed.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a method of constructing a game scene and a corresponding apparatus for constructing a game scene that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a method for constructing a game scene, where a software application is executed on a processor of an electronic device and a graphical user interface is rendered on a screen of the electronic device, where the graphical user interface includes a part of the game scene, and the game scene is divided into a plurality of terrain grids, and the method includes:
when entering a game scene, receiving a center grid coordinate and a terrain grid sent by a server; the terrain grids are terrain grids in a grid coordinate range calculated by the server according to the center grid coordinate and the screen size;
and loading the terrain grids in the screen to construct a game scene.
Preferably, after loading the terrain grid in the screen to construct a game scene, the method further comprises:
when the game scene moves, acquiring the moving distance in the game scene;
calculating a central pixel coordinate by using the central grid coordinate;
calculating a new central pixel coordinate by adopting the moving distance and the central pixel coordinate;
converting the new center pixel coordinates to new center grid coordinates;
sending the new center grid coordinates to the server; the server is used for calculating a new grid coordinate range by adopting the new central grid coordinate and the screen size, and acquiring a terrain grid in the new grid coordinate range to obtain a new terrain grid;
and receiving the new terrain grids sent by the server, and loading the terrain grids in the terrain grids of the screen to update the game scene.
Preferably, after loading the terrain grid in the screen to construct a game scene, the method further comprises:
counting the number of loaded terrain lattices;
and when the quantity exceeds a preset threshold value, recovering the memory resources occupied by the terrain lattices which are not in the screen.
Preferably, the recovering the memory resources occupied by the terrain lattices not in the screen includes:
counting distances between each terrain grid not within the screen and the new center pixel coordinate;
and sequentially recovering the memory resources occupied by the terrain lattices which are not in the screen according to the distance.
The embodiment of the invention also discloses a game scene construction device, which executes software application on a processor of electronic equipment and renders a graphical user interface on a screen of the electronic equipment, wherein the graphical user interface comprises a part of a game scene, the game scene is divided into a plurality of terrain grids, and the device comprises:
the data receiving module is used for receiving the center grid coordinates and the terrain grids sent by the server when a game scene is entered; the terrain grids are terrain grids in a grid coordinate range calculated by the server according to the center grid coordinate and the screen size;
and the game scene constructing module is used for loading the terrain grids in the screen to construct game scenes.
Preferably, the method further comprises the following steps:
a moving distance obtaining module, configured to obtain the moving distance in the game scene when the game scene moves;
the central pixel coordinate calculation module is used for calculating a central pixel coordinate by adopting the central grid coordinate;
the new central pixel coordinate calculation module is used for calculating a new central pixel coordinate by adopting the moving distance and the central pixel coordinate;
a new center grid coordinate calculation module for converting the new center pixel coordinates to new center grid coordinates;
a new center grid coordinate sending module, configured to send the new center grid coordinate to the server; the server is used for calculating a new grid coordinate range by adopting the new central grid coordinate and the screen size, and acquiring a terrain grid in the new grid coordinate range to obtain a new terrain grid;
and the new terrain lattice receiving module is used for receiving the new terrain lattice sent by the server and loading the terrain lattice in the terrain lattice of the screen to update the game scene.
Preferably, the method further comprises the following steps:
the grid number counting module is used for counting the number of the loaded terrain grids;
and the terrain lattice recovery module is used for recovering the memory resources occupied by the terrain lattices not in the screen when the quantity exceeds a preset threshold value.
Preferably, the terrain lattice recovery module comprises:
the distance counting submodule is used for counting the distance between each terrain lattice which is not in the screen and the new central pixel coordinate;
and the memory resource recycling module is used for sequentially recycling the memory resources occupied by the terrain lattices which are not in the screen according to the distance.
The embodiment of the invention also discloses an electronic device, which comprises:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the electronic device to perform one or more methods as described above.
Embodiments of the invention also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more of the methods described above.
The embodiment of the invention has the following advantages:
when entering a game scene, the embodiment of the invention receives the center grid coordinates and the terrain grids sent by the server, wherein the terrain grids are the terrain grids in the grid coordinate range calculated by the server according to the center grid coordinates and the screen size, and the electronic equipment loads the terrain grids in the screen to construct the game scene. In the embodiment of the invention, when a game scene is entered, the corresponding terrain grids in the server can be loaded according to different requirements so as to present different game scenes in the screen, thereby improving the game experience of players.
Drawings
FIG. 1 is a flow chart of steps of an embodiment of a method of constructing a game scene of the present invention;
FIG. 2 is a schematic diagram of a diamond shaped lattice of the present invention;
FIG. 3 is a schematic diagram of a rectangular scene of the present invention;
FIG. 4 is a schematic diagram of the coordinates of a grid of features in a game scene according to the present invention;
FIG. 5 is a block diagram of a game scene constructing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, the present invention is described in detail with reference to the accompanying drawings and the detailed description thereof.
Referring to fig. 1, which is a flowchart illustrating steps of an embodiment of a method for constructing a game scene according to the present invention, a software application is executed on a processor of an electronic device and a graphical user interface is rendered on a screen of the electronic device, where the graphical user interface includes a part of the game scene, and the game scene is divided into a plurality of terrain grids, and the method specifically includes the following steps:
The electronic Device may be a mobile phone, a game machine, a Personal Computer (PC), or other various terminal devices. The software application running on the electronic device renders a graphical user interface on a screen of the electronic device, the content displayed by the graphical user interface at least partially includes a part or all of a game scene, and the specific form of the game scene may be a square shape or other shapes (e.g., a circular shape, etc.).
The software application may be a sand table game. The game scene in the sand table game is composed of a plurality of terrain lattices (diamond lattices), and specifically, the game scene is realized by using a map as a base map and then tiling the diamond lattices on the base map to form different scene elements. The grid of topography may be grass, buildings, mountains, etc. Referring to fig. 2, a diamond shaped lattice is shown. The size of the diamond-shaped grids is fixed, for example, the size of the diamond-shaped grids can be 160 pixels wide and 80 pixels high (being diagonal lines of the diamond-shaped grids), scene elements can be formed through the diamond-shaped grids, and then the whole game scene is formed by a plurality of scene elements.
Wherein, the resources forming the terrain grid are divided into 3 layers, and the grass, trees or buildings and special effects are respectively arranged from low to high. The higher level resources are above all the lower level resources.
In the embodiment of the invention, when entering a game scene, a server sends the current center grid coordinates and the terrain grids to a client of the electronic equipment, wherein the terrain grids are all terrain grids in a grid coordinate range calculated and obtained based on the center grid coordinates and the screen size of the electronic equipment.
In the embodiment of the invention, the diamond-shaped grid uses a 2-dimensional array as grid coordinates. Where grid coordinates are used in the server and pixel coordinates are used by the client.
Referring to fig. 3, a game scene (rectangular scene) is shown, and on the client side, the position of the game scene is represented by pixels, and the lower left corner of the rectangle is the pixel coordinate (0, 0). The middle rectangular area (excluding the white portion) is an actually used area, and the area is formed by sequentially splicing and arranging a plurality of diamond lattices.
On the server side, the diamond-shaped area of the game scene has the middle lower end as (0,0) of the terrain grid index, the right lower side as x, and the left lower side as y. The (x, y) number of the topographic grid is along the lower right side of the diamond as the x-axis direction and the lower left side as the y-axis direction. Referring to fig. 4, the game scene display is shown on the left side, the coordinates of the grid of the terrain are shown in horizontal coordinates on the right side, and the left and right sides are the same.
Suppose the size of the game scene is MAP _ LINE, the WIDTH of the single terrain cell is GRID _ WIDTH, and the HEIGHT is GRID _ HEIGHT. The mapping relation between the pixel coordinates in the game scene and the grid coordinates of the game scene is as follows:
(1) the pixel coordinates corresponding to the lower middle end of the grid with coordinates (idx _ x, idx _ y) are:
pixel_x=GRID_WIDTH/2*(idx_x-idx_y+MAP_LINE)
pixel_y=GRID_HEIGHT/2*(idx_x+idx_y))
(2) the grid idx coordinate corresponding to the position of (pixel _ x, pixel _ y) in the game scene is:
idx_x=(pixel_x-MAP_LINE*GRID_WIDTH/2)/GRID_WIDTH+pixel_y/GRID_HEIGHT
idx_y=pixel_y/GRID_HEIGHT-(pixel_x-MAP_LINE*
GRID_WIDTH/2)/GRID_WIDTH
and 102, loading the terrain grids in the terrain grids of the screen to construct game scenes.
Upon receipt by the client, the grid of terrain may be loaded on the screen to construct a game scene for presentation to the player.
By applying the embodiment of the invention, when a game scene enters, the center grid coordinate and the terrain grid sent by the server are received, wherein the terrain grid is the terrain grid in the grid coordinate range calculated by the server according to the center grid coordinate and the screen size, and the electronic equipment loads the terrain grid in the screen to construct the game scene.
When the game scene is entered, the corresponding terrain grids in the server can be loaded according to different requirements so as to present different game scenes in the screen, and therefore the game experience of players is improved.
In a preferred embodiment of the present invention, the following steps can be further included after the step 102:
when the game scene moves, acquiring the moving distance in the game scene;
calculating a central pixel coordinate by using the central grid coordinate;
calculating a new central pixel coordinate by adopting the moving distance and the central pixel coordinate;
converting the new center pixel coordinates to new center grid coordinates;
sending the new center grid coordinates to the server; the server is used for calculating a new grid coordinate range by adopting the new central grid coordinate and the screen size, and acquiring a terrain grid in the new grid coordinate range to obtain a new terrain grid;
and receiving the new terrain grids sent by the server, and loading the terrain grids in the terrain grids of the screen to update the game scene.
When the player slides the screen, the game scene presented in the screen changes in such a manner that the base map is kept still and the grid of the terrain arranged on the map is moved in the direction opposite to the direction in which the angle of view is moved (slid).
In the embodiment of the invention, when a user slides a screen, the moving distance is acquired according to the operation of a player, then the new central pixel grid is recalculated based on the moving distance, the new central pixel grid is converted into the new central grid coordinate and is sent to the server, after the server receives the new central pixel grid, a new grid coordinate range is calculated based on the new central grid coordinate and the screen size according to the mode, the terrain grid in the new grid coordinate range is acquired, the new terrain grid is acquired and is sent to the client, and the client can update the game scene based on the new terrain grid.
In the specific implementation, too many terrain grids loaded in a game scene consume too much memory resources, so in the embodiment of the invention, only necessary terrain grids can be loaded and kept in the game scene.
In a preferred embodiment of the present invention, the method may further comprise the steps of:
counting the number of loaded terrain lattices;
and when the quantity exceeds a preset threshold value, recovering the memory resources occupied by the terrain lattices which are not in the screen.
When the player slides the screen and the game scene in the screen changes, the memory resource corresponding to the terrain lattice which is not displayed in the screen at a remote place can be recycled. Assuming that the upper limit threshold of one cache terrain lattice is MAX _ NUM, when the number of loaded terrain lattices of the electronic equipment reaches or exceeds the upper limit threshold MAX _ NUM, the terrain lattices which are not displayed in the screen are cleaned, so as to save memory resources.
In a preferred embodiment of the present invention, the step of recycling the memory resources occupied by the geography grids which are not in the screen may include:
counting distances between each terrain grid not within the screen and the new center pixel coordinate;
and sequentially recovering the memory resources occupied by the terrain lattices which are not in the screen according to the distance.
When entering a game scene, the center pixel coordinate is calculated according to the center grid coordinate sent by the server, when the player slides the screen to cause the visual field to move, the corresponding terrain grid in the screen is updated, and the loaded terrain grid is recovered when the distance from the current center pixel coordinate reaches a threshold value.
Preferably, the embodiment of the present invention sets a number GC _ TARGET _ NUM of TARGET cache terrain grids after each cleaning, calculates distances between all loaded terrain grids and new center pixel coordinates, sorts the distances from large to small, and clears the terrain grids from front to back of the sequence until the number of remaining terrain grids is GC _ TARGET _ NUM.
By applying the embodiment of the invention, different game scenes can be presented according to different playing method requirements, and the game scenes can be updated according to the playing method requirements, so that the game experience of players is improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, which is a block diagram illustrating a configuration apparatus of a game scene according to an embodiment of the present invention, a software application is executed on a processor of an electronic device and a graphical user interface is rendered on a screen of the electronic device, where the graphical user interface includes a part of the game scene, and the game scene is divided into a plurality of terrain grids, and the apparatus may specifically include the following modules:
a data receiving module 201, configured to receive the center grid coordinates and the terrain grids sent by the server when entering a game scene; the terrain grid is a terrain grid in a grid coordinate range calculated by the server according to the center grid coordinate and the screen size;
a game scene constructing module 202, configured to load the terrain grid within the screen to construct a game scene.
In a preferred embodiment of the present invention, the apparatus may further include:
a moving distance obtaining module, configured to obtain the moving distance in the game scene when the game scene moves;
the central pixel coordinate calculation module is used for calculating a central pixel coordinate by adopting the central grid coordinate;
the new central pixel coordinate calculation module is used for calculating a new central pixel coordinate by adopting the moving distance and the central pixel coordinate;
a new center grid coordinate calculation module for converting the new center pixel coordinates to new center grid coordinates;
a new center grid coordinate sending module, configured to send the new center grid coordinate to the server; the server is used for calculating a new grid coordinate range by adopting the new central grid coordinate and the screen size, and acquiring a terrain grid in the new grid coordinate range to obtain a new terrain grid;
and the new terrain check receiving module is used for receiving the new terrain check sent by the server and loading the terrain check in the terrain check of the screen so as to update the game scene.
In a preferred embodiment of the present invention, the apparatus may further include:
the grid number counting module is used for counting the number of the loaded terrain grids;
and the terrain lattice recovery module is used for recovering the memory resources occupied by the terrain lattices which are not in the screen when the number exceeds a preset threshold value.
In a preferred embodiment of the present invention, the terrain grid recovery module comprises:
the distance counting submodule is used for counting the distance between each terrain lattice which is not in the screen and the new central pixel coordinate;
and the memory resource recycling module is used for sequentially recycling the memory resources occupied by the topographic grids which are not in the screen according to the distance.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, including:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform methods as described in embodiments of the invention.
Embodiments of the invention also provide one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the methods described in embodiments of the invention.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present invention.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method for constructing a game scene and the device for constructing a game scene provided by the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A method of constructing a game scene, wherein a software application is executed on a processor of an electronic device and rendered on a screen of the electronic device to obtain a graphical user interface, wherein the graphical user interface comprises a portion of the game scene, wherein the game scene is divided into a plurality of terrain cells, and wherein the method comprises:
when entering a game scene, receiving the center grid coordinates and the terrain grids sent by the server; the terrain grids are terrain grids in a grid coordinate range calculated by the server according to the center grid coordinate and the screen size;
loading the terrain grid in the screen to construct a game scene; after the game scene in the screen is changed, when the number of loaded terrain grids exceeds a preset threshold value, recovering the terrain grids which are not displayed in the screen according to memory resources corresponding to the distance between the new central pixel coordinates in sequence, and keeping the number of the cached terrain grids to meet the number of target cached terrain grids during recovery, wherein the new central pixel coordinates are calculated according to the moving distance of the game scene and the central grid coordinates.
2. The method of claim 1, after loading the grid of terrain within the screen to construct a game scene, further comprising:
when the game scene moves, acquiring the moving distance in the game scene;
calculating a central pixel coordinate by using the central grid coordinate;
calculating a new central pixel coordinate by adopting the moving distance and the central pixel coordinate;
converting the new center pixel coordinates to new center grid coordinates;
sending the new center grid coordinates to the server; the server is used for calculating a new grid coordinate range by adopting the new central grid coordinate and the screen size, and acquiring a terrain grid in the new grid coordinate range to obtain a new terrain grid;
and receiving the new terrain grids sent by the server, and loading the terrain grids in the terrain grids of the screen to update the game scene.
3. The method of claim 2, after loading the grid of terrain within the screen to construct a game scene, further comprising:
counting the number of loaded terrain lattices;
and when the quantity exceeds a preset threshold value, recovering the memory resources occupied by the terrain lattices which are not in the screen.
4. The method of claim 3, wherein the reclaiming memory resources occupied by the terrain lattice that is not within the screen comprises:
counting distances between each terrain grid not within the screen and the new center pixel coordinate;
and sequentially recycling memory resources occupied by the terrain lattices which are not in the screen according to the distance.
5. An apparatus for constructing a game scene, wherein a software application is executed on a processor of an electronic device and rendered on a screen of the electronic device to obtain a graphical user interface, wherein the graphical user interface comprises a portion of the game scene, wherein the game scene is divided into a plurality of terrain cells, the apparatus comprising:
the data receiving module is used for receiving the center grid coordinates and the terrain grids sent by the server when entering a game scene; the terrain grids are terrain grids in a grid coordinate range calculated by the server according to the center grid coordinate and the screen size;
a game scene constructing module, configured to load the terrain grid in the screen to construct a game scene; after the game scene in the screen is changed, when the number of loaded terrain grids exceeds a preset threshold value, recovering the terrain grids which are not displayed in the screen according to the memory resources corresponding to the distance between the loaded terrain grids and the new center pixel coordinate in sequence, and keeping the number of the cached terrain grids to meet the number of target cached terrain grids during recovery, wherein the new center pixel coordinate is calculated according to the moving distance of the game scene and the center grid coordinate.
6. The apparatus of claim 5, further comprising:
a moving distance obtaining module, configured to obtain the moving distance in the game scene when the game scene moves;
the central pixel coordinate calculation module is used for calculating a central pixel coordinate by adopting the central grid coordinate;
the new central pixel coordinate calculation module is used for calculating a new central pixel coordinate by adopting the moving distance and the central pixel coordinate;
a new center grid coordinate calculation module for converting the new center pixel coordinates to new center grid coordinates;
a new center grid coordinate sending module for sending the new center grid coordinate to the server; the server is used for calculating a new grid coordinate range by adopting the new central grid coordinate and the screen size, and acquiring a terrain grid in the new grid coordinate range to obtain a new terrain grid;
and the new terrain lattice receiving module is used for receiving the new terrain lattice sent by the server and loading the terrain lattice in the terrain lattice of the screen to update the game scene.
7. The apparatus of claim 6, further comprising:
the grid number counting module is used for counting the number of the loaded terrain grids;
and the terrain lattice recovery module is used for recovering the memory resources occupied by the terrain lattices not in the screen when the quantity exceeds a preset threshold value.
8. The apparatus of claim 7, wherein the terrain grid recovery module comprises:
the distance counting submodule is used for counting the distance between each terrain lattice which is not in the screen and the new central pixel coordinate;
and the memory resource recycling module is used for sequentially recycling the memory resources occupied by the topographic grids which are not in the screen according to the distance.
9. An electronic device, comprising:
one or more processors; and
one or more machine-readable media having instructions stored thereon that, when executed by the one or more processors, cause the electronic device to perform the method of one or more of claims 1-4.
10. One or more machine readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of one or more of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910105721.1A CN109675309B (en) | 2019-02-01 | 2019-02-01 | Construction method and device of game scene |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910105721.1A CN109675309B (en) | 2019-02-01 | 2019-02-01 | Construction method and device of game scene |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109675309A CN109675309A (en) | 2019-04-26 |
CN109675309B true CN109675309B (en) | 2022-09-13 |
Family
ID=66195545
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910105721.1A Active CN109675309B (en) | 2019-02-01 | 2019-02-01 | Construction method and device of game scene |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109675309B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110639201A (en) * | 2019-09-08 | 2020-01-03 | 北京智明星通科技股份有限公司 | Multimedia resource obtaining method and device for mobile phone game and mobile terminal |
CN111228816A (en) * | 2020-02-10 | 2020-06-05 | 郑州阿帕斯数云信息科技有限公司 | Scene layout method and device in game |
CN111522596A (en) * | 2020-03-25 | 2020-08-11 | 平安城市建设科技(深圳)有限公司 | Scene preloading optimization method and device, electronic equipment and storage medium |
CN111973990A (en) * | 2020-08-20 | 2020-11-24 | 北京像素软件科技股份有限公司 | Dynamic loading method and device of game map, electronic equipment and storage medium |
CN111736751B (en) * | 2020-08-26 | 2021-03-26 | 深圳市千分一智能技术有限公司 | Stroke redrawing method, device and readable storage medium |
CN112870723B (en) * | 2021-03-08 | 2024-02-23 | 网易(杭州)网络有限公司 | Game map detection method and device, storage medium and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102682466A (en) * | 2011-03-17 | 2012-09-19 | 腾讯科技(深圳)有限公司 | Method, device and system for realizing dynamic blocking in three-dimensional role playing game |
CN106412277A (en) * | 2016-09-26 | 2017-02-15 | 腾讯科技(深圳)有限公司 | Method and apparatus for loading virtual scene |
CN106547599A (en) * | 2016-11-24 | 2017-03-29 | 腾讯科技(深圳)有限公司 | A kind of method and terminal of resource dynamic load |
CN106991713A (en) * | 2017-04-13 | 2017-07-28 | 网易(杭州)网络有限公司 | Method and apparatus, medium, processor and the terminal of scene in more new game |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100452089B1 (en) * | 2004-06-23 | 2004-10-13 | 엔에이치엔(주) | The image resource loading system and method which carries out loading of the object for renewal of a game screen |
CN100421119C (en) * | 2006-07-11 | 2008-09-24 | 北京金山软件有限公司 | Method for drawing map in game |
-
2019
- 2019-02-01 CN CN201910105721.1A patent/CN109675309B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102682466A (en) * | 2011-03-17 | 2012-09-19 | 腾讯科技(深圳)有限公司 | Method, device and system for realizing dynamic blocking in three-dimensional role playing game |
CN106412277A (en) * | 2016-09-26 | 2017-02-15 | 腾讯科技(深圳)有限公司 | Method and apparatus for loading virtual scene |
CN106547599A (en) * | 2016-11-24 | 2017-03-29 | 腾讯科技(深圳)有限公司 | A kind of method and terminal of resource dynamic load |
CN106991713A (en) * | 2017-04-13 | 2017-07-28 | 网易(杭州)网络有限公司 | Method and apparatus, medium, processor and the terminal of scene in more new game |
Also Published As
Publication number | Publication date |
---|---|
CN109675309A (en) | 2019-04-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109675309B (en) | Construction method and device of game scene | |
CN109994038B (en) | Method and device for determining interest points in irregular area and electronic equipment | |
CN102359791B (en) | 3D layering of map metadata | |
CN110288692B (en) | Illumination rendering method and device, storage medium and electronic device | |
CN106028115A (en) | Video playing method and device | |
CN112419498B (en) | Scheduling rendering method for massive oblique photographic data | |
CN109771943A (en) | A kind of building method and device of scene of game | |
CN116628123B (en) | Dynamic slice generation method and system based on spatial database | |
CN101656037A (en) | Method for displaying large-format picture on small screen equipment and small screen equipment | |
CN109985386B (en) | Method and device for generating map | |
CN105224179A (en) | Method for information display and device | |
CN114130022A (en) | Method, apparatus, device, medium, and program product for displaying screen of virtual scene | |
CN106534485A (en) | Method and device for setting group head portrait | |
CN114241105A (en) | Interface rendering method, device, equipment and computer readable storage medium | |
CN111569418A (en) | Rendering method, device and medium for content to be output and electronic equipment | |
CN109657023B (en) | Scenic spot dynamic electronic map drawing method, server and system | |
CN111353007A (en) | Geographic element picking method, encoding method and device based on vector slice and electronic equipment | |
CN114238528A (en) | Map loading method and device, electronic equipment and storage medium | |
CN116975170A (en) | Map display method, map data generation method, map display device and electronic equipment | |
CN114168696A (en) | Method, device, equipment and readable medium for dividing and rendering ground grids | |
CN109615699B (en) | Augmented reality grouping method, system, readable storage medium and device | |
CN106293357B (en) | The display methods and device of map label picture | |
CN104965910A (en) | Method and apparatus for dynamically displaying social network member information | |
CN113256642A (en) | Method, device, equipment and storage medium for determining failure area in electronic map | |
CN113495935A (en) | Terrain slicing method and system based on irregular triangularization mesh generation |
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 |