Sub-image generation method, device, electronic device and storage medium in puzzle game

By directly loading game images and capturing sub-images in the puzzle game, the problems of large storage space and development workload are solved, efficient puzzle game development and diverse player experience are achieved, and the game is ensured to run normally under poor network conditions.

CN116531759BActive Publication Date: 2025-09-16BEIJING SIMING QICHUANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310440431.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2025-09-16
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

Existing jigsaw puzzle games have large data volumes, take up a lot of storage space, require a lot of development work, and provide a poor player experience, especially when the network signal is poor.

Method used

By directly loading game images in the game and capturing sub-images in the images according to game instructions, sub-images can be generated and rendered in real time, reducing storage requirements and development workload, and supporting players to independently configure the puzzle format.

Benefits of technology

It reduces the storage cost and development workload of puzzle games, improves development efficiency and player experience, supports diverse puzzle gameplay, and ensures that the game runs normally under poor network signal conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116531759B_ABST
    Figure CN116531759B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, electronic device, and storage medium for generating sub-images in a jigsaw puzzle game, relating to the technical field of image data processing. The method comprises: responding to a received game instruction and loading a game image in the jigsaw puzzle game; the game instruction carries a segmentation feature for segmenting the game image, the segmentation feature including the number of segmented sub-images and the shape of the sub-images; based on the segmentation feature, determining the reference position of each sub-image in the game image; and based on the reference position, intercepting each sub-image in the game image. Therefore, this application has the advantages of saving development costs, reducing storage space pressure, and improving development efficiency and quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image data processing, and in particular to a method, device, electronic device, and storage medium for generating sub-images in a jigsaw puzzle game. Background Art

[0002] In the prior art, when a user enters a jigsaw puzzle game through an electronic device, the electronic device often needs to download or call in real time the pre-made and stored overall image data and its corresponding multiple sub-image data based on factors such as the difficulty level or image preference selected by the user, and then perform data rendering through the video memory to present the image sub-images on the display screen of the electronic device. However, based on the user's diverse gameplay requirements in jigsaw puzzle games, the more the total number of image sub-images and the types of special effects (such as grayscale, blur, sub-image shape) selected, the more image data technicians need to pre-process, store or package. Accordingly, the pressure on the storage space of the original server storing the jigsaw puzzle game data or the electronic device running the jigsaw puzzle game on a single machine is also significantly increased. Electronic devices that connect to the Internet in real time to obtain the specified jigsaw puzzle sub-image data will also be unable to start the game due to network lag or no network signal, which will bring a bad gaming experience to users. Summary of the Invention

[0003] The purpose of this application is to provide a method, device, electronic device and storage medium for generating sub-pictures in a jigsaw puzzle game. This application saves the storage space occupied by the jigsaw puzzle game by directly loading the game picture and extracting the sub-pictures after entering the game, reduces the workload and manpower and material costs required for developing the jigsaw puzzle game, and effectively improves the development efficiency, development quality and player experience of the jigsaw puzzle game.

[0004] The embodiment of the present application is implemented as follows:

[0005] A first aspect of an embodiment of the present application provides a method for generating sub-images in a puzzle game, the method comprising: loading a game image in the puzzle game in response to a received game instruction; the game instruction carries a segmentation feature for segmenting the game image, the segmentation feature including the number of segmented sub-images and the shape of the sub-images; determining a reference position of each sub-image in the game image based on the segmentation feature; and capturing each sub-image in the game image based on the reference position.

[0006] In one embodiment, based on the segmentation features, the reference position of each sub-image in the game image is determined, including: judging whether it is necessary to call a mask toolkit based on the shape of the sub-image; if it is necessary to call a mask toolkit, searching for a target mask toolkit in all mask toolkits based on the number of sub-images and the shape of the sub-images; the target mask toolkit includes multiple target masks; the shape of the target mask is consistent with the sub-image shape; Figure 1One-to-one correspondence; based on the placement of each target mask in the game image in the target mask toolkit, the reference position of each sub-image is determined.

[0007] In one embodiment, after determining whether to call the mask toolkit based on the shape of the sub-image, the method further includes: if calling the mask toolkit is not necessary, determining a reference position of each sub-image based on the number of sub-images.

[0008] In one embodiment, the reference position includes a center position, and based on the reference position, each sub-image is captured in the game image, including: for each sub-image, aligning the center cross of the virtual camera with the center position; adjusting the camera range of the virtual camera based on the maximum size of the sub-image along at least one preset direction; and capturing each sub-image in the game image through the virtual camera.

[0009] In one embodiment, the reference position includes an outer contour position, and each sub-image is captured in the game image based on the reference position, including: for each sub-image, based on the maximum size corresponding to the outer contour position, adjusting the camera range of the virtual camera; adjusting the center cross position of the virtual camera until the camera range completely covers the outer contour of the sub-image; and capturing each sub-image in the game image through the virtual camera.

[0010] In one embodiment, after loading the game image in the puzzle game, the method further includes: rendering the game image or sub-image based on special effect information carried by the game instructions, and generating dynamic texture data.

[0011] In one embodiment, based on the special effect information carried by the game instructions, the game image or sub-image is rendered, including: if the target special effects corresponding to all sub-images are consistent, rendering the game image or each sub-image based on the target special effects.

