A game prototype interface image generation method and system

By receiving a requirements document described in natural language and utilizing the game engine interface document and prompt word templates, the initial development code for the game prototype interface image is automatically generated, solving the problems of high learning cost and low efficiency in existing technologies, and realizing efficient generation of game prototype interface images.

CN119917096BActive Publication Date: 2026-02-27DUOYI NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411991904.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2026-02-27
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Existing prototyping tools have high learning costs and low efficiency, and cannot directly understand requirement documents described in natural language, resulting in low efficiency in generating game prototype interface images.

Method used

The system receives a requirements document described in natural language, uses the game engine interface document and prompt word templates to automatically generate preliminary development code, and uses natural language processing technology to automatically parse and understand the requirements document to generate game prototype interface images.

Benefits of technology

It reduces the learning and time costs of creating prototype interfaces, improves the accuracy of requirement understanding and integration convenience, and enhances overall development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917096B_ABST
    Figure CN119917096B_ABST
Patent Text Reader

Abstract

The application provides a game prototype interface image generation method and system, comprising: receiving a requirement document, wherein the requirement document comprises a plurality of requirement texts in natural language for describing the development of a game prototype interface image; screening and integrating a game engine interface document pre-stored for recording a plurality of interface texts according to the requirement document to obtain a requirement interface document; obtaining a prompt word template pre-constructed, extracting corresponding interface texts from the requirement interface document according to the requirement texts; identifying the specific prompt word in the prompt word template, replacing the requirement texts and the interface texts with the replacement mark to generate a prompt word; generating a preliminary development code based on a preset code generation model according to the prompt word; and rendering a game prototype interface image according to the preliminary development code. The application effectively improves the development efficiency of the game prototype interface image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a game prototype interface image generation method and system. BACKGROUND

[0002] In the existing prototype interface production method, various prototype tools are mainly relied on. Although these prototype tools are powerful, users need to spend a lot of time to learn and master their operation methods and functional characteristics, which not only increases the learning burden of users, but also may lead to reduced efficiency in producing prototype interfaces due to unfamiliarity with the tools.

[0003] Moreover, traditional prototype tools usually only provide basic interface design functions and cannot directly understand the requirement documents described in natural language, which leads to the need for users to manually convert the descriptions in the requirement documents into operations in the prototype tools, resulting in low efficiency in generating game prototype interface images. SUMMARY

[0004] The present application provides a game prototype interface image generation method that can improve the development efficiency of game prototype interface images.

[0005] A game prototype interface image generation method, comprising the following steps:

[0006] receiving a requirement document, wherein the requirement document includes a plurality of requirement texts described in natural language for developing game prototype interface images;

[0007] According to the requirement document, a game engine interface document pre-stored for recording a plurality of interface texts is screened and integrated to obtain a requirement interface document;

[0008] obtaining a prompt word template pre-constructed, the prompt word template including a specific prompt word for indicating a text replacement operation and a replacement marker for replacing the requirement text and the interface text;

[0009] According to the requirement text, the corresponding interface text is extracted from the requirement interface document;

[0010] After identifying the specific prompt word in the prompt word template, the requirement text and the interface text are replaced with the replacement marker to generate a prompt word;

[0011] According to the prompt word, a preliminary development code is generated based on a pre-set code generation model;

[0012] According to the preliminary development code, a game prototype interface image is rendered.

[0013] The present application also provides a game prototype interface image generation method system, comprising:

[0014] a requirement document receiving module configured to receive a requirement document, wherein the requirement document comprises a plurality of requirement texts in natural language describing a development game prototype interface image;

[0015] a requirement interface document obtaining module configured to filter and integrate a game engine interface document pre-stored for recording a plurality of interface texts to obtain a requirement interface document according to the requirement document;

[0016] a prompt word module replacement module configured to obtain a pre-constructed prompt word template, wherein the prompt word template comprises a specific prompt word for indicating a text replacement operation and a replacement mark for being replaced by the requirement text and the interface text;

[0017] an interface text obtaining module configured to extract corresponding interface texts from the requirement interface document according to the requirement texts;

[0018] a prompt word obtaining module configured to replace the requirement texts and the interface texts with the replacement mark after recognizing the specific prompt word in the prompt word template to generate a prompt word;

[0019] a preliminary development code obtaining module configured to generate a preliminary development code based on a pre-set code generation model according to the prompt word;

[0020] a game prototype interface image obtaining module configured to render a game prototype interface image according to the preliminary development code.

[0021] Compared with the prior art, the scheme receives a requirement document described in natural language, and automatically generates a preliminary development code by using a game engine interface document and a prompt word template. Then, a game prototype interface image is rendered according to the code, which reduces the learning cost and time cost of prototype interface production. By using a natural language processing technology, automatic analysis and understanding of the requirement document are realized, human intervention and understanding deviation are reduced, the game engine interface document and the prompt word template are integrated, automatic generation from requirement to code is realized, the accuracy of requirement understanding and the convenience of integration are improved, and thus the overall development efficiency is improved.

[0022] In order to more clearly understand the present application, the specific embodiments of the present application will be described in the following with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 a flowchart of a game prototype interface image generation method of the present application;

[0024] Figure 2 a method flowchart for adjusting requirement texts in the game prototype interface image generation method of the present application;

[0025] Figure 3 A method flowchart for calculating relative positions in a game prototype interface image generation method of the present application;

[0026] Figure 4 A method flowchart for calculating proportions in a game prototype interface image generation method of the present application;

