CN113408657B - Method and system for dynamic planning and merging of game atlas - Google Patents

Method and system for dynamic planning and merging of game atlas Download PDF

Info

Publication number
CN113408657B
CN113408657B CN202110795560.0A CN202110795560A CN113408657B CN 113408657 B CN113408657 B CN 113408657B CN 202110795560 A CN202110795560 A CN 202110795560A CN 113408657 B CN113408657 B CN 113408657B
Authority
CN
China
Prior art keywords
pictures
side length
module
picture
merging
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
CN202110795560.0A
Other languages
Chinese (zh)
Other versions
CN113408657A (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.)
Fujian Tianqing Online Interactive Technology Co Ltd
Original Assignee
Fujian Tianqing Online Interactive 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 Fujian Tianqing Online Interactive Technology Co Ltd filed Critical Fujian Tianqing Online Interactive Technology Co Ltd
Priority to CN202110795560.0A priority Critical patent/CN113408657B/en
Publication of CN113408657A publication Critical patent/CN113408657A/en
Application granted granted Critical
Publication of CN113408657B publication Critical patent/CN113408657B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image 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 dynamic planning and merging of game atlases, which comprises the following steps: s1, placing a plurality of pictures into a file array list; s2, taking out file array list pictures to form a set S according to the side length of the pictures; step S3, selecting two pictures with minimum side length from the set S; s4, merging the two selected pictures into a new picture; s5, recording the merging information of the set S so as to position the picture area during use; s6, recalculating the side length of the spliced pictures, and updating the side length into the set S; the invention can realize the merging of the dynamic game planning atlases.

Description