[0012] In one embodiment, rendering a game image or sub-image based on special effect information carried by a game instruction further includes: if target special effects corresponding to each sub-image are inconsistent, rendering each sub-image separately based on different target special effects.

[0013] In one embodiment, in response to a received game instruction, a game image in a puzzle game is loaded, including: if the game instruction carries user preference image information, retrieving the game image corresponding to the user preference image information; if the game instruction does not carry the user preference image information, randomly loading the game image.

[0014] A second aspect of an embodiment of the present application provides a sub-image generation device for a puzzle game, the device comprising: a loading module, a determination module, and a capture module. The loading module is configured to load a game image from the puzzle game in response to a received game instruction; the game instruction carries a segmentation feature for segmenting the game image, the segmentation feature including the number and shape of the segmented sub-images; the determination module is configured to determine a reference position of each sub-image in the game image based on the segmentation feature; and the capture module is configured to capture each sub-image in the game image based on the reference position.

[0015] A third aspect of an embodiment of the present application provides an electronic device, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute the sub-image generation method in the jigsaw puzzle game of the first aspect of the embodiment of the present application and any embodiment thereof.

[0016] A fourth aspect of the present application provides a computer-readable storage medium storing a computer program that can be executed by a processor to implement the method for generating a sub-graph in a jigsaw puzzle game according to the first aspect of the present application and any of its embodiments.

[0017] The beneficial effects of this application compared with the prior art are:

[0018] The present application can solve the technical problems in the prior art such as too much storage space occupied by jigsaw puzzle game-related data, heavy workload during jigsaw puzzle game development, waste of manpower and material resources, low development efficiency and quality, and poor player experience. The present application realizes the real-time generation and rendering of fragment images (sub-images) in the jigsaw puzzle game by directly loading the game image after entering the game and intercepting sub-images in the game image according to the segmentation features carried by the game instructions. The present application effectively reduces the workload and storage cost of the jigsaw puzzle game during the development period, improves the development efficiency and quality of the staff, and can realize the diversified presentation of the jigsaw puzzle game without the need for technical personnel to pre-enumerate the rendering data of all fragment images (sub-images) in the jigsaw puzzle game; the present application can also realize the player's independent configuration of the presentation form of the jigsaw puzzle fragments; and under the conditions of a single machine or poor network signal, the present application can also realize the smooth operation of the jigsaw puzzle game by pre-storing images or obtaining less data. The present application effectively improves the player's experience of use. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0021] Figure 2 A schematic flow chart of a method for generating a sub-image in a jigsaw puzzle game according to an embodiment of the present application;

[0022] Figure 3 A schematic diagram of a jigsaw puzzle game provided by an embodiment of the present application displaying a game picture;

[0023] Figure 4 A schematic diagram of a jigsaw puzzle game according to an embodiment of the present application showing various sub-pictures;

[0024] Figure 5 A schematic flow chart of a method for generating a sub-image in a jigsaw puzzle game according to an embodiment of the present application;

[0025] Figure 6 A schematic diagram of rendering an image by placing rectangles in a virtual world, provided by an embodiment of the present application;

[0026] Figure 7 A schematic diagram of displaying an image on a screen based on a rectangular position according to an embodiment of the present application;

[0027] Figure 8 A schematic diagram of a game image provided in one embodiment of the present application;

[0028] Figure 9 A schematic diagram of segmenting a game image based on subgraph features according to an embodiment of the present application;

[0029] Figure 10 A schematic diagram of determining the reference position of each sub-image provided in an embodiment of the present application;

[0030] Figure 11 Schematic diagram of each sub-graph extracted from an embodiment of the present application;

[0031] Figure 12 A schematic diagram of setting a target mask on a game image provided by an embodiment of the present application;

[0032] Figure 13 A schematic diagram of a sub-image captured by a target mask according to an embodiment of the present application;

[0033] Figure 14 A schematic structural diagram of a sub-image generating device in a jigsaw puzzle game provided in one embodiment of the present application.

[0034] Reference numerals: 1—electronic device; 10—memory; 11—bus; 12—processor; 300—sub-graph generating device in a jigsaw puzzle game; 310—loading module; 320—determination module; 330—interception module. DETAILED DESCRIPTION

[0035] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0036] Similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.

[0037] The technical solution of this application will be clearly and completely described below with reference to the accompanying drawings.

[0038] When developing jigsaw puzzles, it's often necessary to process data based on the different ways each game image can display its fragments. The same game image can have different fragment shapes, numbers of fragments, and stacking effects depending on the game's difficulty. With a database containing numerous game images, it's difficult for engineers to pre-enumerate all possible fragment displays and store them on the game server. This also creates an enormous development workload for developers. Pre-storing all fragment image (sub-image) data on the game server also places significant pressure on server storage space.