[0027] Figure 5 A method flowchart for obtaining executable code in a game prototype interface image generation method of the present application;

[0028] Figure 6 A method flowchart for obtaining fault-tolerant executable code in a game prototype interface image generation method of the present application;

[0029] Figure 7 A schematic diagram of a game prototype interface image generation system of the present application. DETAILED DESCRIPTION

[0030] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0031] It should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present application show the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can not be implemented in sequence, and the steps without logical context relationship can be reversed in sequence or implemented simultaneously. In addition, one or more other operations can be added to the flowcharts or one or more operations can be removed from the flowcharts by those skilled in the art under the guidance of the content of the present application.

[0032] Reference to "an embodiment" in this text means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily independent or alternative embodiments to other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0033] Embodiment 1

[0034] Please refer to Figure 1 , Figure 1A game prototype interface image generation method flowchart is provided in the application. The application provides a game prototype interface image generation method, which specifically comprises the following steps:

[0035] S1: receiving a requirement document, wherein the requirement document comprises a plurality of requirement texts in natural language for describing development of a game prototype interface image;

[0036] S2: screening and integrating a game engine interface document for recording a plurality of interface texts according to the requirement document, to obtain a requirement interface document;

[0037] S3: obtaining a prompt word template, wherein the prompt word template comprises a specific prompt word for indicating a text replacement operation and a replacement mark for replacing the requirement text and the interface text;

[0038] S4: extracting a corresponding interface text from the requirement interface document according to the requirement text;

[0039] S5: identifying the specific prompt word in the prompt word template, and replacing the requirement text and the interface text with the replacement mark to generate a prompt word;

[0040] S6: generating a preliminary development code according to the prompt word based on a preset code generation model;

[0041] S7: rendering a game prototype interface image according to the preliminary development code.

[0042] Compared with the prior art, the scheme receives a requirement document described in natural language, and automatically generates a preliminary development code by using a game engine interface document and a prompt word template, thereby reducing learning cost and time cost of prototype interface production, and enabling a developer to quickly produce a game prototype interface image meeting requirements without deeply understanding a complex prototype tool or a game engine. By using a natural language processing technology, automatic analysis and understanding of the requirement document are realized, human intervention and understanding deviation are reduced, the game engine interface document and the prompt word template are integrated, automatic generation from requirements to code is realized, accuracy of requirement understanding and convenience of integration are improved, and thus overall development efficiency is improved.

[0043] The game prototype interface image generation method of the application can be executed by a computer system comprising a development database server, a data import server, a data collection server and a game prototype interface image generation server.

[0044] The development database server is configured to store a requirement document, a game engine interface document, a prompt word template, a requirement interface document, and a preliminary development code document, and build a development database. The data import server receives the requirement document into the development database. The data import server can import the game engine interface document into the development database from a game engine official website, and import a preset prompt word template into the development database.

[0045] The data collection server is configured to obtain the requirement document, the prompt word template, and the game engine interface document from the development database, and send them to the game prototype interface image generation server.

[0046] The game prototype interface image generation server executes the game prototype interface image generation method of the present application, filters and integrates the game engine interface document for recording a plurality of interface texts according to a requirement text in the requirement document, to obtain a requirement interface document; extracts a corresponding interface text from the requirement interface document according to the requirement text, for example, the requirement text specifically requires a button control, and an event needs to be triggered after the user clicks the button; at this time, the interface text related to the button control is found in the requirement interface document, and the interface method matching the function described in the requirement text is identified. After identifying the specific prompt word in the prompt word template, the requirement text and the interface text are replaced with the replacement mark to generate a prompt word; according to the prompt word, a preliminary development code is generated based on a preset code generation model and stored in the development database. According to the preliminary development code, a game prototype interface image is obtained by rendering through a game development tool and an engine.

[0047] In the present embodiment, for step S1, in response to a receiving instruction of the data collection server, the data import server receives a requirement document of a user, for example, a natural language text input by the user through human-computer dialogue, to generate the requirement document. Of course, the data import server can also receive the requirement document through an application programming interface (API).

[0048] The requirement document includes a plurality of requirement texts described in natural language for developing a game prototype interface image. The requirement text includes a description of a prototype control layout, an implementation function, and an interaction mode of the game prototype interface image, wherein each prototype control is correspondingly provided with a prototype control identifier.

[0049] For example, for the prototype control layout description, a top navigation bar, a game information display area, and a bottom control bar are provided, the top navigation bar is located at the top of the interface, contains five buttons of "start game", "continue game", "settings", "store" and "exit", maintains uniform spacing between the buttons, adopts a rounded rectangular design for the buttons, the background color is dark blue, the text color is white, and the background color changes to light blue when hovering; the game information display area is located below the navigation bar, contains text, and adopts clear font and color to distinguish different information; the bottom control bar is provided at the bottom of the interface, contains a virtual joystick (for movement), an attack button, a jump button, and a special skill button.

[0050] For the implementation function description, click the "start game" button to load and display the game main interface, initialize the game data; click the "continue game" button to load the game progress saved by the player last time; click the "settings" button to allow the player to adjust the game sound effect, picture quality and other options; click the "store" button to display the purchasable props, equipment and skills, and the player can use gold coins to make purchases; click the "exit" button to save the current game progress and exit the game.

[0051] For the interaction mode description, click the interaction: the player can interact by clicking the buttons on the interface, such as selecting a character, purchasing props, etc. Virtual joystick control: the player can control the movement direction of the game character through the virtual joystick to achieve precise operation. Button combination operation: support players to realize special skills or attacks by combining pressing different attack buttons, jump buttons and special skill buttons.

