Jigsaw puzzle generation system and method based on Stable Diffusion
By introducing a Stable Diffusion-based puzzle game generation system in puzzle games, the problem of single content and insufficient difficulty of existing puzzle games is solved, dynamic generation of diversified pictures and intelligent difficulty adjustments are achieved, and the game playability and user participation are improved.
Patent Information
- Application Number
- CN202510159066.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-06-03
AI Technical Summary
Existing puzzle games rely on fixed image templates, resulting in high content repetition rate and slow update speed, which cannot meet users' needs for diverse themes and novel experiences. At the same time, it is difficult for technology to achieve irregular tiles and variable gameplay, which is less challenging and interesting.
The puzzle game generation system based on Stable Diffusion is adopted, including image generation module, puzzle cutting module, verification module, dynamic difficulty adjustment module and data storage and statistics module. High-quality puzzle materials are generated through user input text, supporting rules and irregular cutting, real-time detection of the correctness of puzzle pieces, dynamic adjustment of difficulty, and saving user data.
It realizes dynamic generation of diverse pictures, avoids aesthetic fatigue caused by fixed templates, improves the playability and long-term attractiveness of the game, and intelligently adjusts the difficulty according to user performance, ensures that the game is suitable for different players, and improves the user's immersion and continuous participation.
Smart Images