[0039] Correspondingly, when players load a jigsaw puzzle game through an electronic device, they need to obtain a data packet of jigsaw puzzle fragments in the jigsaw puzzle game (collectively referred to as a game loading data packet). The data packet often takes up too much storage space of the electronic device, and the electronic device only uses a small part of the data in the data packet each time the game is started, so its utilization rate is not high. The data packet also puts a lot of pressure on the storage space of the user's electronic device. When there is less storage space left in the electronic device, there will be problems of lag or even crash. Moreover, when the fragment form in the data packet is not perfect, it is difficult for players to choose their preferred or even more diverse jigsaw forms according to their needs. When the player is in a stand-alone environment with a stuck network signal or no network signal, unless the electronic device has downloaded the latest game loading data packet in advance, it is difficult for the player to start the game or experience the updated jigsaw puzzle gameplay, which will also bring a bad gaming experience to the player.

[0040] Based on the above technical problems, the present application provides a method, device, electronic device and storage medium for generating sub-images in a puzzle game. The processor of the electronic device (such as a video memory processor) loads the game image after entering the game and captures sub-images in the game image in real time according to the segmentation features carried by the game instructions, thereby realizing real-time generation and rendering of fragmented images (sub-images) in the puzzle game, effectively solving the existing technical problems. The specific implementation method is as follows.

[0041] See Figure 1 , Figure 1 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. Figure 1 As shown, the electronic device 1 includes at least one processor 12 and a memory 10. Figure 1 In the embodiment, a processor 12 is used as an example. The processor 12 and the memory 10 are connected via a bus 11. The memory 10 stores instructions executable by at least one processor 12. The instructions are executed by the at least one processor 12 so that the at least one processor 12 performs the sub-graph generation method in the jigsaw puzzle game described in the following embodiment.

[0042] See Figure 2 , Figure 2 This is a flow chart of a method for generating sub-graphs in a jigsaw puzzle game according to an embodiment of the present application. Figure 2 As shown, the method includes steps S110 to S130.

[0043] S110: Responding to the received game instruction, loading a game picture in the jigsaw puzzle game.

[0044] The game instruction refers to the instruction received by the processor at the start of the game to split the game image in real time to provide jigsaw puzzle sub-image fragments. The game instruction usually carries the segmentation characteristics for segmenting the game image, and the segmentation characteristics include the number of segmented sub-images and the shape of the sub-images. In this step, after receiving the game instruction, the processor loads the game image required for the jigsaw puzzle game from the memory of the electronic device, or obtains the game image required for the jigsaw puzzle game from the website server or game server via the Internet. The game image is the complete image after all the sub-images presented by the jigsaw puzzle game are pieced together, or before all the sub-images are segmented.

[0045] S120: Determine the reference position of each sub-image in the game image based on the segmentation features.

[0046] The segmentation feature refers to the features of each sub-image in the puzzle game that corresponds to the complete game image and is presented after segmentation, such as the number of sub-images, the shape of the sub-image, and other features. In this step, the processor determines the reference position of each sub-image based on the segmentation feature of the sub-image, so as to facilitate the subsequent rapid search for the sub-image or extraction of the complete sub-image from the complete game image based on the reference position. For example, the processor determines the arrangement of each sub-image in the game image based on whether the shape of the sub-image is regular or whether the shape of the sub-image is a preset shape; the processor determines the proportion of the sub-image in the game image under the specified shape based on the number of sub-images, and then determines the reference position of each sub-image in the game image based on the information such as the occupation ratio and the arrangement method.

[0047] S130: Based on the reference position, capture each sub-image in the game image.

[0048] In this step, the processor quickly locates the sub-image in the game image based on the reference position corresponding to each sub-image, and then determines the capture size that can completely capture the sub-image based on other information represented by the reference position, or the sub-image segmentation characteristics and the pixel size of the game image, so as to reduce the processor's screening of non-sub-image noise data and speed up the processor's processing efficiency.

[0049] See Figures 3 and 4 , Figure 3 A schematic diagram of a jigsaw puzzle game displaying game images provided by an embodiment of the present application. Figure 4 This is a schematic diagram of a jigsaw puzzle game provided by an embodiment of the present application showing each sub-image. Figures 3 and 4 As shown, when receiving the relevant instruction to start the jigsaw puzzle game, the electronic device first loads the Figure 3 The complete game image to be split is shown, and it is rendered to be displayed to the player through the screen. Then, the graphics memory processor executes the sub-image generation method provided by the present application to automatically split the game image into multiple sub-images, and displays the multiple sub-images after the splitting to the player through the screen (such as Figure 4 ), the user can start the jigsaw puzzle game.

[0050] See Figure 5 , Figure 5 This is a flow chart of a method for generating sub-graphs in a jigsaw puzzle game according to an embodiment of the present application. Figure 5 As shown, the sub-image generation method in the jigsaw puzzle game includes the following steps S210 to S250.

[0051] S210: In response to the received game command, load the game picture in the jigsaw puzzle game. This step is the same as step S110. For details, please refer to step S110. Step S210 includes sub-steps S211 and S212.

[0052] S211: If the game instruction carries user preference image information, retrieve the game image corresponding to the user preference image information.

[0053] User-preferred image information refers to the game image information selected by the player on the configuration interface when entering the puzzle game. In one embodiment, upon entering the puzzle game, the player can select a game image type based on their preferences on the user configuration interface, such as images of flowers and birds, landscapes, portraits, animation, film and television dramas, and other themes. The processor then generates the user-preferred image information based on the user's preferred game image type, packages it into game instructions, and sends it to the graphics memory processor that receives the game instructions and executes the sub-image generation method of the present application; or the processor directly generates the user-preferred image information and game instructions based on the user's selection and begins executing step S211 based on the game instructions.