[0052] Of course, in other embodiments, according to the actual development needs, the requirement text also includes annotation content, etc.

[0053] For step S2, in response to the screening and integration instruction of the data collection server, the data collection server obtains the requirement document and game engine interface document from the development database and sends it to the game prototype interface image generation server.

[0054] The game prototype interface image generation server matches the requirement text in the requirement document with the controls, implementation functions and interaction modes mentioned in the requirement text, excludes interface texts irrelevant to the current game prototype interface image design, thereby completing the screening of each game engine interface document. And integrate each game engine interface document after screening to obtain the requirement interface document and store it in the development database. The interface text refers to the API interface text in the game engine interface document.

[0055] For steps S3-S5, in response to the replacement instruction of the data collection server, the data collection server obtains the requirement document, requirement interface document and the prompt word template from the development database and sends them to the game prototype interface image generation server.

[0056] The prompt word template is a pre-defined text structure containing specific placeholders or markers that will be replaced by actual content in subsequent steps to guide the generation of prompt words with explicit indication meaning based on the requirement document and requirement interface document. The prompt word template includes specific prompt words for indicating text replacement operations and replacement markers for replacing the requirement text and interface text.

[0057] The game prototype interface image generation server searches for interfaces in the requirement interface document that match the functionality described in the requirement text in the requirement document, extracts the corresponding interface text, which can include complete definitions, parameter descriptions and usage examples of the interface, etc. After identifying the specific prompt words in the prompt word template, the requirement text and interface text are replaced with the replacement markers to generate prompt words and store them in the development database. The prompt word is the final text generated based on the prompt word template, which combines the requirement text in the requirement document and the interface text in the interface document, and is formed by replacing the placeholders or markers in the template, to provide clear instructions to developers or code generation models to implement specific functions or interfaces according to requirements.

[0058] In one embodiment, the replacement markers include requirement text replacement markers and interface text replacement markers. After identifying the specific prompt words in the prompt word template, the requirement text and interface text are replaced with the requirement text replacement markers and interface text replacement markers, respectively. For example, the specific prompt word is "according to the content of the requirement text, filter out the interface text required to implement the requirement content from the requirement interface document, the following is the interface text content and requirement content", the interface text replacement marker is "<api_tag>", and the requirement text replacement marker is "<requirement_tag>". <input>

[0059] Of course, in other embodiments, the prompt word template also includes an annotation text replacement marker, which is replaced by the annotation content in the requirement document after identifying the annotation text replacement marker. According to actual development requirements, the content of the specific prompt words, requirement text replacement markers and interface text replacement markers can also be adaptively modified.

[0060] ​For steps S6 and S7, the preset code generation model is a large language model, and the GPT model is preferentially selected. The data collection server obtains the prompt words from the development database and sends them to the game prototype interface image generation server. The game prototype interface image generation server inputs the prompt words into the code generation model to obtain the preliminary development code and stores it in the development database. According to the preliminary development code, the game prototype interface image is rendered by using a game development tool and an engine.

[0061] For step S7, after the game prototype interface image is rendered according to the preliminary development code, the following step S8 is included: adjusting the demand text based on a demand-driven game prototype interface image iterative optimization mechanism according to the game prototype interface image to obtain the final development code.

[0062] For step S8, in the embodiment, the demand-driven game prototype interface image iterative optimization mechanism specifically includes that a developer evaluates the game prototype interface image to obtain an evaluation result. The evaluation result includes whether the control layout, color, and font in the game prototype interface image meet the needs of the developer. According to the evaluation result, the demand text is adjusted, and steps S1-S7 are repeatedly executed according to the adjusted demand text. The user evaluates the generated game prototype interface image again, and continues to adjust the demand text according to the evaluation result until the game prototype interface image meets the needs of the developer. At this time, the preliminary development code is the final development code.

[0063] For example, the position of a specific button control in the game prototype interface image is above, and the developer's demand is that the position of the button control is below. At this time, the developer can modify the demand text as “the position of the button control is lowered”, and then evaluate the game prototype interface image generated according to the modified demand text again. If it is found that the button control is located at the lower position, the game prototype interface image meets the needs of the developer, and the process of adjusting the demand text is stopped, and the preliminary development code at this time is determined as the final development code. Otherwise, the demand text is continuously modified to adjust the position of the button control.

[0064] In other embodiments, for step S8, please refer to Figure 2 , Figure 2 A method flowchart for adjusting the demand text in the game prototype interface image generation method of the application. According to the game prototype interface image, the demand text is adjusted based on a demand-driven game prototype interface image iterative optimization mechanism to obtain the final development code, and the following steps are further included:

[0065] S81: Obtain a pre-stored game prototype reference interface image, wherein each reference control identifier in the game prototype reference interface image has any one of the prototype control identifiers matched therewith;

[0066] S82: Based on a pre-set control recognition model, perform image recognition on the game prototype reference interface image and the game prototype interface image to obtain a reference control prediction box, a reference control type probability, a reference control identifier, and a game prototype reference interface edge box in the game prototype reference interface image, and a prototype control prediction box, a prototype control type probability, a prototype control identifier, and a game prototype interface edge box in the game prototype interface image;

[0067] S83: According to the pixel point coordinates of the reference control prediction box, the game prototype reference interface edge box, the prototype control prediction box, and the game prototype interface edge box, respectively calculate the relative positions of each reference control relative to the game prototype reference interface and the relative positions of each prototype control relative to the game prototype interface;