Figure CN120079110A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of jigsaw puzzle entertainment, and specifically relates to a jigsaw game generation system and method based on Stable Diffusion. Background Art
[0002] The jigsaw puzzle game is a classic form of puzzle entertainment, which is widely popular for its simple and intuitive gameplay and puzzle-solving function. Currently, the jigsaw puzzle game usually manually generates the original jigsaw puzzle picture and jigsaw puzzle piece pictures through drawing software, and then the game can be carried out after background configuration.
[0003] However, traditional jigsaw puzzle games mainly rely on fixed image templates, which are designed manually or selected from a fixed material library, resulting in a high content repetition rate and a slow update speed, and unable to meet the needs of users for diverse themes and novel experiences. In today's digital age, users tend to prefer personalized and dynamically generated content, while static jigsaw puzzles are difficult to meet this trend.
[0004] Secondly, the jigsaw puzzle game technology in the market still remains in the basic rule cutting and simple layout stage, such as rectangles or squares, and it is difficult to achieve innovative designs such as irregular puzzle pieces and variable gameplay, with low challenge and interest. This fixed mode reduces the playability of the game and the long-term stickiness of users.
[0005] Finally, the background configuration tool of the jigsaw puzzle game is mainly used for parameter adjustment of static content, such as jigsaw puzzle difficulty, picture material selection, etc., lacking support for dynamically generated content, and unable to flexibly adjust the game rules to adapt to innovative gameplay. Therefore, it needs to be improved and optimized. Summary of the Invention
[0006] The purpose of the present invention is to provide a jigsaw game generation system and method based on Stable Diffusion to solve the problems raised in the above background art.
[0007] To achieve the above purpose, the present invention provides the following technical solution: A jigsaw game generation system and method based on Stable Diffusion, the jigsaw game generation system includes an image generation module, a jigsaw cutting module, a verification module, a dynamic difficulty adjustment module, and a data storage and statistics module;
[0008] The image generation module is implemented based on the Stable Diffusion generation model, and can dynamically generate high-quality puzzle materials according to the text description and preset theme provided by the user; the puzzle cutting module is responsible for cutting the generated image into several puzzle pieces, supporting regular cutting and irregular cutting; the verification module real-time detects the correctness of the player's splicing of puzzle pieces to ensure the correct game logic; the dynamic difficulty adjustment module real-time evaluates and automatically adjusts the game difficulty according to the user's performance in the game; the data storage and statistics module is used to save the user's game progress, the generated image, and the status of the puzzle pieces.
[0009] Preferably, after the user inputs the text, the background takes the user text as a condition and inputs it to the Stable Diffusion model to further generate the corresponding image, and provides a preview function after the image is generated, allowing the user to decide whether to adopt the generated result and regenerate.
[0010] Preferably, the puzzle cutting module includes two modes: regular cutting and irregular cutting. Among them, the regular cutting mode uses a fixed geometric algorithm to evenly divide the image, and the irregular cutting mode uses a random generation algorithm and an edge detection algorithm to generate puzzle pieces with complex shapes.
[0011] Preferably, the verification module continuously monitors the positional relationship between the puzzle piece and the target area in real time when the user drags and places the puzzle piece; after the puzzle piece is correctly matched, it locks the piece through status marking and does not allow subsequent movement, and gives feedback to the user through color flashing and vibration when the matching is incorrect.
[0012] Preferably, the dynamic difficulty adjustment module will collect various data of the user in the game in the background in real time, further calculate the user's performance, and determine the difficulty adjustment plan according to the analysis results.
[0013] Preferably, the data storage and statistics module creates an independent user session record at the start of each game, and establishes an association for the generated image and puzzle piece data.
[0014] Preferably, the data storage and statistics module can automatically save each step of the user's operation, the splicing status and time of the puzzle piece during the game, and when the user exits and the game ends, the system summarizes all the data and stores it in the database.
[0015] Preferably, the specific generation steps are as follows:
[0016] S1. The user first inputs the theme and keyword text of the puzzle in the picture generation module, and then generates the corresponding image through the StableDiffusion model for the user to select;
[0017] S2. After the picture selection is completed, the picture generation module sends the generated picture to the jigsaw cutting module, and the jigsaw cutting module cuts the picture according to the difficulty set in the dynamic difficulty adjustment module;
[0018] S3. First, the dynamic difficulty adjustment module will, based on the data in the data storage and statistics module, query the current level of the user according to the user information. Subsequently, the dynamic difficulty adjustment module returns the difficulty of the user's current level and controls the jigsaw cutting module to cut the picture according to the difficulty;
[0019] S4. The jigsaw cutting module sends the cut picture to the picture generation module, and then the picture generation module displays the original jigsaw picture and the cut jigsaw picture to the user, enabling the user to play the jigsaw game;
[0020] S5. After completing the jigsaw puzzle, the system sends the result picture of the jigsaw puzzle to the verification module and compares whether the result picture is consistent with the original jigsaw picture;
[0021] S6. Finally, the verification module sends the result of the jigsaw puzzle to the data storage and statistics module, and the user data is stored through the data storage and statistics module.
[0022] Preferably, there are three levels of difficulty set in the dynamic difficulty adjustment module in S2, namely easy, medium, and hard. Among them, the corresponding number of cuts for easy is four pieces, the corresponding number of cuts for medium is sixteen pieces, and the corresponding number of cuts for hard is forty-eight pieces.
[0023] The beneficial effects of the present invention are as follows:
[0024] 1. By introducing the Stable Diffusion technology, the present invention solves the problem of single jigsaw game materials, realizes the dynamic generation of diverse pictures, avoids the aesthetic fatigue caused by fixed templates, and players can generate unique jigsaw content by inputting keywords or setting personalized preferences, making the game experience more rich and personalized, and enhancing the playability and long-term attractiveness of the game.
[0025] 2. The present invention collects user data through the data storage and statistics module, and based on these data, the dynamic difficulty adjustment module controls the jigsaw cutting module to cut the picture into different numbers corresponding to different difficulties, realizing the intelligent dynamic adjustment of difficulty. The game can match the appropriate jigsaw difficulty according to the player's ability, ensuring that novices can easily get started, while also providing sufficient challenges for advanced players, thereby enhancing the user's immersion and continuous participation.
[0026] 3. The present invention uses Stable Diffusion model technology to automatically generate personalized pictures required by users. Without pre-storing a large number of material libraries, it can generate high-quality jigsaw pictures in real time, saving storage space and optimizing the content update process. At the same time, it promotes technological innovation in the jigsaw game field and enhances market competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flowchart of the operation of the jigsaw game generation system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0029] As Figure 1 shown, the embodiment of the present invention provides a jigsaw game generation system and method based on Stable Diffusion. The jigsaw game generation system includes an image generation module, a jigsaw cutting module, a verification module, a dynamic difficulty adjustment module, and a data storage and statistics module;
[0030] The image generation module is implemented based on the Stable Diffusion generation model, and can dynamically generate high-quality jigsaw materials according to the text description provided by the user and the preset theme; the jigsaw cutting module is responsible for cutting the generated image into several jigsaw pieces, supporting regular cutting (such as equal-proportion rectangles, squares) and irregular cutting; the verification module detects the correctness of the player's splicing of the jigsaw pieces in real time to ensure the correct game logic; the dynamic difficulty adjustment module evaluates and automatically adjusts the game difficulty in real time according to the user's performance in the game (such as completion speed, number of errors, etc.); the data storage and statistics module is used to save the user's game progress, the generated images, and the status of the jigsaw pieces.
[0031] Among them, after the user inputs the text, the background takes the user text as a condition and inputs it to the Stable Diffusion model to further generate the corresponding image, and provides a preview function after the image is generated, allowing the user to decide whether to adopt the generated result and regenerate.
[0032] The user inputs a text description (such as "sunset beach", "future city") in the interface or selects from the preset themes. After the selection or input is completed, the system calls the Stable Diffusion model through the API to convert the text into an image for the user to select.
[0033] By introducing the Stable Diffusion technology, the problem of single puzzle game materials is solved, realizing the dynamic generation of diverse pictures, avoiding the aesthetic fatigue caused by fixed templates, and allowing players to generate unique puzzle content by inputting keywords or setting personalized preferences, making the game experience more rich and personalized, and enhancing the playability and long-term attractiveness of the game.
[0034] Among them, the puzzle cutting module includes two modes: regular cutting and irregular cutting. In the regular cutting mode, a fixed geometric algorithm is used to evenly divide the image, and in the irregular cutting mode, a random generation algorithm and an edge detection algorithm are used to generate puzzle pieces with complex shapes.
[0035] Users can choose between the two cutting modes. After cutting is completed and all puzzles are generated, the system randomly shuffles the order and displays them for players to start the puzzle game.
[0036] Among them, the verification module continuously monitors the positional relationship between the puzzle piece and the target area in real time when the user drags and places the puzzle piece; after the puzzle piece is correctly matched, it locks the piece through status marking and does not allow subsequent movement, and gives feedback to the user through color flashing and vibration when there is a wrong match.
[0037] When the user is doing the puzzle, the verification module verifies whether the current puzzle piece is placed in the correct area through collision detection and boundary judgment, further ensuring the correctness of the user's game logic.
[0038] Among them, the dynamic difficulty adjustment module will collect various data of the user in the game in real time in the background, further calculate the user's performance, and decide the difficulty adjustment plan according to the analysis results.
[0039] When the performance is excellent, increase the number of puzzle pieces or reduce the size of the pieces; when the performance is poor, reduce the difficulty accordingly or provide auxiliary hints, and after the difficulty is adjusted, update the game parameters in real time to ensure the continuity of the game experience.
[0040] The data storage and statistics module collects user data, and based on these data, the dynamic difficulty adjustment module controls the puzzle cutting module to cut the picture into corresponding numbers of different difficulties, realizing the intelligent dynamic adjustment of difficulty. The game can match appropriate puzzle difficulties according to the player's ability, ensuring that novices can easily get started, while also providing sufficient challenges for advanced players, thereby enhancing the user's immersion and continuous participation.
[0041] Among them, the data storage and statistics module creates an independent user session record at the start of each game and establishes an association for the generated image and puzzle piece data.
[0042] Prevent data from being accidentally lost through real-time backup of data during the game, and provide feedback for dynamic difficulty adjustment and product optimization based on the stored data.
[0043] Among them, the data storage and statistics module can automatically save each step of the user's operation, the splicing state of the puzzle pieces, and the time during the game process. When the user exits or the game ends, the system will summarize all the data and store it in the database.
[0044] By summarizing the data, it is convenient for the background to regularly perform statistics and analysis on the data, such as calculating the average completion time, error rate, etc., and feedback the results to the dynamic difficulty adjustment module and the product R & D team to promote the continuous optimization of the game experience.
[0045] Automatically generate the pictures required by users and personalized pictures through the Stable Diffusion model technology. Without pre-storing a large number of material libraries, high-quality puzzle pictures can be generated in real time, saving storage space and optimizing the content update process. At the same time, it promotes technological innovation in the puzzle game field and enhances market competitiveness.
[0046] Among them, the specific generation steps are as follows:
[0047] S1. First, the user inputs the theme and keyword text of the puzzle in the picture generation module, and then generates the corresponding image through the StableDiffusion model for the user to select;
[0048] S2. After the picture is selected, the picture generation module sends the generated picture to the puzzle cutting module, and the puzzle cutting module will cut it according to the difficulty set in the dynamic difficulty adjustment module;
[0049] S3. First, the dynamic difficulty adjustment module will query the current level of the user based on the user information according to the data in the data storage and statistics module. Subsequently, the dynamic difficulty adjustment module returns the difficulty of the user's current level and controls the puzzle cutting module to cut the picture according to the difficulty;
[0050] S4. The puzzle cutting module sends the cut picture to the picture generation module, and then the picture generation module displays the original puzzle picture and the cut puzzle picture to the user so that the user can play the puzzle game;
[0051] S5. After completing the puzzle, the system sends the result picture of the puzzle to the verification module and compares whether the result picture is consistent with the original puzzle picture;
[0052] S6. Finally, the verification module sends the result of the puzzle to the data storage and statistics module, and stores the user data through the data storage and statistics module.
[0053] Among them, there are three levels of difficulty set in the dynamic difficulty adjustment module in S2, namely easy, medium, and difficult. The number of cuts corresponding to easy is four, the number of cuts corresponding to medium is sixteen, and the number of cuts corresponding to difficult is forty-eight.
[0054] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device.
[0055] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A jigsaw puzzle generation system based on Stable Diffusion, characterized by: The jigsaw puzzle game generation system includes an image generation module, a jigsaw puzzle cutting module, a verification module, a dynamic difficulty adjustment module, and a data storage and statistics module; The image generation module is implemented based on the Stable Diffusion generation model, and dynamically generates high-quality puzzle materials according to the text description and preset themes provided by the user; the puzzle cutting module is responsible for cutting the generated image into several puzzle pieces, supporting regular cutting and irregular cutting; the verification module detects the correctness of the player's splicing of puzzle pieces in real time to ensure the correctness of the game logic; the dynamic difficulty adjustment module evaluates and automatically adjusts the game difficulty in real time according to the user's performance in the game; the data storage and statistics module is used to save the user's game progress, the generated images and the status of the puzzle pieces.
2. A jigsaw puzzle generation system based on Stable Diffusion according to claim 1, characterized in that: After the user inputs text, the image generation module uses the user text as a condition to input into the StableDiffusion model in the background, further generates a corresponding image, and provides a preview function after the image is generated, allowing the user to decide whether to adopt the generated result and regenerate it.
3. A jigsaw puzzle generation system based on Stable Diffusion according to claim 1, characterized in that: The jigsaw cutting module includes two modes: regular cutting and irregular cutting. The regular cutting mode uses a fixed geometric algorithm to evenly divide the image, and the irregular cutting mode uses a random generation algorithm and an edge detection algorithm to generate jigsaw pieces of complex shapes.
4. The jigsaw puzzle generation system based on Stable Diffusion according to claim 1, characterized in that: The verification module continuously monitors the positional relationship between the puzzle piece and the target area in real time when the user drags and places the puzzle piece; after the puzzle piece is correctly matched, the block is locked through a status mark, and subsequent movement is not allowed. In the case of an incorrect match, the user is fed back through color flashing and vibration.
5. The jigsaw puzzle generation system based on Stable Diffusion according to claim 1, characterized in that: The dynamic difficulty adjustment module will collect various data of users in the game in real time in the background, further calculate the user performance, and determine the difficulty adjustment plan based on the analysis results.
6. The jigsaw puzzle generation system based on Stable Diffusion according to claim 1, characterized in that: The data storage and statistics module creates an independent user session record each time a game starts, and associates the generated image and puzzle piece data.
7. A jigsaw puzzle generation system based on Stable Diffusion according to claim 6, characterized in that: The data storage and statistics module can automatically save each operation of the user, the splicing status and time of the puzzle pieces during the game, and when the user exits and the game ends, the system summarizes and stores all the data in the database.
8. A jigsaw puzzle generation method based on Stable Diffusion, characterized in that: The specific generation steps are: S1, the user first inputs the theme and keyword text of the puzzle in the image generation module, and then the StableDiffusion model generates the corresponding image for the user to select; S2, after the picture selection is completed, the picture generation module sends the generated picture to the jigsaw cutting module, and the jigsaw cutting module cuts the picture according to the difficulty set in the dynamic difficulty adjustment module; S3, first, the dynamic difficulty adjustment module will query the user's current level based on the data in the data storage and statistics module according to the user information, and then the dynamic difficulty adjustment module will return the difficulty of the user's current level and control the jigsaw cutting module to cut the picture according to the difficulty; S4, the jigsaw cutting module sends the cut picture to the picture generating module, and then the picture generating module displays the original jigsaw picture and the cut jigsaw picture to the user, so that the user can play the jigsaw game; S5, after completing the puzzle, the system sends the puzzle result image to the verification module and compares the result image with the original puzzle image to see if they are consistent; S6, finally the verification module sends the puzzle result to the data storage and statistics module, and the user data is stored in the data storage and statistics module.
9. The method for generating a jigsaw puzzle based on Stable Diffusion according to claim 8, characterized in that: The difficulty set in the dynamic difficulty adjustment module in S2 has three types: simple, medium and difficult. The number of cuts corresponding to simple is four, the number of cuts corresponding to medium is sixteen, and the number of cuts corresponding to difficult is forty-eight.