[0054] In another embodiment, when entering a jigsaw puzzle game, a player can directly specify an image from the electronic device's photo album as the game image. This game image is a pre-stored image in memory. In this case, the user's preferred image information refers to the information corresponding to the specified image, such as the image name, image ID, loading path, image content, or storage location. The jigsaw puzzle game requires the player to request photo album access permission before accessing the image from the album.

[0055] Therefore, in this step, if the game instruction carries user-preferred image information, the processor can retrieve the game image corresponding to the user-preferred information from the jigsaw puzzle game's cloud server or other webpage via the network based on the user-preferred image information. The processor can also search and retrieve the corresponding game image from the memory based on the user-preferred image information to continue executing subsequent steps. The memory refers to the hardware external storage device of the electronic device, such as a memory card, hard drive, optical disc, USB flash drive, etc.

[0056] S212: If the game instruction does not carry the user's preferred image information, randomly load the game image.

[0057] In this step, if the game instruction does not carry the user's preferred image information, the processor can search the memory for the acquired jigsaw puzzle game data packet, search for the material therein and randomly load a game picture data; the processor can also randomly obtain at least one material picture from the game server through the network and randomly select one as the game picture.

[0058] After loading the game image, the electronic device must first display the complete game image on the screen to the player. The processor renders the game image or sub-image based on the relevant data and displays it on the screen as an image in the following process.

[0059] See Figures 6 and 7 , Figure 6 A schematic diagram of rendering an image by placing rectangles in a virtual world, provided by an embodiment of the present application; Figure 7 A schematic diagram of displaying an image on a screen based on rectangular positions provided in one embodiment of the present application. Figures 6 and 7 What is shown is that an electronic device establishes a computer virtual world and places objects in the form of data in a cube that can be observed by a virtual camera. Then, by pointing the virtual camera at a certain surface of the cube, the observation results within the camera's observation range are used as the display content of the electronic device screen, and the image is rendered and displayed on the screen.

[0060] like Figures 6 and 7 As shown, the principle of image rendering by electronic devices is as follows: in the virtual world, the processor uses a program to place many objects. It can also place a camera (or camera) and set the camera's observation range in the virtual world in the form of a cube. It can then display objects in the virtual world that intersect with this cube on the screen. To render an image, we need to place a rectangle in the virtual world, set the positions of the rectangle's four vertices, and then input the rendering data for the image to be displayed on the rectangle. In this way, when the rectangle is placed in the cube corresponding to the camera, the specific image can be displayed on the electronic device screen.

[0061] The processor can place the game image at the virtual world coordinate origin (0, 0, 0), which corresponds to the center of the screen. The coordinate system uses the right side of the screen as the positive X-axis direction, the upward direction of the screen as the positive Y-axis direction, and the direction of the screen toward the user as the negative Z-axis direction. After the processor loads and displays the game image, it continues to determine the reference position of the sub-image in the game image based on the segmentation characteristics, as shown in step S220.

[0062] S220: Based on the segmentation features, determine the reference position of each sub-image in the game image. This step is the same as step S120. For details, see step S120. This step includes sub-steps S221 to S224.

[0063] It should be noted that the splitting characteristics can be the default information when the puzzle game is started, or they can be selected by the player when entering the puzzle game. For example, a puzzle game can be set up in a format with multiple levels of gradually increasing difficulty, with different default splitting characteristics at different levels; a puzzle game can also be set up to start the puzzle game based on the number of puzzle pieces (number of sub-pictures) and the type of puzzle piece shape (sub-picture shape) selected by the player.

[0064] In an embodiment of the present application, the reference position can be the center point position of each sub-image (i.e., the center position), or the position of the outer contour of each sub-image in the game image. The reference position can also be the vertex position of each sub-image in the same orientation.

[0065] For example, using the reference position as the center point of each sub-image, place the virtual camera's shooting center point (center cross) at the reference position. This means the virtual camera's X- and Y-axis coordinates are the same as the reference position, and the virtual camera is positioned at -1000 on the virtual world's Z axis, with the shooting direction oriented in the positive Z axis. This allows you to capture the corresponding sub-image in the game image. Determining the reference position helps the virtual camera quickly locate the sub-image and fully capture it.

[0066] S221: Based on the shape of the sub-image, determine whether a mask toolkit needs to be called.

[0067] Since the shapes of the sub-images used as fragments in the jigsaw puzzle game are diverse, when the sub-image shape is irregular or does not conform to the preset shape, the processor can more efficiently extract or intercept the sub-image by directly setting a mask at a specified position on the game image. Therefore, in this step, the processor needs to determine whether it is necessary to call the mask toolkit based on the shape of the sub-image. The mask toolkit includes multiple masks, and the number of masks in a mask toolkit is the same as the number of sub-images. The masks in the same mask toolkit conform to the sub-image shape, and the shape of each mask corresponds one-to-one to each sub-image shape corresponding to the same game image. The different types of shapes corresponding to the multiple mask toolkits meet the fragment shapes that players can choose when entering the game or the fragment shapes that can be presented in the jigsaw puzzle game.