Method and system for dynamic planning and merging of game atlas
Technical Field
The invention relates to the technical field of computers, in particular to a method and a system for dynamic planning and merging of game atlas.
Background
The atlas is a set of pictures, so that the interface control can conveniently select the pictures, the pictures can be changed randomly within the range of the set, and the pictures can be conveniently distributed when the game interface control is generated.
In games, an atlas is often used instead of a specific picture, and if a specific picture is used in a game, each picture must correspond to a picture file. And if the atlas formed by combining the picture files is used, only the texture of one atlas is corresponding.
When the atlas is synthesized, blank areas around each picture are removed, various optimization algorithms can be implemented on the whole, and game inclusion and memory occupation can be greatly reduced after the atlas is synthesized. The number of network applications can also be reduced by synthesizing the atlas (assuming that 10 pictures are applied for 10 times and then combined into the atlas, only two applications are needed, one is the synthesized large atlas, and the other is the configuration file for recording the combined information of the atlas). The synthesis atlas also greatly reduces the number of DrawCall times, (the process of preparing data by the CPU and notifying the GPU to render each time is called as one DrawCall, if the number of DrawCall is too large, the CPU can be caused to calculate, thereby causing overload of the CPU and affecting the running efficiency of the game), and the running efficiency of the game is improved. The method can also reduce the number of times of file switching and block loading speed (the step of file reading and writing is that firstly, a channel is established, then a data storage space is established, then data reading and writing are started, and the flow is closed).
However, a plurality of picture sets are sometimes provided, which are manually synthesized by an art maker, and the whole picture sets are required to be put one by one, which is very troublesome.
Disclosure of Invention
To overcome the above problems, it is an object of the present invention to provide a method that enables dynamic game planning atlas consolidation.
The invention is realized by adopting the following scheme: a method of game atlas dynamic programming merge, the method comprising the steps of:
s1, placing a plurality of pictures into a file array list;
s2, taking out file array list pictures to form a set S according to the side length of the pictures;
step S3, selecting two pictures with minimum side length from the set S;
s4, combining the two selected pictures into a new picture;
s5, recording the merging information of the set S so as to position the picture area during use;
and S6, recalculating the side length of the spliced pictures, and updating the side length into the set S.
Further, the step S1 specifically includes: placing the required pictures into a folder, traversing the folder and adding the read files into a file array list.
Further, the step S2 specifically includes: and taking out the pictures of the file array list, arranging the pictures according to the side length of the pictures, and arranging the pictures from small to large according to the side length, and if the side length is the same, arranging the pictures from small to large according to the area to form a set S.
Further, the step S3 specifically includes: and selecting two pictures with the smallest side length and the same side length from the set S, and selecting the picture with the smallest area if the two selected pictures with the smallest side length are the same.
The invention also provides a system for dynamic planning and merging of the game atlas, which comprises a collection module, a taking-out module, a selecting module, a merging module, a recording module and a calculating module; the aggregation module is used for placing a plurality of pictures into a file array list; the extraction module extracts 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 smallest side length from the set S; the merging module merges the two selected pictures into a new picture; the recording module records the merging information of the set S so as to position the picture area when in use; the calculation module recalculates the side length of the stitched pictures and updates the side length to the set S.
Further, the aggregation module specifically includes: placing the required pictures into a folder, traversing the folder and adding the read files into a file array list.
Further, the extraction module specifically includes: and taking out the pictures of the file array list, arranging the pictures according to the side length of the pictures, and arranging the pictures from small to large according to the side length, and if the side length is the same, arranging the pictures from small to large according to the area to form a set S.
Further, the selecting module specifically includes: and selecting two pictures with the smallest side length and the same side length from the set S, and selecting the picture with the smallest area if the two selected pictures with the smallest side length are the same.
The invention has the beneficial effects that: the invention combines a plurality of pictures into one atlas to the maximum extent, which is beneficial to reducing the number of DrawCall times, (the process of preparing data by the CPU and informing the GPU to render is called as DrawCall each time, if the number of DrawCall is too large, the CPU can be calculated in a large amount, thereby causing overload of the CPU and affecting the running efficiency of the game), improving the running efficiency of the game, reducing the inclusion, reducing the number of network application times, reducing the number of file opening times, more reasonably and effectively using image resources and leading game users to obtain better game enjoyment.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention.
Fig. 2 is a system schematic block diagram of the present invention.
Fig. 3 is a schematic structural diagram of a first embodiment for merging new pictures.
Fig. 4 is a schematic structural diagram of a second embodiment for merging new pictures.
Fig. 5 is a schematic structural diagram of a third embodiment for merging new pictures.
Fig. 6 is a schematic diagram of calculating a side length of a 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 dynamic programming merging of game atlases according to the present invention includes the following steps:
s1, placing a plurality of pictures into a file array list;
s2, taking out file array list pictures to form a set S according to the side length of the pictures;
step S3, selecting two pictures with minimum side length from the set S;
s4, combining the two selected pictures into a new picture;
s5, recording the merging information of the set S so as to position the picture area during use;
and 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 examples:
1. placing 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 pictures according to the side lengths (length and width) of the pictures (from small to large according to the side lengths, and from small to large according to the area if the side lengths are the same) to form a set S;
3. selecting two pictures with the smallest side length (the first two pictures are taken out from the set S in the selection process) from the set S (the two pictures are arranged from small to large according to the side length in the step 2), wherein the side lengths of the two pictures are similar (equal priority), and if the side lengths of the two pictures to be selected with the smallest side length are the same, selecting the picture with the smallest 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 locate (record the position of the two merged pictures in the new picture) the picture area when in use;
(5-1) the numbers 3 and 7 form a new graph 11 (as shown in fig. 3), and the new graph set after the combination needs to record the positions of the numbers 3 and 7 in the current graph, because the numbers 3 and 7 have equal length and equal width, the number 3 occupies the left half part in the new graph after the combination, 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 shown in fig. 4), and the new graph set after the combination 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 equal in width, the number 8 after the combination occupies the left half part in the new graph, and the number 10 occupies the right half part in the new graph.
(5-3) the new pattern number 11 after the combination in the step 5-1 is further combined with the new pattern number 14 after the combination in the step 5-2 (as shown in fig. 5), the information of the numbers 3,7,8 and 10 occupied by the numbers 14 needs to be recorded, because the equal widths of equal lengths are adopted, and the numbers 3,7,8 and 10 after the combination occupy 1 of 4 th of the pattern of the number 14.
6. Recalculating the side lengths of the spliced pictures and updating the side lengths to a set S;
the calculation steps are as follows:
(1) As shown 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 that the length of the new pattern after combination is unchanged and the width is twice that of the new pattern
7. And (3) circulating the steps 3-6 until all the pictures are spliced (S sets are empty).
By way of one example, how such an algorithm performs a merge optimization on the atlas element strokes of the game interface is described below:
examples: the area of the combination is minimized so that the voids created by the splice are minimized. Since the area of the picture sum is constant, this area does not change regardless of the spelling. The method aims at minimizing the gap of the new pattern formed each time, the next pattern splicing is also based on the previous basis, and the area of the pattern spliced by the method is minimum.
As shown in FIG. 6, the 10 pictures of the prior numbers 1 to 10 are firstly arranged from small to large according to the side length (from small to large according to the area when the side lengths are equal)
1. The extraction numbers 3,7 form a new pattern (number 11) to form a new set S
2. The numbers 8 and 10 are taken out to form a new graph (number 12) to form a new set S
3. The numbers 4 and 6 are taken out to form a new graph (number 13) to form a new set S
4. The extraction numbers 11,12 form a new pattern (number 14) to form a new set S
5. The extraction numbers 13 and 9 form a new pattern (number 15) to form 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 extraction numbers 15, 16 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 invention also provides a system for dynamic planning and merging of game atlases, which comprises a collection module, a taking-out module, a selection module, a merging module, a recording module and a calculation module; the aggregation module is used for placing a plurality of pictures into a file array list; the extraction module extracts 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 smallest side length from the set S; the merging module merges the two selected pictures into a new picture; the recording module records the merging information of the set S so as to position the picture area when in use; the calculation module recalculates the side length of the stitched pictures and updates the side length to the set S.
The aggregation module specifically comprises: placing the required pictures into a folder, traversing the folder and adding the read files into a file array list.
The extraction module comprises the following components: and taking out the pictures of the file array list, arranging the pictures according to the side length of the pictures, and arranging the pictures from small to large according to the side length, and if the side length is the same, arranging the pictures from small to large according to the area to form a set S.
The selecting module specifically comprises: and selecting two pictures with the smallest side length and the same side length from the set S, and selecting the picture with the smallest area if the two selected pictures with the smallest side length are the same.
The foregoing description is only of the preferred embodiments of the invention, and all changes and modifications that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