[0068] S84: According to the pixel point coordinates of the reference control prediction box, the game prototype reference interface edge box, the prototype control prediction box, and the game prototype interface edge box, respectively calculate the proportions of each reference control relative to the game prototype reference interface and the proportions of each prototype control relative to the game prototype interface;

[0069] S85: According to the relative positions and proportions of the reference controls relative to the game prototype reference interface and the relative positions and proportions of the prototype controls relative to the game prototype interface, select reference controls and prototype controls with the same reference control identifier and prototype control identifier, and calculate the relative position error of the prototype control relative to the reference control and the proportion error of the prototype control relative to the reference control;

[0070] S86: Respectively select the control type with the highest reference control type probability as the reference control type and the control type with the highest prototype control type probability as the prototype control type;

[0071] S87: If the relative position error is greater than a pre-set relative position error threshold, and / or the proportion error is greater than a pre-set proportion error threshold, and / or the reference control type and the prototype control type are not the same, based on a pre-set control adjustment model, repeatedly adjust the requirement document until the relative position error is less than the pre-set relative position error threshold, and / or the proportion error is less than the pre-set proportion error threshold, and / or the reference control type and the prototype control type are the same.

[0072] For step S81, during the development of the game, the UI design team first designs the game prototype reference interface image according to the requirement document, which shows the layout of each reference control such as the top navigation bar, game information display area, and bottom control bar, etc., wherein each reference control is correspondingly provided with a specific reference control identifier.

[0073] The requirement text in the requirement document should be consistent with the setting standard of each reference control identifier in the game prototype reference interface image, specifically, each reference control identifier in the game prototype reference interface image has any one of the prototype control identifiers matched therewith. The game prototype reference interface image can be stored in the development database, and of course can be used as an input parameter for comparison with the game prototype interface image.

[0074] For step S82, in this embodiment, a deep learning method such as a convolutional neural network (CNN) is preferentially used as the control recognition model, and the control recognition model is trained based on a large amount of labeled data. The labeled data can be obtained by frame labeling the controls in the game prototype interface image and the whole game prototype interface image to mark the position coordinates, type label and identifier label of the controls, and the position coordinates of the game prototype interface image, so that the game prototype interface image can learn and extract features, and then realize accurate recognition and positioning of the control position, control identifier and type, and accurate recognition and positioning of the position of the game prototype interface image.

[0075] It is worth noting that the control recognition model is not only applicable to the game prototype interface image used for training, but also can be extended to other related images such as the game prototype reference interface image.

[0076] When the control recognition model performs image recognition on the game prototype reference interface image and the game prototype interface image, for each prototype control and reference control recognized, the control recognition model generates a corresponding prediction box, control identifier and control type probability, and according to the pixel point coordinates of the corresponding prediction box, the center coordinates and size of the corresponding prototype control and / or reference control can be further extracted. And for the corresponding prediction box, the control type with the highest control type probability is selected as the control type of the prediction box, and the control type includes buttons, text boxes, drop-down lists, icons, etc.

[0077] Meanwhile, the control recognition model also generates a benchmark bounding box of the game prototype benchmark interface image as a whole and a prototype bounding box of the game prototype interface image as a whole, and further extracts the center coordinates and size of the game prototype benchmark interface image and the game prototype interface image according to the pixel point coordinates of the benchmark bounding box and the prototype bounding box.

[0078] The prototype control refers to a control arranged in the game prototype benchmark interface, and the benchmark control refers to a control arranged in the game prototype benchmark interface.

[0079] For step S83, please refer to Figure 3 , Figure 3 A method flowchart for calculating relative positions in the game prototype interface image generation method of the application. The relative positions of the benchmark control relative to the game prototype benchmark interface and the relative positions of the prototype control relative to the game prototype interface are calculated according to the pixel point coordinates of the benchmark control prediction box, the game prototype benchmark interface edge box, the prototype control prediction box and the game prototype interface edge box, respectively, including:

[0080] S831: The center coordinates of the benchmark control, the center coordinates of the game prototype benchmark interface, the center coordinates of the prototype control and the center coordinates of the game prototype benchmark interface are calculated according to the pixel point coordinates of the benchmark control prediction box, the game prototype benchmark interface edge box, the prototype control prediction box and the game prototype interface edge box.

[0081] S832: The relative positions of the benchmark control relative to the game prototype benchmark interface and the relative positions of the prototype control relative to the game prototype interface are calculated according to the center coordinates of the benchmark control and the center coordinates of the game prototype benchmark interface, and the center coordinates of the prototype control and the center coordinates of the game prototype benchmark interface.

[0082] For step S831, in the embodiment, when the benchmark control prediction box, the game prototype benchmark interface edge box, the prototype control prediction box and the game prototype interface edge box are all rectangular boxes, the left upper corner coordinates and the right lower corner coordinates of the rectangular box can be obtained, and the horizontal coordinate average and the vertical coordinate average of the left upper corner coordinates and the right lower corner coordinates are calculated respectively to obtain the center coordinates. When the benchmark control prediction box and the prototype control prediction box are circular or elliptical, the center of the circle is the center coordinates of the benchmark control prediction box and the prototype control prediction box.

[0083] Of course, the center coordinates can also be obtained by calculating the center of mass of the reference control prediction frame, the game prototype reference interface edge frame, the prototype control prediction frame and the game prototype interface edge frame according to the pixel point coordinates of the reference control prediction frame, the game prototype reference interface edge frame, the prototype control prediction frame and the game prototype interface edge frame.