[0068] In this embodiment of the present application, the processor uses a rectangle or a rectangle with a preset length and width ratio as the preset shape. When the sub-image shape is a rectangle, or a sub-image with a preset length and width ratio, no mask is required to capture the sub-image from the game image. When the sub-image shape is other shapes, the corresponding masking tool is required to capture the sub-image from the game image.

[0069] S222: If the mask toolkit does not need to be called, the reference position of each sub-image is determined based on the number of sub-images.

[0070] In this step, if the mask toolkit is not needed, the processor can directly divide the game image evenly based on the number of sub-images. Accordingly, the reference positions corresponding to the sub-images are also evenly distributed in the game image. Thus, the processor can determine the reference position of each sub-image in the game image based on the number of sub-images; or determine the reference position of each sub-image in the game image based on the number of sub-images and the sub-image shape.

[0071] S223: If a mask toolkit needs to be called, a target mask toolkit is searched for in all mask toolkits based on the number and shape of the sub-images.

[0072] In this step, if the mask toolkit needs to be called, the processor searches for a matching target mask based on the segmentation features. Normally, a mask toolkit includes masks for assisting in intercepting all sub-images corresponding to a game image, that is, a target mask toolkit includes all masks corresponding to a set of sub-images. In the target mask toolkit, the shape and size of the target mask correspond one-to-one to the shape and size of the sub-image to be intercepted; in the target mask toolkit, the number of target masks is equal to the number of sub-images. Among them, all target masks in a target mask toolkit can be pieced together into a complete mask of the same size as the game image, and the size of the complete mask is consistent with the size of the game image; and when all target masks in a target mask toolkit are pieced together into a complete mask, there is no overlapping area or gap between the target masks.

[0073] S224: Determine the reference position of each sub-image based on the placement position of each target mask in the game image in the target mask toolkit.

[0074] Based on the above, in this step, the processor can directly determine the reference position of each sub-image based on the placement of the target mask in the game image. The placement position can be the location of the mask's coverage area in the game image; the location of the mask's outer contour when the mask is overlaid on the game image; or the center position or vertex position of the mask when the mask is overlaid on the game image.

[0075] In other embodiments of the present application, the processor may be further configured to generate a target mask toolkit consisting of multiple target masks corresponding to the same game image based on the sub-image shape selected or drawn by the player. When entering the game, the player may select a preferred sub-image shape from multiple preset sub-image shapes, or may draw a closed mask shape in real time on the touch screen of the electronic device, or draw at least one straight or curved dividing line that divides the game image.

[0076] In one embodiment, the processor can also call the vertex data corresponding to the sub-image shape, the position set of multiple points corresponding to the outer contour curve of the sub-image shape, and other data based on the preset sub-image shape selected by the user and the existing mask generation program, and write them into the mask generation code to achieve real-time adjustment of the mask shape and real-time generation of the target mask.

[0077] In another embodiment, the processor can also identify the position of the dividing line drawn by the player on the touch screen for the game image, and determine the intersection position between the dividing lines, or the intersection position between the dividing line and the outer contour of the game image. Then, based on the position of the shortest dividing line between adjacent intersections and the outer contour position of the game image, the processor writes the relevant data into an existing mask generation program or inputs it into an existing mask generation model to generate the outer contour position information of multiple target masks corresponding to the same game image (i.e., the placement position of the target mask, usually expressed in the form of a coordinate set), and obtains multiple target masks corresponding to the dividing lines drawn by the player for the game image, thereby realizing real-time adjustment of the mask shape and real-time generation of the target mask.

[0078] In another embodiment, the processor can also identify a closed figure drawn by the player on the touch screen for the game image and determine the center point position and outer contour shape information of the closed figure. Then, based on the center point position, outer contour shape information, outer contour position of the game image, and the number of sub-images, the processor writes the relevant data into an existing mask generation program or inputs it into an existing mask generation model to generate the outer contour positions of multiple target masks corresponding to the same game image (i.e., the placement positions of the target masks, usually expressed as a set of coordinates), thereby obtaining multiple target masks corresponding to the closed figure drawn by the player for the game image, thereby achieving real-time generation of the target masks.

[0079] S230: Based on the reference position, capture each sub-image in the game image. This step is the same as the above step S130. For details, please refer to the above step S130. This step includes the following two embodiments.

[0080] Example 1: Taking the reference position as the center position of the sub-image as an example, the processor first locates the sub-image through the virtual camera and then determines the camera range to capture the complete sub-image image. The specific details are as follows.

[0081] For each sub-image, the processor aligns the center crosshairs of the virtual camera with the center position of each sub-image. The processor then adjusts the virtual camera's imaging range based on the maximum size of the sub-image along at least one preset direction. The maximum size of the sub-image along at least one preset direction can be the maximum outer dimension of the mask in the same preset direction, or a value determined by the processor based on the total size of the game image after equally dividing the game image.

