CN113408657A - Method and system for dynamically planning and merging game atlas - Google Patents
Method and system for dynamically planning and merging game atlas Download PDFInfo
- Publication number
- CN113408657A CN113408657A CN202110795560.0A CN202110795560A CN113408657A CN 113408657 A CN113408657 A CN 113408657A CN 202110795560 A CN202110795560 A CN 202110795560A CN 113408657 A CN113408657 A CN 113408657A
- Authority
- CN
- China
- Prior art keywords
- pictures
- module
- merging
- side length
- picture
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 15
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 7
- 230000002776 aggregation Effects 0.000 description 3
- 238000004220 aggregation Methods 0.000 description 3
- 238000005457 optimization Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 238000007596 consolidation process Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4038—Image mosaicing, e.g. composing plane images from plane sub-images
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention provides a method for dynamically planning and merging game atlas, which comprises the following steps: step S1, putting a plurality of pictures into a file array list; step S2, taking out the file array list pictures to form a set S according to the side length of the pictures; step S3, selecting two pictures with the minimum side length from the set S; step S4, combining the two selected picture pictures into a new picture; step S5, recording the merging information of the set S so as to position the picture area when in use; step S6, recalculating the side length of the spliced pictures, and updating the side length into a set S; the invention can realize dynamic game planning atlas combination.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a system for dynamically planning and merging game atlas.
Background
The picture set is a picture set, which is convenient for the interface control to select pictures, can randomly change the pictures in the set range, and can also conveniently distribute the pictures when generating the game interface control.
In games, an album is often used instead of specific pictures, and if specific pictures are used in games, each picture is necessarily corresponding to a picture file. However, an album formed by combining these picture files corresponds to only the texture of one album.
Blank areas around each picture can be removed when the atlas is synthesized, and various optimization algorithms can be integrally implemented, so that the occupation of a game bag body and a memory can be greatly reduced after the atlas is synthesized. The number of network applications can be reduced by synthesizing the atlas (assuming that 10 pictures are applied for 10 times and the combined atlas needs to be applied for only two times, one time is the synthesized large atlas, and the other time is the configuration file for recording the information of the combined atlas). The composite atlas can also greatly reduce the frequency of DrawCall (the process of preparing data and informing the GPU to render by the CPU each time is called a DrawCall, if the number of the DrawCall is too large, a large amount of calculation can be carried out by the CPU, further the overload of the CPU is caused, the game running efficiency is influenced), and the game running efficiency is improved. The synthetic atlas can also reduce the number of times of opening and closing files and increase the block loading speed (the steps of reading and writing files are that a channel is firstly established, then a data storage space is established, then data reading and writing are started, and the stream is closed).
However, sometimes a plurality of picture sets need to be manually synthesized by art makers, and the whole picture set needs to be placed one by one, which is very troublesome.
Disclosure of Invention
To overcome the above problems, the present invention provides a method for realizing dynamic game planning atlas merging.
The invention is realized by adopting the following scheme: a method for dynamic programming consolidation of game albums, the method comprising the steps of:
step S1, putting a plurality of pictures into a file array list;
step S2, taking out the file array list pictures to form a set S according to the side length of the pictures;
step S3, selecting two pictures with the minimum side length from the set S;
step S4, combining the two selected picture pictures into a new picture;
step S5, recording the merging information of the set S so as to position the picture area when in use;
and step S6, recalculating the side length of the spliced pictures, and updating the side length into the set S.
Further, the step S1 is further specifically: and putting a plurality of pictures required to be used into a folder, traversing the folder and adding the read files into a file array list.
Further, the step S2 is further specifically: and taking out the pictures of the file array list, arranging the multiple pictures according to the side lengths of the pictures, and arranging the pictures from small to large according to the side lengths, and if the side lengths are the same, arranging the pictures from small to large according to the areas to form a set S.
Further, the step S3 is further specifically: and selecting two pictures with the minimum side length and the same side length from the set S, and if the minimum side lengths of the two selected pictures are the same, selecting the picture with the minimum area.
The invention also provides a system for dynamically planning and merging the game atlas, which comprises an aggregation module, a taking-out module, a selection module, a merging module, a recording module and a calculation module; the collection module is used for placing a plurality of pictures into a file array list; the taking-out module is used for taking out the file array list pictures to form a set S according to the side length of the pictures; the selecting module selects two pictures with the minimum side length from the set S; the merging module merges the two selected picture images into a new picture; the recording module is used for recording the merging information of the set S so as to position the picture area when in use; and the calculating module is used for recalculating the side length of the spliced pictures and updating the side length into the set S.
Further, the aggregation module is further specifically: and putting a plurality of pictures required to be used into a folder, traversing the folder and adding the read files into a file array list.
Further, the taking-out module is further specifically: and taking out the pictures of the file array list, arranging the multiple pictures according to the side lengths of the pictures, and arranging the pictures from small to large according to the side lengths, and if the side lengths are the same, arranging the pictures from small to large according to the areas to form a set S.
Further, the selecting module further specifically includes: and selecting two pictures with the minimum side length and the same side length from the set S, and if the minimum side lengths of the two selected pictures are the same, selecting the picture with the minimum area.
The invention has the beneficial effects that: the invention combines a plurality of pictures into a picture set to the maximum extent, which is helpful for reducing the frequency of DrawCall (the process of preparing data by the CPU and informing the GPU to render each time is called as DrawCall, if the number of the DrawCall is too large, the CPU can carry out a large amount of calculation, thereby causing the overload of the CPU and influencing the game running efficiency), improving the game running efficiency, reducing the bag body, reducing the frequency of network application and the frequency of file opening, more reasonably and effectively using image resources, and leading game users to obtain better game enjoyment.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention.
Fig. 2 is a schematic block diagram of the system of the present invention.
Fig. 3 is a schematic structural diagram of a first embodiment of merging new pictures.
Fig. 4 is a schematic structural diagram of a second embodiment of merging new pictures.
Fig. 5 is a schematic structural diagram of a third embodiment of merging new pictures.
Fig. 6 is a schematic diagram of calculating the side length of the stitched picture.
Fig. 7 is a final schematic diagram of the picture stitching result.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1, a method for dynamically planning and merging a game atlas of the present invention includes the following steps:
step S1, putting a plurality of pictures into a file array list;
step S2, taking out the file array list pictures to form a set S according to the side length of the pictures;
step S3, selecting two pictures with the minimum side length from the set S;
step S4, combining the two selected picture pictures into a new picture;
step S5, recording the merging information of the set S so as to position the picture area when in use;
and step S6, recalculating the side length of the spliced pictures, and updating the side length into the set S.
The invention is further illustrated by the following specific examples:
1. putting a plurality of pictures to be used into a folder, traversing the folder and adding the read files into a file array list;
2. taking out the pictures of the file array list, and arranging the multiple pictures according to the side lengths (length and width) of the pictures (from small to large according to the side lengths, and if the side lengths are the same, from small to large according to the areas) to form a set S;
3. selecting two pictures with the minimum side length and the similar (equal and preferential) side length from the set S (the two pictures are arranged according to the side lengths from small to large in the step 2, and if the minimum side lengths of the two pictures to be selected are the same, selecting the picture with the minimum area;
4. splicing the two pictures selected in the step 3 into a new picture;
5. recording the merging information of the current atlas so as to position (record the positions of the merged two edges in the new atlas) the picture area when in use;
(5-1) the numbers 3 and 7 form a new graph 11 (as in fig. 3), the new graph set after the full merging needs to record the positions of the numbers 3 and 7 in the current graph, because the numbers 3 and 7 are equal in length and width, the number 3 occupies the left half part in the new graph after the merging, and the number 7 occupies the right half part in the new graph.
(5-2), the numbers 8 and 10 form a new graph 12 (as in fig. 4), the new graph set after the full merging needs to record the positions of the numbers 8 and 10 in the current graph, because the numbers 8 and 10 are equal in length and width, the number 8 occupies the left half part in the new graph after the merging, and the number 10 occupies the right half part in the new graph.
(5-3) the new pattern number 11 merged at the step 5-1 and the new pattern number 14 merged at the step 5-2 (see fig. 5) need to record the information of the numbers 3, 7, 8, 10 occupying the number 14, because the same length and the same width, the numbers 3, 7, 8, 10 occupy 1 in 4 of the pattern of the number 14 after merging.
6. Recalculating the side length of the spliced pictures and updating the side length to a set S;
the calculation steps are as follows:
(1) in FIG. 6, the numbers 3 and 7 form a new pattern 11
(2) Because the length and width of the numbers 3 and 7 are equal
(3) So the length of the new graph is not changed after merging, and the width is twice of the new graph
7. And (5) circulating the step (3) until all the pictures are spliced (the S set is empty).
The following describes how the algorithm performs merging optimization on the drawing of the atlas element of the game interface by an example:
example (c): the area resulting from the merging is minimized so that the gaps formed by the splices are minimized. Since the total area of the pictures is constant, the area of the part does not change no matter how the pictures are pieced together. The scheme aims to minimize the gap of a new graph formed each time, the graph spliced next time is based on the previous time, and the area of the graph spliced in the circulation mode is the minimum.
Referring to FIG. 6, 10 picture sources of conventional numbers 1 to 10 are arranged such that the side lengths of the following pictures are equal to each other (the side lengths are equal to each other, and the picture sources are arranged such that the side lengths of the following pictures are equal to each other, that is, the picture sources are arranged from small to large according to the area
1. The extraction numbers 3, 7 form a new pattern (number 11) forming a new set S
2. The drawing numbers 8, 10 form a new figure (number 12) forming a new set S
3. The drawing numbers 4, 6 form a new figure (number 13) forming a new set S
4. The drawing numbers 11,12 form a new pattern (number 14) forming a new set S
5. The drawing numbers 13,9 form a new figure (number 15) forming a new set S
6. The numbers 1, 14 are taken out to form a new pattern (number 16) to form a new set S
7. The numbers 15, 16 are taken out to form a new pattern (the set S is empty at this time)
The final result of the spelling is shown in FIG. 7.
Referring to fig. 2, the present invention further provides a system for dynamically planning and merging game atlas, which includes an aggregation module, a fetching module, a selecting module, a merging module, a recording module, and a calculating module; the collection module is used for placing a plurality of pictures into a file array list; the taking-out module is used for taking out the file array list pictures to form a set S according to the side length of the pictures; the selecting module selects two pictures with the minimum side length from the set S; the merging module merges the two selected picture images into a new picture; the recording module is used for recording the merging information of the set S so as to position the picture area when in use; and the calculating module is used for recalculating the side length of the spliced pictures and updating the side length into the set S.
The collection module further specifically comprises: and putting a plurality of pictures required to be used into a folder, traversing the folder and adding the read files into a file array list.
The taking-out module is further specifically: and taking out the pictures of the file array list, arranging the multiple pictures according to the side lengths of the pictures, and arranging the pictures from small to large according to the side lengths, and if the side lengths are the same, arranging the pictures from small to large according to the areas to form a set S.
The selecting module is further specifically: and selecting two pictures with the minimum side length and the same side length from the set S, and if the minimum side lengths of the two selected pictures are the same, selecting the picture with the minimum area.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.
Claims (8)
1. A method for dynamically planning and merging game galleries, which is characterized by comprising the following steps:
step S1, putting a plurality of pictures into a file array list;
step S2, taking out the file array list pictures to form a set S according to the side length of the pictures;
step S3, selecting two pictures with the minimum side length from the set S;
step S4, combining the two selected picture pictures into a new picture;
step S5, recording the merging information of the set S so as to position the picture area when in use;
and step S6, recalculating the side length of the spliced pictures, and updating the side length into the set S.
2. The method of claim 1, wherein the step of dynamically planning the merging of the game atlas comprises the steps of: the step S1 further includes: and putting a plurality of pictures required to be used into a folder, traversing the folder and adding the read files into a file array list.
3. The method of claim 1, wherein the step of dynamically planning the merging of the game atlas comprises the steps of: the step S2 further includes: and taking out the pictures of the file array list, arranging the multiple pictures according to the side lengths of the pictures, and arranging the pictures from small to large according to the side lengths, and if the side lengths are the same, arranging the pictures from small to large according to the areas to form a set S.
4. The method of claim 1, wherein the step of dynamically planning the merging of the game atlas comprises the steps of: the step S3 further includes: and selecting two pictures with the minimum side length and the same side length from the set S, and if the minimum side lengths of the two selected pictures are the same, selecting the picture with the minimum area.
5. A system for dynamically planning and merging game atlas is characterized in that: the system comprises a collection module, a taking-out module, a selection module, a combination module, a recording module and a calculation module; the collection module is used for placing a plurality of pictures into a file array list; the taking-out module is used for taking out the file array list pictures to form a set S according to the side length of the pictures; the selecting module selects two pictures with the minimum side length from the set S; the merging module merges the two selected picture images into a new picture; the recording module is used for recording the merging information of the set S so as to position the picture area when in use; and the calculating module is used for recalculating the side length of the spliced pictures and updating the side length into the set S.
6. The system for dynamically planning and merging game albums according to claim 5, wherein: the collection module further specifically comprises: and putting a plurality of pictures required to be used into a folder, traversing the folder and adding the read files into a file array list.
7. The system for dynamically planning and merging game albums according to claim 5, wherein: the taking-out module is further specifically: and taking out the pictures of the file array list, arranging the multiple pictures according to the side lengths of the pictures, and arranging the pictures from small to large according to the side lengths, and if the side lengths are the same, arranging the pictures from small to large according to the areas to form a set S.
8. The system for dynamically planning and merging game albums according to claim 5, wherein: the selecting module is further specifically: and selecting two pictures with the minimum side length and the same side length from the set S, and if the minimum side lengths of the two selected pictures are the same, selecting the picture with the minimum area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110795560.0A CN113408657B (en) | 2021-07-14 | 2021-07-14 | Method and system for dynamic planning and merging of game atlas |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110795560.0A CN113408657B (en) | 2021-07-14 | 2021-07-14 | Method and system for dynamic planning and merging of game atlas |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113408657A true CN113408657A (en) | 2021-09-17 |
CN113408657B CN113408657B (en) | 2024-01-30 |
Family
ID=77686428
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110795560.0A Active CN113408657B (en) | 2021-07-14 | 2021-07-14 | Method and system for dynamic planning and merging of game atlas |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113408657B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115253305A (en) * | 2022-07-25 | 2022-11-01 | 杭州摩西科技发展有限公司 | Picture loading method, device and system, electronic device and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000062178A1 (en) * | 1999-04-14 | 2000-10-19 | Varis Corporation | Method and system for merging variable text and images into bitmaps defined by a page description language |
JP2010177987A (en) * | 2009-01-29 | 2010-08-12 | Make Softwear:Kk | Photography game machine, photography game method, and photography game program |
CN105321177A (en) * | 2015-10-09 | 2016-02-10 | 浙江工业大学 | Automatic hierarchical atlas collaging method based on image importance |
CN110597759A (en) * | 2019-08-28 | 2019-12-20 | 福建省天奕网络科技有限公司 | Method and storage medium for optimizing atlas resources in LayaIDE |
CN111026493A (en) * | 2019-12-10 | 2020-04-17 | 网易(杭州)网络有限公司 | Interface rendering processing method and device |
CN111161127A (en) * | 2019-12-19 | 2020-05-15 | 深圳海拓时代科技有限公司 | Picture resource rendering optimization method |
CN112073730A (en) * | 2020-09-03 | 2020-12-11 | 北京字节跳动网络技术有限公司 | Method, device and equipment for packing atlas and storage medium |
CN112464328A (en) * | 2020-09-29 | 2021-03-09 | 中国建筑第八工程局有限公司 | Deep design method and system based on BIM technology and atlas |
CN112580655A (en) * | 2020-12-25 | 2021-03-30 | 特赞(上海)信息科技有限公司 | Text detection method and device based on improved CRAFT |
CN112767419A (en) * | 2021-01-29 | 2021-05-07 | 福建天晴在线互动科技有限公司 | Method and system for cutting nine-grid of atlas |
-
2021
- 2021-07-14 CN CN202110795560.0A patent/CN113408657B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000062178A1 (en) * | 1999-04-14 | 2000-10-19 | Varis Corporation | Method and system for merging variable text and images into bitmaps defined by a page description language |
JP2010177987A (en) * | 2009-01-29 | 2010-08-12 | Make Softwear:Kk | Photography game machine, photography game method, and photography game program |
CN105321177A (en) * | 2015-10-09 | 2016-02-10 | 浙江工业大学 | Automatic hierarchical atlas collaging method based on image importance |
CN110597759A (en) * | 2019-08-28 | 2019-12-20 | 福建省天奕网络科技有限公司 | Method and storage medium for optimizing atlas resources in LayaIDE |
CN111026493A (en) * | 2019-12-10 | 2020-04-17 | 网易(杭州)网络有限公司 | Interface rendering processing method and device |
CN111161127A (en) * | 2019-12-19 | 2020-05-15 | 深圳海拓时代科技有限公司 | Picture resource rendering optimization method |
CN112073730A (en) * | 2020-09-03 | 2020-12-11 | 北京字节跳动网络技术有限公司 | Method, device and equipment for packing atlas and storage medium |
CN112464328A (en) * | 2020-09-29 | 2021-03-09 | 中国建筑第八工程局有限公司 | Deep design method and system based on BIM technology and atlas |
CN112580655A (en) * | 2020-12-25 | 2021-03-30 | 特赞(上海)信息科技有限公司 | Text detection method and device based on improved CRAFT |
CN112767419A (en) * | 2021-01-29 | 2021-05-07 | 福建天晴在线互动科技有限公司 | Method and system for cutting nine-grid of atlas |
Non-Patent Citations (1)
Title |
---|
王旭;张璐;杨新;毛为;谭祥升;: "飞行监控系统中基于GPU的地形渲染", 航空学报 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115253305A (en) * | 2022-07-25 | 2022-11-01 | 杭州摩西科技发展有限公司 | Picture loading method, device and system, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113408657B (en) | 2024-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101896880B (en) | Method for providing graphical user interface (GUI) using divided screen and multimedia device using the same | |
US9619428B2 (en) | SIMD processing unit with local data share and access to a global data share of a GPU | |
US9445016B2 (en) | Features such as titles, transitions, and/or effects which vary according to positions | |
US8839152B2 (en) | Image processing apparatus and image processing method | |
JP4751047B2 (en) | How to place a set of objects in an area | |
EP3998610A1 (en) | Synchronizing audio and video components of an automatically generated audio/video presentation | |
US11461943B1 (en) | Mosaic display systems and methods for intelligent media search | |
JP2004164823A5 (en) | ||
US8819590B2 (en) | Image display apparatus and image display method | |
US20120013640A1 (en) | Graphical representation of events | |
JPWO2012111275A1 (en) | Image evaluation apparatus, image evaluation method, program, integrated circuit | |
CN107644056A (en) | A kind of file memory method, apparatus and system | |
US8862974B2 (en) | Image display apparatus and image display method | |
CN110418191A (en) | A kind of generation method and device of short-sighted frequency | |
CN113408657A (en) | Method and system for dynamically planning and merging game atlas | |
CN101930778A (en) | Image-reproducing means | |
US7389038B1 (en) | Multimedia information recording device and method for recording multimedia information file on recording medium | |
CN115119014B (en) | Video processing method, training method and device for interpolation frame number model | |
JP2007036737A (en) | Image display device | |
CN111161283A (en) | Method and device for processing picture resources and electronic equipment | |
US20070279410A1 (en) | Method For Synthesizing Dynamic Virtual Figures | |
CN106663050A (en) | Differential Data Creating System, Data Updating System, And Differential Data Creating Method | |
JP2004206810A (en) | Data control method, data control device, data control program, and storage medium in which data control program is stored and which can be read by a computer | |
JP7566937B2 (en) | Video processing method, device, apparatus and computer-readable storage medium | |
US11587203B2 (en) | Method for optimizing hardware structure of convolutional neural networks |
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 |