[0084] For step S832, the relative position of the reference control relative to the game prototype reference interface and the relative position of the prototype control relative to the game prototype interface can be represented by vectors or coordinate differences. The relative position of the reference control relative to the game prototype reference interface is obtained by calculating the horizontal coordinate difference and the vertical coordinate difference between the center coordinates of the reference control and the game prototype reference interface. The relative position of the prototype control relative to the game prototype interface is obtained by calculating the horizontal coordinate difference and the vertical coordinate difference between the center coordinates of the prototype control and the game prototype interface.

[0085] For step S84, please also refer to Figure 4 , Figure 4 A method flowchart for calculating the proportion in the game prototype interface image generation method of the application. According to the pixel point coordinates of the reference control prediction frame, the game prototype reference interface edge frame, the prototype control prediction frame and the game prototype interface edge frame, the proportion of the reference control relative to the game prototype reference interface and the proportion of the prototype control relative to the game prototype interface are calculated respectively, which comprises:

[0086] S841: According to the pixel point coordinates of the reference control prediction frame, the game prototype reference interface edge frame, the prototype control prediction frame and the game prototype interface edge frame, the area of the reference control, the area of the game prototype reference interface, the area of the prototype control and the area of the game prototype reference interface are calculated respectively.

[0087] S842: The ratio of the area of the reference control to the area of the game prototype reference interface and the ratio of the area of the prototype control to the area of the game prototype reference interface are calculated respectively to obtain the proportion of the reference control relative to the game prototype reference interface and the proportion of the prototype control relative to the game prototype interface.

[0088] For step S841, in the embodiment, when the reference control prediction frame, the game prototype reference interface edge frame, the prototype control prediction frame and the game prototype interface edge frame are rectangles, the area of the rectangle can be obtained by calculating the horizontal coordinate difference value and the vertical coordinate difference value of the upper left corner coordinates and the lower right corner coordinates of the rectangle, and multiplying the horizontal coordinate difference value and the vertical coordinate difference value.

[0089] When the reference control prediction frame, the game prototype reference interface edge frame, the prototype control prediction frame and the game prototype interface edge frame are irregular shapes, the boundary pixel points of the irregular shapes can be determined by using a polygon approximation technique, the irregular shapes are approximated to polygons by using a polygon approximation algorithm (such as a convex hull algorithm, a minimum circumscribed polygon algorithm or the like), and the areas of the polygons are calculated. The polygon area calculation can use various methods, such as a vector cross product method, a triangle segmentation method or the like.

[0090] For step S85, in the present embodiment, a difference between the horizontal coordinate of the prototype control relative position and the horizontal coordinate of the reference control relative position is calculated to obtain a horizontal coordinate error; a difference between the vertical coordinate of the prototype control relative position and the vertical coordinate of the reference control relative position is calculated to obtain a vertical coordinate error. According to actual requirements, the horizontal coordinate error and the vertical coordinate error can also be combined by calculating the square root of the sum of the squares of the vertical coordinate error and the horizontal coordinate error (i.e., the Euclidean distance) to form a comprehensive relative position error, and the relative position error is obtained.

[0091] The proportion error is obtained by calculating an absolute difference or a relative difference between the proportion of the reference control relative to the game prototype reference interface and the proportion of the prototype control relative to the game prototype interface.

[0092] For step S87, in the present embodiment, the relative position error threshold value can be set as a proportional value related to the size of the game prototype reference interface or the game prototype interface. For example, when the width and height of the game prototype reference interface or the game prototype interface are both 1000 pixels, the relative position error threshold value can be set as 5% of the size of the game prototype reference interface or the game prototype interface, i.e., 50 pixels.

[0093] The proportion error threshold value is a proportional value of the difference between the actual proportion of the control and the expected proportion. For example, if the proportion of the reference control or the prototype control is between 0.1 and 0.5, the reasonable proportion error threshold value should be set to within 10% of the proportion. For example, for a reference control or a prototype control with a proportion of 0.2, the proportion error threshold value should be strictly limited to within 0.02 (i.e., 10% of 0.2). According to actual development requirements, the proportion error threshold value can be adaptively reduced as the proportion increases.

[0094] When any prototype control and reference control corresponding to the same identification of the prototype control and the reference control simultaneously satisfy the relative position error being less than the preset relative position error threshold value, the proportion error being less than the preset proportion error threshold value, and the reference control type and the prototype control type being the same, it is considered that the game prototype interface image meets the development requirements.

[0095] The preset control adjustment model preferentially selects a GPT model. If the relative position error is greater than a preset relative position error threshold, the control adjustment model generates a relative position adjustment text for adjusting the demand text according to the value and direction of the relative position error, indicates that the position of the corresponding prototype control needs to be adjusted, and the direction and distance of the adjustment. For example, it can be generated: “Please move the ‘login button’ several pixels to the right and several pixels down”, to ensure that the relative position of the “login button” in the game prototype interface is consistent with the relative position of the “login button” in the game prototype reference interface image, specifically reflected in that the relative position error is less than the relative position error threshold.

[0096] If the proportion error is greater than a preset proportion error threshold, the control adjustment model generates a proportion adjustment text for adjusting the demand text according to the value of the proportion error, indicating that the size of the corresponding prototype control needs to be adjusted. For example, it can be generated: “Please increase the width of the ‘login button’ by several pixels, and keep the height unchanged”, to ensure that the proportion of the “login button” in the game prototype interface is consistent with the proportion of the “login button” in the game prototype reference interface image, specifically reflected in that the proportion error is less than the proportion error threshold.