[0082] The aspect ratio of the virtual camera's imaging range may be fixed or variable. If it is variable, the processor may adjust the aspect ratio of the virtual camera's imaging range based on the size ratio of the sub-image in both the aspect and width directions (i.e., the X-axis and Y-axis directions, which are preset directions), and adjust the virtual camera's zoom distance into the image based on the maximum size in any preset direction, i.e., the virtual camera's imaging range size. After adjusting the virtual camera's imaging range based on the maximum size of the sub-image along at least one preset direction, the processor uses the virtual camera to capture each sub-image in the game image.

[0083] Example 2: Taking the reference position as the outer contour position of the sub-image as an example, the processor captures the complete sub-image image by adjusting the camera range of the virtual camera first and then positioning the sub-image. Specific steps are as follows.

[0084] First, the processor adjusts the imaging range of the virtual camera for each sub-image based on the maximum size corresponding to the outer contour position. Therefore, the processor needs to determine the maximum size of the sub-image in at least one preset direction based on the preset direction and the outer contour position in advance; the preset direction is usually the length and width corresponding to the imaging range of the virtual camera, that is, the X-axis direction and the Y-axis direction in the virtual world. The processor adjusts the imaging range of the virtual camera so that the imaging range can completely cover the outer contour of the corresponding sub-image. Then, the processor moves the center cross position of the virtual camera based on the outer contour position, so that it traverses every pixel coordinate point in the coverage area of ​​the sub-image on the game picture, until the imaging range of the virtual camera can completely cover the outer contour of the sub-image. Finally, the processor captures each sub-image in the game picture through the virtual camera.

[0085] In one embodiment, after loading a game image or capturing sub-images based on the game image, the processor also needs to overlay special effects on the game image or sub-images and generate dynamic texture data for rendering. Specifically, the processor renders the game image or sub-image based on the special effects information carried by the game instructions and generates dynamic texture data. Dynamic texture data is the image rendering data used by the video memory processor in the electronic device to present the game image or sub-image-related images on the screen.

[0086] Among them, the processor needs to determine whether the target special effects corresponding to all sub-images are consistent based on the special effects information carried by the game instructions; if the target special effects corresponding to all sub-images are consistent, the processor directly renders the entire game image based on the target special effects after loading the game image, and generates dynamic texture data for the entire game image, so that after the game image is divided into multiple sub-images, the processor can display the sub-image image on the electronic device screen based on the dynamic texture data corresponding to each sub-image; the processor can also render all sub-images separately based on the same target special effects after intercepting each sub-image, and generate dynamic texture data corresponding to each sub-image.

[0087] If the target special effects corresponding to each sub-image are inconsistent, the processor can only render each sub-image according to the target special effects corresponding to each sub-image contained in the special effects information after intercepting each sub-image, and generate dynamic texture data corresponding to each sub-image, so that each sub-image can be displayed on the electronic device screen in the form of different image special effects.

[0088] Taking direct sub-image interception and mask-based sub-image interception as examples, the following content specifically introduces a specific application example of the sub-image generation method in the jigsaw puzzle game provided by this application.

[0089] See Figures 8 to 11 , Figure 8 A schematic diagram of a game image provided in one embodiment of the present application; Figure 9 A schematic diagram of segmenting a game image based on subgraph features according to an embodiment of the present application; Figure 10 A schematic diagram of determining the reference position of each sub-image provided in an embodiment of the present application; Figure 11 Schematic diagram of each sub-graph extracted from an embodiment of the present application.