Claims (2)

1. A method of dynamic programming merge of game atlases, the method comprising the steps of:
s1, placing a plurality of pictures into a file array list;
s2, taking out pictures in the file array list, and forming a set S according to the arrangement of the side length of each picture from small to large;
step S3, selecting two pictures with minimum side length from the set S;
s4, combining the two selected pictures into a new picture;
s5, recording the merging information of the set S so as to position the picture area during use;
s6, recalculating the side length of the spliced pictures, and updating the side length into the set S; the step S1 specifically comprises the following steps: placing a plurality of pictures to be used into a folder, traversing the folder and adding the read files into a file array list;
the step S2 specifically comprises the following steps: taking out the pictures of the file array list, arranging the pictures according to the side length of the pictures, and arranging the pictures from small to large according to the side length, and if the side length is the same, arranging the pictures from small to large according to the area to form a set S;
the step S3 specifically comprises the following steps: selecting two pictures with the smallest side length and similar side lengths from the set S, and selecting the picture with the smallest area if the two selected pictures have the same side length;
splicing the two pictures selected in the step S3 into a new picture;
step S5 is to record the positions of the two combined pictures in the new picture;
and step S6, circulating the steps S3-S6 until all pictures in the set S are spliced.
2. A system for dynamic planning and merging of game atlases, characterized by: the device comprises a collection module, a taking-out module, a selection module, a merging module, a recording module and a calculation module; the aggregation module is used for placing a plurality of pictures into a file array list; the extraction module extracts pictures in the file array list, and forms a set S according to the arrangement of the side length of each picture from small to large; the selecting module selects two pictures with the smallest side length from the set S; the merging module merges the two selected pictures into a new picture; the recording module records the merging information of the set S so as to position the picture area when in use; the computing module recalculates the side length of the spliced pictures and updates the side length into the set S;
the aggregation module specifically comprises: placing a plurality of pictures to be used into a folder, traversing the folder and adding the read files into a file array list;
the extraction module comprises the following components: taking out the pictures of the file array list, arranging the pictures according to the side length of the pictures, and arranging the pictures from small to large according to the side length, and if the side length is the same, arranging the pictures from small to large according to the area to form a set S;
the selecting module specifically comprises: selecting two pictures with the smallest side length and the same side length from the set S, and selecting the picture with the smallest area if the two selected pictures have the same smallest side length;
splicing the two pictures selected in the selection module into a new picture;
recording the positions of the two combined pictures in the new picture in a recording module;
and the calculation module is followed by a selection module, a merging module, a recording module and a calculation module in a circulating way until all pictures in the set S are spliced.
CN202110795560.0A 2021-07-14 2021-07-14 Method and system for dynamic planning and merging of game atlas Active CN113408657B (en)

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 CN113408657A (en) 2021-09-17
CN113408657B true 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)

Citations (10)

* Cited by examiner, † Cited by third party
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

Patent Citations (10)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
飞行监控系统中基于GPU的地形渲染;王旭;张璐;杨新;毛为;谭祥升;;航空学报(第06期);全文 *

Also Published As

Publication number Publication date
CN113408657A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
JP6062427B2 (en) Visual display processing of hierarchically structured media that can be zoomed
CN101896880B (en) Method for providing graphical user interface (GUI) using divided screen and multimedia device using the same
US9983760B2 (en) Apparatus, method and computer readable recording medium for arranging a plurality of items automatically in a canvas
KR101037864B1 (en) Features such as titles, transitions, and/or effects which vary according to positions
US7555730B2 (en) Method for arranging graphic assemblies
US8839152B2 (en) Image processing apparatus and image processing method
US8056013B2 (en) Method for arranging graphic assemblies
JP2016071511A (en) Method and file system for rolling back data on tape
CN104572668B (en) Method and apparatus based on multiple pattern file generated Merge Styles files
US10978108B2 (en) Apparatus, method, and program for creating a video work
CN106709070B (en) Animation generation method and device and animation playing method and device
KR20140023596A (en) Apparatus, method and computer readable recording medium for editting the image automatically by analyzing an image
US8819590B2 (en) Image display apparatus and image display method
US8862974B2 (en) Image display apparatus and image display method
CN107644056A (en) A kind of file memory method, apparatus and system
US20070256012A1 (en) User interface for browsing content, method of providing the user interface, and content browsing apparatus
CN113408657B (en) Method and system for dynamic planning and merging of game atlas
CN111161283A (en) Method and device for processing picture resources and electronic equipment
JP2008301264A (en) Image block layout method and image block layout system
JP2007036737A (en) Image display device
JP3558048B2 (en) File recording method, file processing method, image display device, and image editing device
CN111460770B (en) Method, device, equipment and storage medium for synchronizing element attributes in document
CN102929923B (en) Organization and management and displaying methods and devices for ordered data interface elements
CN115119014B (en) Video processing method, training method and device for interpolation frame number model
CN102253970B (en) Image processing method

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