[0097] If the reference control type and the prototype control type are not the same, the control adjustment model generates a control type adjustment text for adjusting the demand text, indicating that the control type of the corresponding prototype control needs to be adjusted. For example, it can be generated: “Please change the ‘text input box’ to a ‘password input box’”, to ensure that the reference control type and the prototype control type corresponding to the prototype control and the reference control are the same. Of course, the control adjustment model uses other artificial intelligence models suitable for understanding and generating natural language texts.

[0098] In one embodiment, the preliminary development code includes execution code, non-execution code, and an execution code partition identifier for partitioning the execution code and non-execution code, wherein the execution code refers to a code segment that can be directly executed by a computer or an interpreter to complete a specific task, usually including instructions in a programming language (such as Python, Java, C++, etc.), such as function definitions, variable declarations, control structures (such as loops and conditional statements), etc. The execution code is compiled or interpreted at runtime to perform specific operations or calculations. The non-execution code usually refers to text or markup language content that is not directly used for computer execution, including comments, documentation strings, Markdown text (used for document writing), HTML tags (used for web development to describe text and structure), etc., for code interpretation, usage instructions, or formatted text information. The non-execution code is important for human reading and understanding the code, but will not be directly executed by the computer. The execution code partition identifier is the Markdown code block marker, specifically "```".

[0099] The developer can add a description of the code generation requirement in the requirement text. Exemplarily, the code generation requirement can be: in the generated preliminary development code, include execution code and non-execution code, and set execution code partition identifiers before and after the execution code to separate the execution code and the non-execution code. The code partition identifier is "```. Of course, according to the actual development requirements, the execution code partition identifier can also use other code block markers.

[0100] Please refer to Figure 5 , Figure 5 The method flowchart for obtaining executable code in the game prototype interface image generation method of the application. After generating the preliminary development code based on the prompt word and the preset code generation model, the following steps are included:

[0101] S91: According to the preliminary development code, identify the execution code partition identifier, and determine the start and end boundaries of the execution code according to the position of the execution code partition identifier;

[0102] S92: Based on the start and end boundaries of the execution code, extract the execution code from the preliminary development code as the executable code by string cutting.

[0103] For step S92, please refer to Figure 6 , Figure 6 The method flowchart for obtaining fault-tolerant execution code in the game prototype interface image generation method of the application. After obtaining the executable code, the executable code is encapsulated to obtain fault-tolerant execution code, which includes the following steps:

[0104] S921: According to the executable code, the executable code is sequentially divided into a plurality of executable code blocks with independent logic and capable of being executed independently based on preset code division criteria;

[0105] S922: After inserting preset fault-tolerant codes before and after each executable code block, an enhanced code block is obtained.

[0106] S923: The enhanced code blocks are sequentially spliced to obtain the fault-tolerant execution code.

[0107] For step S921, the code division criteria at least include any function structure, any class structure, any complete conditional judgment statement and any complete loop statement as an executable code block. The function structure refers to an entity encapsulating a series of executable instructions for performing specific tasks or calculations, and possibly returning execution results, including function declaration and function body, the function declaration is used to specify the name, parameter list and return type of the function, and the function body is the code for performing specific tasks or calculations.

[0108] The class structure is used to define the properties and behaviors of an object, which includes class declaration and class body, the class declaration is used to specify the name of the class structure and the parent class to be inherited, and the class body includes property definition and method definition.

[0109] The complete conditional judgment statement is used to execute different code paths according to the judgment condition, which includes one or more conditional expressions, and one or more conditional execution code blocks, the conditional execution code block is executed when the condition is true or false.

[0110] The complete loop statement is used to repeatedly execute a piece of code until a certain condition is met, which includes loop initialization, loop condition and loop body, the loop initialization refers to setting initial conditions and / or initial variables before the loop starts, for example, in the for loop, the initialization is completed in the loop declaration, for example, int i = 0 in for(int i = 0; i < 10; i++) is the loop initialization. In the while loop, the loop initialization is usually completed in a separate statement before the loop statement, because the while loop itself does not contain loop initialization. The loop condition is a Boolean expression used to determine whether to continue executing the loop body. The loop body refers to the code block that is repeatedly executed.

[0111] In other embodiments, the code division criteria can also be adaptively adjusted according to actual development needs. For example, if the code block involves database transactions, the entire database transaction processing code can be taken as an independent code block.

[0112] For steps S922-S923, the fault-tolerant code uses a try-catch block to capture exceptions and record error information or take other recovery measures in the except block. Specifically, the try block is inserted at the front end of the executable code block, so that the executable code block is placed in the try block, and the catch block is inserted at the back end of the executable code block, and any possible exceptions are handled in the catch block. For example, in Java, for a for loop statement, after inserting the fault-tolerant code, it is as follows:

[0113] try{

[0114] / / This is the beginning of the for loop

[0115] for(int i=0;i<10;i++){

[0116] / / Code in the loop body

[0117] System.out.println(i);

[0118] / / You can put some code here that may throw an exception

[0119] }

[0120] }catch(SomeSpecificException e){

[0121] / / If SomeSpecificException exception is thrown in the for loop, execute the code here

[0122] System.out.println("An error occurred:"+e.getMessage());

[0123] }。

[0124] According to the above code segmentation standard, the executable code block obtained by cutting has independent logic and the ability to be executed independently. After inserting the fault-tolerant code to obtain an enhanced code block, the final fault-tolerant execution code is formed by splicing. By inserting fault-tolerant code to capture exceptions, it can prevent the program from crashing directly when encountering errors, and help improve the robustness, readability and maintainability of the code.