[0090] Please combine Figures 8 to 11 As shown, assuming the game image size is 512x 512 pixels, the game instruction instructs the processor to cut the game image into 9 sub-images (such as Figure 9 The figure shows 9 square sub-graphs. Based on the number of cuts required, the processor dynamically calculates the reference position (center point position) of each sub-graph: {-85, -85, 0}, {85, -85, 0}, {0, -85, 0}, {85, 0, 0}, {-85, 0, 0}, {0, 0, 0}, {-85, 85, 0}, {85, 85, 0}, {0, 85, 0}. The reference positions of each sub-graph are shown in the figure. Figure 10 The 9 white dots in the game image shown in .

[0091] Place the virtual camera (also called world camera) aiming point (i.e. center cross) at Figure 10The virtual camera is controlled to aim at each component diagram by adjusting the positions of the white dots on the screen; the virtual camera is then zoomed in toward the positive direction of the Z axis (the direction of the player relative to the screen of the electronic device) to control the size of the virtual camera's image to be 170 pixels (512÷3=170), and the aspect ratio of the virtual camera's image range is controlled to remain unchanged at the preset value (the preset value can be the length of the display screen / the width of the display screen; or the length of the game image / the width of the game image). By setting these parameters, the virtual camera's image range is controlled to just capture and cover a certain sub-image (i.e., a 1 / 9 cut of the game image), the screenshot function of the virtual camera is turned on, and the captured image is saved as a dynamic texture, that is, a sub-image can be presented on the screen. The processor controls the virtual camera to adjust the camera range and take screenshots at each white dot position, and 9 sub-images can be obtained (such as Figure 11 As shown), the dynamic texture data corresponding to the 9 sub-images are obtained, and all the sub-images are displayed on the screen based on the dynamic texture data. At this point, the task of dynamically generating sub-images in the jigsaw puzzle game is completed.

[0092] See Figures 12 to 13 , Figure 12 A schematic diagram of setting a target mask on a game image provided by an embodiment of the present application; Figure 13 This is a schematic diagram of a sub-image intercepted by a target mask provided in an embodiment of the present application. Figures 8 to 10 、 Figures 12 to 13 As shown, before the virtual camera takes a picture or screenshot, the processor sets a target mask for the game image through the target mask toolkit corresponding to the sub-image; the processor sets the cropped area of ​​the game image as the mask range, and still places the virtual camera's aiming point (center cross) at a certain white point position (such as Figure 10 As shown, the white dot position is the reference position of the sub-image, which can be determined based on the even distribution of the game image or the placement of each mask in the game image). The processor then adjusts the virtual camera's camera range to be slightly larger or smaller based on the maximum outer contour size of the target mask along the length and width directions (X-axis and Y-axis) (although the dimensions of multiple target masks corresponding to a game image are roughly within the same range along the length and width directions, in order to achieve complete splicing of multiple adjacent masks, the length and width dimensions corresponding to the local positions may be special, so the camera range needs to be further adjusted based on the maximum outer contour size) to cover the entirety of each target mask. At this time, the virtual camera can only capture images within the mask range ( Figure 12 The processor controls the virtual camera to take a screenshot, and you can get Figure 13 The above steps are then repeated until dynamic texture data of 9 sub-images are obtained, and all sub-images are displayed on the screen based on the dynamic texture data.

[0093] This application realizes the real-time generation and rendering of fragment images (sub-images) in a jigsaw puzzle game by directly loading the game image after entering the game and intercepting sub-images in the game image according to the segmentation features carried by the game instructions. This application effectively reduces the workload and storage cost of the jigsaw puzzle game during the development period, improves the development efficiency and quality of the staff, and can realize the diversified presentation of the jigsaw puzzle game without the need for technical personnel to pre-examine the rendering data of all fragment images (sub-images) in the jigsaw puzzle game; this application can also realize the player's independent configuration of the presentation form of the jigsaw puzzle fragments. Players can choose their preferred jigsaw puzzle gameplay combination based on the various sub-image shapes, sub-image numbers and special effects forms preset during the game development. The processor imports the corresponding game configuration data into the program instructions through EXCEL based on the gameplay combination selected by the user to generate multiple sub-images corresponding to the jigsaw puzzle gameplay combination; under the conditions of a single machine or poor network signal, this application can also realize the smooth operation of the jigsaw puzzle game by pre-storing images or obtaining less data. This application effectively improves the player's user experience.

[0094] See Figure 14 , Figure 14 Schematic diagram of the structure of the sub-image generating device 300 in the jigsaw puzzle game provided by an embodiment of the present application. Figure 14 As shown, the present application provides a sub-graph generation device 300 in a jigsaw puzzle game, which includes: a loading module 310 , a determination module 320 and an interception module 330 .

[0095] Among them, the loading module 310 is used to respond to the received game instructions and load the game pictures in the puzzle game; the game instructions carry segmentation features for segmenting the game pictures, and the segmentation features include the number of segmented sub-pictures and the shape of the sub-pictures; the determination module 320 is used to determine the reference position of each sub-picture in the game picture based on the segmentation features; the interception module 330 is used to intercept each sub-picture in the game picture based on the reference position.

[0096] In one embodiment, the determination module 320 is used to: determine whether a mask toolkit needs to be called based on the shape of the sub-image; if a mask toolkit needs to be called, search for a target mask toolkit in all mask toolkits based on the number and shape of the sub-images; the target mask toolkit includes multiple target masks; the shape of the target mask corresponds one-to-one to the shape of the sub-image; and determine the reference position of each sub-image based on the placement of each target mask in the target mask toolkit in the game image.

[0097] In one embodiment, the determination module 320 is further configured to: if the mask toolkit does not need to be called, determine the reference position of each sub-image based on the number of sub-images.

[0098] In one embodiment, the reference position includes a center position. Based on the reference position, the capture module 330 is specifically used to: align the center cross of the virtual camera with the center position for each sub-image; adjust the shooting range of the virtual camera based on the maximum size of the sub-image along at least one preset direction; and capture each sub-image in the game picture through the virtual camera.

[0099] In one embodiment, the reference position includes an outer contour position, and the capture module 330 is specifically used to: for each sub-image, adjust the camera range of the virtual camera based on the maximum size corresponding to the outer contour position; adjust the center cross position of the virtual camera until the camera range completely covers the outer contour of the sub-image; and capture each sub-image in the game picture through the virtual camera.

[0100] In one embodiment, the sub-image generation device in the puzzle game further includes a rendering module, which is used to render the game image or sub-image based on the special effect information carried by the game instructions and generate dynamic texture data.

[0101] In one embodiment, the rendering module is specifically configured to: if the target special effects corresponding to all sub-images are consistent, render the game image or each sub-image based on the target special effects.

[0102] In one embodiment, the rendering module is further configured to render the sub-images separately based on different target special effects if the target special effects corresponding to the sub-images are inconsistent.

[0103] In one embodiment, the loading module 310 is specifically configured to: if the game instruction carries user preference image information, retrieve the game image corresponding to the user preference image information; if the game instruction does not carry user preference image information, randomly load the game image.

[0104] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the sub-image generation method in the above-mentioned jigsaw puzzle game, and will not be repeated here.

[0105] In several embodiments provided in this application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a portion of code, and a module, a program segment, or a portion of code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, may be implemented using a dedicated hardware-based system that performs a specified function or action, or may be implemented using a combination of dedicated hardware and computer instructions.

[0106] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0107] The embodiment of the present application provides a computer-readable storage medium storing a computer program. The computer program can be executed by the processor 12 to implement a sub-image generation method in a jigsaw puzzle game.

[0108] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory 10 (ROM, Read-Only Memory), random access memory 10 (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0109] The above are merely preferred embodiments of the present application and are not intended to limit the present application. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A method for generating a sub-graph in a jigsaw puzzle game, characterized in that: The method comprises: In response to the received game instruction, a game picture in the jigsaw puzzle game is loaded; the game instruction carries a segmentation feature for segmenting the game picture, the segmentation feature including the number of segmented sub-pictures and the shape of the sub-pictures; Determining a reference position of each of the sub-images in the game image based on the segmentation features includes: judging whether a mask toolkit needs to be called based on the shape of the sub-image; if the mask toolkit needs to be called, searching for a target mask toolkit in all the mask toolkits based on the number of the sub-images and the shapes of the sub-images; the target mask toolkit includes a plurality of target masks; the shapes of the target masks correspond one-to-one to the shapes of the sub-images; and determining a reference position of each of the sub-images based on the placement position of each target mask in the target mask toolkit in the game image; Based on the reference position, each sub-image is captured in the game image, including: for each sub-image, aligning the central cross of the virtual camera with the center position; based on the maximum size of the sub-image along at least one preset direction, adjusting the camera range of the virtual camera; and using the virtual camera to capture each sub-image in the game image.

2. The method for generating sub-graphs in a jigsaw puzzle game according to claim 1, wherein: After determining whether a mask toolkit needs to be called based on the shape of the sub-image, the method further includes: If the mask toolkit does not need to be called, the reference position of each sub-image is determined based on the number of the sub-images.

3. The method for generating sub-graphs in a jigsaw puzzle game according to claim 1, wherein: The reference position includes an outer contour position, and intercepting each sub-image in the game image based on the reference position includes: For each of the sub-images, adjusting the shooting range of the virtual camera based on the maximum size corresponding to the outer contour position; Adjusting the center cross position of the virtual camera until the camera range completely covers the outer contour of the sub-image; Each of the sub-images is captured in the game image through the virtual camera.

4. The method for generating sub-graphs in a jigsaw puzzle game according to claim 1, wherein: After loading the game picture in the jigsaw puzzle game, the method further includes: Based on the special effect information carried by the game instruction, the game image or the sub-image is rendered, and dynamic texture data is generated.

5. The method for generating sub-graphs in a jigsaw puzzle game according to claim 4, characterized in that: The rendering of the game image or the sub-image based on the special effect information carried by the game instruction includes: If the target special effects corresponding to all the sub-images are consistent, the game image or each of the sub-images is rendered based on the target special effects.

6. The method for generating sub-graphs in a jigsaw puzzle game according to claim 5, wherein: The rendering of the game image or the sub-image based on the special effect information carried by the game instruction further includes: If the target special effects corresponding to the sub-images are inconsistent, the sub-images are rendered separately based on the different target special effects.

7. The method for generating sub-graphs in a jigsaw puzzle game according to claim 1, wherein: The step of responding to the received game instruction and loading the game picture in the jigsaw puzzle game comprises: If the game instruction carries user preference image information, retrieving the game image corresponding to the user preference image information; If the game instruction does not carry the user preferred image information, the game picture is loaded randomly.

8. A sub-image generation device in a jigsaw puzzle game, characterized in that: The device comprises: a loading module, configured to load a game image in the jigsaw puzzle game in response to a received game instruction; the game instruction carries a segmentation feature for segmenting the game image, the segmentation feature including the number of segmented sub-images and the shape of the sub-images; a determination module configured to determine a reference position of each of the sub-images in the game image based on the segmentation features; wherein the determination module is configured to: determine whether a mask toolkit needs to be called based on the shape of the sub-image; if a mask toolkit needs to be called, search for a target mask toolkit in all mask toolkits based on the number and shape of the sub-images; the target mask toolkit includes multiple target masks; the shapes of the target masks correspond one-to-one to the shapes of the sub-images; and determine a reference position of each sub-image based on the placement of each target mask in the game image in the target mask toolkit; A capture module is used to capture each of the sub-images in the game image based on the reference position; wherein the capture module is specifically used to: align the center cross of the virtual camera with the center position of each sub-image; adjust the camera range of the virtual camera based on the maximum size of the sub-image along at least one preset direction; and capture each sub-image in the game image through the virtual camera.

9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the sub-graph generation method in a jigsaw puzzle game according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program can be executed by a processor to implement the sub-graph generation method in a jigsaw puzzle game according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image generation method and device, storage medium and electronic equipment

    CN115292629A

  • Pixel coordinate calculation method and device, equipment and medium

    CN115760580A