[0125] Embodiment 2

[0126] Please refer to Figure 7 , Figure 7 is a schematic diagram of a game prototype interface image generation system of the present application. The present application also provides a game prototype interface image generation system, comprising:

[0127] The requirement document receiving module 1 is configured to receive a requirement document, wherein the requirement document comprises a plurality of requirement texts in natural language describing a development game prototype interface image;

[0128] The requirement interface document obtaining module 2 is configured to filter and integrate a game engine interface document pre-stored for recording a plurality of interface texts to obtain a requirement interface document according to the requirement document;

[0129] The prompt word module replacing module 3 is configured to obtain a pre-constructed prompt word template, wherein the prompt word template comprises a specific prompt word for indicating a text replacing operation and a replacement mark for being replaced by the requirement text and the interface text;

[0130] The interface text obtaining module 4 is configured to extract a corresponding interface text from the requirement interface document according to the requirement text;

[0131] The prompt word obtaining module 5 is configured to replace the requirement text and the interface text by the replacement mark after recognizing the specific prompt word in the prompt word template to generate a prompt word;

[0132] The preliminary development code obtaining module 6 is configured to generate a preliminary development code based on a pre-set code generation model according to the prompt word;

[0133] The game prototype interface image obtaining module 7 is configured to render a game prototype interface image according to the preliminary development code.

[0134] It should be noted that the game prototype interface image generation method system provided by the present application corresponds to the data obtained when the game prototype interface image generation method is implemented, which is saved in the storage of the system. When related calculations are needed, the required data can be directly obtained from the storage.

[0135] It should be noted that the game prototype interface image generation method system provided by the above embodiment corresponds to the data obtained when the game prototype interface image generation method is implemented, which is saved in the storage of the system. When related calculations are needed, the required data can be directly obtained from the storage.

[0136] Based on the same inventive concept, the present application also provides an electronic device, which can be a server, a desktop computing device or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.) or the like terminal device. The device includes one or more processors and a memory, wherein the processor is configured to execute a program to implement the game prototype interface image generation method; and the memory is configured to store a computer program executable by the processor.

[0137] The present application can take the form of a computer program product embodied in one or more storage media (including but not limited to a disk memory, a CD-ROM, an optical storage, etc.) containing program code. The computer usable storage media include permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer executable instructions, which can execute the game prototype interface image generation method. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0138] The present application is not limited to the above-described embodiments, and various modifications or changes can be made to the present application without departing from the spirit and scope of the present application, and the present application is intended to include such modifications and changes within the scope of the claims and equivalent technology.

Claims

1. A method for generating game prototype interface images, characterized in that, Includes the following steps: Receive a requirements document, wherein the requirements document includes several requirements texts describing the development of game prototype interface images in natural language; Based on the requirements document, the game engine interface documents that are pre-stored and used to record various interface texts are filtered and integrated to obtain the requirements interface document. Obtain a pre-built prompt word template, which includes specific prompt words for instructing the text replacement operation and replacement tags for replacing the required text and interface text; Based on the requirement text, extract the corresponding interface text from the requirement interface document; After identifying the specific prompt word in the prompt word template, the requirement text and interface text are replaced with the replacement marker to generate the prompt word; Based on the prompt words, preliminary development code is generated using a preset code generation model; Based on the initial development code, the game prototype interface image is rendered; Based on the game prototype interface image, the requirement text is adjusted using a requirement-driven iterative optimization mechanism to obtain the final development code. This includes: acquiring a pre-stored game prototype baseline interface image, wherein each baseline control identifier in the game prototype baseline interface image has a matching prototype control identifier; and performing image recognition on the game prototype baseline interface image and the game prototype interface image based on a preset control recognition model to obtain the baseline control prediction box, baseline control type probability, baseline control identifier, and game prototype baseline interface border frame in the game prototype baseline interface image, as well as the prototype control prediction box, prototype control type probability, prototype control identifier, and game prototype interface border frame in the game prototype interface image. The requirement text includes at least the layout of the prototype controls for the game prototype interface image, and each prototype control is assigned a prototype control identifier.

2. The method for generating a game prototype interface image according to claim 1, characterized in that, Based on the game prototype interface image, the requirement text is adjusted using a requirement-driven iterative optimization mechanism to obtain the final development code. This also includes the following steps: Based on the pixel coordinates of the baseline control prediction box, the game prototype baseline interface border box, the prototype control prediction box, and the game prototype interface border box, calculate the relative position of each baseline control relative to the game prototype baseline interface and the relative position of each prototype control relative to the game prototype interface. Based on the pixel coordinates of the baseline control prediction box, the game prototype baseline interface border box, the prototype control prediction box, and the game prototype interface border box, calculate the proportion of each baseline control relative to the game prototype baseline interface and the proportion of each prototype control relative to the game prototype interface. Based on the relative position and proportion of the benchmark control relative to the game prototype benchmark interface, and the relative position and proportion of the prototype control relative to the game prototype interface, a benchmark control and a prototype control with the same benchmark control identifier as the prototype control identifier are selected, and the relative position error of the prototype control relative to the benchmark control and the proportion error of the prototype control relative to the benchmark control are calculated. The control type with the highest probability of the baseline control type is selected as the baseline control type, and the control type with the highest probability of the prototype control type is selected as the prototype control type. If the relative position error is greater than a preset relative position error threshold, and / or the percentage error is greater than a preset percentage error threshold, and / or the baseline control type and the prototype control type are not the same, the requirement document is repeatedly adjusted based on the preset control adjustment model until the relative position error is less than the preset relative position error threshold, and / or the percentage error is less than the preset percentage error threshold, and / or the baseline control type and the prototype control type are the same.

3. The method for generating a game prototype interface image according to claim 2, characterized in that, The step of calculating the relative positions of each reference control relative to the game prototype reference interface and the relative positions of each prototype control relative to the game prototype interface based on the pixel coordinates of the reference control prediction box, the game prototype reference interface border box, the prototype control prediction box, and the game prototype interface border box includes: Based on the pixel coordinates of the baseline control prediction box, the game prototype baseline interface border box, the prototype control prediction box, and the game prototype interface border box, calculate the center coordinates of the baseline control, the center coordinates of the game prototype baseline interface, the center coordinates of the prototype control, and the center coordinates of the game prototype baseline interface, respectively. Based on the center coordinates of the baseline control and the center coordinates of the game prototype baseline interface, as well as the center coordinates of the prototype control and the center coordinates of the game prototype baseline interface, calculate the relative positions of the baseline control and the prototype control relative to the game prototype interface.

4. The method for generating a game prototype interface image according to claim 2, characterized in that, The step of calculating the proportion of each benchmark control relative to the game prototype benchmark interface and the proportion of each prototype control relative to the game prototype interface based on the pixel coordinates of the benchmark control prediction box, the game prototype benchmark interface border box, the prototype control prediction box, and the game prototype interface border box includes: Based on the pixel coordinates of the baseline control prediction box, the game prototype baseline interface border box, the prototype control prediction box, and the game prototype interface border box, calculate the area of ​​the baseline control, the area of ​​the game prototype baseline interface, the area of ​​the prototype control, and the area of ​​the game prototype baseline interface, respectively. Calculate the ratio of the area of ​​the baseline control to the area of ​​the game prototype baseline interface, and calculate the ratio of the area of ​​the prototype control to the area of ​​the game prototype baseline interface, to obtain the proportion of the baseline control relative to the game prototype baseline interface and the proportion of the prototype control relative to the game prototype interface.

5. The method for generating a game prototype interface image according to claim 1, characterized in that, The replacement markers include requirement text replacement markers and interface text replacement markers. After identifying the specific prompt words in the prompt word template, the requirement text and interface text are respectively replaced by the requirement text replacement markers and interface text replacement markers.

6. The method for generating a game prototype interface image according to claim 1, characterized in that, The initial development code includes executable code, non-executable code, and an executable code segmentation identifier used to separate the executable code and non-executable code; Based on the prompt words and a preset code generation model, preliminary development code is generated, including the following steps: Based on the preliminary development code, the execution code segmentation marker is identified, and the start and end boundaries of the execution code are determined based on the position of the execution code segmentation marker; Based on the start and end boundaries of the executable code, the executable code is extracted from the initial development code through string splitting, and used as the executable code.

7. The method for generating a game prototype interface image according to claim 6, characterized in that, After obtaining the executable code, the executable code is encapsulated to obtain fault-tolerant execution code, specifically including the following steps: Based on the executable code, and according to a preset code segmentation standard, the executable code is sequentially segmented into several executable code blocks with independent logic and capable of being executed independently. The code segmentation standard includes at least any function structure, any type of structure, any complete conditional statement, and any complete loop statement as executable code blocks. After inserting preset fault-tolerant code before and after each of the executable code blocks, an enhanced code block is obtained; The enhanced code blocks are concatenated sequentially to obtain the fault-tolerant execution code.

8. A game prototype interface image generation system, characterized in that, include: Requirements document receiving module: used to receive requirements documents, wherein the requirements document includes several requirement texts describing the interface images of the game prototype in natural language; Requirements Interface Document Acquisition Module: Used to filter and integrate pre-stored game engine interface documents that record various interface texts based on the requirements document to obtain the requirements interface document; Prompt word module replacement module: used to obtain a pre-built prompt word template, the prompt word template including specific prompt words for instructing the execution of text replacement operation and replacement tags for replacing with the required text and interface text; Interface text acquisition module: used to extract the corresponding interface text from the requirement interface document based on the requirement text; Prompt word acquisition module: used to identify the specific prompt word in the prompt word template, and then replace the replacement mark with the requirement text and interface text to generate the prompt word; Preliminary development code acquisition module: used to generate preliminary development code based on the prompt words and a preset code generation model; The game prototype interface image acquisition module is used to render a game prototype interface image based on the preliminary development code; and to adjust the requirement text based on the game prototype interface image using a requirement-driven game prototype interface image iterative optimization mechanism to obtain the final development code. This includes: acquiring a pre-stored game prototype baseline interface image, wherein each baseline control identifier in the game prototype baseline interface image has a matching prototype control identifier; performing image recognition on the game prototype baseline interface image and the game prototype interface image based on a preset control recognition model to obtain the baseline control prediction box, baseline control type probability, baseline control identifier, and game prototype baseline interface border frame in the game prototype baseline interface image, and the prototype control prediction box, prototype control type probability, prototype control identifier, and game prototype interface border frame in the game prototype interface image; wherein the requirement text at least includes the prototype control layout of the game prototype interface image, and each prototype control is correspondingly set with a prototype control identifier.

9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements a method for generating a game prototype interface image as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Document generation method and device based on product prototype interface

    CN111859886A

  • Interactive page generation method and device, equipment and storage medium thereof

    CN117234505A